@wix/pricing-plans 1.0.45 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,8 +89,8 @@ export declare function memberGetOrder(httpClient: HttpClient): (_id: string, op
89
89
  }>;
90
90
  export declare function memberListOrders(httpClient: HttpClient): (options?: MemberListOrdersOptions) => Promise<import("./pricing-plans-v2-order.universal").MemberListOrdersResponse & import("./pricing-plans-v2-order.universal").MemberListOrdersResponseNonNullableFields>;
91
91
  export declare function requestCancellation(httpClient: HttpClient): (_id: string, effectiveAt: CancellationEffectiveAt) => Promise<void>;
92
- export declare function createOfflineOrder(httpClient: HttpClient): (planId: string, options?: CreateOfflineOrderOptions) => Promise<import("./pricing-plans-v2-order.universal").CreateOfflineOrderResponse & import("./pricing-plans-v2-order.universal").CreateOfflineOrderResponseNonNullableFields>;
93
- export declare function getOfflineOrderPreview(httpClient: HttpClient): (planId: string, options?: GetOfflineOrderPreviewOptions) => Promise<import("./pricing-plans-v2-order.universal").GetOfflineOrderPreviewResponse & import("./pricing-plans-v2-order.universal").GetOfflineOrderPreviewResponseNonNullableFields>;
92
+ export declare function createOfflineOrder(httpClient: HttpClient): (planId: string, memberId: string, options?: CreateOfflineOrderOptions) => Promise<import("./pricing-plans-v2-order.universal").CreateOfflineOrderResponse & import("./pricing-plans-v2-order.universal").CreateOfflineOrderResponseNonNullableFields>;
93
+ export declare function getOfflineOrderPreview(httpClient: HttpClient): (planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions) => Promise<import("./pricing-plans-v2-order.universal").GetOfflineOrderPreviewResponse & import("./pricing-plans-v2-order.universal").GetOfflineOrderPreviewResponseNonNullableFields>;
94
94
  export declare function getPricePreview(httpClient: HttpClient): (planId: string, options?: GetPricePreviewOptions) => Promise<import("./pricing-plans-v2-order.universal").GetPricePreviewResponse & import("./pricing-plans-v2-order.universal").GetPricePreviewResponseNonNullableFields>;
95
95
  export declare function managementGetOrder(httpClient: HttpClient): (_id: string, options?: ManagementGetOrderOptions) => Promise<import("./pricing-plans-v2-order.universal").GetOrderResponse & import("./pricing-plans-v2-order.universal").GetOrderResponseNonNullableFields>;
96
96
  export declare function managementListOrders(httpClient: HttpClient): (options?: ManagementListOrdersOptions) => Promise<import("./pricing-plans-v2-order.universal").ListOrdersResponse & import("./pricing-plans-v2-order.universal").ListOrdersResponseNonNullableFields>;
@@ -22,13 +22,13 @@ function requestCancellation(httpClient) {
22
22
  }
23
23
  exports.requestCancellation = requestCancellation;
