@forge/util
2.0.12.0.1-experimental-7890858
packages/ari/chunk-LAJB5RXM.mjs+
packages/ari/chunk-LAJB5RXM.mjsNew file+70
Index: package/packages/ari/chunk-LAJB5RXM.mjs
===================================================================
--- package/packages/ari/chunk-LAJB5RXM.mjs
+++ package/packages/ari/chunk-LAJB5RXM.mjs
@@ -0,0 +1,70 @@
+import {
+ AvocadoAnswerAriResourceOwner,
+ AvocadoAnswerAriResourceType
+} from "./chunk-MBGO4Q2M.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/avocado/answer/manifest.ts
+var avocadoAnswerAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+ resourceOwner: AvocadoAnswerAriResourceOwner,
+ resourceType: AvocadoAnswerAriResourceType,
+ resourceIdSlug: "activation/{workspaceId}/{answerId}",
+ 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}/,
+ answerId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
+ }
+};
+
+// src/avocado/answer/index.ts
+var AvocadoAnswerAri = class _AvocadoAnswerAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts), this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._answerId = opts.resourceIdSegmentValues.answerId;
+ }
+ get siteId() {
+ return this._siteId;
+ }
+ get workspaceId() {
+ return this._workspaceId;
+ }
+ get answerId() {
+ return this._answerId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: avocadoAnswerAriStaticOpts.qualifier,
+ platformQualifier: avocadoAnswerAriStaticOpts.platformQualifier,
+ cloudId: opts.siteId,
+ resourceOwner: avocadoAnswerAriStaticOpts.resourceOwner,
+ resourceType: avocadoAnswerAriStaticOpts.resourceType,
+ resourceId: `activation/${opts.workspaceId}/${opts.answerId}`,
+ resourceIdSegmentValues: {
+ workspaceId: opts.workspaceId,
+ answerId: opts.answerId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, avocadoAnswerAriStaticOpts);
+ return new _AvocadoAnswerAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, avocadoAnswerAriStaticOpts);
+ return new _AvocadoAnswerAri(opts);
+ }
+ getVariables() {
+ return {
+ siteId: this.siteId,
+ workspaceId: this.workspaceId,
+ answerId: this.answerId
+ };
+ }
+};
+
+export {
+ AvocadoAnswerAri
+};