npm package diff
Package: @forge/util
Versions: 1.4.10-next.0 - 1.4.10-next.0-experimental-effab31
File: package/packages/ari/chunk-EPLQMWI3.mjs
Index: package/packages/ari/chunk-EPLQMWI3.mjs
===================================================================
--- package/packages/ari/chunk-EPLQMWI3.mjs
+++ package/packages/ari/chunk-EPLQMWI3.mjs
@@ -0,0 +1,63 @@
+import {
+ RuntimeAuthClientRoleAriResourceOwner,
+ RuntimeAuthClientRoleAriResourceType
+} from "./chunk-N3DYIPHN.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/runtime-auth-client/role/manifest.ts
+var runtimeAuthClientRoleAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
+ resourceOwner: RuntimeAuthClientRoleAriResourceOwner,
+ resourceType: RuntimeAuthClientRoleAriResourceType,
+ resourceIdSlug: "product/{roleType}",
+ resourceIdSegmentFormats: {
+ roleType: /(?:member|admin)/
+ // eslint-disable-line no-useless-escape
+ }
+};
+
+// src/runtime-auth-client/role/index.ts
+var RuntimeAuthClientRoleAri = class _RuntimeAuthClientRoleAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts);
+ this._roleType = opts.resourceIdSegmentValues.roleType;
+ }
+ get roleType() {
+ return this._roleType;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: runtimeAuthClientRoleAriStaticOpts.qualifier,
+ platformQualifier: runtimeAuthClientRoleAriStaticOpts.platformQualifier,
+ cloudId: void 0,
+ resourceOwner: runtimeAuthClientRoleAriStaticOpts.resourceOwner,
+ resourceType: runtimeAuthClientRoleAriStaticOpts.resourceType,
+ resourceId: `product/${opts.roleType}`,
+ resourceIdSegmentValues: {
+ roleType: opts.roleType
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, runtimeAuthClientRoleAriStaticOpts);
+ return new _RuntimeAuthClientRoleAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, runtimeAuthClientRoleAriStaticOpts);
+ return new _RuntimeAuthClientRoleAri(opts);
+ }
+ getVariables() {
+ return {
+ roleType: this.roleType
+ };
+ }
+};
+
+export {
+ RuntimeAuthClientRoleAri
+};