npm package diff

Package: @forge/util

Versions: 1.4.10-next.0 - 1.4.10-next.0-experimental-effab31

File: package/packages/ari/chunk-EA5J4EAW.mjs

Index: package/packages/ari/chunk-EA5J4EAW.mjs
===================================================================
--- package/packages/ari/chunk-EA5J4EAW.mjs
+++ package/packages/ari/chunk-EA5J4EAW.mjs
@@ -0,0 +1,74 @@
+import {
+  CompassWebhookAriResourceOwner,
+  CompassWebhookAriResourceType
+} from "./chunk-RX4T5I6M.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/compass/webhook/manifest.ts
+var compassWebhookAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: CompassWebhookAriResourceOwner,
+  resourceType: CompassWebhookAriResourceType,
+  resourceIdSlug: "{workspaceId}/{webhookId}",
+  resourceIdSegmentFormats: {
+    workspaceId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/,
+    // eslint-disable-line no-useless-escape
+    webhookId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/compass/webhook/index.ts
+var CompassWebhookAri = class _CompassWebhookAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._webhookId = opts.resourceIdSegmentValues.webhookId;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get workspaceId() {
+    return this._workspaceId;
+  }
+  get webhookId() {
+    return this._webhookId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: compassWebhookAriStaticOpts.qualifier,
+      platformQualifier: compassWebhookAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: compassWebhookAriStaticOpts.resourceOwner,
+      resourceType: compassWebhookAriStaticOpts.resourceType,
+      resourceId: `${opts.workspaceId}/${opts.webhookId}`,
+      resourceIdSegmentValues: {
+        workspaceId: opts.workspaceId,
+        webhookId: opts.webhookId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, compassWebhookAriStaticOpts);
+    return new _CompassWebhookAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, compassWebhookAriStaticOpts);
+    return new _CompassWebhookAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      workspaceId: this.workspaceId,
+      webhookId: this.webhookId
+    };
+  }
+};
+
+export {
+  CompassWebhookAri
+};