npm package diff

Package: @forge/util

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

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

Index: package/packages/ari/chunk-HPWWKSLI.mjs
===================================================================
--- package/packages/ari/chunk-HPWWKSLI.mjs
+++ package/packages/ari/chunk-HPWWKSLI.mjs
@@ -0,0 +1,67 @@
+import {
+  DevopsContainerAriResourceOwner,
+  DevopsContainerAriResourceType
+} from "./chunk-FGEFELP3.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/devops/container/manifest.ts
+var devopsContainerAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: DevopsContainerAriResourceOwner,
+  resourceType: DevopsContainerAriResourceType,
+  resourceIdSlug: "{containerId}",
+  resourceIdSegmentFormats: {
+    containerId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/devops/container/index.ts
+var DevopsContainerAri = class _DevopsContainerAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._siteId = opts.cloudId || "", this._containerId = opts.resourceIdSegmentValues.containerId;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get containerId() {
+    return this._containerId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: devopsContainerAriStaticOpts.qualifier,
+      platformQualifier: devopsContainerAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: devopsContainerAriStaticOpts.resourceOwner,
+      resourceType: devopsContainerAriStaticOpts.resourceType,
+      resourceId: `${opts.containerId}`,
+      resourceIdSegmentValues: {
+        containerId: opts.containerId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, devopsContainerAriStaticOpts);
+    return new _DevopsContainerAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, devopsContainerAriStaticOpts);
+    return new _DevopsContainerAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      containerId: this.containerId
+    };
+  }
+};
+
+export {
+  DevopsContainerAri
+};