npm package diff

Package: @forge/util

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

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

Index: package/packages/ari/chunk-FC35M4RB.mjs
===================================================================
--- package/packages/ari/chunk-FC35M4RB.mjs
+++ package/packages/ari/chunk-FC35M4RB.mjs
@@ -0,0 +1,77 @@
+import {
+  TrelloAttachmentAriResourceOwner,
+  TrelloAttachmentAriResourceType
+} from "./chunk-BAWQZ3RT.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/trello/attachment/manifest.ts
+var trelloAttachmentAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: TrelloAttachmentAriResourceOwner,
+  resourceType: TrelloAttachmentAriResourceType,
+  resourceIdSlug: "card/workspace/{workspaceId}/{cardId}/{attachmentId}",
+  resourceIdSegmentFormats: {
+    workspaceId: /[a-zA-Z0-9\-_.]*/,
+    // eslint-disable-line no-useless-escape
+    cardId: /[a-zA-Z0-9\-_.]*/,
+    // eslint-disable-line no-useless-escape
+    attachmentId: /[a-zA-Z0-9\-_.]*/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/trello/attachment/index.ts
+var TrelloAttachmentAri = class _TrelloAttachmentAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._cardId = opts.resourceIdSegmentValues.cardId, this._attachmentId = opts.resourceIdSegmentValues.attachmentId;
+  }
+  get workspaceId() {
+    return this._workspaceId;
+  }
+  get cardId() {
+    return this._cardId;
+  }
+  get attachmentId() {
+    return this._attachmentId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: trelloAttachmentAriStaticOpts.qualifier,
+      platformQualifier: trelloAttachmentAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: trelloAttachmentAriStaticOpts.resourceOwner,
+      resourceType: trelloAttachmentAriStaticOpts.resourceType,
+      resourceId: `card/workspace/${opts.workspaceId}/${opts.cardId}/${opts.attachmentId}`,
+      resourceIdSegmentValues: {
+        workspaceId: opts.workspaceId || "",
+        cardId: opts.cardId || "",
+        attachmentId: opts.attachmentId || ""
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, trelloAttachmentAriStaticOpts);
+    return new _TrelloAttachmentAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, trelloAttachmentAriStaticOpts);
+    return new _TrelloAttachmentAri(opts);
+  }
+  getVariables() {
+    return {
+      workspaceId: this.workspaceId,
+      cardId: this.cardId,
+      attachmentId: this.attachmentId
+    };
+  }
+};
+
+export {
+  TrelloAttachmentAri
+};