npm package diff

Package: @forge/util

Versions: 1.4.10-next.0 - 1.4.10-next.0-experimental-effab31

File: package/packages/ari/chunk-BUS4F7GN.mjs

Index: package/packages/ari/chunk-BUS4F7GN.mjs
===================================================================
--- package/packages/ari/chunk-BUS4F7GN.mjs
+++ package/packages/ari/chunk-BUS4F7GN.mjs
@@ -0,0 +1,67 @@
+import {
+  TownsquareLearningAriResourceOwner,
+  TownsquareLearningAriResourceType
+} from "./chunk-4J5O222V.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/townsquare/learning/manifest.ts
+var townsquareLearningAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: TownsquareLearningAriResourceOwner,
+  resourceType: TownsquareLearningAriResourceType,
+  resourceIdSlug: "{learningUuid}",
+  resourceIdSegmentFormats: {
+    learningUuid: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/townsquare/learning/index.ts
+var TownsquareLearningAri = class _TownsquareLearningAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._siteId = opts.cloudId || "", this._learningUuid = opts.resourceIdSegmentValues.learningUuid;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get learningUuid() {
+    return this._learningUuid;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: townsquareLearningAriStaticOpts.qualifier,
+      platformQualifier: townsquareLearningAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: townsquareLearningAriStaticOpts.resourceOwner,
+      resourceType: townsquareLearningAriStaticOpts.resourceType,
+      resourceId: `${opts.learningUuid}`,
+      resourceIdSegmentValues: {
+        learningUuid: opts.learningUuid
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, townsquareLearningAriStaticOpts);
+    return new _TownsquareLearningAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, townsquareLearningAriStaticOpts);
+    return new _TownsquareLearningAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      learningUuid: this.learningUuid
+    };
+  }
+};
+
+export {
+  TownsquareLearningAri
+};