@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-UV6IHQDG.mjs
+packages/ari/chunk-UV6IHQDG.mjsNew file
+67
Index: package/packages/ari/chunk-UV6IHQDG.mjs
===================================================================
--- package/packages/ari/chunk-UV6IHQDG.mjs
+++ package/packages/ari/chunk-UV6IHQDG.mjs
@@ -0,0 +1,67 @@
+import {
+  CommunicationMessageAriResourceOwner,
+  CommunicationMessageAriResourceType
+} from "./chunk-KTNCNDUS.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/communication/message/manifest.ts
+var communicationMessageAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^$"),
+  resourceOwner: CommunicationMessageAriResourceOwner,
+  resourceType: CommunicationMessageAriResourceType,
+  resourceIdSlug: "{activationId}/{messageId}",
+  resourceIdSegmentFormats: {
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    messageId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
+  }
+};
+
+// src/communication/message/index.ts
+var CommunicationMessageAri = class _CommunicationMessageAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._activationId = opts.resourceIdSegmentValues.activationId, this._messageId = opts.resourceIdSegmentValues.messageId;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get messageId() {
+    return this._messageId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: communicationMessageAriStaticOpts.qualifier,
+      platformQualifier: communicationMessageAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: communicationMessageAriStaticOpts.resourceOwner,
+      resourceType: communicationMessageAriStaticOpts.resourceType,
+      resourceId: `${opts.activationId}/${opts.messageId}`,
+      resourceIdSegmentValues: {
+        activationId: opts.activationId,
+        messageId: opts.messageId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, communicationMessageAriStaticOpts);
+    return new _CommunicationMessageAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, communicationMessageAriStaticOpts);
+    return new _CommunicationMessageAri(opts);
+  }
+  getVariables() {
+    return {
+      activationId: this.activationId,
+      messageId: this.messageId
+    };
+  }
+};
+
+export {
+  CommunicationMessageAri
+};