@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-EZVWMOG6.mjs
+packages/ari/chunk-EZVWMOG6.mjsNew file
+60
Index: package/packages/ari/chunk-EZVWMOG6.mjs
===================================================================
--- package/packages/ari/chunk-EZVWMOG6.mjs
+++ package/packages/ari/chunk-EZVWMOG6.mjs
@@ -0,0 +1,60 @@
+import {
+  MercuryRoleAriResourceOwner,
+  MercuryRoleAriResourceType
+} from "./chunk-2CIDR5KT.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/mercury/role/manifest.ts
+var mercuryRoleAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^$"),
+  resourceOwner: MercuryRoleAriResourceOwner,
+  resourceType: MercuryRoleAriResourceType,
+  resourceIdSlug: "product/{roleType}",
+  resourceIdSegmentFormats: {
+    roleType: /(?:member|admin)/
+  }
+};
+
+// src/mercury/role/index.ts
+var MercuryRoleAri = class _MercuryRoleAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._roleType = opts.resourceIdSegmentValues.roleType;
+  }
+  get roleType() {
+    return this._roleType;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: mercuryRoleAriStaticOpts.qualifier,
+      platformQualifier: mercuryRoleAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: mercuryRoleAriStaticOpts.resourceOwner,
+      resourceType: mercuryRoleAriStaticOpts.resourceType,
+      resourceId: `product/${opts.roleType}`,
+      resourceIdSegmentValues: {
+        roleType: opts.roleType
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, mercuryRoleAriStaticOpts);
+    return new _MercuryRoleAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, mercuryRoleAriStaticOpts);
+    return new _MercuryRoleAri(opts);
+  }
+  getVariables() {
+    return {
+      roleType: this.roleType
+    };
+  }
+};
+
+export {
+  MercuryRoleAri
+};