npm package diff

Package: @forge/util

Versions: 1.4.10-next.0 - 1.4.10-next.0-experimental-effab31

File: package/packages/ari/commerce/order/index.js

Index: package/packages/ari/commerce/order/index.js
===================================================================
--- package/packages/ari/commerce/order/index.js
+++ package/packages/ari/commerce/order/index.js
@@ -27,9 +27,9 @@
 var ValidationError = class extends Error {
 };
 
 // src/core/rules/cloud-id.ts
-function validateCloudId(cloudId, format = new RegExp("^[a-zA-Z0-9\\-]*$")) {
+function validateCloudId(cloudId, format = new RegExp("^[a-zA-Z0-9_\\-.]{0,255}$")) {
   if (!cloudId.match(format))
     throw new ValidationError(`Invalid cloud ID, expected ID of format ${format}.`);
 }
 
@@ -49,9 +49,9 @@
     throw new ValidationError(`ARI must have a qualifier of 'ari'. Received: ${qualifier}`);
 }
 
 // src/core/rules/resource-id.ts
-function validateResourceId(id, format = new RegExp("[!a-zA-Z0-9\\-_.~@:{}=]+(/[!a-zA-Z0-9\\-_.~@:{}=]+)*" /* ANY_RESOURCE_ID */), key = "resourceId") {
+function validateResourceId(id, format = new RegExp("[!a-zA-Z0-9\\-_.~@:;{}=]+(/[!a-zA-Z0-9\\-_.~@:;{}=]+)*" /* ANY_RESOURCE_ID */), key = "resourceId") {
   let formatWithCarets = new RegExp(`^${format.source}$`);
   if (!id.match(formatWithCarets))
     throw new ValidationError(`Invalid ${key} - ${id}, expected ID of format ${formatWithCarets}.`);
 }
@@ -283,9 +283,10 @@
 // src/commerce/order/manifest.ts
 var commerceOrderAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
-  cloudId: new RegExp("^[a-zA-Z0-9-]+$"),
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
   resourceOwner: CommerceOrderAriResourceOwner,
   resourceType: CommerceOrderAriResourceType,
   resourceIdSlug: "{orderId}",
   resourceIdSegmentFormats: {
@@ -297,21 +298,18 @@
 // src/commerce/order/index.ts
 var CommerceOrderAri = class _CommerceOrderAri extends RegisteredAri {
   constructor(opts) {
     super(opts);
-    this._txaId = opts.cloudId || "", this._orderId = opts.resourceIdSegmentValues.orderId;
+    this._orderId = opts.resourceIdSegmentValues.orderId;
   }
-  get txaId() {
-    return this._txaId;
-  }
   get orderId() {
     return this._orderId;
   }
   static create(opts) {
     let derivedOpts = {
       qualifier: commerceOrderAriStaticOpts.qualifier,
       platformQualifier: commerceOrderAriStaticOpts.platformQualifier,
-      cloudId: opts.txaId,
+      cloudId: void 0,
       resourceOwner: commerceOrderAriStaticOpts.resourceOwner,
       resourceType: commerceOrderAriStaticOpts.resourceType,
       resourceId: `${opts.orderId}`,
       resourceIdSegmentValues: {
@@ -325,9 +323,8 @@
     return new _CommerceOrderAri(opts);
   }
   getVariables() {
     return {
-      txaId: this.txaId,
       orderId: this.orderId
     };
   }
 };