24
24
  function createOfflineOrder(httpClient) {
25
- return (planId, options) => (0, pricing_plans_v2_order_universal_1.createOfflineOrder)(planId, options,
25
+ return (planId, memberId, options) => (0, pricing_plans_v2_order_universal_1.createOfflineOrder)(planId, memberId, options,
26
26
  // @ts-ignore
27
27
  { httpClient });
28
28
  }
29
29
  exports.createOfflineOrder = createOfflineOrder;
30
30
  function getOfflineOrderPreview(httpClient) {
31
- return (planId, options) => (0, pricing_plans_v2_order_universal_1.getOfflineOrderPreview)(planId, options,
31
+ return (planId, memberId, options) => (0, pricing_plans_v2_order_universal_1.getOfflineOrderPreview)(planId, memberId, options,
32
32
  // @ts-ignore
33
33
  { httpClient });
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pricing-plans-v2-order.public.js","sourceRoot":"","sources":["../../../src/pricing-plans-v2-order.public.ts"],"names":[],"mappings":";;;AACA,yFAsB4C;AAE/B,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAEjE,SAAgB,cAAc,CAAC,UAAsB;IACnD,OAAO,CAAC,GAAW,EAAE,OAA+B,EAAE,EAAE,CACtD,IAAA,iDAAuB,EACrB,GAAG,EACH,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wCAQC;AAED,SAAgB,gBAAgB,CAAC,UAAsB;IACrD,OAAO,CAAC,OAAiC,EAAE,EAAE,CAC3C,IAAA,mDAAyB,EACvB,OAAO;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Ae,CAAC,UAAsB;IACpD,OAAO,CAAC,GAAW,EAAE,OAAa,EAAE,EAAE,CACpC,IAAA,kDAAwB,EACtB,GAAG,EACH,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,0CAQC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,GAAW,EAAE,WAAoC,EAAE,EAAE,CAC3D,IAAA,8CAAoB,EAClB,GAAG,EACH,WAAW;IACX,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,kCAQC;AAED,SAAgB,UAAU,CAAC,UAAsB;IAC/C,OAAO,CAAC,GAAW,EAAE,EAAE,CACrB,IAAA,6CAAmB,EACjB,GAAG;IACH,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,gCAOC;AAED,SAAgB,UAAU,CAAC,UAAsB;IAC/C,OAAO,CAAC,GAAW,EAAE,EAAE,CACrB,IAAA,6CAAmB,EACjB,GAAG;IACH,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,gCAOC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,GAAW,EAAE,EAAE,CACrB,IAAA,8CAAoB,EAClB,GAAG;IACH,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,kCAOC;AAED,uFAY4C;AAX1C,8HAAA,UAAU,OAAA;AACV,6HAAA,SAAS,OAAA;AACT,+HAAA,WAAW,OAAA;AACX,+HAAA,WAAW,OAAA;AACX,qIAAA,iBAAiB,OAAA;AACjB,2IAAA,uBAAuB,OAAA;AACvB,iIAAA,aAAa,OAAA;AACb,0HAAA,MAAM,OAAA;AACN,uHAAA,GAAG,OAAA;AACH,6HAAA,SAAS,OAAA;AACT,wIAAA,oBAAoB,OAAA"}
1
+ {"version":3,"file":"pricing-plans-v2-order.public.js","sourceRoot":"","sources":["../../../src/pricing-pl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,IAAA,8CAAoB,EAClB,GAAG;IACH,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,kCAOC;AAED,uFAY4C;AAX1C,8HAAA,UAAU,OAAA;AACV,6HAAA,SAAS,OAAA;AACT,+HAAA,WAAW,OAAA;AACX,+HAAA,WAAW,OAAA;AACX,qIAAA,iBAAiB,OAAA;AACjB,2IAAA,uBAAuB,OAAA;AACvB,iIAAA,aAAa,OAAA;AACb,0HAAA,MAAM,OAAA;AACN,uHAAA,GAAG,OAAA;AACH,6HAAA,SAAS,OAAA;AACT,wIAAA,oBAAoB,OAAA"}
@@ -1776,6 +1776,7 @@ export interface MemberGetOrderOptions {
1776
1776
  *
1777
1777
  * The `memberListOrders()` function returns a Promise that resolves to a list of up to 100 pricing plan orders.
1778
1778
  * @public
1779
+ * @documentationMaturity preview
1779
1780
  * @param options - Filtering, sorting, and pagination options.
1780
1781
  * @applicableIdentity MEMBER
1781
1782
  */
@@ -1859,6 +1860,7 @@ export interface MemberListOrdersOptions {
1859
1860
  * - `"IMMEDIATELY"`: Indicates that the order should be canceled immediately.
1860
1861
  * - `"NEXT_PAYMENT_DATE"`: Indicates that the order be canceled at the next payment date.
1861
1862
  * @public
1863
+ * @documentationMaturity preview
1862
1864
  * @requiredField _id
1863
1865
  * @requiredField effectiveAt
1864
1866
  * @param options - Options for requesting a cancellation.
@@ -1882,8 +1884,10 @@ export declare function requestCancellation(_id: string, effectiveAt: Cancellati
1882
1884
  * When creating a free offline order:
1883
1885
  * - The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
1884
1886
  * - The order's last payment status is set to `"NOT_APPLICABLE"`.
1887
+ * @param memberId - ID of the member ordering the plan.
1885
1888
  * @public
1886
- * @requiredField options.memberId
1889
+ * @documentationMaturity preview
1890
+ * @requiredField memberId
1887
1891
  * @requiredField planId
1888
1892
  * @param options - Options for creating an offline order.
1889
1893
  * @param planId - ID of the plan being ordered. See [Plans for more information about plan IDs](plans)
@@ -1891,14 +1895,8 @@ export declare function requestCancellation(_id: string, effectiveAt: Cancellati
1891
1895
  * @applicableIdentity APP
1892
1896
  * @returns Fulfilled - The order of the plan.
1893
1897
  */
1894
- export declare function createOfflineOrder(planId: string, options?: CreateOfflineOrderOptions): Promise<CreateOfflineOrderResponse & CreateOfflineOrderResponseNonNullableFields>;
1898
+ export declare function createOfflineOrder(planId: string, memberId: string, options?: CreateOfflineOrderOptions): Promise<CreateOfflineOrderResponse & CreateOfflineOrderResponseNonNullableFields>;
1895
1899
  export interface CreateOfflineOrderOptions {
1896
- /**
1897
- * ID of the member ordering the plan.
1898
- * This field is required when creating an offline order.
1899
- *
1900
- */
1901
- memberId: string;
1902
1900
  /**
1903
1901
  * Start date and time for the ordered plan.
1904
1902
  *
@@ -1926,8 +1924,10 @@ export interface CreateOfflineOrderOptions {
1926
1924
  * If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection) for the site, taxes are applied to the preview. If not, `tax` previews as `null`.
1927
1925
  *
1928
1926
  * You can preview the order to check purchase limitations, but the limitations are not enforced for the preview. If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview. But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then `purchaseLimitExceeded` will return as `true`. Thus function is not available to the buyer. You specify the member ID for the buyer whose order should be previewed. To get a general price preview for a plan that's not buyer-specific, use the [`getPricePreview()`](#getpricepreview) function.
1927
+ * @param memberId - Member ID of the buyer the previewed order is for.
1929
1928
  * @public
1930
- * @requiredField options.memberId
1929
+ * @documentationMaturity preview
1930
+ * @requiredField memberId
1931
1931
  * @requiredField planId
1932
1932
  * @param options - Options for previewing the offline order.
1933
1933
  * @param planId - ID of the plan of the previewed order.
@@ -1935,13 +1935,8 @@ export interface CreateOfflineOrderOptions {
1935
1935
  * @applicableIdentity APP
1936
1936
  * @returns Fulfilled - A preview of the order.
1937
1937
  */
1938
- export declare function getOfflineOrderPreview(planId: string, options?: GetOfflineOrderPreviewOptions): Promise<GetOfflineOrderPreviewResponse & GetOfflineOrderPreviewResponseNonNullableFields>;
1938
+ export declare function getOfflineOrderPreview(planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions): Promise<GetOfflineOrderPreviewResponse & GetOfflineOrderPreviewResponseNonNullableFields>;
1939
1939
  export interface GetOfflineOrderPreviewOptions {
1940
- /**
1941
- * Member ID for the buyer who might order the plan offline.
1942
- * This field is required to get an offline order preview.
1943
- */
1944
- memberId: string;
1945
1940
  /**
1946
1941
  * Start date and time for plan of the previewed order.
1947
1942
  *
@@ -1961,6 +1956,7 @@ export interface GetOfflineOrderPreviewOptions {
1961
1956
  * Buyers do not have to be logged in to preview the price, as such, the details returned by this function are not buyer-specific. To generate a preview of a purchase for a specific-buyer, use the [`getOfflineOrderPreview()`](#getofflineorderpreview).
1962
1957
  * @param planId - ID of plan to preview.
1963
1958
  * @public
1959
+ * @documentationMaturity preview
1964
1960
  * @requiredField planId
1965
1961
  * @param options - Options for getting a price preview.
1966
1962
  * @permissionScope Read Pricing Plans
@@ -1984,6 +1980,7 @@ export interface GetPricePreviewOptions {
1984
1980
  * The `managementGetOrder()` function returns a Promise that resolves to information about the specified order.
1985
1981
  * @param _id - Order ID.
1986
1982
  * @public
1983
+ * @documentationMaturity preview
1987
1984
  * @requiredField _id
1988
1985
  * @param options - Options to use when getting an order.
1989
1986
  * @permissionScope Manage Orders
@@ -2002,6 +1999,7 @@ export interface ManagementGetOrderOptions {
2002
1999
  *
2003
2000
  * This function returns the orders on the site. To list orders for the currently logged-in member, use [`memberListOrders()`](#memberlistorders).
2004
2001
  * @public
2002
+ * @documentationMaturity preview
2005
2003
  * @param options - Filtering, sorting, and pagination options.
2006
2004
  * @permissionScope Manage Orders
2007
2005
  * @permissionScope Manage Bookings Services and Settings
@@ -2073,6 +2071,7 @@ export interface ManagementListOrdersOptions {
2073
2071
  *
2074
2072
  * Must be later than the current end date and time.
2075
2073
  * @public
2074
+ * @documentationMaturity preview
2076
2075
  * @requiredField _id
2077
2076
  * @requiredField endDate
2078
2077
  * @param options - Options for postponing the end date of an order.
@@ -2109,6 +2108,7 @@ export declare function postponeEndDate(_id: string, endDate: Date): Promise<voi
2109
2108
  * - `"IMMEDIATELY"`: The order is canceled immediately.
2110
2109
  * - `"NEXT_PAYMENT_DATE"`: The order is canceled at the next payment date.
2111
2110
  * @public
2111
+ * @documentationMaturity preview
2112
2112
  * @requiredField _id
2113
2113
  * @requiredField effectiveAt
2114
2114
  * @param options - Options for canceling orders.
@@ -2135,6 +2135,7 @@ export declare function cancelOrder(_id: string, effectiveAt: CancellationEffect
2135
2135
  * - Mark an online order as paid. The `markAsPaid()` function is supported for offline orders only.
2136
2136
  * @param _id - Order ID.
2137
2137
  * @public
2138
+ * @documentationMaturity preview
2138
2139
  * @requiredField _id
2139
2140
  * @permissionScope Manage Orders
2140
2141
  * @applicableIdentity APP
@@ -2157,6 +2158,7 @@ export declare function markAsPaid(_id: string): Promise<void>;
2157
2158
  * Paused orders can be continued with the [`resumeOrder()`](#resumeorder) function.
2158
2159
  * @param _id - Order ID.
2159
2160
  * @public
2161
+ * @documentationMaturity preview
2160
2162
  * @requiredField _id
2161
2163
  * @permissionScope Manage Orders
2162
2164
  * @applicableIdentity APP
@@ -2177,6 +2179,7 @@ export declare function pauseOrder(_id: string): Promise<void>;
2177
2179
  * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2178
2180
  * @param _id - Order ID.
2179
2181
  * @public
2182
+ * @documentationMaturity preview
2180
2183
  * @requiredField _id
2181
2184
  * @permissionScope Manage Orders
2182
2185
  * @applicableIdentity APP
@@ -34,6 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.resumeOrder = exports.pauseOrder = exports.markAsPaid = exports.cancelOrder = exports.postponeEndDate = exports.managementListOrders = exports.managementGetOrder = exports.getPricePreview = exports.getOfflineOrderPreview = exports.createOfflineOrder = exports.requestCancellation = exports.memberListOrders = exports.memberGetOrder = exports.ReasonNotSuspendable = exports.SortOrder = exports.Set = exports.Status = exports.PaymentStatus = exports.CancellationEffectiveAt = exports.CancellationCause = exports.OrderStatus = exports.OrderMethod = exports.OrderType = exports.PeriodUnit = exports.__debug = void 0;
36
36
  const velo_1 = require("@wix/metro-runtime/velo");
37
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
37
38
  const ambassadorWixPricingPlansV2Order = __importStar(require("./pricing-plans-v2-order.http"));
38
39
  // @ts-ignore
39
40
  let __verbose = false;
@@ -254,10 +255,11 @@ function memberGetOrder(_id, options) {
254
255
  return fromJSON(result.data);
255
256
  }
256
257
  catch (err) {
257
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
258
- '_id',
259
- 'options',
260
- ]);
258
+ const transformedError = (0, transform_error_1.transformError)(err, {
259
+ spreadPathsToArguments: {},
260
+ explicitPathsToArguments: { id: '$[0]', fieldSet: '$[1].fieldSet' },
261
+ singleArgumentUnchanged: false,
262
+ }, ['_id', 'options']);
261
263
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
262
264
  throw transformedError;
263
265
  }
@@ -269,6 +271,7 @@ exports.memberGetOrder = memberGetOrder;
269
271
  *
270
272
  * The `memberListOrders()` function returns a Promise that resolves to a list of up to 100 pricing plan orders.
271
273
  * @public
274
+ * @documentationMaturity preview
272
275
  * @param options - Filtering, sorting, and pagination options.
273
276
  * @applicableIdentity MEMBER
274
277
  */
@@ -316,9 +319,20 @@ function memberListOrders(options) {
316
319
  return fromJSON(result.data);
317
320
  }
318
321
  catch (err) {
319
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
320
- 'options',
321
- ]);
322
+ const transformedError = (0, transform_error_1.transformError)(err, {
323
+ spreadPathsToArguments: {},
324
+ explicitPathsToArguments: {
325
+ planIds: '$[0].planIds',
326
+ autoRenewCanceled: '$[0].autoRenewCanceled',
327
+ orderStatuses: '$[0].orderStatuses',
328
+ paymentStatuses: '$[0].paymentStatuses',
329
+ limit: '$[0].limit',
330
+ offset: '$[0].offset',
331
+ sorting: '$[0].sorting',
332
+ fieldSet: '$[0].fieldSet',
333
+ },
334
+ singleArgumentUnchanged: false,
335
+ }, ['options']);
322
336
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
323
337
  throw transformedError;
324
338
  }
@@ -343,6 +357,7 @@ exports.memberListOrders = memberListOrders;
343
357
  * - `"IMMEDIATELY"`: Indicates that the order should be canceled immediately.
344
358
  * - `"NEXT_PAYMENT_DATE"`: Indicates that the order be canceled at the next payment date.
345
359
  * @public
360
+ * @documentationMaturity preview
346
361
  * @requiredField _id
347
362
  * @requiredField effectiveAt
348
363
  * @param options - Options for requesting a cancellation.
@@ -383,10 +398,11 @@ function requestCancellation(_id, effectiveAt) {
383
398
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
384
399
  }
385
400
  catch (err) {
386
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
387
- '_id',
388
- 'effectiveAt',
389
- ]);
401
+ const transformedError = (0, transform_error_1.transformError)(err, {
402
+ spreadPathsToArguments: {},
403
+ explicitPathsToArguments: { id: '$[0]', effectiveAt: '$[1]' },
404
+ singleArgumentUnchanged: false,
405
+ }, ['_id', 'effectiveAt']);
390
406
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
391
407
  throw transformedError;
392
408
  }
@@ -409,8 +425,10 @@ exports.requestCancellation = requestCancellation;
409
425
  * When creating a free offline order:
410
426
  * - The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
411
427
  * - The order's last payment status is set to `"NOT_APPLICABLE"`.
428
+ * @param memberId - ID of the member ordering the plan.
412
429
  * @public
413
- * @requiredField options.memberId
430
+ * @documentationMaturity preview
431
+ * @requiredField memberId
414
432
  * @requiredField planId
415
433
  * @param options - Options for creating an offline order.
416
434
  * @param planId - ID of the plan being ordered. See [Plans for more information about plan IDs](plans)
@@ -418,20 +436,20 @@ exports.requestCancellation = requestCancellation;
418
436
  * @applicableIdentity APP
419
437
  * @returns Fulfilled - The order of the plan.
420
438
  */
421
- function createOfflineOrder(planId, options) {
439
+ function createOfflineOrder(planId, memberId, options) {
422
440
  var _a, _b, _c;
423
441
  return __awaiter(this, arguments, void 0, function* () {
424
442
  const requestTransformation = {
425
443
  planId: '$[0]',
426
- memberId: '$[1].memberId',
427
- startDate: '$[1].startDate',
428
- paid: '$[1].paid',
429
- couponCode: '$[1].couponCode',
430
- submissionId: '$[1].submissionId',
444
+ memberId: '$[1]',
445
+ startDate: '$[2].startDate',
446
+ paid: '$[2].paid',
447
+ couponCode: '$[2].couponCode',
448
+ submissionId: '$[2].submissionId',
431
449
  };
432
450
  const responseTransformation = '$';
433
451
  // @ts-ignore
434
- const { httpClient, sideEffects } = arguments[2];
452
+ const { httpClient, sideEffects } = arguments[3];
435
453
  const { toAmbassadorRequest } = (0, velo_1.serializer)({
436
454
  rootSchema: _createOfflineOrderRequest,
437
455
  depSchemas: {},
@@ -450,7 +468,7 @@ function createOfflineOrder(planId, options) {
450
468
  },
451
469
  customTransformation: responseTransformation,
452
470
  });
453
- const payload = toAmbassadorRequest([planId, options]);
471
+ const payload = toAmbassadorRequest([planId, memberId, options]);
454
472
  const reqOpts = ambassadorWixPricingPlansV2Order.createOfflineOrder(payload);
455
473
  __log(`"CreateOfflineOrder" sending request with: ${__inspect(reqOpts)}`);
456
474
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
@@ -460,10 +478,18 @@ function createOfflineOrder(planId, options) {
460
478
  return fromJSON(result.data);
461
479
  }
462
480
  catch (err) {
463
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
464
- 'planId',
465
- 'options',
466
- ]);
481
+ const transformedError = (0, transform_error_1.transformError)(err, {
482
+ spreadPathsToArguments: {},
483
+ explicitPathsToArguments: {
484
+ planId: '$[0]',
485
+ memberId: '$[1]',
486
+ startDate: '$[2].startDate',
487
+ paid: '$[2].paid',
488
+ couponCode: '$[2].couponCode',
489
+ submissionId: '$[2].submissionId',
490
+ },
491
+ singleArgumentUnchanged: false,
492
+ }, ['planId', 'memberId', 'options']);
467
493
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
468
494
  throw transformedError;
469
495
  }
@@ -480,8 +506,10 @@ exports.createOfflineOrder = createOfflineOrder;
480
506
  * If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection) for the site, taxes are applied to the preview. If not, `tax` previews as `null`.
481
507
  *
482
508
  * You can preview the order to check purchase limitations, but the limitations are not enforced for the preview. If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview. But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then `purchaseLimitExceeded` will return as `true`. Thus function is not available to the buyer. You specify the member ID for the buyer whose order should be previewed. To get a general price preview for a plan that's not buyer-specific, use the [`getPricePreview()`](#getpricepreview) function.
509
+ * @param memberId - Member ID of the buyer the previewed order is for.
483
510
  * @public
484
- * @requiredField options.memberId
511
+ * @documentationMaturity preview
512
+ * @requiredField memberId
485
513
  * @requiredField planId
486
514
  * @param options - Options for previewing the offline order.
487
515
  * @param planId - ID of the plan of the previewed order.
@@ -489,18 +517,18 @@ exports.createOfflineOrder = createOfflineOrder;
489
517
  * @applicableIdentity APP
490
518
  * @returns Fulfilled - A preview of the order.
491
519
  */
492
- function getOfflineOrderPreview(planId, options) {
520
+ function getOfflineOrderPreview(planId, memberId, options) {
493
521
  var _a, _b, _c;
494
522
  return __awaiter(this, arguments, void 0, function* () {
495
523
  const requestTransformation = {
496
524
  planId: '$[0]',
497
- memberId: '$[1].memberId',
498
- startDate: '$[1].startDate',
499
- couponCode: '$[1].couponCode',
525
+ memberId: '$[1]',
526
+ startDate: '$[2].startDate',
527
+ couponCode: '$[2].couponCode',
500
528
  };
501
529
  const responseTransformation = '$';
502
530
  // @ts-ignore
503
- const { httpClient, sideEffects } = arguments[2];
531
+ const { httpClient, sideEffects } = arguments[3];
504
532
  const { toAmbassadorRequest } = (0, velo_1.serializer)({
505
533
  rootSchema: _getOfflineOrderPreviewRequest,
506
534
  depSchemas: {},
@@ -519,7 +547,7 @@ function getOfflineOrderPreview(planId, options) {
519
547
  },
520
548
  customTransformation: responseTransformation,
521
549
  });
522
- const payload = toAmbassadorRequest([planId, options]);
550
+ const payload = toAmbassadorRequest([planId, memberId, options]);
523
551
  const reqOpts = ambassadorWixPricingPlansV2Order.getOfflineOrderPreview(payload);
524
552
  __log(`"GetOfflineOrderPreview" sending request with: ${__inspect(reqOpts)}`);
525
553
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
@@ -529,10 +557,16 @@ function getOfflineOrderPreview(planId, options) {
529
557
  return fromJSON(result.data);
530
558
  }
531
559
  catch (err) {
532
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
533
- 'planId',
534
- 'options',
535
- ]);
560
+ const transformedError = (0, transform_error_1.transformError)(err, {
561
+ spreadPathsToArguments: {},
562
+ explicitPathsToArguments: {
563
+ planId: '$[0]',
564
+ memberId: '$[1]',
565
+ startDate: '$[2].startDate',
566
+ couponCode: '$[2].couponCode',
567
+ },
568
+ singleArgumentUnchanged: false,
569
+ }, ['planId', 'memberId', 'options']);
536
570
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
537
571
  throw transformedError;
538
572
  }
@@ -549,6 +583,7 @@ exports.getOfflineOrderPreview = getOfflineOrderPreview;
549
583
  * Buyers do not have to be logged in to preview the price, as such, the details returned by this function are not buyer-specific. To generate a preview of a purchase for a specific-buyer, use the [`getOfflineOrderPreview()`](#getofflineorderpreview).
550
584
  * @param planId - ID of plan to preview.
551
585
  * @public
586
+ * @documentationMaturity preview
552
587
  * @requiredField planId
553
588
  * @param options - Options for getting a price preview.
554
589
  * @permissionScope Read Pricing Plans
@@ -599,10 +634,14 @@ function getPricePreview(planId, options) {
599
634
  return fromJSON(result.data);
600
635
  }
601
636
  catch (err) {
602
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
603
- 'planId',
604
- 'options',
605
- ]);
637
+ const transformedError = (0, transform_error_1.transformError)(err, {
638
+ spreadPathsToArguments: {},
639
+ explicitPathsToArguments: {
640
+ planId: '$[0]',
641
+ couponCode: '$[1].couponCode',
642
+ },
643
+ singleArgumentUnchanged: false,
644
+ }, ['planId', 'options']);
606
645
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
607
646
  throw transformedError;
608
647
  }
@@ -615,6 +654,7 @@ exports.getPricePreview = getPricePreview;
615
654
  * The `managementGetOrder()` function returns a Promise that resolves to information about the specified order.
616
655
  * @param _id - Order ID.
617
656
  * @public
657
+ * @documentationMaturity preview
618
658
  * @requiredField _id
619
659
  * @param options - Options to use when getting an order.
620
660
  * @permissionScope Manage Orders
@@ -657,10 +697,11 @@ function managementGetOrder(_id, options) {
657
697
  return fromJSON(result.data);
658
698
  }
659
699
  catch (err) {
660
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
661
- '_id',
662
- 'options',
663
- ]);
700
+ const transformedError = (0, transform_error_1.transformError)(err, {
701
+ spreadPathsToArguments: {},
702
+ explicitPathsToArguments: { id: '$[0]', fieldSet: '$[1].fieldSet' },
703
+ singleArgumentUnchanged: false,
704
+ }, ['_id', 'options']);
664
705
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
665
706
  throw transformedError;
666
707
  }
@@ -674,6 +715,7 @@ exports.managementGetOrder = managementGetOrder;
674
715
  *
675
716
  * This function returns the orders on the site. To list orders for the currently logged-in member, use [`memberListOrders()`](#memberlistorders).
676
717
  * @public
718
+ * @documentationMaturity preview
677
719
  * @param options - Filtering, sorting, and pagination options.
678
720
  * @permissionScope Manage Orders
679
721
  * @permissionScope Manage Bookings Services and Settings
@@ -725,9 +767,21 @@ function managementListOrders(options) {
725
767
  return fromJSON(result.data);
726
768
  }
727
769
  catch (err) {
728
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
729
- 'options',
730
- ]);
770
+ const transformedError = (0, transform_error_1.transformError)(err, {
771
+ spreadPathsToArguments: {},
772
+ explicitPathsToArguments: {
773
+ buyerIds: '$[0].buyerIds',
774
+ planIds: '$[0].planIds',
775
+ autoRenewCanceled: '$[0].autoRenewCanceled',
776
+ orderStatuses: '$[0].orderStatuses',
777
+ paymentStatuses: '$[0].paymentStatuses',
778
+ limit: '$[0].limit',
779
+ offset: '$[0].offset',
780
+ sorting: '$[0].sorting',
781
+ fieldSet: '$[0].fieldSet',
782
+ },
783
+ singleArgumentUnchanged: false,
784
+ }, ['options']);
731
785
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
732
786
  throw transformedError;
733
787
  }
@@ -750,6 +804,7 @@ exports.managementListOrders = managementListOrders;
750
804
  *
751
805
  * Must be later than the current end date and time.
752
806
  * @public
807
+ * @documentationMaturity preview
753
808
  * @requiredField _id
754
809
  * @requiredField endDate
755
810
  * @param options - Options for postponing the end date of an order.
@@ -793,10 +848,11 @@ function postponeEndDate(_id, endDate) {
793
848
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
794
849
  }
795
850
  catch (err) {
796
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
797
- '_id',
798
- 'endDate',
799
- ]);
851
+ const transformedError = (0, transform_error_1.transformError)(err, {
852
+ spreadPathsToArguments: {},
853
+ explicitPathsToArguments: { id: '$[0]', endDate: '$[1]' },
854
+ singleArgumentUnchanged: false,
855
+ }, ['_id', 'endDate']);
800
856
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
801
857
  throw transformedError;
802
858
  }
@@ -829,6 +885,7 @@ exports.postponeEndDate = postponeEndDate;
829
885
  * - `"IMMEDIATELY"`: The order is canceled immediately.
830
886
  * - `"NEXT_PAYMENT_DATE"`: The order is canceled at the next payment date.
831
887
  * @public
888
+ * @documentationMaturity preview
832
889
  * @requiredField _id
833
890
  * @requiredField effectiveAt
834
891
  * @param options - Options for canceling orders.
@@ -870,10 +927,11 @@ function cancelOrder(_id, effectiveAt) {
870
927
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
871
928
  }
872
929
  catch (err) {
873
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
874
- '_id',
875
- 'effectiveAt',
876
- ]);
930
+ const transformedError = (0, transform_error_1.transformError)(err, {
931
+ spreadPathsToArguments: {},
932
+ explicitPathsToArguments: { id: '$[0]', effectiveAt: '$[1]' },
933
+ singleArgumentUnchanged: false,
934
+ }, ['_id', 'effectiveAt']);
877
935
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
878
936
  throw transformedError;
879
937
  }
@@ -898,6 +956,7 @@ exports.cancelOrder = cancelOrder;
898
956
  * - Mark an online order as paid. The `markAsPaid()` function is supported for offline orders only.
899
957
  * @param _id - Order ID.
900
958
  * @public
959
+ * @documentationMaturity preview
901
960
  * @requiredField _id
902
961
  * @permissionScope Manage Orders
903
962
  * @applicableIdentity APP
@@ -937,9 +996,11 @@ function markAsPaid(_id) {
937
996
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
938
997
  }
939
998
  catch (err) {
940
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
941
- '_id',
942
- ]);
999
+ const transformedError = (0, transform_error_1.transformError)(err, {
1000
+ spreadPathsToArguments: {},
1001
+ explicitPathsToArguments: { id: '$[0]' },
1002
+ singleArgumentUnchanged: false,
1003
+ }, ['_id']);
943
1004
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
944
1005
  throw transformedError;
