@forge/util
2.0.12.0.1-experimental-7890858
packages/ari/chunk-FZZEGQU5.mjs+
packages/ari/chunk-FZZEGQU5.mjsNew file+64
Index: package/packages/ari/chunk-FZZEGQU5.mjs
===================================================================
--- package/packages/ari/chunk-FZZEGQU5.mjs
+++ package/packages/ari/chunk-FZZEGQU5.mjs
@@ -0,0 +1,64 @@
+import {
+ CommerceQuoteAriResourceOwner,
+ CommerceQuoteAriResourceType
+} from "./chunk-2PBMRYJM.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/commerce/quote/manifest.ts
+var commerceQuoteAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^[a-zA-Z0-9\\-]+$"),
+ resourceOwner: CommerceQuoteAriResourceOwner,
+ resourceType: CommerceQuoteAriResourceType,
+ resourceIdSlug: "{quoteId}",
+ resourceIdSegmentFormats: {
+ quoteId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
+ }
+};
+
+// src/commerce/quote/index.ts
+var CommerceQuoteAri = class _CommerceQuoteAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts), this._txaId = opts.cloudId || "", this._quoteId = opts.resourceIdSegmentValues.quoteId;
+ }
+ get txaId() {
+ return this._txaId;
+ }
+ get quoteId() {
+ return this._quoteId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: commerceQuoteAriStaticOpts.qualifier,
+ platformQualifier: commerceQuoteAriStaticOpts.platformQualifier,
+ cloudId: opts.txaId,
+ resourceOwner: commerceQuoteAriStaticOpts.resourceOwner,
+ resourceType: commerceQuoteAriStaticOpts.resourceType,
+ resourceId: `${opts.quoteId}`,
+ resourceIdSegmentValues: {
+ quoteId: opts.quoteId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, commerceQuoteAriStaticOpts);
+ return new _CommerceQuoteAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, commerceQuoteAriStaticOpts);
+ return new _CommerceQuoteAri(opts);
+ }
+ getVariables() {
+ return {
+ txaId: this.txaId,
+ quoteId: this.quoteId
+ };
+ }
+};
+
+export {
+ CommerceQuoteAri
+};