@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-IS6DIJN7.mjs
+packages/ari/chunk-IS6DIJN7.mjsNew file
+66
Index: package/packages/ari/chunk-IS6DIJN7.mjs
===================================================================
--- package/packages/ari/chunk-IS6DIJN7.mjs
+++ package/packages/ari/chunk-IS6DIJN7.mjs
@@ -0,0 +1,66 @@
+import {
+  GraphServiceAriResourceOwner,
+  GraphServiceAriResourceType
+} from "./chunk-KKDL7RK7.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/graph/service/manifest.ts
+var graphServiceAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^$"),
+  resourceOwner: GraphServiceAriResourceOwner,
+  resourceType: GraphServiceAriResourceType,
+  resourceIdSlug: "{workspaceId}/{serviceId}",
+  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}/,
+    serviceId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
+  }
+};
+
+// src/graph/service/index.ts
+var GraphServiceAri = class _GraphServiceAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._serviceId = opts.resourceIdSegmentValues.serviceId;
+  }
+  get workspaceId() {
+    return this._workspaceId;
+  }
+  get serviceId() {
+    return this._serviceId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: graphServiceAriStaticOpts.qualifier,
+      platformQualifier: graphServiceAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: graphServiceAriStaticOpts.resourceOwner,
+      resourceType: graphServiceAriStaticOpts.resourceType,
+      resourceId: `${opts.workspaceId}/${opts.serviceId}`,
+      resourceIdSegmentValues: {
+        workspaceId: opts.workspaceId,
+        serviceId: opts.serviceId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, graphServiceAriStaticOpts);
+    return new _GraphServiceAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, graphServiceAriStaticOpts);
+    return new _GraphServiceAri(opts);
+  }
+  getVariables() {
+    return {
+      workspaceId: this.workspaceId,
+      serviceId: this.serviceId
+    };
+  }
+};
+
+export {
+  GraphServiceAri
+};