@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-AGOEYDKR.mjs
+packages/ari/chunk-AGOEYDKR.mjsNew file
+71
Index: package/packages/ari/chunk-AGOEYDKR.mjs
===================================================================
--- package/packages/ari/chunk-AGOEYDKR.mjs
+++ package/packages/ari/chunk-AGOEYDKR.mjs
@@ -0,0 +1,71 @@
+import {
+  LoomCommentAriResourceOwner,
+  LoomCommentAriResourceType
+} from "./chunk-KBPT7WSP.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/loom/comment/manifest.ts
+var loomCommentAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  resourceOwner: LoomCommentAriResourceOwner,
+  resourceType: LoomCommentAriResourceType,
+  resourceIdSlug: "activation/{activationId}/{commentId}",
+  resourceIdSegmentFormats: {
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    commentId: /(?:[0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/
+  }
+};
+
+// src/loom/comment/index.ts
+var LoomCommentAri = class _LoomCommentAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._siteId = opts.cloudId || "", this._activationId = opts.resourceIdSegmentValues.activationId, this._commentId = opts.resourceIdSegmentValues.commentId;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get commentId() {
+    return this._commentId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: loomCommentAriStaticOpts.qualifier,
+      platformQualifier: loomCommentAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: loomCommentAriStaticOpts.resourceOwner,
+      resourceType: loomCommentAriStaticOpts.resourceType,
+      resourceId: `activation/${opts.activationId}/${opts.commentId}`,
+      resourceIdSegmentValues: {
+        activationId: opts.activationId,
+        commentId: opts.commentId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, loomCommentAriStaticOpts);
+    return new _LoomCommentAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, loomCommentAriStaticOpts);
+    return new _LoomCommentAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      activationId: this.activationId,
+      commentId: this.commentId
+    };
+  }
+};
+
+export {
+  LoomCommentAri
+};