@forge/util
2.0.12.0.1-experimental-7890858
packages/ari/chunk-XAYNCOR6.mjs+
packages/ari/chunk-XAYNCOR6.mjsNew file+72
Index: package/packages/ari/chunk-XAYNCOR6.mjs
===================================================================
--- package/packages/ari/chunk-XAYNCOR6.mjs
+++ package/packages/ari/chunk-XAYNCOR6.mjs
@@ -0,0 +1,72 @@
+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("^$"),
+ resourceOwner: TrelloAttachmentAriResourceOwner,
+ resourceType: TrelloAttachmentAriResourceType,
+ resourceIdSlug: "card/workspace/{workspaceId}/{cardId}/{attachmentId}",
+ resourceIdSegmentFormats: {
+ workspaceId: /[a-zA-Z0-9\-_.]*/,
+ cardId: /[a-zA-Z0-9\-_.]*/,
+ attachmentId: /[a-zA-Z0-9\-_.]*/
+ }
+};
+
+// 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
+};