@forge/util
2.0.12.0.1-experimental-7890858
packages/ari/chunk-HF2CGR3P.mjs+
packages/ari/chunk-HF2CGR3P.mjsNew file+66
Index: package/packages/ari/chunk-HF2CGR3P.mjs
===================================================================
--- package/packages/ari/chunk-HF2CGR3P.mjs
+++ package/packages/ari/chunk-HF2CGR3P.mjs
@@ -0,0 +1,66 @@
+import {
+ BitbucketAppAriResourceOwner,
+ BitbucketAppAriResourceType
+} from "./chunk-HN5XXUJU.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/bitbucket/app/manifest.ts
+var bitbucketAppAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^$"),
+ resourceOwner: BitbucketAppAriResourceOwner,
+ resourceType: "app",
+ resourceIdSlug: "{workspaceId}/{appId}",
+ resourceIdSegmentFormats: {
+ workspaceId: /\{[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}}/,
+ appId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+ }
+};
+
+// src/bitbucket/app/index.ts
+var BitbucketAppAri = class _BitbucketAppAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts), this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._appId = opts.resourceIdSegmentValues.appId;
+ }
+ get workspaceId() {
+ return this._workspaceId;
+ }
+ get appId() {
+ return this._appId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: bitbucketAppAriStaticOpts.qualifier,
+ platformQualifier: bitbucketAppAriStaticOpts.platformQualifier,
+ cloudId: void 0,
+ resourceOwner: bitbucketAppAriStaticOpts.resourceOwner,
+ resourceType: bitbucketAppAriStaticOpts.resourceType,
+ resourceId: `${opts.workspaceId}/${opts.appId}`,
+ resourceIdSegmentValues: {
+ workspaceId: opts.workspaceId,
+ appId: opts.appId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, bitbucketAppAriStaticOpts);
+ return new _BitbucketAppAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, bitbucketAppAriStaticOpts);
+ return new _BitbucketAppAri(opts);
+ }
+ getVariables() {
+ return {
+ workspaceId: this.workspaceId,
+ appId: this.appId
+ };
+ }
+};
+
+export {
+ BitbucketAppAri
+};