@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-56JKVPRX.mjs
+packages/ari/chunk-56JKVPRX.mjsNew file
+77
Index: package/packages/ari/chunk-56JKVPRX.mjs
===================================================================
--- package/packages/ari/chunk-56JKVPRX.mjs
+++ package/packages/ari/chunk-56JKVPRX.mjs
@@ -0,0 +1,77 @@
+import {
+  JiraSoftwareViewConfigAriResourceOwner,
+  JiraSoftwareViewConfigAriResourceType
+} from "./chunk-ZOFOPGOV.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/jira-software/view-config/manifest.ts
+var jiraSoftwareViewConfigAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  resourceOwner: JiraSoftwareViewConfigAriResourceOwner,
+  resourceType: JiraSoftwareViewConfigAriResourceType,
+  resourceIdSlug: "activation/{activationId}/{boardId}/{viewType}",
+  resourceIdSegmentFormats: {
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    boardId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
+    viewType: /(board|backlog|timeline)/
+  }
+};
+
+// src/jira-software/view-config/index.ts
+var JiraSoftwareViewConfigAri = class _JiraSoftwareViewConfigAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._siteId = opts.cloudId || "", this._activationId = opts.resourceIdSegmentValues.activationId, this._boardId = opts.resourceIdSegmentValues.boardId, this._viewType = opts.resourceIdSegmentValues.viewType;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get boardId() {
+    return this._boardId;
+  }
+  get viewType() {
+    return this._viewType;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: jiraSoftwareViewConfigAriStaticOpts.qualifier,
+      platformQualifier: jiraSoftwareViewConfigAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: jiraSoftwareViewConfigAriStaticOpts.resourceOwner,
+      resourceType: jiraSoftwareViewConfigAriStaticOpts.resourceType,
+      resourceId: `activation/${opts.activationId}/${opts.boardId}/${opts.viewType}`,
+      resourceIdSegmentValues: {
+        activationId: opts.activationId,
+        boardId: opts.boardId,
+        viewType: opts.viewType
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, jiraSoftwareViewConfigAriStaticOpts);
+    return new _JiraSoftwareViewConfigAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, jiraSoftwareViewConfigAriStaticOpts);
+    return new _JiraSoftwareViewConfigAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      activationId: this.activationId,
+      boardId: this.boardId,
+      viewType: this.viewType
+    };
+  }
+};
+
+export {
+  JiraSoftwareViewConfigAri
+};