@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-LEKMAIIX.mjs
+packages/ari/chunk-LEKMAIIX.mjsNew file
+83
Index: package/packages/ari/chunk-LEKMAIIX.mjs
===================================================================
--- package/packages/ari/chunk-LEKMAIIX.mjs
+++ package/packages/ari/chunk-LEKMAIIX.mjs
@@ -0,0 +1,83 @@
+import {
+  JiraEntityPropertyAriResourceOwner,
+  JiraEntityPropertyAriResourceType
+} from "./chunk-WVAVMODN.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/jira/entity-property/manifest.ts
+var jiraEntityPropertyAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  resourceOwner: JiraEntityPropertyAriResourceOwner,
+  resourceType: JiraEntityPropertyAriResourceType,
+  resourceIdSlug: "activation/{activationId}/{entityType}/{entityId}/{propertyKey}",
+  resourceIdSegmentFormats: {
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    entityType: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
+    entityId: /[0-9]+/,
+    propertyKey: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+  }
+};
+
+// src/jira/entity-property/index.ts
+var JiraEntityPropertyAri = class _JiraEntityPropertyAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._siteId = opts.cloudId || "", this._activationId = opts.resourceIdSegmentValues.activationId, this._entityType = opts.resourceIdSegmentValues.entityType, this._entityId = opts.resourceIdSegmentValues.entityId, this._propertyKey = opts.resourceIdSegmentValues.propertyKey;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get entityType() {
+    return this._entityType;
+  }
+  get entityId() {
+    return this._entityId;
+  }
+  get propertyKey() {
+    return this._propertyKey;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: jiraEntityPropertyAriStaticOpts.qualifier,
+      platformQualifier: jiraEntityPropertyAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: jiraEntityPropertyAriStaticOpts.resourceOwner,
+      resourceType: jiraEntityPropertyAriStaticOpts.resourceType,
+      resourceId: `activation/${opts.activationId}/${opts.entityType}/${opts.entityId}/${opts.propertyKey}`,
+      resourceIdSegmentValues: {
+        activationId: opts.activationId,
+        entityType: opts.entityType,
+        entityId: opts.entityId,
+        propertyKey: opts.propertyKey
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, jiraEntityPropertyAriStaticOpts);
+    return new _JiraEntityPropertyAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, jiraEntityPropertyAriStaticOpts);
+    return new _JiraEntityPropertyAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      activationId: this.activationId,
+      entityType: this.entityType,
+      entityId: this.entityId,
+      propertyKey: this.propertyKey
+    };
+  }
+};
+
+export {
+  JiraEntityPropertyAri
+};