945
1006
  }
@@ -962,6 +1023,7 @@ exports.markAsPaid = markAsPaid;
962
1023
  * Paused orders can be continued with the [`resumeOrder()`](#resumeorder) function.
963
1024
  * @param _id - Order ID.
964
1025
  * @public
1026
+ * @documentationMaturity preview
965
1027
  * @requiredField _id
966
1028
  * @permissionScope Manage Orders
967
1029
  * @applicableIdentity APP
@@ -1001,9 +1063,11 @@ function pauseOrder(_id) {
1001
1063
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1002
1064
  }
1003
1065
  catch (err) {
1004
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1005
- '_id',
1006
- ]);
1066
+ const transformedError = (0, transform_error_1.transformError)(err, {
1067
+ spreadPathsToArguments: {},
1068
+ explicitPathsToArguments: { id: '$[0]' },
1069
+ singleArgumentUnchanged: false,
1070
+ }, ['_id']);
1007
1071
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1008
1072
  throw transformedError;
1009
1073
  }
@@ -1024,6 +1088,7 @@ exports.pauseOrder = pauseOrder;
1024
1088
  * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
1025
1089
  * @param _id - Order ID.
1026
1090
  * @public
1091
+ * @documentationMaturity preview
1027
1092
  * @requiredField _id
1028
1093
  * @permissionScope Manage Orders
1029
1094
  * @applicableIdentity APP
@@ -1063,9 +1128,11 @@ function resumeOrder(_id) {
1063
1128
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1064
1129
  }
1065
1130
  catch (err) {
1066
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1067
- '_id',
1068
- ]);
1131
+ const transformedError = (0, transform_error_1.transformError)(err, {
1132
+ spreadPathsToArguments: {},
1133
+ explicitPathsToArguments: { id: '$[0]' },
1134
+ singleArgumentUnchanged: false,
1135
+ }, ['_id']);
1069
1136
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1070
1137
  throw transformedError;
1071
1138
  }