npm package diff

Package: @forge/util

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

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

Index: package/packages/ari/chunk-T6BSHAZR.mjs
===================================================================
--- package/packages/ari/chunk-T6BSHAZR.mjs
+++ package/packages/ari/chunk-T6BSHAZR.mjs
@@ -0,0 +1,70 @@
+import {
+  OpsgenieIncidentAriResourceOwner,
+  OpsgenieIncidentAriResourceType
+} from "./chunk-TLNXXINJ.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/opsgenie/incident/manifest.ts
+var opsgenieIncidentAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: OpsgenieIncidentAriResourceOwner,
+  resourceType: OpsgenieIncidentAriResourceType,
+  resourceIdSlug: "{workspaceId}/{incidentId}",
+  resourceIdSegmentFormats: {
+    workspaceId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    incidentId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/opsgenie/incident/index.ts
+var OpsgenieIncidentAri = class _OpsgenieIncidentAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._incidentId = opts.resourceIdSegmentValues.incidentId;
+  }
+  get workspaceId() {
+    return this._workspaceId;
+  }
+  get incidentId() {
+    return this._incidentId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: opsgenieIncidentAriStaticOpts.qualifier,
+      platformQualifier: opsgenieIncidentAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: opsgenieIncidentAriStaticOpts.resourceOwner,
+      resourceType: opsgenieIncidentAriStaticOpts.resourceType,
+      resourceId: `${opts.workspaceId}/${opts.incidentId}`,
+      resourceIdSegmentValues: {
+        workspaceId: opts.workspaceId,
+        incidentId: opts.incidentId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, opsgenieIncidentAriStaticOpts);
+    return new _OpsgenieIncidentAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, opsgenieIncidentAriStaticOpts);
+    return new _OpsgenieIncidentAri(opts);
+  }
+  getVariables() {
+    return {
+      workspaceId: this.workspaceId,
+      incidentId: this.incidentId
+    };
+  }
+};
+
+export {
+  OpsgenieIncidentAri
+};