@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-FJ2IPLEO.mjs
+packages/ari/chunk-FJ2IPLEO.mjsNew file
+67
Index: package/packages/ari/chunk-FJ2IPLEO.mjs
===================================================================
--- package/packages/ari/chunk-FJ2IPLEO.mjs
+++ package/packages/ari/chunk-FJ2IPLEO.mjs
@@ -0,0 +1,67 @@
+import {
+  CommunicationChatAriResourceOwner,
+  CommunicationChatAriResourceType
+} from "./chunk-KLI7NJPB.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/communication/chat/manifest.ts
+var communicationChatAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^$"),
+  resourceOwner: CommunicationChatAriResourceOwner,
+  resourceType: CommunicationChatAriResourceType,
+  resourceIdSlug: "{activationId}/{chatId}",
+  resourceIdSegmentFormats: {
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    chatId: /[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/chat/index.ts
+var CommunicationChatAri = class _CommunicationChatAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._activationId = opts.resourceIdSegmentValues.activationId, this._chatId = opts.resourceIdSegmentValues.chatId;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get chatId() {
+    return this._chatId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: communicationChatAriStaticOpts.qualifier,
+      platformQualifier: communicationChatAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: communicationChatAriStaticOpts.resourceOwner,
+      resourceType: communicationChatAriStaticOpts.resourceType,
+      resourceId: `${opts.activationId}/${opts.chatId}`,
+      resourceIdSegmentValues: {
+        activationId: opts.activationId,
+        chatId: opts.chatId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, communicationChatAriStaticOpts);
+    return new _CommunicationChatAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, communicationChatAriStaticOpts);
+    return new _CommunicationChatAri(opts);
+  }
+  getVariables() {
+    return {
+      activationId: this.activationId,
+      chatId: this.chatId
+    };
+  }
+};
+
+export {
+  CommunicationChatAri
+};