@forge/util
2.0.12.0.1-experimental-7890858
packages/ari/chunk-IYVYAIZA.mjs+
packages/ari/chunk-IYVYAIZA.mjsNew file+72
Index: package/packages/ari/chunk-IYVYAIZA.mjs
===================================================================
--- package/packages/ari/chunk-IYVYAIZA.mjs
+++ package/packages/ari/chunk-IYVYAIZA.mjs
@@ -0,0 +1,72 @@
+import {
+ TrelloBackgroundAriResourceOwner,
+ TrelloBackgroundAriResourceType
+} from "./chunk-5WRAUVE4.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/trello/background/manifest.ts
+var trelloBackgroundAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^$"),
+ resourceOwner: TrelloBackgroundAriResourceOwner,
+ resourceType: TrelloBackgroundAriResourceType,
+ resourceIdSlug: "type-id/background-type/{backgroundType}/{typeId}/{backgroundId}",
+ resourceIdSegmentFormats: {
+ backgroundType: /(?:member|board|shared)/,
+ typeId: /[a-zA-Z0-9\-_.]*/,
+ backgroundId: /[a-zA-Z0-9\-_.]*/
+ }
+};
+
+// src/trello/background/index.ts
+var TrelloBackgroundAri = class _TrelloBackgroundAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts), this._backgroundType = opts.resourceIdSegmentValues.backgroundType, this._typeId = opts.resourceIdSegmentValues.typeId, this._backgroundId = opts.resourceIdSegmentValues.backgroundId;
+ }
+ get backgroundType() {
+ return this._backgroundType;
+ }
+ get typeId() {
+ return this._typeId;
+ }
+ get backgroundId() {
+ return this._backgroundId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: trelloBackgroundAriStaticOpts.qualifier,
+ platformQualifier: trelloBackgroundAriStaticOpts.platformQualifier,
+ cloudId: void 0,
+ resourceOwner: trelloBackgroundAriStaticOpts.resourceOwner,
+ resourceType: trelloBackgroundAriStaticOpts.resourceType,
+ resourceId: `type-id/background-type/${opts.backgroundType}/${opts.typeId}/${opts.backgroundId}`,
+ resourceIdSegmentValues: {
+ backgroundType: opts.backgroundType,
+ typeId: opts.typeId || "",
+ backgroundId: opts.backgroundId || ""
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, trelloBackgroundAriStaticOpts);
+ return new _TrelloBackgroundAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, trelloBackgroundAriStaticOpts);
+ return new _TrelloBackgroundAri(opts);
+ }
+ getVariables() {
+ return {
+ backgroundType: this.backgroundType,
+ typeId: this.typeId,
+ backgroundId: this.backgroundId
+ };
+ }
+};
+
+export {
+ TrelloBackgroundAri
+};