@forge/util
2.0.1-experimental-78908582.0.1-experimental-04cc2b9
packages/ari/chunk-MNJMUR4K.mjs+
packages/ari/chunk-MNJMUR4K.mjsNew file+70
Index: package/packages/ari/chunk-MNJMUR4K.mjs
===================================================================
--- package/packages/ari/chunk-MNJMUR4K.mjs
+++ package/packages/ari/chunk-MNJMUR4K.mjs
@@ -0,0 +1,70 @@
+import {
+ TrelloLabelAriResourceOwner,
+ TrelloLabelAriResourceType
+} from "./chunk-JOW7TB5R.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/trello/label/manifest.ts
+var trelloLabelAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
+ resourceOwner: TrelloLabelAriResourceOwner,
+ resourceType: TrelloLabelAriResourceType,
+ resourceIdSlug: "workspace/{workspaceId}/{labelId}",
+ resourceIdSegmentFormats: {
+ workspaceId: /[a-zA-Z0-9\-_.]*/,
+ // eslint-disable-line no-useless-escape
+ labelId: /[a-zA-Z0-9\-_.]*/
+ // eslint-disable-line no-useless-escape
+ }
+};
+
+// src/trello/label/index.ts
+var TrelloLabelAri = class _TrelloLabelAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts);
+ this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._labelId = opts.resourceIdSegmentValues.labelId;
+ }
+ get workspaceId() {
+ return this._workspaceId;
+ }
+ get labelId() {
+ return this._labelId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: trelloLabelAriStaticOpts.qualifier,
+ platformQualifier: trelloLabelAriStaticOpts.platformQualifier,
+ cloudId: void 0,
+ resourceOwner: trelloLabelAriStaticOpts.resourceOwner,
+ resourceType: trelloLabelAriStaticOpts.resourceType,
+ resourceId: `workspace/${opts.workspaceId}/${opts.labelId}`,
+ resourceIdSegmentValues: {
+ workspaceId: opts.workspaceId || "",
+ labelId: opts.labelId || ""
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, trelloLabelAriStaticOpts);
+ return new _TrelloLabelAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, trelloLabelAriStaticOpts);
+ return new _TrelloLabelAri(opts);
+ }
+ getVariables() {
+ return {
+ workspaceId: this.workspaceId,
+ labelId: this.labelId
+ };
+ }
+};
+
+export {
+ TrelloLabelAri
+};