@forge/util
2.0.12.0.1-experimental-7890858
packages/ari/chunk-6VOXEIWM.mjs+
packages/ari/chunk-6VOXEIWM.mjsNew file+66
Index: package/packages/ari/chunk-6VOXEIWM.mjs
===================================================================
--- package/packages/ari/chunk-6VOXEIWM.mjs
+++ package/packages/ari/chunk-6VOXEIWM.mjs
@@ -0,0 +1,66 @@
+import {
+ ExusExternalUserAriResourceOwner,
+ ExusExternalUserAriResourceType
+} from "./chunk-IWWNXWBX.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/exus-external/user/manifest.ts
+var exusExternalUserAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^$"),
+ resourceOwner: ExusExternalUserAriResourceOwner,
+ resourceType: ExusExternalUserAriResourceType,
+ resourceIdSlug: "{thirdPartySource}/{thirdPartyUserId}",
+ resourceIdSegmentFormats: {
+ thirdPartySource: /[a-z0-9-]+/,
+ thirdPartyUserId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+ }
+};
+
+// src/exus-external/user/index.ts
+var ExusExternalUserAri = class _ExusExternalUserAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts), this._thirdPartySource = opts.resourceIdSegmentValues.thirdPartySource, this._thirdPartyUserId = opts.resourceIdSegmentValues.thirdPartyUserId;
+ }
+ get thirdPartySource() {
+ return this._thirdPartySource;
+ }
+ get thirdPartyUserId() {
+ return this._thirdPartyUserId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: exusExternalUserAriStaticOpts.qualifier,
+ platformQualifier: exusExternalUserAriStaticOpts.platformQualifier,
+ cloudId: void 0,
+ resourceOwner: exusExternalUserAriStaticOpts.resourceOwner,
+ resourceType: exusExternalUserAriStaticOpts.resourceType,
+ resourceId: `${opts.thirdPartySource}/${opts.thirdPartyUserId}`,
+ resourceIdSegmentValues: {
+ thirdPartySource: opts.thirdPartySource,
+ thirdPartyUserId: opts.thirdPartyUserId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, exusExternalUserAriStaticOpts);
+ return new _ExusExternalUserAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, exusExternalUserAriStaticOpts);
+ return new _ExusExternalUserAri(opts);
+ }
+ getVariables() {
+ return {
+ thirdPartySource: this.thirdPartySource,
+ thirdPartyUserId: this.thirdPartyUserId
+ };
+ }
+};
+
+export {
+ ExusExternalUserAri
+};