@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-KLXGQ56Z.mjs
+packages/ari/chunk-KLXGQ56Z.mjsNew file
+77
Index: package/packages/ari/chunk-KLXGQ56Z.mjs
===================================================================
--- package/packages/ari/chunk-KLXGQ56Z.mjs
+++ package/packages/ari/chunk-KLXGQ56Z.mjs
@@ -0,0 +1,77 @@
+import {
+  ConfluenceCustomContentAriResourceOwner,
+  ConfluenceCustomContentAriResourceType
+} from "./chunk-FXD6ATKK.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/confluence/custom-content/manifest.ts
+var confluenceCustomContentAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  resourceOwner: ConfluenceCustomContentAriResourceOwner,
+  resourceType: ConfluenceCustomContentAriResourceType,
+  resourceIdSlug: "{customContentType}/activation/{activationId}/{customContentId}",
+  resourceIdSegmentFormats: {
+    customContentType: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    customContentId: /[0-9]+/
+  }
+};
+
+// src/confluence/custom-content/index.ts
+var ConfluenceCustomContentAri = class _ConfluenceCustomContentAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._siteId = opts.cloudId || "", this._customContentType = opts.resourceIdSegmentValues.customContentType, this._activationId = opts.resourceIdSegmentValues.activationId, this._customContentId = opts.resourceIdSegmentValues.customContentId;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get customContentType() {
+    return this._customContentType;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get customContentId() {
+    return this._customContentId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: confluenceCustomContentAriStaticOpts.qualifier,
+      platformQualifier: confluenceCustomContentAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: confluenceCustomContentAriStaticOpts.resourceOwner,
+      resourceType: confluenceCustomContentAriStaticOpts.resourceType,
+      resourceId: `${opts.customContentType}/activation/${opts.activationId}/${opts.customContentId}`,
+      resourceIdSegmentValues: {
+        customContentType: opts.customContentType,
+        activationId: opts.activationId,
+        customContentId: opts.customContentId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, confluenceCustomContentAriStaticOpts);
+    return new _ConfluenceCustomContentAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, confluenceCustomContentAriStaticOpts);
+    return new _ConfluenceCustomContentAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      customContentType: this.customContentType,
+      activationId: this.activationId,
+      customContentId: this.customContentId
+    };
+  }
+};
+
+export {
+  ConfluenceCustomContentAri
+};