@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-373ZXR56.mjs
+packages/ari/chunk-373ZXR56.mjsNew file
+77
Index: package/packages/ari/chunk-373ZXR56.mjs
===================================================================
--- package/packages/ari/chunk-373ZXR56.mjs
+++ package/packages/ari/chunk-373ZXR56.mjs
@@ -0,0 +1,77 @@
+import {
+  JiraProjectFeatureAriResourceOwner,
+  JiraProjectFeatureAriResourceType
+} from "./chunk-QKR33HHC.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/jira/project-feature/manifest.ts
+var jiraProjectFeatureAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  resourceOwner: JiraProjectFeatureAriResourceOwner,
+  resourceType: JiraProjectFeatureAriResourceType,
+  resourceIdSlug: "activation/{activationId}/{projectId}/featureKey/{featureKey}",
+  resourceIdSegmentFormats: {
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    projectId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/,
+    featureKey: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+  }
+};
+
+// src/jira/project-feature/index.ts
+var JiraProjectFeatureAri = class _JiraProjectFeatureAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._siteId = opts.cloudId || "", this._activationId = opts.resourceIdSegmentValues.activationId, this._projectId = opts.resourceIdSegmentValues.projectId, this._featureKey = opts.resourceIdSegmentValues.featureKey;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get projectId() {
+    return this._projectId;
+  }
+  get featureKey() {
+    return this._featureKey;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: jiraProjectFeatureAriStaticOpts.qualifier,
+      platformQualifier: jiraProjectFeatureAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: jiraProjectFeatureAriStaticOpts.resourceOwner,
+      resourceType: jiraProjectFeatureAriStaticOpts.resourceType,
+      resourceId: `activation/${opts.activationId}/${opts.projectId}/featureKey/${opts.featureKey}`,
+      resourceIdSegmentValues: {
+        activationId: opts.activationId,
+        projectId: opts.projectId,
+        featureKey: opts.featureKey
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, jiraProjectFeatureAriStaticOpts);
+    return new _JiraProjectFeatureAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, jiraProjectFeatureAriStaticOpts);
+    return new _JiraProjectFeatureAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      activationId: this.activationId,
+      projectId: this.projectId,
+      featureKey: this.featureKey
+    };
+  }
+};
+
+export {
+  JiraProjectFeatureAri
+};