npm package diff

Package: @forge/util

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

File: package/packages/ari/chunk-3RQEZ4PX.mjs

Index: package/packages/ari/chunk-3RQEZ4PX.mjs
===================================================================
--- package/packages/ari/chunk-3RQEZ4PX.mjs
+++ package/packages/ari/chunk-3RQEZ4PX.mjs
@@ -0,0 +1,77 @@
+import {
+  SearchForwardDocumentAriResourceOwner,
+  SearchForwardDocumentAriResourceType
+} from "./chunk-I4OEQ7AG.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/search/forward-document/manifest.ts
+var searchForwardDocumentAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: SearchForwardDocumentAriResourceOwner,
+  resourceType: SearchForwardDocumentAriResourceType,
+  resourceIdSlug: "activation/{activationId}/{documentType}/{documentId}",
+  resourceIdSegmentFormats: {
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    documentType: /[a-zA-Z0-9\-_]+/,
+    // eslint-disable-line no-useless-escape
+    documentId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/search/forward-document/index.ts
+var SearchForwardDocumentAri = class _SearchForwardDocumentAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._activationId = opts.resourceIdSegmentValues.activationId, this._documentType = opts.resourceIdSegmentValues.documentType, this._documentId = opts.resourceIdSegmentValues.documentId;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get documentType() {
+    return this._documentType;
+  }
+  get documentId() {
+    return this._documentId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: searchForwardDocumentAriStaticOpts.qualifier,
+      platformQualifier: searchForwardDocumentAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: searchForwardDocumentAriStaticOpts.resourceOwner,
+      resourceType: searchForwardDocumentAriStaticOpts.resourceType,
+      resourceId: `activation/${opts.activationId}/${opts.documentType}/${opts.documentId}`,
+      resourceIdSegmentValues: {
+        activationId: opts.activationId,
+        documentType: opts.documentType,
+        documentId: opts.documentId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, searchForwardDocumentAriStaticOpts);
+    return new _SearchForwardDocumentAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, searchForwardDocumentAriStaticOpts);
+    return new _SearchForwardDocumentAri(opts);
+  }
+  getVariables() {
+    return {
+      activationId: this.activationId,
+      documentType: this.documentType,
+      documentId: this.documentId
+    };
+  }
+};
+
+export {
+  SearchForwardDocumentAri
+};