@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-G3OR437A.mjs
+packages/ari/chunk-G3OR437A.mjsNew file
+70
Index: package/packages/ari/chunk-G3OR437A.mjs
===================================================================
--- package/packages/ari/chunk-G3OR437A.mjs
+++ package/packages/ari/chunk-G3OR437A.mjs
@@ -0,0 +1,70 @@
+import {
+  IdentityForgeInstallationAriResourceOwner,
+  IdentityForgeInstallationAriResourceType
+} from "./chunk-IV2D7WYN.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/identity/forge-installation/manifest.ts
+var identityForgeInstallationAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  resourceOwner: IdentityForgeInstallationAriResourceOwner,
+  resourceType: IdentityForgeInstallationAriResourceType,
+  resourceIdSlug: "{appId}/{envId}",
+  resourceIdSegmentFormats: {
+    appId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/,
+    envId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
+  }
+};
+
+// src/identity/forge-installation/index.ts
+var IdentityForgeInstallationAri = class _IdentityForgeInstallationAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._siteId = opts.cloudId || "", this._appId = opts.resourceIdSegmentValues.appId, this._envId = opts.resourceIdSegmentValues.envId;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get appId() {
+    return this._appId;
+  }
+  get envId() {
+    return this._envId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: identityForgeInstallationAriStaticOpts.qualifier,
+      platformQualifier: identityForgeInstallationAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: identityForgeInstallationAriStaticOpts.resourceOwner,
+      resourceType: identityForgeInstallationAriStaticOpts.resourceType,
+      resourceId: `${opts.appId}/${opts.envId}`,
+      resourceIdSegmentValues: {
+        appId: opts.appId,
+        envId: opts.envId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, identityForgeInstallationAriStaticOpts);
+    return new _IdentityForgeInstallationAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, identityForgeInstallationAriStaticOpts);
+    return new _IdentityForgeInstallationAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      appId: this.appId,
+      envId: this.envId
+    };
+  }
+};
+
+export {
+  IdentityForgeInstallationAri
+};