@wix/auto_sdk_ecom_orders 1.0.53 → 1.0.54

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.
Files changed (134) hide show
  1. package/build/{cjs/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-CO-UuLIK.d.mts} +640 -1079
  2. package/build/{es/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-CO-UuLIK.d.ts} +640 -1079
  3. package/build/index.d.mts +216 -0
  4. package/build/index.d.ts +216 -0
  5. package/build/index.js +3502 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +3399 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{cjs/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-DrkwwhMV.d.mts} +640 -1446
  10. package/build/internal/{es/src/ecom-v1-order-orders.universal.d.ts → ecom-v1-order-orders.universal-DrkwwhMV.d.ts} +640 -1446
  11. package/build/internal/index.d.mts +395 -0
  12. package/build/internal/index.d.ts +395 -0
  13. package/build/internal/index.js +3502 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +3399 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +3302 -0
  18. package/build/internal/meta.d.ts +3302 -0
  19. package/build/internal/meta.js +1941 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +1890 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +3302 -0
  24. package/build/meta.d.ts +3302 -0
  25. package/build/meta.js +1941 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +1890 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -43
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/ecom-v1-order-orders.context.d.ts +0 -34
  40. package/build/cjs/src/ecom-v1-order-orders.context.js +0 -117
  41. package/build/cjs/src/ecom-v1-order-orders.context.js.map +0 -1
  42. package/build/cjs/src/ecom-v1-order-orders.http.d.ts +0 -200
  43. package/build/cjs/src/ecom-v1-order-orders.http.js +0 -1610
  44. package/build/cjs/src/ecom-v1-order-orders.http.js.map +0 -1
  45. package/build/cjs/src/ecom-v1-order-orders.meta.d.ts +0 -78
  46. package/build/cjs/src/ecom-v1-order-orders.meta.js +0 -503
  47. package/build/cjs/src/ecom-v1-order-orders.meta.js.map +0 -1
  48. package/build/cjs/src/ecom-v1-order-orders.public.d.ts +0 -190
  49. package/build/cjs/src/ecom-v1-order-orders.public.js +0 -382
  50. package/build/cjs/src/ecom-v1-order-orders.public.js.map +0 -1
  51. package/build/cjs/src/ecom-v1-order-orders.types.d.ts +0 -6317
  52. package/build/cjs/src/ecom-v1-order-orders.types.js +0 -652
  53. package/build/cjs/src/ecom-v1-order-orders.types.js.map +0 -1
  54. package/build/cjs/src/ecom-v1-order-orders.universal.js +0 -2337
  55. package/build/cjs/src/ecom-v1-order-orders.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -43
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/ecom-v1-order-orders.context.d.ts +0 -34
  67. package/build/es/src/ecom-v1-order-orders.context.js +0 -62
  68. package/build/es/src/ecom-v1-order-orders.context.js.map +0 -1
  69. package/build/es/src/ecom-v1-order-orders.http.d.ts +0 -200
  70. package/build/es/src/ecom-v1-order-orders.http.js +0 -1582
  71. package/build/es/src/ecom-v1-order-orders.http.js.map +0 -1
  72. package/build/es/src/ecom-v1-order-orders.meta.d.ts +0 -78
  73. package/build/es/src/ecom-v1-order-orders.meta.js +0 -452
  74. package/build/es/src/ecom-v1-order-orders.meta.js.map +0 -1
  75. package/build/es/src/ecom-v1-order-orders.public.d.ts +0 -190
  76. package/build/es/src/ecom-v1-order-orders.public.js +0 -302
  77. package/build/es/src/ecom-v1-order-orders.public.js.map +0 -1
  78. package/build/es/src/ecom-v1-order-orders.types.d.ts +0 -6317
  79. package/build/es/src/ecom-v1-order-orders.types.js +0 -648
  80. package/build/es/src/ecom-v1-order-orders.types.js.map +0 -1
  81. package/build/es/src/ecom-v1-order-orders.universal.js +0 -2285
  82. package/build/es/src/ecom-v1-order-orders.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -43
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/ecom-v1-order-orders.context.d.ts +0 -62
  93. package/build/internal/cjs/src/ecom-v1-order-orders.context.js +0 -117
  94. package/build/internal/cjs/src/ecom-v1-order-orders.context.js.map +0 -1
  95. package/build/internal/cjs/src/ecom-v1-order-orders.http.d.ts +0 -200
  96. package/build/internal/cjs/src/ecom-v1-order-orders.http.js +0 -1610
  97. package/build/internal/cjs/src/ecom-v1-order-orders.http.js.map +0 -1
  98. package/build/internal/cjs/src/ecom-v1-order-orders.meta.d.ts +0 -78
  99. package/build/internal/cjs/src/ecom-v1-order-orders.meta.js +0 -503
  100. package/build/internal/cjs/src/ecom-v1-order-orders.meta.js.map +0 -1
  101. package/build/internal/cjs/src/ecom-v1-order-orders.public.d.ts +0 -341
  102. package/build/internal/cjs/src/ecom-v1-order-orders.public.js +0 -382
  103. package/build/internal/cjs/src/ecom-v1-order-orders.public.js.map +0 -1
  104. package/build/internal/cjs/src/ecom-v1-order-orders.types.d.ts +0 -6317
  105. package/build/internal/cjs/src/ecom-v1-order-orders.types.js +0 -652
  106. package/build/internal/cjs/src/ecom-v1-order-orders.types.js.map +0 -1
  107. package/build/internal/cjs/src/ecom-v1-order-orders.universal.js +0 -2337
  108. package/build/internal/cjs/src/ecom-v1-order-orders.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -43
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/ecom-v1-order-orders.context.d.ts +0 -62
  119. package/build/internal/es/src/ecom-v1-order-orders.context.js +0 -62
  120. package/build/internal/es/src/ecom-v1-order-orders.context.js.map +0 -1
  121. package/build/internal/es/src/ecom-v1-order-orders.http.d.ts +0 -200
  122. package/build/internal/es/src/ecom-v1-order-orders.http.js +0 -1582
  123. package/build/internal/es/src/ecom-v1-order-orders.http.js.map +0 -1
  124. package/build/internal/es/src/ecom-v1-order-orders.meta.d.ts +0 -78
  125. package/build/internal/es/src/ecom-v1-order-orders.meta.js +0 -452
  126. package/build/internal/es/src/ecom-v1-order-orders.meta.js.map +0 -1
  127. package/build/internal/es/src/ecom-v1-order-orders.public.d.ts +0 -341
  128. package/build/internal/es/src/ecom-v1-order-orders.public.js +0 -302
  129. package/build/internal/es/src/ecom-v1-order-orders.public.js.map +0 -1
  130. package/build/internal/es/src/ecom-v1-order-orders.types.d.ts +0 -6317
  131. package/build/internal/es/src/ecom-v1-order-orders.types.js +0 -648
  132. package/build/internal/es/src/ecom-v1-order-orders.types.js.map +0 -1
  133. package/build/internal/es/src/ecom-v1-order-orders.universal.js +0 -2285
  134. package/build/internal/es/src/ecom-v1-order-orders.universal.js.map +0 -1
@@ -1,2337 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.DepositType = exports.ValueType = exports.CustomFieldGroup = exports.SourceType = exports.SubdivisionType = exports.Placement = exports.InventoryAction = exports.DeltaPaymentOptionType = exports.OrderApprovalStrategy = exports.VersioningMode = exports.SortOrder = exports.Namespace = exports.State = exports.PreviewEmailType = exports.AnimationDetection = exports.TextDetection = exports.WebhookIdentityType = exports.RefundStatus = exports.MembershipPaymentStatus = exports.ActionType = exports.Reason = exports.AuthorizationVoidStatus = exports.AuthorizationCaptureStatus = exports.TransactionStatus = exports.RestockType = exports.ManuallyRefundableReason = exports.NonRefundableReason = exports.RefundableStatus = exports.PaymentCollectabilityStatus = exports.DurationUnit = exports.ScheduledAction = exports.ChannelType = exports.AttributionSource = exports.ActivityType = exports.LineItemQuantityChangeType = exports.DiscountReason = exports.DiscountType = exports.OrderStatus = exports.PickupMethod = exports.VatType = exports.WeightUnit = exports.FulfillmentStatus = exports.PaymentStatus = exports.TaxableAddressType = exports.AdjustmentType = exports.SubscriptionFrequency = exports.JurisdictionType = exports.PaymentOptionType = exports.ItemTypeItemType = exports.DescriptionLineType = void 0;
27
- exports.bulkUpdateOrderTags = exports.aggregateOrders = exports.updateOrderStatus = exports.cancelOrder = exports.deleteActivity = exports.updateActivity = exports.addActivity = exports.updateOrderLineItem = exports.commitDeltas = exports.bulkUpdateOrders = exports.updateOrder = exports.createOrder = exports.searchOrders = exports.getOrder = exports.captureAuthorizedPayments = exports.voidAuthorizedPayments = exports.triggerRefund = exports.chargeMemberships = exports.paymentCollectionCreatePaymentGatewayOrder = exports.getRefundabilityStatus = exports.paymentCollectionBulkMarkOrdersAsPaid = exports.paymentCollectionMarkOrderAsPaid = exports.recordManuallyCollectedPayment = exports.getPaymentCollectabilityStatus = exports.preparePaymentCollection = exports.InvoiceStatus = void 0;
28
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
29
- const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
30
- const ambassadorWixEcomV1Order = __importStar(require("./ecom-v1-order-orders.http.js"));
31
- // @ts-ignore
32
- const address_1 = require("@wix/sdk-runtime/transformations/address");
33
- const address_2 = require("@wix/sdk-runtime/transformations/address");
34
- const image_1 = require("@wix/sdk-runtime/transformations/image");
35
- const image_2 = require("@wix/sdk-runtime/transformations/image");
36
- const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
37
- var DescriptionLineType;
38
- (function (DescriptionLineType) {
39
- /** Unrecognized type. */
40
- DescriptionLineType["UNRECOGNISED"] = "UNRECOGNISED";
41
- /** Plain text type. */
42
- DescriptionLineType["PLAIN_TEXT"] = "PLAIN_TEXT";
43
- /** Color type. */
44
- DescriptionLineType["COLOR"] = "COLOR";
45
- })(DescriptionLineType || (exports.DescriptionLineType = DescriptionLineType = {}));
46
- var ItemTypeItemType;
47
- (function (ItemTypeItemType) {
48
- ItemTypeItemType["UNRECOGNISED"] = "UNRECOGNISED";
49
- ItemTypeItemType["PHYSICAL"] = "PHYSICAL";
50
- ItemTypeItemType["DIGITAL"] = "DIGITAL";
51
- ItemTypeItemType["GIFT_CARD"] = "GIFT_CARD";
52
- ItemTypeItemType["SERVICE"] = "SERVICE";
53
- })(ItemTypeItemType || (exports.ItemTypeItemType = ItemTypeItemType = {}));
54
- /** Type of selected payment option for catalog item */
55
- var PaymentOptionType;
56
- (function (PaymentOptionType) {
57
- /** The entire payment for this item happens as part of the checkout. */
58
- PaymentOptionType["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
59
- /** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
60
- PaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
61
- /** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
62
- PaymentOptionType["MEMBERSHIP"] = "MEMBERSHIP";
63
- /** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
64
- PaymentOptionType["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
65
- /** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
66
- PaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
67
- })(PaymentOptionType || (exports.PaymentOptionType = PaymentOptionType = {}));
68
- /** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
69
- var JurisdictionType;
70
- (function (JurisdictionType) {
71
- JurisdictionType["UNDEFINED"] = "UNDEFINED";
72
- JurisdictionType["COUNTRY"] = "COUNTRY";
73
- JurisdictionType["STATE"] = "STATE";
74
- JurisdictionType["COUNTY"] = "COUNTY";
75
- JurisdictionType["CITY"] = "CITY";
76
- JurisdictionType["SPECIAL"] = "SPECIAL";
77
- })(JurisdictionType || (exports.JurisdictionType = JurisdictionType = {}));
78
- /** Frequency unit of recurring payment */
79
- var SubscriptionFrequency;
80
- (function (SubscriptionFrequency) {
81
- SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
82
- SubscriptionFrequency["DAY"] = "DAY";
83
- SubscriptionFrequency["WEEK"] = "WEEK";
84
- SubscriptionFrequency["MONTH"] = "MONTH";
85
- SubscriptionFrequency["YEAR"] = "YEAR";
86
- })(SubscriptionFrequency || (exports.SubscriptionFrequency = SubscriptionFrequency = {}));
87
- var AdjustmentType;
88
- (function (AdjustmentType) {
89
- AdjustmentType["UNKNOWN_ADJUSTMENT_TYPE"] = "UNKNOWN_ADJUSTMENT_TYPE";
90
- /** Adjustment increases the total amount due to changes like covering extra billing days. Typically results in an additional fee. */
91
- AdjustmentType["EXTRA_CHARGE"] = "EXTRA_CHARGE";
92
- /** Adjustment reduces the total amount due to changes like covering fewer billing days. Typically results in a credit or discount. */
93
- AdjustmentType["CREDIT"] = "CREDIT";
94
- })(AdjustmentType || (exports.AdjustmentType = AdjustmentType = {}));
95
- var TaxableAddressType;
96
- (function (TaxableAddressType) {
97
- TaxableAddressType["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
98
- TaxableAddressType["BUSINESS"] = "BUSINESS";
99
- TaxableAddressType["BILLING"] = "BILLING";
100
- TaxableAddressType["SHIPPING"] = "SHIPPING";
101
- })(TaxableAddressType || (exports.TaxableAddressType = TaxableAddressType = {}));
102
- var PaymentStatus;
103
- (function (PaymentStatus) {
104
- PaymentStatus["UNSPECIFIED"] = "UNSPECIFIED";
105
- /**
106
- * `NOT_PAID` can apply to an order made online, but not yet paid. In such cases `order.status` will be `INITIALIZED`.
107
- * This status also applies when an offline order needs to be manually marked as paid. In such cases `order.status` will be `APPROVED`.
108
- */
109
- PaymentStatus["NOT_PAID"] = "NOT_PAID";
110
- /** All required payments associated with this order are paid. */
111
- PaymentStatus["PAID"] = "PAID";
112
- /** Order partially refunded, but the refunded amount is less than the order's total price. See `order.balanceSummary` for more details. */
113
- PaymentStatus["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
114
- /** Order fully refunded. Refund amount equals total price. See `order.balanceSummary` for more details. */
115
- PaymentStatus["FULLY_REFUNDED"] = "FULLY_REFUNDED";
116
- /**
117
- * All payments pending.
118
- *
119
- * This can happen with two-step payments, when a payment requires manual review, or when a payment is in progress and will be concluded shortly.
120
- * Learn more about [pending orders](https://support.wix.com/en/article/pending-orders).
121
- */
122
- PaymentStatus["PENDING"] = "PENDING";
123
- /** At least one payment received and approved, but it covers less than the order's total price. See `order.balanceSummary` for more details. */
124
- PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
125
- /**
126
- * Payment received, but not yet confirmed by the payment provider.
127
- *
128
- * In most cases, when a payment provider is holding payment it's because setup hasn't been successfully completed by the merchant/site owner.
129
- * To solve this, the merchant/site owner should log in to the payment provider's dashboard and make sure their account is set up correctly, or contact their support for further assistance.
130
- * @documentationMaturity preview
131
- */
132
- PaymentStatus["PENDING_MERCHANT"] = "PENDING_MERCHANT";
133
- /**
134
- * One or more payments canceled.
135
- * @documentationMaturity preview
136
- */
137
- PaymentStatus["CANCELED"] = "CANCELED";
138
- /**
139
- * One or more payments declined.
140
- * @documentationMaturity preview
141
- */
142
- PaymentStatus["DECLINED"] = "DECLINED";
143
- })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
144
- var FulfillmentStatus;
145
- (function (FulfillmentStatus) {
146
- /** None of the order items are fulfilled or the order was manually marked as unfulfilled. */
147
- FulfillmentStatus["NOT_FULFILLED"] = "NOT_FULFILLED";
148
- /**
149
- * All of the order items are fulfilled or the order was manually marked as fulfilled.
150
- * Orders without shipping info are fulfilled automatically.
151
- */
152
- FulfillmentStatus["FULFILLED"] = "FULFILLED";
153
- /** Some, but not all, of the order items are fulfilled. */
154
- FulfillmentStatus["PARTIALLY_FULFILLED"] = "PARTIALLY_FULFILLED";
155
- })(FulfillmentStatus || (exports.FulfillmentStatus = FulfillmentStatus = {}));
156
- var WeightUnit;
157
- (function (WeightUnit) {
158
- /** Weight unit can't be classified due to an error. */
159
- WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
160
- /** Kilograms. */
161
- WeightUnit["KG"] = "KG";
162
- /** Pounds. */
163
- WeightUnit["LB"] = "LB";
164
- })(WeightUnit || (exports.WeightUnit = WeightUnit = {}));
165
- /** tax info types */
166
- var VatType;
167
- (function (VatType) {
168
- VatType["UNSPECIFIED"] = "UNSPECIFIED";
169
- /** CPF - for individual tax payers. */
170
- VatType["CPF"] = "CPF";
171
- /** CNPJ - for corporations */
172
- VatType["CNPJ"] = "CNPJ";
173
- })(VatType || (exports.VatType = VatType = {}));
174
- var PickupMethod;
175
- (function (PickupMethod) {
176
- PickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
177
- PickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
178
- PickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
179
- })(PickupMethod || (exports.PickupMethod = PickupMethod = {}));
180
- var OrderStatus;
181
- (function (OrderStatus) {
182
- /** Order created, but not yet approved or canceled. */
183
- OrderStatus["INITIALIZED"] = "INITIALIZED";
184
- /**
185
- * Order approved.
186
- *
187
- * This happens when either an online payment is received **or** when `order.priceSummary.total = 0` (a zero-total order).
188
- * Offline orders (cash payment) are automatically approved.
189
- */
190
- OrderStatus["APPROVED"] = "APPROVED";
191
- /** Order canceled by the user. */
192
- OrderStatus["CANCELED"] = "CANCELED";
193
- /**
194
- * Order pending.
195
- * @documentationMaturity preview
196
- */
197
- OrderStatus["PENDING"] = "PENDING";
198
- /**
199
- * Order rejected.
200
- *
201
- * This happens when pending payments fail.
202
- * @documentationMaturity preview
203
- */
204
- OrderStatus["REJECTED"] = "REJECTED";
205
- })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
206
- var DiscountType;
207
- (function (DiscountType) {
208
- DiscountType["GLOBAL"] = "GLOBAL";
209
- DiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
210
- DiscountType["SHIPPING"] = "SHIPPING";
211
- })(DiscountType || (exports.DiscountType = DiscountType = {}));
212
- var DiscountReason;
213
- (function (DiscountReason) {
214
- DiscountReason["UNSPECIFIED"] = "UNSPECIFIED";
215
- DiscountReason["EXCHANGED_ITEMS"] = "EXCHANGED_ITEMS";
216
- DiscountReason["BILLING_ADJUSTMENT"] = "BILLING_ADJUSTMENT";
217
- })(DiscountReason || (exports.DiscountReason = DiscountReason = {}));
218
- var LineItemQuantityChangeType;
219
- (function (LineItemQuantityChangeType) {
220
- /** Quantity increased. */
221
- LineItemQuantityChangeType["QUANTITY_INCREASED"] = "QUANTITY_INCREASED";
222
- /** Quantity decreased. */
223
- LineItemQuantityChangeType["QUANTITY_DECREASED"] = "QUANTITY_DECREASED";
224
- })(LineItemQuantityChangeType || (exports.LineItemQuantityChangeType = LineItemQuantityChangeType = {}));
225
- var ActivityType;
226
- (function (ActivityType) {
227
- ActivityType["ORDER_REFUNDED"] = "ORDER_REFUNDED";
228
- ActivityType["ORDER_PLACED"] = "ORDER_PLACED";
229
- ActivityType["ORDER_PAID"] = "ORDER_PAID";
230
- ActivityType["ORDER_FULFILLED"] = "ORDER_FULFILLED";
231
- ActivityType["ORDER_NOT_FULFILLED"] = "ORDER_NOT_FULFILLED";
232
- ActivityType["ORDER_CANCELED"] = "ORDER_CANCELED";
233
- ActivityType["DOWNLOAD_LINK_SENT"] = "DOWNLOAD_LINK_SENT";
234
- ActivityType["TRACKING_NUMBER_ADDED"] = "TRACKING_NUMBER_ADDED";
235
- ActivityType["TRACKING_NUMBER_EDITED"] = "TRACKING_NUMBER_EDITED";
236
- ActivityType["TRACKING_LINK_ADDED"] = "TRACKING_LINK_ADDED";
237
- ActivityType["SHIPPING_CONFIRMATION_EMAIL_SENT"] = "SHIPPING_CONFIRMATION_EMAIL_SENT";
238
- ActivityType["INVOICE_ADDED"] = "INVOICE_ADDED";
239
- ActivityType["INVOICE_REMOVED"] = "INVOICE_REMOVED";
240
- ActivityType["INVOICE_SENT"] = "INVOICE_SENT";
241
- ActivityType["FULFILLER_EMAIL_SENT"] = "FULFILLER_EMAIL_SENT";
242
- ActivityType["SHIPPING_ADDRESS_EDITED"] = "SHIPPING_ADDRESS_EDITED";
243
- ActivityType["EMAIL_EDITED"] = "EMAIL_EDITED";
244
- ActivityType["PICKUP_READY_EMAIL_SENT"] = "PICKUP_READY_EMAIL_SENT";
245
- ActivityType["CUSTOM_ACTIVITY"] = "CUSTOM_ACTIVITY";
246
- ActivityType["MERCHANT_COMMENT"] = "MERCHANT_COMMENT";
247
- ActivityType["ORDER_CREATED_FROM_EXCHANGE"] = "ORDER_CREATED_FROM_EXCHANGE";
248
- ActivityType["NEW_EXCHANGE_ORDER_CREATED"] = "NEW_EXCHANGE_ORDER_CREATED";
249
- ActivityType["ORDER_PARTIALLY_PAID"] = "ORDER_PARTIALLY_PAID";
250
- ActivityType["DRAFT_ORDER_CHANGES_APPLIED"] = "DRAFT_ORDER_CHANGES_APPLIED";
251
- ActivityType["SAVED_PAYMENT_METHOD"] = "SAVED_PAYMENT_METHOD";
252
- /** @documentationMaturity preview */
253
- ActivityType["PAYMENT_PENDING"] = "PAYMENT_PENDING";
254
- /** @documentationMaturity preview */
255
- ActivityType["PAYMENT_CANCELED"] = "PAYMENT_CANCELED";
256
- /** @documentationMaturity preview */
257
- ActivityType["PAYMENT_DECLINED"] = "PAYMENT_DECLINED";
258
- /** @documentationMaturity preview */
259
- ActivityType["ORDER_PENDING"] = "ORDER_PENDING";
260
- /** @documentationMaturity preview */
261
- ActivityType["ORDER_REJECTED"] = "ORDER_REJECTED";
262
- })(ActivityType || (exports.ActivityType = ActivityType = {}));
263
- var AttributionSource;
264
- (function (AttributionSource) {
265
- AttributionSource["UNSPECIFIED"] = "UNSPECIFIED";
266
- AttributionSource["FACEBOOK_ADS"] = "FACEBOOK_ADS";
267
- })(AttributionSource || (exports.AttributionSource = AttributionSource = {}));
268
- var ChannelType;
269
- (function (ChannelType) {
270
- /** Unspecified sales channel. This value is not supported. */
271
- ChannelType["UNSPECIFIED"] = "UNSPECIFIED";
272
- /** A web client. */
273
- ChannelType["WEB"] = "WEB";
274
- /** [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395). */
275
- ChannelType["POS"] = "POS";
276
- /** [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop). */
277
- ChannelType["EBAY"] = "EBAY";
278
- /** [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop). */
279
- ChannelType["AMAZON"] = "AMAZON";
280
- /** Other sales platform. */
281
- ChannelType["OTHER_PLATFORM"] = "OTHER_PLATFORM";
282
- /** [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview). */
283
- ChannelType["WIX_APP_STORE"] = "WIX_APP_STORE";
284
- /** Wix Invoices app in [your dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Finvoices/settings/general-settings) */
285
- ChannelType["WIX_INVOICES"] = "WIX_INVOICES";
286
- /** Wix merchant backoffice. */
287
- ChannelType["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
288
- /** Wish sales channel. */
289
- ChannelType["WISH"] = "WISH";
290
- /** [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass). */
291
- ChannelType["CLASS_PASS"] = "CLASS_PASS";
292
- /** Global-E sales channel. */
293
- ChannelType["GLOBAL_E"] = "GLOBAL_E";
294
- /** [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops). */
295
- ChannelType["FACEBOOK"] = "FACEBOOK";
296
- /** [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel). */
297
- ChannelType["ETSY"] = "ETSY";
298
- /** [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel). */
299
- ChannelType["TIKTOK"] = "TIKTOK";
300
- /** [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app). */
301
- ChannelType["FAIRE_COM"] = "FAIRE_COM";
302
- })(ChannelType || (exports.ChannelType = ChannelType = {}));
303
- var ScheduledAction;
304
- (function (ScheduledAction) {
305
- ScheduledAction["UNSPECIFIED"] = "UNSPECIFIED";
306
- /** Whether payment will be auto-voided when duration passes */
307
- ScheduledAction["VOID"] = "VOID";
308
- /** Whether payment will be auto-captured when duration passes */
309
- ScheduledAction["CAPTURE"] = "CAPTURE";
310
- })(ScheduledAction || (exports.ScheduledAction = ScheduledAction = {}));
311
- var DurationUnit;
312
- (function (DurationUnit) {
313
- DurationUnit["UNKNOWN_DURATION_UNIT"] = "UNKNOWN_DURATION_UNIT";
314
- DurationUnit["MINUTES"] = "MINUTES";
315
- DurationUnit["HOURS"] = "HOURS";
316
- DurationUnit["DAYS"] = "DAYS";
317
- })(DurationUnit || (exports.DurationUnit = DurationUnit = {}));
318
- var PaymentCollectabilityStatus;
319
- (function (PaymentCollectabilityStatus) {
320
- PaymentCollectabilityStatus["UNKNOWN"] = "UNKNOWN";
321
- PaymentCollectabilityStatus["COLLECTABLE"] = "COLLECTABLE";
322
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_IS_CANCELLED"] = "NONCOLLECTABLE_ORDER_IS_CANCELLED";
323
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_IS_PAID"] = "NONCOLLECTABLE_ORDER_IS_PAID";
324
- PaymentCollectabilityStatus["NONCOLLECTABLE_MISSING_PAYMENT_METHOD"] = "NONCOLLECTABLE_MISSING_PAYMENT_METHOD";
325
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_IS_PENDING"] = "NONCOLLECTABLE_ORDER_IS_PENDING";
326
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_IS_REJECTED"] = "NONCOLLECTABLE_ORDER_IS_REJECTED";
327
- PaymentCollectabilityStatus["NONCOLLECTABLE_ORDER_HAS_SUBSCRIPTIONS"] = "NONCOLLECTABLE_ORDER_HAS_SUBSCRIPTIONS";
328
- })(PaymentCollectabilityStatus || (exports.PaymentCollectabilityStatus = PaymentCollectabilityStatus = {}));
329
- var RefundableStatus;
330
- (function (RefundableStatus) {
331
- RefundableStatus["NOT_REFUNDABLE"] = "NOT_REFUNDABLE";
332
- RefundableStatus["MANUAL"] = "MANUAL";
333
- RefundableStatus["REFUNDABLE"] = "REFUNDABLE";
334
- })(RefundableStatus || (exports.RefundableStatus = RefundableStatus = {}));
335
- var NonRefundableReason;
336
- (function (NonRefundableReason) {
337
- NonRefundableReason["NONE"] = "NONE";
338
- NonRefundableReason["ALREADY_REFUNDED"] = "ALREADY_REFUNDED";
339
- NonRefundableReason["PROVIDER_IS_DOWN"] = "PROVIDER_IS_DOWN";
340
- NonRefundableReason["INTERNAL_ERROR"] = "INTERNAL_ERROR";
341
- NonRefundableReason["NOT_PAID"] = "NOT_PAID";
342
- NonRefundableReason["ACCESS_DENIED"] = "ACCESS_DENIED";
343
- NonRefundableReason["ZERO_PRICE"] = "ZERO_PRICE";
344
- NonRefundableReason["DISABLED_BY_PROVIDER"] = "DISABLED_BY_PROVIDER";
345
- NonRefundableReason["PENDING_REFUND"] = "PENDING_REFUND";
346
- NonRefundableReason["FORBIDDEN"] = "FORBIDDEN";
347
- NonRefundableReason["TRANSACTION_NOT_FOUND"] = "TRANSACTION_NOT_FOUND";
348
- NonRefundableReason["ORDER_IS_PENDING"] = "ORDER_IS_PENDING";
349
- NonRefundableReason["ORDER_IS_REJECTED"] = "ORDER_IS_REJECTED";
350
- })(NonRefundableReason || (exports.NonRefundableReason = NonRefundableReason = {}));
351
- var ManuallyRefundableReason;
352
- (function (ManuallyRefundableReason) {
353
- ManuallyRefundableReason["EXPIRED"] = "EXPIRED";
354
- ManuallyRefundableReason["NOT_SUPPORTED"] = "NOT_SUPPORTED";
355
- ManuallyRefundableReason["OFFLINE"] = "OFFLINE";
356
- ManuallyRefundableReason["REQUIRES_CARD_READER"] = "REQUIRES_CARD_READER";
357
- })(ManuallyRefundableReason || (exports.ManuallyRefundableReason = ManuallyRefundableReason = {}));
358
- var RestockType;
359
- (function (RestockType) {
360
- RestockType["NO_ITEMS"] = "NO_ITEMS";
361
- RestockType["ALL_ITEMS"] = "ALL_ITEMS";
362
- RestockType["SOME_ITEMS"] = "SOME_ITEMS";
363
- })(RestockType || (exports.RestockType = RestockType = {}));
364
- var TransactionStatus;
365
- (function (TransactionStatus) {
366
- TransactionStatus["UNDEFINED"] = "UNDEFINED";
367
- TransactionStatus["APPROVED"] = "APPROVED";
368
- TransactionStatus["PENDING"] = "PENDING";
369
- TransactionStatus["PENDING_MERCHANT"] = "PENDING_MERCHANT";
370
- TransactionStatus["CANCELED"] = "CANCELED";
371
- TransactionStatus["DECLINED"] = "DECLINED";
372
- TransactionStatus["REFUNDED"] = "REFUNDED";
373
- TransactionStatus["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
374
- TransactionStatus["AUTHORIZED"] = "AUTHORIZED";
375
- TransactionStatus["VOIDED"] = "VOIDED";
376
- })(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
377
- var AuthorizationCaptureStatus;
378
- (function (AuthorizationCaptureStatus) {
379
- AuthorizationCaptureStatus["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
380
- /** Capture operation still in progress. */
381
- AuthorizationCaptureStatus["PENDING"] = "PENDING";
382
- /** Capture operation succeeded. */
383
- AuthorizationCaptureStatus["SUCCEEDED"] = "SUCCEEDED";
384
- /** Capture operation failed. */
385
- AuthorizationCaptureStatus["FAILED"] = "FAILED";
386
- })(AuthorizationCaptureStatus || (exports.AuthorizationCaptureStatus = AuthorizationCaptureStatus = {}));
387
- var AuthorizationVoidStatus;
388
- (function (AuthorizationVoidStatus) {
389
- AuthorizationVoidStatus["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
390
- /** Void operation still in progress. */
391
- AuthorizationVoidStatus["PENDING"] = "PENDING";
392
- /** Void operation succeeded. */
393
- AuthorizationVoidStatus["SUCCEEDED"] = "SUCCEEDED";
394
- /** Void operation failed. */
395
- AuthorizationVoidStatus["FAILED"] = "FAILED";
396
- })(AuthorizationVoidStatus || (exports.AuthorizationVoidStatus = AuthorizationVoidStatus = {}));
397
- /** Reason the authorization was voided. */
398
- var Reason;
399
- (function (Reason) {
400
- Reason["UNKNOWN_REASON"] = "UNKNOWN_REASON";
401
- /** Authorization was voided by user. */
402
- Reason["MANUAL"] = "MANUAL";
403
- /** Authorization passed execution date. */
404
- Reason["SCHEDULED"] = "SCHEDULED";
405
- })(Reason || (exports.Reason = Reason = {}));
406
- var ActionType;
407
- (function (ActionType) {
408
- ActionType["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
409
- ActionType["VOID"] = "VOID";
410
- ActionType["CAPTURE"] = "CAPTURE";
411
- })(ActionType || (exports.ActionType = ActionType = {}));
412
- var MembershipPaymentStatus;
413
- (function (MembershipPaymentStatus) {
414
- /** Payment was charged. */
415
- MembershipPaymentStatus["CHARGED"] = "CHARGED";
416
- /** The attempt to charge the payment failed, for example, due to lack of credits. */
417
- MembershipPaymentStatus["CHARGE_FAILED"] = "CHARGE_FAILED";
418
- })(MembershipPaymentStatus || (exports.MembershipPaymentStatus = MembershipPaymentStatus = {}));
419
- /** Refund transaction status. */
420
- var RefundStatus;
421
- (function (RefundStatus) {
422
- /** Refund was initiated on payment provider side. PENDING status was assigned by provider. */
423
- RefundStatus["PENDING"] = "PENDING";
424
- /** Refund transaction succeeded. */
425
- RefundStatus["SUCCEEDED"] = "SUCCEEDED";
426
- /** Refund transaction failed. */
427
- RefundStatus["FAILED"] = "FAILED";
428
- /** Refund request acknowledged, and will be executed soon. */
429
- RefundStatus["SCHEDULED"] = "SCHEDULED";
430
- /** Refund was initiated on payment provider side. */
431
- RefundStatus["STARTED"] = "STARTED";
432
- })(RefundStatus || (exports.RefundStatus = RefundStatus = {}));
433
- var WebhookIdentityType;
434
- (function (WebhookIdentityType) {
435
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
436
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
437
- WebhookIdentityType["MEMBER"] = "MEMBER";
438
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
439
- WebhookIdentityType["APP"] = "APP";
440
- })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
441
- var TextDetection;
442
- (function (TextDetection) {
443
- /** No detection was made */
444
- TextDetection["UNKNOWN_TEXT_DETECTION"] = "UNKNOWN_TEXT_DETECTION";
445
- /** The image contains text */
446
- TextDetection["CONTAINS_TEXT"] = "CONTAINS_TEXT";
447
- /** The image does not contain text */
448
- TextDetection["NO_TEXT"] = "NO_TEXT";
449
- })(TextDetection || (exports.TextDetection = TextDetection = {}));
450
- var AnimationDetection;
451
- (function (AnimationDetection) {
452
- /** No detection was made */
453
- AnimationDetection["UNKNOWN_ANIMATION_DETECTION"] = "UNKNOWN_ANIMATION_DETECTION";
454
- /** The image contains animation */
455
- AnimationDetection["CONTAINS_ANIMATION"] = "CONTAINS_ANIMATION";
456
- /** The image does not contain animation */
457
- AnimationDetection["NO_ANIMATION"] = "NO_ANIMATION";
458
- })(AnimationDetection || (exports.AnimationDetection = AnimationDetection = {}));
459
- var PreviewEmailType;
460
- (function (PreviewEmailType) {
461
- PreviewEmailType["ORDER_PLACED"] = "ORDER_PLACED";
462
- PreviewEmailType["DOWNLOAD_LINKS"] = "DOWNLOAD_LINKS";
463
- PreviewEmailType["ORDER_SHIPPED"] = "ORDER_SHIPPED";
464
- PreviewEmailType["ORDER_READY_FOR_PICKUP"] = "ORDER_READY_FOR_PICKUP";
465
- })(PreviewEmailType || (exports.PreviewEmailType = PreviewEmailType = {}));
466
- /**
467
- * Represents the actual state of the application on site. Do not confuse with the State in the old MetaSiteDTO,
468
- * which has less values and doesn't have 1-to-1 correspondence with this one (this one is exact and correct!)
469
- */
470
- var State;
471
- (function (State) {
472
- State["UNKNOWN"] = "UNKNOWN";
473
- /** App is installed on a site. */
474
- State["ENABLED"] = "ENABLED";
475
- /** App is removed from a site (but we preserve it just in case). */
476
- State["DISABLED"] = "DISABLED";
477
- /** App is in "demo" mode, meaning that it's in read-only mode (it's in a template OR not installed yet). */
478
- State["TEMPLATE"] = "TEMPLATE";
479
- /** App is not installed, there is a user intention for it only (user will see the pimpl in the editor). */
480
- State["PENDING"] = "PENDING";
481
- })(State || (exports.State = State = {}));
482
- var Namespace;
483
- (function (Namespace) {
484
- Namespace["UNKNOWN_NAMESPACE"] = "UNKNOWN_NAMESPACE";
485
- /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
486
- Namespace["WIX"] = "WIX";
487
- /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
488
- Namespace["SHOUT_OUT"] = "SHOUT_OUT";
489
- /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
490
- Namespace["ALBUMS"] = "ALBUMS";
491
- /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
492
- Namespace["WIX_STORES_TEST_DRIVE"] = "WIX_STORES_TEST_DRIVE";
493
- /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
494
- Namespace["HOTELS"] = "HOTELS";
495
- /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
496
- Namespace["CLUBS"] = "CLUBS";
497
- /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
498
- Namespace["ONBOARDING_DRAFT"] = "ONBOARDING_DRAFT";
499
- /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
500
- Namespace["DEV_SITE"] = "DEV_SITE";
501
- /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
502
- Namespace["LOGOS"] = "LOGOS";
503
- /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
504
- Namespace["VIDEO_MAKER"] = "VIDEO_MAKER";
505
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
506
- Namespace["PARTNER_DASHBOARD"] = "PARTNER_DASHBOARD";
507
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
508
- Namespace["DEV_CENTER_COMPANY"] = "DEV_CENTER_COMPANY";
509
- /**
510
- * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
511
- *
512
- * Meta site with this namespace will *not* be shown in a user's site list by default.
513
- */
514
- Namespace["HTML_DRAFT"] = "HTML_DRAFT";
515
- /**
516
- * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
517
- * Will be accessible from Site List and will not have a website app.
518
- * Once the user attaches a site, the site will become a regular wixsite.
519
- */
520
- Namespace["SITELESS_BUSINESS"] = "SITELESS_BUSINESS";
521
- /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
522
- Namespace["CREATOR_ECONOMY"] = "CREATOR_ECONOMY";
523
- /** It is to be used in the Business First efforts. */
524
- Namespace["DASHBOARD_FIRST"] = "DASHBOARD_FIRST";
525
- /** Bookings business flow with no site. */
526
- Namespace["ANYWHERE"] = "ANYWHERE";
527
- /** Namespace for Headless Backoffice with no editor */
528
- Namespace["HEADLESS"] = "HEADLESS";
529
- /**
530
- * Namespace for master site that will exist in parent account that will be referenced by subaccounts
531
- * The site will be used for account level CSM feature for enterprise
532
- */
533
- Namespace["ACCOUNT_MASTER_CMS"] = "ACCOUNT_MASTER_CMS";
534
- /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
535
- Namespace["RISE"] = "RISE";
536
- /**
537
- * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
538
- * There's a blank site behind the scene but it's blank).
539
- * The Mobile company will be the owner of this namespace.
540
- */
541
- Namespace["BRANDED_FIRST"] = "BRANDED_FIRST";
542
- /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
543
- Namespace["NOWNIA"] = "NOWNIA";
544
- /**
545
- * UGC Templates are templates that are created by users for personal use and to sale to other users.
546
- * The Partners company owns this namespace.
547
- */
548
- Namespace["UGC_TEMPLATE"] = "UGC_TEMPLATE";
549
- /** Codux Headless Sites */
550
- Namespace["CODUX"] = "CODUX";
551
- /** Bobb - AI Design Creator. */
552
- Namespace["MEDIA_DESIGN_CREATOR"] = "MEDIA_DESIGN_CREATOR";
553
- /**
554
- * Shared Blog Site is a unique single site across Enterprise account,
555
- * This site will hold all Blog posts related to the Marketing product.
556
- */
557
- Namespace["SHARED_BLOG_ENTERPRISE"] = "SHARED_BLOG_ENTERPRISE";
558
- /** Standalone forms (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
559
- Namespace["STANDALONE_FORMS"] = "STANDALONE_FORMS";
560
- /** Standalone events (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
561
- Namespace["STANDALONE_EVENTS"] = "STANDALONE_EVENTS";
562
- /** MIMIR - Siteless account for MIMIR Ai Job runner. */
563
- Namespace["MIMIR"] = "MIMIR";
564
- })(Namespace || (exports.Namespace = Namespace = {}));
565
- var SortOrder;
566
- (function (SortOrder) {
567
- SortOrder["ASC"] = "ASC";
568
- SortOrder["DESC"] = "DESC";
569
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
570
- var VersioningMode;
571
- (function (VersioningMode) {
572
- /** use default versioning mode agreed with search team */
573
- VersioningMode["DEFAULT"] = "DEFAULT";
574
- /** execute only if version is greater than existing */
575
- VersioningMode["GREATER_THAN"] = "GREATER_THAN";
576
- /** execute only if version is greater or equal to existing */
577
- VersioningMode["GREATER_OR_EQUAL"] = "GREATER_OR_EQUAL";
578
- })(VersioningMode || (exports.VersioningMode = VersioningMode = {}));
579
- var OrderApprovalStrategy;
580
- (function (OrderApprovalStrategy) {
581
- /** Order is automatically approved when `order.priceSummary.total = 0`, **or** after receiving payment. */
582
- OrderApprovalStrategy["DEFAULT"] = "DEFAULT";
583
- /** Order is automatically approved **only** after receiving payment. */
584
- OrderApprovalStrategy["PAYMENT_RECEIVED"] = "PAYMENT_RECEIVED";
585
- /** Order is automatically approved when payment method is saved for it. */
586
- OrderApprovalStrategy["PAYMENT_METHOD_SAVED"] = "PAYMENT_METHOD_SAVED";
587
- })(OrderApprovalStrategy || (exports.OrderApprovalStrategy = OrderApprovalStrategy = {}));
588
- /** Type of selected payment option for catalog item */
589
- var DeltaPaymentOptionType;
590
- (function (DeltaPaymentOptionType) {
591
- /** Irrelevant */
592
- DeltaPaymentOptionType["UNKNOWN_PAYMENT_OPTION"] = "UNKNOWN_PAYMENT_OPTION";
593
- /** The entire payment for the given item will happen after checkout. */
594
- DeltaPaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
595
- /**
596
- * Payment for this item can only be done using a membership and must be manually redeemed in the dashboard by the site owner.
597
- * Note: when this option is used, the price will be 0.
598
- */
599
- DeltaPaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
600
- })(DeltaPaymentOptionType || (exports.DeltaPaymentOptionType = DeltaPaymentOptionType = {}));
601
- var InventoryAction;
602
- (function (InventoryAction) {
603
- /** Restock inventory */
604
- InventoryAction["RESTOCK"] = "RESTOCK";
605
- /** Decrease inventory. Without failing on negative inventory. */
606
- InventoryAction["DECREASE"] = "DECREASE";
607
- })(InventoryAction || (exports.InventoryAction = InventoryAction = {}));
608
- var Placement;
609
- (function (Placement) {
610
- Placement["Unknown"] = "Unknown";
611
- Placement["Replace"] = "Replace";
612
- Placement["Before"] = "Before";
613
- Placement["After"] = "After";
614
- })(Placement || (exports.Placement = Placement = {}));
615
- var SubdivisionType;
616
- (function (SubdivisionType) {
617
- SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
618
- /** State */
619
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
620
- /** County */
621
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
622
- /** City/town */
623
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
624
- /** Neighborhood/quarter */
625
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
626
- /** Street/block */
627
- SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
628
- /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
629
- SubdivisionType["COUNTRY"] = "COUNTRY";
630
- })(SubdivisionType || (exports.SubdivisionType = SubdivisionType = {}));
631
- var SourceType;
632
- (function (SourceType) {
633
- SourceType["UNKNOWN_SOURCE_TYPE"] = "UNKNOWN_SOURCE_TYPE";
634
- SourceType["WIX_APP"] = "WIX_APP";
635
- SourceType["EXTERNAL"] = "EXTERNAL";
636
- SourceType["ADMIN"] = "ADMIN";
637
- SourceType["OTHER"] = "OTHER";
638
- })(SourceType || (exports.SourceType = SourceType = {}));
639
- var CustomFieldGroup;
640
- (function (CustomFieldGroup) {
641
- CustomFieldGroup["UNKNOWN_CUSTOM_FIELD_GROUP"] = "UNKNOWN_CUSTOM_FIELD_GROUP";
642
- CustomFieldGroup["BUSINESS_DETAILS"] = "BUSINESS_DETAILS";
643
- CustomFieldGroup["CUSTOMER_DETAILS"] = "CUSTOMER_DETAILS";
644
- CustomFieldGroup["DOCUMENT"] = "DOCUMENT";
645
- CustomFieldGroup["FOOTER"] = "FOOTER";
646
- CustomFieldGroup["OTHER"] = "OTHER";
647
- })(CustomFieldGroup || (exports.CustomFieldGroup = CustomFieldGroup = {}));
648
- var ValueType;
649
- (function (ValueType) {
650
- ValueType["UNKNOWN_VALUE_TYPE"] = "UNKNOWN_VALUE_TYPE";
651
- ValueType["STRING"] = "STRING";
652
- ValueType["DATE"] = "DATE";
653
- ValueType["BOOLEAN"] = "BOOLEAN";
654
- ValueType["NUMBER"] = "NUMBER";
655
- })(ValueType || (exports.ValueType = ValueType = {}));
656
- var DepositType;
657
- (function (DepositType) {
658
- DepositType["UNKNOWN"] = "UNKNOWN";
659
- DepositType["FLAT"] = "FLAT";
660
- DepositType["PERCENTAGE"] = "PERCENTAGE";
661
- })(DepositType || (exports.DepositType = DepositType = {}));
662
- /**
663
- * InvoiceStatus allowed transitions based on current status:
664
- * Draft -> Deleted, Paid, Partially Paid, Sent
665
- * Sent -> Draft, Deleted, Void, Paid, Partially Paid, Processing, (Overdue)
666
- * Processing -> PartiallyPaid, Paid, Sent
667
- * Paid -> Void
668
- * PartiallyPaid -> Void, (PartialAndOverdue)
669
- * Void -> Deleted
670
- * Deleted
671
- */
672
- var InvoiceStatus;
673
- (function (InvoiceStatus) {
674
- InvoiceStatus["Draft"] = "Draft";
675
- InvoiceStatus["Sent"] = "Sent";
676
- InvoiceStatus["Processing"] = "Processing";
677
- InvoiceStatus["Paid"] = "Paid";
678
- InvoiceStatus["Overdue"] = "Overdue";
679
- InvoiceStatus["Void"] = "Void";
680
- InvoiceStatus["Deleted"] = "Deleted";
681
- InvoiceStatus["PartiallyPaid"] = "PartiallyPaid";
682
- InvoiceStatus["PartialAndOverdue"] = "PartialAndOverdue";
683
- })(InvoiceStatus || (exports.InvoiceStatus = InvoiceStatus = {}));
684
- /**
685
- * Prepares payment collection for given ecom order. This is the first of 2-step process of payment collection.
686
- * Here we ensure that payment collection is possible for given order and store and prepare payment gateway order for future charge.
687
- * 2nd step is an actual charge of prepared payment gateway order. This could be done either
688
- * via Wix-Cashier's API (https://bo.wix.com/wix-docs/rest/wix-cashier/pay/charge/charge-for-order)
689
- * or using Cashier Payments Widget (https://github.com/wix-private/cashier-client/tree/master/packages/cashier-payments-widget)
690
- * @param ecomOrderId - Ecom order ID.
691
- * @param amount - Amount to collect
692
- * @public
693
- * @documentationMaturity preview
694
- * @requiredField amount
695
- * @requiredField ecomOrderId
696
- * @permissionId ECOM.COLLECT_PAYMENTS
697
- * @permissionScope Manage Stores - all permissions
698
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
699
- * @permissionScope Manage Stores
700
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
701
- * @permissionScope Manage Restaurants - all permissions
702
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
703
- * @permissionScope Manage eCommerce - all permissions
704
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
705
- * @applicableIdentity APP
706
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.PreparePaymentCollection
707
- */
708
- async function preparePaymentCollection(ecomOrderId, amount, options) {
709
- // @ts-ignore
710
- const { httpClient, sideEffects } = arguments[3];
711
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
712
- ecomOrderId: ecomOrderId,
713
- amount: amount,
714
- paymentGatewayOrderId: options?.paymentGatewayOrderId,
715
- delayedCapture: options?.delayedCapture,
716
- delayedCaptureSettings: options?.delayedCaptureSettings,
717
- });
718
- const reqOpts = ambassadorWixEcomV1Order.preparePaymentCollection(payload);
719
- sideEffects?.onSiteCall?.();
720
- try {
721
- const result = await httpClient.request(reqOpts);
722
- sideEffects?.onSuccess?.(result);
723
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
724
- }
725
- catch (err) {
726
- const transformedError = (0, transform_error_1.transformError)(err, {
727
- spreadPathsToArguments: {},
728
- explicitPathsToArguments: {
729
- ecomOrderId: '$[0]',
730
- amount: '$[1]',
731
- paymentGatewayOrderId: '$[2].paymentGatewayOrderId',
732
- delayedCapture: '$[2].delayedCapture',
733
- delayedCaptureSettings: '$[2].delayedCaptureSettings',
734
- },
735
- singleArgumentUnchanged: false,
736
- }, ['ecomOrderId', 'amount', 'options']);
737
- sideEffects?.onError?.(err);
738
- throw transformedError;
739
- }
740
- }
741
- exports.preparePaymentCollection = preparePaymentCollection;
742
- /**
743
- * Provides payment collectability status for given order. If payment collection is possible
744
- * response will contain collectable amount for given ecom order. If not - response will contain
745
- * reason why payment collection is not possible.
746
- * @param ecomOrderId - Ecom order ID.
747
- * @public
748
- * @documentationMaturity preview
749
- * @requiredField ecomOrderId
750
- * @permissionId ECOM.COLLECT_PAYMENTS
751
- * @permissionScope Manage Stores - all permissions
752
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
753
- * @permissionScope Manage Stores
754
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
755
- * @permissionScope Manage Restaurants - all permissions
756
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
757
- * @permissionScope Manage eCommerce - all permissions
758
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
759
- * @applicableIdentity APP
760
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.GetPaymentCollectabilityStatus
761
- */
762
- async function getPaymentCollectabilityStatus(ecomOrderId) {
763
- // @ts-ignore
764
- const { httpClient, sideEffects } = arguments[1];
765
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
766
- ecomOrderId: ecomOrderId,
767
- });
768
- const reqOpts = ambassadorWixEcomV1Order.getPaymentCollectabilityStatus(payload);
769
- sideEffects?.onSiteCall?.();
770
- try {
771
- const result = await httpClient.request(reqOpts);
772
- sideEffects?.onSuccess?.(result);
773
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
774
- }
775
- catch (err) {
776
- const transformedError = (0, transform_error_1.transformError)(err, {
777
- spreadPathsToArguments: {},
778
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
779
- singleArgumentUnchanged: false,
780
- }, ['ecomOrderId']);
781
- sideEffects?.onError?.(err);
782
- throw transformedError;
783
- }
784
- }
785
- exports.getPaymentCollectabilityStatus = getPaymentCollectabilityStatus;
786
- /**
787
- * Records and approves new manual payment with provided custom amount on given order.
788
- * Existing pending payments are ignored.
789
- * Custom amount is expected to be less or equal remaining amount to be paid on order (affected by approved payments, refunds and gift card payments)
790
- * @param orderId - Order ID.
791
- * @param amount - Amount to be recorded as approved manual payment for given order
792
- * @internal
793
- * @documentationMaturity preview
794
- * @requiredField amount
795
- * @requiredField orderId
796
- * @permissionId ECOM.COLLECT_PAYMENTS
797
- * @permissionScope Manage Stores - all permissions
798
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
799
- * @permissionScope Manage Stores
800
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
801
- * @permissionScope Manage Restaurants - all permissions
802
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
803
- * @permissionScope Manage eCommerce - all permissions
804
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
805
- * @applicableIdentity APP
806
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.RecordManuallyCollectedPayment
807
- */
808
- async function recordManuallyCollectedPayment(orderId, amount) {
809
- // @ts-ignore
810
- const { httpClient, sideEffects } = arguments[2];
811
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
812
- orderId: orderId,
813
- amount: amount,
814
- });
815
- const reqOpts = ambassadorWixEcomV1Order.recordManuallyCollectedPayment(payload);
816
- sideEffects?.onSiteCall?.();
817
- try {
818
- const result = await httpClient.request(reqOpts);
819
- sideEffects?.onSuccess?.(result);
820
- }
821
- catch (err) {
822
- const transformedError = (0, transform_error_1.transformError)(err, {
823
- spreadPathsToArguments: {},
824
- explicitPathsToArguments: { orderId: '$[0]', amount: '$[1]' },
825
- singleArgumentUnchanged: false,
826
- }, ['orderId', 'amount']);
827
- sideEffects?.onError?.(err);
828
- throw transformedError;
829
- }
830
- }
831
- exports.recordManuallyCollectedPayment = recordManuallyCollectedPayment;
832
- /**
833
- * Marks the order as paid. `order.paymentStatus` field *eventually* changes to `PAID`.
834
- * In case the order already has an offline payment transaction associated with it
835
- * (usually when manual payment method is chosen at checkout) - This transaction will become approved.
836
- * In case the order has no payment transactions associated with it
837
- * (usually when the item is set to be paid offline after checkout or when an order is created from the backoffice) - A payment transaction
838
- * will be created and approved.
839
- * @param ecomOrderId - Ecom order ID.
840
- * @internal
841
- * @documentationMaturity preview
842
- * @requiredField ecomOrderId
843
- * @permissionId ECOM.MODIFY_ORDERS
844
- * @permissionScope Manage Stores - all permissions
845
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
846
- * @permissionScope Manage Stores
847
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
848
- * @permissionScope Manage Restaurants - all permissions
849
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
850
- * @permissionScope Manage eCommerce - all permissions
851
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
852
- * @permissionScope Manage Orders
853
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
854
- * @applicableIdentity APP
855
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.MarkOrderAsPaid
856
- */
857
- async function paymentCollectionMarkOrderAsPaid(ecomOrderId) {
858
- // @ts-ignore
859
- const { httpClient, sideEffects } = arguments[1];
860
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
861
- ecomOrderId: ecomOrderId,
862
- });
863
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionMarkOrderAsPaid(payload);
864
- sideEffects?.onSiteCall?.();
865
- try {
866
- const result = await httpClient.request(reqOpts);
867
- sideEffects?.onSuccess?.(result);
868
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
869
- {
870
- transformFn: image_2.transformRESTImageToSDKImage,
871
- paths: [{ path: 'order.lineItems.image' }],
872
- },
873
- {
874
- transformFn: address_2.transformRESTAddressToSDKAddress,
875
- paths: [
876
- { path: 'order.billingInfo.address' },
877
- {
878
- path: 'order.shippingInfo.logistics.shippingDestination.address',
879
- },
880
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
881
- { path: 'order.recipientInfo.address' },
882
- ],
883
- },
884
- ]));
885
- }
886
- catch (err) {
887
- const transformedError = (0, transform_error_1.transformError)(err, {
888
- spreadPathsToArguments: {},
889
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
890
- singleArgumentUnchanged: false,
891
- }, ['ecomOrderId']);
892
- sideEffects?.onError?.(err);
893
- throw transformedError;
894
- }
895
- }
896
- exports.paymentCollectionMarkOrderAsPaid = paymentCollectionMarkOrderAsPaid;
897
- /**
898
- * Marks multiple orders as paid. `order.paymentStatus` field *eventually* changes to `PAID`.
899
- * @param ecomOrderIds - IDs of orders to mark as paid.
900
- * @internal
901
- * @documentationMaturity preview
902
- * @requiredField ecomOrderIds
903
- * @permissionId ECOM.MODIFY_ORDERS
904
- * @permissionScope Manage Stores - all permissions
905
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
906
- * @permissionScope Manage Stores
907
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
908
- * @permissionScope Manage Restaurants - all permissions
909
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
910
- * @permissionScope Manage eCommerce - all permissions
911
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
912
- * @permissionScope Manage Orders
913
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
914
- * @applicableIdentity APP
915
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.BulkMarkOrdersAsPaid
916
- */
917
- async function paymentCollectionBulkMarkOrdersAsPaid(ecomOrderIds) {
918
- // @ts-ignore
919
- const { httpClient, sideEffects } = arguments[1];
920
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
921
- ecomOrderIds: ecomOrderIds,
922
- });
923
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionBulkMarkOrdersAsPaid(payload);
924
- sideEffects?.onSiteCall?.();
925
- try {
926
- const result = await httpClient.request(reqOpts);
927
- sideEffects?.onSuccess?.(result);
928
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
929
- {
930
- transformFn: image_2.transformRESTImageToSDKImage,
931
- paths: [{ path: 'results.item.lineItems.image' }],
932
- },
933
- {
934
- transformFn: address_2.transformRESTAddressToSDKAddress,
935
- paths: [
936
- { path: 'results.item.billingInfo.address' },
937
- {
938
- path: 'results.item.shippingInfo.logistics.shippingDestination.address',
939
- },
940
- {
941
- path: 'results.item.shippingInfo.logistics.pickupDetails.address',
942
- },
943
- { path: 'results.item.recipientInfo.address' },
944
- ],
945
- },
946
- ]));
947
- }
948
- catch (err) {
949
- const transformedError = (0, transform_error_1.transformError)(err, {
950
- spreadPathsToArguments: {},
951
- explicitPathsToArguments: { ecomOrderIds: '$[0]' },
952
- singleArgumentUnchanged: false,
953
- }, ['ecomOrderIds']);
954
- sideEffects?.onError?.(err);
955
- throw transformedError;
956
- }
957
- }
958
- exports.paymentCollectionBulkMarkOrdersAsPaid = paymentCollectionBulkMarkOrdersAsPaid;
959
- /**
960
- * Checks whether this order can be refunded.
961
- * @param ecomOrderId - Order ID.
962
- * @internal
963
- * @documentationMaturity preview
964
- * @requiredField ecomOrderId
965
- * @permissionId ECOM.READ_TRANSACTIONS
966
- * @permissionScope Manage Stores - all permissions
967
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
968
- * @permissionScope Manage Stores
969
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
970
- * @permissionScope Read eCommerce - all read permissions
971
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
972
- * @permissionScope Read Orders
973
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
974
- * @permissionScope Read Stores - all read permissions
975
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
976
- * @permissionScope Manage Restaurants - all permissions
977
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
978
- * @permissionScope Manage eCommerce - all permissions
979
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
980
- * @permissionScope Manage Orders
981
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
982
- * @applicableIdentity APP
983
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.GetRefundabilityStatus
984
- */
985
- async function getRefundabilityStatus(ecomOrderId) {
986
- // @ts-ignore
987
- const { httpClient, sideEffects } = arguments[1];
988
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
989
- ecomOrderId: ecomOrderId,
990
- });
991
- const reqOpts = ambassadorWixEcomV1Order.getRefundabilityStatus(payload);
992
- sideEffects?.onSiteCall?.();
993
- try {
994
- const result = await httpClient.request(reqOpts);
995
- sideEffects?.onSuccess?.(result);
996
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
997
- }
998
- catch (err) {
999
- const transformedError = (0, transform_error_1.transformError)(err, {
1000
- spreadPathsToArguments: {},
1001
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
1002
- singleArgumentUnchanged: false,
1003
- }, ['ecomOrderId']);
1004
- sideEffects?.onError?.(err);
1005
- throw transformedError;
1006
- }
1007
- }
1008
- exports.getRefundabilityStatus = getRefundabilityStatus;
1009
- /**
1010
- * Call this endpoint to create an order in the payment gateway system. The amount of the order would be either:
1011
- * 1. An explicit amount provided in the request, or;
1012
- * 2. If an explicit amount is not provided - the remaining amount to complete the payment of that eCom order.
1013
- * As a result, an ID of the created payment gateway order would be returned.
1014
- * You can then use Wix Payments APIs to approve that order or collect payment, which will eventually change the eCom order state (e.g mark it as paid).
1015
- * @param ecomOrderId - Ecom order ID.
1016
- * @internal
1017
- * @documentationMaturity preview
1018
- * @requiredField ecomOrderId
1019
- * @permissionId ECOM.MODIFY_ORDERS
1020
- * @permissionScope Manage Stores - all permissions
1021
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1022
- * @permissionScope Manage Stores
1023
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1024
- * @permissionScope Manage Restaurants - all permissions
1025
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1026
- * @permissionScope Manage eCommerce - all permissions
1027
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1028
- * @permissionScope Manage Orders
1029
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1030
- * @applicableIdentity APP
1031
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.CreatePaymentGatewayOrder
1032
- */
1033
- async function paymentCollectionCreatePaymentGatewayOrder(ecomOrderId, options) {
1034
- // @ts-ignore
1035
- const { httpClient, sideEffects } = arguments[2];
1036
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1037
- ecomOrderId: ecomOrderId,
1038
- chargedBy: options?.chargedBy,
1039
- });
1040
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionCreatePaymentGatewayOrder(payload);
1041
- sideEffects?.onSiteCall?.();
1042
- try {
1043
- const result = await httpClient.request(reqOpts);
1044
- sideEffects?.onSuccess?.(result);
1045
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1046
- }
1047
- catch (err) {
1048
- const transformedError = (0, transform_error_1.transformError)(err, {
1049
- spreadPathsToArguments: {},
1050
- explicitPathsToArguments: {
1051
- ecomOrderId: '$[0]',
1052
- chargedBy: '$[1].chargedBy',
1053
- },
1054
- singleArgumentUnchanged: false,
1055
- }, ['ecomOrderId', 'options']);
1056
- sideEffects?.onError?.(err);
1057
- throw transformedError;
1058
- }
1059
- }
1060
- exports.paymentCollectionCreatePaymentGatewayOrder = paymentCollectionCreatePaymentGatewayOrder;
1061
- /** @param ecomOrderId - Order ID.
1062
- * @param memberId - The member id. Do not attempt to get it from the request context, since in some cases the caller is not a member
1063
- * but a user which is using the membership on behalf of the a member
1064
- * @internal
1065
- * @documentationMaturity preview
1066
- * @requiredField ecomOrderId
1067
- * @requiredField memberId
1068
- * @requiredField options.membershipCharges.appId
1069
- * @requiredField options.membershipCharges.catalogReference
1070
- * @requiredField options.membershipCharges.catalogReference.appId
1071
- * @requiredField options.membershipCharges.catalogReference.catalogItemId
1072
- * @requiredField options.membershipCharges.membershipId
1073
- * @requiredField options.membershipCharges.membershipName
1074
- * @requiredField options.membershipCharges.membershipName.original
1075
- * @requiredField options.membershipCharges.rootCatalogItemId
1076
- * @permissionId ECOM.MODIFY_TRANSACTIONS
1077
- * @permissionScope Manage Stores - all permissions
1078
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1079
- * @permissionScope Manage Stores
1080
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1081
- * @permissionScope Manage Restaurants - all permissions
1082
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1083
- * @permissionScope Manage eCommerce - all permissions
1084
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1085
- * @permissionScope Manage Orders
1086
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1087
- * @applicableIdentity APP
1088
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.ChargeMemberships
1089
- */
1090
- async function chargeMemberships(ecomOrderId, memberId, options) {
1091
- // @ts-ignore
1092
- const { httpClient, sideEffects } = arguments[3];
1093
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1094
- ecomOrderId: ecomOrderId,
1095
- memberId: memberId,
1096
- membershipCharges: options?.membershipCharges,
1097
- });
1098
- const reqOpts = ambassadorWixEcomV1Order.chargeMemberships(payload);
1099
- sideEffects?.onSiteCall?.();
1100
- try {
1101
- const result = await httpClient.request(reqOpts);
1102
- sideEffects?.onSuccess?.(result);
1103
- }
1104
- catch (err) {
1105
- const transformedError = (0, transform_error_1.transformError)(err, {
1106
- spreadPathsToArguments: {},
1107
- explicitPathsToArguments: {
1108
- ecomOrderId: '$[0]',
1109
- memberId: '$[1]',
1110
- membershipCharges: '$[2].membershipCharges',
1111
- },
1112
- singleArgumentUnchanged: false,
1113
- }, ['ecomOrderId', 'memberId', 'options']);
1114
- sideEffects?.onError?.(err);
1115
- throw transformedError;
1116
- }
1117
- }
1118
- exports.chargeMemberships = chargeMemberships;
1119
- /**
1120
- * Calls corresponding payment providers and creates refund transactions for requested payments.
1121
- * Updates order transactions based on refund results.
1122
- * For requested payments with `TriggerRefundRequest.payments.external_refund = true` will not call payment providers and
1123
- * will only update order transactions.
1124
- * @param ecomOrderId - The order this refund related to
1125
- * @param payments - Refund operations information
1126
- * @internal
1127
- * @documentationMaturity preview
1128
- * @requiredField ecomOrderId
1129
- * @requiredField payments
1130
- * @requiredField payments.paymentId
1131
- * @permissionId ECOM.MODIFY_TRANSACTIONS
1132
- * @permissionScope Manage Stores - all permissions
1133
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1134
- * @permissionScope Manage Stores
1135
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1136
- * @permissionScope Manage Restaurants - all permissions
1137
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1138
- * @permissionScope Manage eCommerce - all permissions
1139
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1140
- * @permissionScope Manage Orders
1141
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1142
- * @applicableIdentity APP
1143
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.TriggerRefund
1144
- */
1145
- async function triggerRefund(ecomOrderId, payments, options) {
1146
- // @ts-ignore
1147
- const { httpClient, sideEffects } = arguments[3];
1148
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1149
- ecomOrderId: ecomOrderId,
1150
- payments: payments,
1151
- details: options?.details,
1152
- sideEffects: options?.sideEffects,
1153
- });
1154
- const reqOpts = ambassadorWixEcomV1Order.triggerRefund(payload);
1155
- sideEffects?.onSiteCall?.();
1156
- try {
1157
- const result = await httpClient.request(reqOpts);
1158
- sideEffects?.onSuccess?.(result);
1159
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1160
- }
1161
- catch (err) {
1162
- const transformedError = (0, transform_error_1.transformError)(err, {
1163
- spreadPathsToArguments: {},
1164
- explicitPathsToArguments: {
1165
- ecomOrderId: '$[0]',
1166
- payments: '$[1]',
1167
- details: '$[2].details',
1168
- sideEffects: '$[2].sideEffects',
1169
- },
1170
- singleArgumentUnchanged: false,
1171
- }, ['ecomOrderId', 'payments', 'options']);
1172
- sideEffects?.onError?.(err);
1173
- throw transformedError;
1174
- }
1175
- }
1176
- exports.triggerRefund = triggerRefund;
1177
- /**
1178
- * Void authorized payments
1179
- * Transaction statuses for related payments will be updated in async way
1180
- * @param ecomOrderId - Wix eCommerce order ID
1181
- * @param paymentIds - Payment IDs
1182
- * @public
1183
- * @documentationMaturity preview
1184
- * @requiredField ecomOrderId
1185
- * @requiredField paymentIds
1186
- * @permissionId ECOM.ORDER_VOID_AUTHORIZED_PAYMENT
1187
- * @permissionScope Manage Stores - all permissions
1188
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1189
- * @permissionScope Manage Stores
1190
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1191
- * @permissionScope Manage Restaurants - all permissions
1192
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1193
- * @permissionScope Manage eCommerce - all permissions
1194
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1195
- * @permissionScope Manage Orders
1196
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1197
- * @applicableIdentity APP
1198
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.VoidAuthorizedPayments
1199
- */
1200
- async function voidAuthorizedPayments(ecomOrderId, paymentIds) {
1201
- // @ts-ignore
1202
- const { httpClient, sideEffects } = arguments[2];
1203
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1204
- ecomOrderId: ecomOrderId,
1205
- paymentIds: paymentIds,
1206
- });
1207
- const reqOpts = ambassadorWixEcomV1Order.voidAuthorizedPayments(payload);
1208
- sideEffects?.onSiteCall?.();
1209
- try {
1210
- const result = await httpClient.request(reqOpts);
1211
- sideEffects?.onSuccess?.(result);
1212
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1213
- }
1214
- catch (err) {
1215
- const transformedError = (0, transform_error_1.transformError)(err, {
1216
- spreadPathsToArguments: {},
1217
- explicitPathsToArguments: { ecomOrderId: '$[0]', paymentIds: '$[1]' },
1218
- singleArgumentUnchanged: false,
1219
- }, ['ecomOrderId', 'paymentIds']);
1220
- sideEffects?.onError?.(err);
1221
- throw transformedError;
1222
- }
1223
- }
1224
- exports.voidAuthorizedPayments = voidAuthorizedPayments;
1225
- /**
1226
- * Capture authorized payments
1227
- * Transaction statuses for related payments will be updated in async way
1228
- * @param ecomOrderId - Wix eCommerce order ID
1229
- * @param payments - Capture payments information
1230
- * @public
1231
- * @documentationMaturity preview
1232
- * @requiredField ecomOrderId
1233
- * @requiredField payments
1234
- * @requiredField payments.paymentId
1235
- * @permissionId ECOM.ORDER_CAPTURE_AUTHORIZED_PAYMENT
1236
- * @permissionScope Manage Stores - all permissions
1237
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1238
- * @permissionScope Manage Stores
1239
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1240
- * @permissionScope Manage Restaurants - all permissions
1241
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1242
- * @permissionScope Manage eCommerce - all permissions
1243
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1244
- * @permissionScope Manage Orders
1245
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1246
- * @applicableIdentity APP
1247
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.CaptureAuthorizedPayments
1248
- */
1249
- async function captureAuthorizedPayments(ecomOrderId, payments) {
1250
- // @ts-ignore
1251
- const { httpClient, sideEffects } = arguments[2];
1252
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1253
- ecomOrderId: ecomOrderId,
1254
- payments: payments,
1255
- });
1256
- const reqOpts = ambassadorWixEcomV1Order.captureAuthorizedPayments(payload);
1257
- sideEffects?.onSiteCall?.();
1258
- try {
1259
- const result = await httpClient.request(reqOpts);
1260
- sideEffects?.onSuccess?.(result);
1261
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1262
- }
1263
- catch (err) {
1264
- const transformedError = (0, transform_error_1.transformError)(err, {
1265
- spreadPathsToArguments: {},
1266
- explicitPathsToArguments: { ecomOrderId: '$[0]', payments: '$[1]' },
1267
- singleArgumentUnchanged: false,
1268
- }, ['ecomOrderId', 'payments']);
1269
- sideEffects?.onError?.(err);
1270
- throw transformedError;
1271
- }
1272
- }
1273
- exports.captureAuthorizedPayments = captureAuthorizedPayments;
1274
- /**
1275
- * Retrieves an order.
1276
- *
1277
- *
1278
- * The `getOrder()` function returns a Promise that resolves when the specified order is retrieved.
1279
- *
1280
- * To retrieve an order's payment and refund details, including amounts, payment methods, and payment statuses, pass the order ID to [`listTransactionsForSingleOrder( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/listtransactionsforsingleorder).
1281
- * @param _id - ID of the order to retrieve.
1282
- * @public
1283
- * @requiredField _id
1284
- * @permissionId ECOM.READ_ORDERS
1285
- * @permissionId ECOM.ORDER_READ_ALL_EXTENDED_FIELDS
1286
- * @permissionScope Manage Stores - all permissions
1287
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1288
- * @permissionScope Manage Stores
1289
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1290
- * @permissionScope Read eCommerce - all read permissions
1291
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
1292
- * @permissionScope Read Orders
1293
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
1294
- * @permissionScope Read Stores - all read permissions
1295
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1296
- * @permissionScope Manage Restaurants - all permissions
1297
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1298
- * @permissionScope Manage eCommerce - all permissions
1299
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1300
- * @permissionScope Manage Orders
1301
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1302
- * @applicableIdentity APP
1303
- * @returns Fulfilled - The requested order.
1304
- * @fqn com.wix.ecom.orders.v1.Orders.GetOrder
1305
- */
1306
- async function getOrder(_id) {
1307
- // @ts-ignore
1308
- const { httpClient, sideEffects } = arguments[1];
1309
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
1310
- const reqOpts = ambassadorWixEcomV1Order.getOrder(payload);
1311
- sideEffects?.onSiteCall?.();
1312
- try {
1313
- const result = await httpClient.request(reqOpts);
1314
- sideEffects?.onSuccess?.(result);
1315
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1316
- {
1317
- transformFn: image_2.transformRESTImageToSDKImage,
1318
- paths: [{ path: 'order.lineItems.image' }],
1319
- },
1320
- {
1321
- transformFn: address_2.transformRESTAddressToSDKAddress,
1322
- paths: [
1323
- { path: 'order.billingInfo.address' },
1324
- {
1325
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1326
- },
1327
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1328
- { path: 'order.recipientInfo.address' },
1329
- ],
1330
- },
1331
- ]))?.order;
1332
- }
1333
- catch (err) {
1334
- const transformedError = (0, transform_error_1.transformError)(err, {
1335
- spreadPathsToArguments: {},
1336
- explicitPathsToArguments: { id: '$[0]' },
1337
- singleArgumentUnchanged: false,
1338
- }, ['_id']);
1339
- sideEffects?.onError?.(err);
1340
- throw transformedError;
1341
- }
1342
- }
1343
- exports.getOrder = getOrder;
1344
- /**
1345
- * Retrieves a list of orders, given the provided paging, filtering, and sorting.
1346
- *
1347
- *
1348
- * Search Orders runs with these defaults, which you can override:
1349
- *
1350
- * - `createdDate` is sorted in `DESC` order
1351
- * - `cursorPaging.limit` is `100`
1352
- * - `filter: {"status": {"$ne": "INITIALIZED"}}` - other order statuses can be queried, but orders with `status: "INITIALIZED"` are never returned
1353
- *
1354
- * For field support for filters and sorting, see [Orders: Supported Filters and Sorting](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/orders/supported-filters-and-sorting).
1355
- *
1356
- * To learn about working with _Search_ endpoints, see
1357
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language), and
1358
- * [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1359
- * @param search - Search options.
1360
- * @public
1361
- * @requiredField search
1362
- * @permissionId ECOM.READ_ORDERS
1363
- * @permissionScope Manage Stores - all permissions
1364
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1365
- * @permissionScope Manage Stores
1366
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1367
- * @permissionScope Read eCommerce - all read permissions
1368
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
1369
- * @permissionScope Read Orders
1370
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
1371
- * @permissionScope Read Stores - all read permissions
1372
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1373
- * @permissionScope Manage Restaurants - all permissions
1374
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1375
- * @permissionScope Manage eCommerce - all permissions
1376
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1377
- * @permissionScope Manage Orders
1378
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1379
- * @applicableIdentity APP
1380
- * @fqn com.wix.ecom.orders.v1.Orders.SearchOrders
1381
- */
1382
- async function searchOrders(search) {
1383
- // @ts-ignore
1384
- const { httpClient, sideEffects } = arguments[1];
1385
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ search: search });
1386
- const reqOpts = ambassadorWixEcomV1Order.searchOrders(payload);
1387
- sideEffects?.onSiteCall?.();
1388
- try {
1389
- const result = await httpClient.request(reqOpts);
1390
- sideEffects?.onSuccess?.(result);
1391
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1392
- {
1393
- transformFn: image_2.transformRESTImageToSDKImage,
1394
- paths: [{ path: 'orders.lineItems.image' }],
1395
- },
1396
- {
1397
- transformFn: address_2.transformRESTAddressToSDKAddress,
1398
- paths: [
1399
- { path: 'orders.billingInfo.address' },
1400
- {
1401
- path: 'orders.shippingInfo.logistics.shippingDestination.address',
1402
- },
1403
- { path: 'orders.shippingInfo.logistics.pickupDetails.address' },
1404
- { path: 'orders.recipientInfo.address' },
1405
- ],
1406
- },
1407
- ]));
1408
- }
1409
- catch (err) {
1410
- const transformedError = (0, transform_error_1.transformError)(err, {
1411
- spreadPathsToArguments: {},
1412
- explicitPathsToArguments: { search: '$[0]' },
1413
- singleArgumentUnchanged: false,
1414
- }, ['search']);
1415
- sideEffects?.onError?.(err);
1416
- throw transformedError;
1417
- }
1418
- }
1419
- exports.searchOrders = searchOrders;
1420
- /**
1421
- * Creates an order.
1422
- *
1423
- *
1424
- * The `createOrder()` function returns a Promise that resolves when the order is created.
1425
- *
1426
- * > **Notes:**
1427
- * > + If an item is digital - `lineItems[i].itemType.preset: DIGITAL` - then `lineItems[i].digitalFile` must be provided.
1428
- * > + If `lineItems[i].id` is passed, it must be either a valid GUID, or empty.
1429
- * @param order - Order info.
1430
- * @public
1431
- * @requiredField order
1432
- * @requiredField order.billingInfo.contactDetails
1433
- * @requiredField order.channelInfo
1434
- * @requiredField order.currencyConversionDetails.conversionRate
1435
- * @requiredField order.currencyConversionDetails.originalCurrency
1436
- * @requiredField order.lineItems
1437
- * @requiredField order.lineItems.catalogReference.appId
1438
- * @requiredField order.lineItems.catalogReference.catalogItemId
1439
- * @requiredField order.lineItems.itemType
1440
- * @requiredField order.lineItems.price
1441
- * @requiredField order.lineItems.productName
1442
- * @requiredField order.lineItems.productName.original
1443
- * @requiredField order.lineItems.quantity
1444
- * @requiredField order.priceSummary
1445
- * @permissionId ECOM.CREATE_ORDERS
1446
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1447
- * @permissionScope Manage Stores - all permissions
1448
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1449
- * @permissionScope Manage Stores
1450
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1451
- * @permissionScope Manage Restaurants - all permissions
1452
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1453
- * @permissionScope Manage eCommerce - all permissions
1454
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1455
- * @permissionScope Manage Orders
1456
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1457
- * @applicableIdentity APP
1458
- * @returns Newly created order.
1459
- * @fqn com.wix.ecom.orders.v1.Orders.CreateOrder
1460
- */
1461
- async function createOrder(order, options) {
1462
- // @ts-ignore
1463
- const { httpClient, sideEffects } = arguments[2];
1464
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1465
- order: order,
1466
- settings: options?.settings,
1467
- }), [
1468
- {
1469
- transformFn: image_1.transformSDKImageToRESTImage,
1470
- paths: [{ path: 'order.lineItems.image' }],
1471
- },
1472
- {
1473
- transformFn: address_1.transformSDKAddressToRESTAddress,
1474
- paths: [
1475
- { path: 'order.billingInfo.address' },
1476
- { path: 'order.shippingInfo.logistics.shippingDestination.address' },
1477
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1478
- { path: 'order.recipientInfo.address' },
1479
- ],
1480
- },
1481
- ]);
1482
- const reqOpts = ambassadorWixEcomV1Order.createOrder(payload);
1483
- sideEffects?.onSiteCall?.();
1484
- try {
1485
- const result = await httpClient.request(reqOpts);
1486
- sideEffects?.onSuccess?.(result);
1487
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1488
- {
1489
- transformFn: image_2.transformRESTImageToSDKImage,
1490
- paths: [{ path: 'order.lineItems.image' }],
1491
- },
1492
- {
1493
- transformFn: address_2.transformRESTAddressToSDKAddress,
1494
- paths: [
1495
- { path: 'order.billingInfo.address' },
1496
- {
1497
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1498
- },
1499
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1500
- { path: 'order.recipientInfo.address' },
1501
- ],
1502
- },
1503
- ]))?.order;
1504
- }
1505
- catch (err) {
1506
- const transformedError = (0, transform_error_1.transformError)(err, {
1507
- spreadPathsToArguments: {},
1508
- explicitPathsToArguments: { order: '$[0]', settings: '$[1].settings' },
1509
- singleArgumentUnchanged: false,
1510
- }, ['order', 'options']);
1511
- sideEffects?.onError?.(err);
1512
- throw transformedError;
1513
- }
1514
- }
1515
- exports.createOrder = createOrder;
1516
- /**
1517
- * Updates an order.
1518
- *
1519
- *
1520
- * The `updateOrder()` function returns a Promise that resolves when the specified order's information is updated.
1521
- *
1522
- * Currently, the following fields can be updated:
1523
- * + `order.buyerInfo.email`
1524
- * + `order.buyerLanguage`
1525
- * + `order.weightUnit`
1526
- * + `order.billingInfo.address`
1527
- * + `order.billingInfo.contactDetails`
1528
- * + `order.archived`
1529
- * + `order.attributionSource`
1530
- * + `order.seenByAHuman`
1531
- * + `order.recipientInfo.address`
1532
- * + `order.recipientInfo.contactDetails`
1533
- * + `order.shippingInfo.logistics.shippingDestination.address`
1534
- * + `order.shippingInfo.logistics.shippingDestination.contactDetails`
1535
- *
1536
- * To update a field's value, include the new value in the `order` object in the method parameters.
1537
- * To remove a field's value, pass `null`.
1538
- *
1539
- * > **Note:** Removing `buyerInfo` or `contactDetails` fields results in an error.
1540
- *
1541
- * To update an order's payment status, use [`updatePaymentStatus( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus).
1542
- * @param _id - Order ID.
1543
- * @public
1544
- * @requiredField _id
1545
- * @requiredField order
1546
- * @permissionId ECOM.MODIFY_ORDERS
1547
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1548
- * @permissionScope Manage Stores - all permissions
1549
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1550
- * @permissionScope Manage Stores
1551
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1552
- * @permissionScope Manage Restaurants - all permissions
1553
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1554
- * @permissionScope Manage eCommerce - all permissions
1555
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1556
- * @permissionScope Manage Orders
1557
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1558
- * @applicableIdentity APP
1559
- * @returns Newly created order.
1560
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrder
1561
- */
1562
- async function updateOrder(_id, order) {
1563
- // @ts-ignore
1564
- const { httpClient, sideEffects } = arguments[2];
1565
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ order: { ...order, id: _id } }), [
1566
- {
1567
- transformFn: image_1.transformSDKImageToRESTImage,
1568
- paths: [{ path: 'order.lineItems.image' }],
1569
- },
1570
- {
1571
- transformFn: address_1.transformSDKAddressToRESTAddress,
1572
- paths: [
1573
- { path: 'order.billingInfo.address' },
1574
- { path: 'order.shippingInfo.logistics.shippingDestination.address' },
1575
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1576
- { path: 'order.recipientInfo.address' },
1577
- ],
1578
- },
1579
- ]);
1580
- const reqOpts = ambassadorWixEcomV1Order.updateOrder(payload);
1581
- sideEffects?.onSiteCall?.();
1582
- try {
1583
- const result = await httpClient.request(reqOpts);
1584
- sideEffects?.onSuccess?.(result);
1585
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1586
- {
1587
- transformFn: image_2.transformRESTImageToSDKImage,
1588
- paths: [{ path: 'order.lineItems.image' }],
1589
- },
1590
- {
1591
- transformFn: address_2.transformRESTAddressToSDKAddress,
1592
- paths: [
1593
- { path: 'order.billingInfo.address' },
1594
- {
1595
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1596
- },
1597
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1598
- { path: 'order.recipientInfo.address' },
1599
- ],
1600
- },
1601
- ]))?.order;
1602
- }
1603
- catch (err) {
1604
- const transformedError = (0, transform_error_1.transformError)(err, {
1605
- spreadPathsToArguments: { order: '$[1]' },
1606
- explicitPathsToArguments: { 'order.id': '$[0]' },
1607
- singleArgumentUnchanged: false,
1608
- }, ['_id', 'order']);
1609
- sideEffects?.onError?.(err);
1610
- throw transformedError;
1611
- }
1612
- }
1613
- exports.updateOrder = updateOrder;
1614
- /**
1615
- * Updates up to 100 orders.
1616
- *
1617
- *
1618
- * The `bulkUpdateOrders()` function returns a Promise that resolves when the specified orders' information is updated.
1619
- *
1620
- * Currently, the following fields can be updated:
1621
- * + `order.buyerInfo.email`
1622
- * + `order.buyerLanguage`
1623
- * + `order.weightUnit`
1624
- * + `order.billingInfo.address`
1625
- * + `order.billingInfo.contactDetails`
1626
- * + `order.archived`
1627
- * + `order.attributionSource`
1628
- * + `order.seenByAHuman`
1629
- * + `order.recipientInfo.address`
1630
- * + `order.recipientInfo.contactDetails`
1631
- * + `order.shippingInfo.logistics.shippingDestination.address`
1632
- * + `order.shippingInfo.logistics.shippingDestination.contactDetails`
1633
- *
1634
- * To update a field's value, include the new value in the `orders.order` object in the method parameters.
1635
- * To remove a field's value, pass `null`.
1636
- *
1637
- * > **Note:** Removing `buyerInfo` or `contactDetails` fields results in an error.
1638
- *
1639
- * To update an order's payment status, use [`updatePaymentStatus( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus).
1640
- * @param orders - Orders to update.
1641
- * @public
1642
- * @requiredField orders
1643
- * @requiredField orders.order
1644
- * @requiredField orders.order._id
1645
- * @permissionId ECOM.MODIFY_ORDERS
1646
- * @permissionScope Manage Stores - all permissions
1647
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1648
- * @permissionScope Manage Stores
1649
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1650
- * @permissionScope Manage Restaurants - all permissions
1651
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1652
- * @permissionScope Manage eCommerce - all permissions
1653
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1654
- * @permissionScope Manage Orders
1655
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1656
- * @applicableIdentity APP
1657
- * @fqn com.wix.ecom.orders.v1.Orders.BulkUpdateOrders
1658
- */
1659
- async function bulkUpdateOrders(orders, options) {
1660
- // @ts-ignore
1661
- const { httpClient, sideEffects } = arguments[2];
1662
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1663
- orders: orders,
1664
- returnEntity: options?.returnEntity,
1665
- }), [
1666
- {
1667
- transformFn: image_1.transformSDKImageToRESTImage,
1668
- paths: [{ path: 'orders.order.lineItems.image' }],
1669
- },
1670
- {
1671
- transformFn: address_1.transformSDKAddressToRESTAddress,
1672
- paths: [
1673
- { path: 'orders.order.billingInfo.address' },
1674
- {
1675
- path: 'orders.order.shippingInfo.logistics.shippingDestination.address',
1676
- },
1677
- { path: 'orders.order.shippingInfo.logistics.pickupDetails.address' },
1678
- { path: 'orders.order.recipientInfo.address' },
1679
- ],
1680
- },
1681
- ]);
1682
- const reqOpts = ambassadorWixEcomV1Order.bulkUpdateOrders(payload);
1683
- sideEffects?.onSiteCall?.();
1684
- try {
1685
- const result = await httpClient.request(reqOpts);
1686
- sideEffects?.onSuccess?.(result);
1687
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1688
- {
1689
- transformFn: image_2.transformRESTImageToSDKImage,
1690
- paths: [{ path: 'results.item.lineItems.image' }],
1691
- },
1692
- {
1693
- transformFn: address_2.transformRESTAddressToSDKAddress,
1694
- paths: [
1695
- { path: 'results.item.billingInfo.address' },
1696
- {
1697
- path: 'results.item.shippingInfo.logistics.shippingDestination.address',
1698
- },
1699
- {
1700
- path: 'results.item.shippingInfo.logistics.pickupDetails.address',
1701
- },
1702
- { path: 'results.item.recipientInfo.address' },
1703
- ],
1704
- },
1705
- ]));
1706
- }
1707
- catch (err) {
1708
- const transformedError = (0, transform_error_1.transformError)(err, {
1709
- spreadPathsToArguments: {},
1710
- explicitPathsToArguments: {
1711
- orders: '$[0]',
1712
- returnEntity: '$[1].returnEntity',
1713
- },
1714
- singleArgumentUnchanged: false,
1715
- }, ['orders', 'options']);
1716
- sideEffects?.onError?.(err);
1717
- throw transformedError;
1718
- }
1719
- }
1720
- exports.bulkUpdateOrders = bulkUpdateOrders;
1721
- /** @param _id - Order id to be updated
1722
- * @internal
1723
- * @documentationMaturity preview
1724
- * @requiredField _id
1725
- * @requiredField options.changes
1726
- * @requiredField options.changes.priceSummary.subtotal
1727
- * @requiredField options.changes.priceSummary.total
1728
- * @permissionId ECOM.ORDERS_DELTAS_COMMIT
1729
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1730
- * @permissionScope Manage Stores
1731
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1732
- * @applicableIdentity APP
1733
- * @fqn com.wix.ecom.orders.v1.Orders.CommitDeltas
1734
- */
1735
- async function commitDeltas(_id, options) {
1736
- // @ts-ignore
1737
- const { httpClient, sideEffects } = arguments[2];
1738
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1739
- id: _id,
1740
- draftOrderId: options?.draftOrderId,
1741
- changes: options?.changes,
1742
- commitSettings: options?.commitSettings,
1743
- reason: options?.reason,
1744
- }), [
1745
- {
1746
- transformFn: address_1.transformSDKAddressToRESTAddress,
1747
- paths: [
1748
- {
1749
- path: 'changes.changedShippingInfo.logistics.shippingDestination.address',
1750
- },
1751
- {
1752
- path: 'changes.changedShippingInfo.logistics.pickupDetails.address',
1753
- },
1754
- { path: 'changes.changedBillingInfo.address' },
1755
- { path: 'changes.changedRecipientInfo.address' },
1756
- ],
1757
- },
1758
- {
1759
- transformFn: image_1.transformSDKImageToRESTImage,
1760
- paths: [{ path: 'changes.lineItems.lineItem.image' }],
1761
- },
1762
- ]);
1763
- const reqOpts = ambassadorWixEcomV1Order.commitDeltas(payload);
1764
- sideEffects?.onSiteCall?.();
1765
- try {
1766
- const result = await httpClient.request(reqOpts);
1767
- sideEffects?.onSuccess?.(result);
1768
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1769
- {
1770
- transformFn: image_2.transformRESTImageToSDKImage,
1771
- paths: [{ path: 'order.lineItems.image' }],
1772
- },
1773
- {
1774
- transformFn: address_2.transformRESTAddressToSDKAddress,
1775
- paths: [
1776
- { path: 'order.billingInfo.address' },
1777
- {
1778
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1779
- },
1780
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1781
- { path: 'order.recipientInfo.address' },
1782
- ],
1783
- },
1784
- ]));
1785
- }
1786
- catch (err) {
1787
- const transformedError = (0, transform_error_1.transformError)(err, {
1788
- spreadPathsToArguments: {},
1789
- explicitPathsToArguments: {
1790
- id: '$[0]',
1791
- draftOrderId: '$[1].draftOrderId',
1792
- changes: '$[1].changes',
1793
- commitSettings: '$[1].commitSettings',
1794
- reason: '$[1].reason',
1795
- },
1796
- singleArgumentUnchanged: false,
1797
- }, ['_id', 'options']);
1798
- sideEffects?.onError?.(err);
1799
- throw transformedError;
1800
- }
1801
- }
1802
- exports.commitDeltas = commitDeltas;
1803
- /** @internal
1804
- * @documentationMaturity preview
1805
- * @requiredField identifiers
1806
- * @requiredField identifiers._id
1807
- * @requiredField identifiers.lineItemId
1808
- * @requiredField lineItem
1809
- * @permissionId ECOM.MODIFY_ORDERS
1810
- * @permissionScope Manage Stores - all permissions
1811
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1812
- * @permissionScope Manage Stores
1813
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1814
- * @permissionScope Manage Restaurants - all permissions
1815
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1816
- * @permissionScope Manage eCommerce - all permissions
1817
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1818
- * @permissionScope Manage Orders
1819
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1820
- * @applicableIdentity APP
1821
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrderLineItem
1822
- * @deprecated
1823
- * @targetRemovalDate 2024-02-15
1824
- */
1825
- async function updateOrderLineItem(identifiers, lineItem) {
1826
- // @ts-ignore
1827
- const { httpClient, sideEffects } = arguments[2];
1828
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1829
- id: identifiers?._id,
1830
- lineItem: { ...lineItem, id: identifiers?.lineItemId },
1831
- }), [
1832
- {
1833
- transformFn: image_1.transformSDKImageToRESTImage,
1834
- paths: [{ path: 'lineItem.image' }],
1835
- },
1836
- ]);
1837
- const reqOpts = ambassadorWixEcomV1Order.updateOrderLineItem(payload);
1838
- sideEffects?.onSiteCall?.();
1839
- try {
1840
- const result = await httpClient.request(reqOpts);
1841
- sideEffects?.onSuccess?.(result);
1842
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1843
- {
1844
- transformFn: image_2.transformRESTImageToSDKImage,
1845
- paths: [{ path: 'order.lineItems.image' }],
1846
- },
1847
- {
1848
- transformFn: address_2.transformRESTAddressToSDKAddress,
1849
- paths: [
1850
- { path: 'order.billingInfo.address' },
1851
- {
1852
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1853
- },
1854
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1855
- { path: 'order.recipientInfo.address' },
1856
- ],
1857
- },
1858
- ]));
1859
- }
1860
- catch (err) {
1861
- const transformedError = (0, transform_error_1.transformError)(err, {
1862
- spreadPathsToArguments: { lineItem: '$[1]' },
1863
- explicitPathsToArguments: {
1864
- id: '$[0]._id',
1865
- 'lineItem.id': '$[0].lineItemId',
1866
- },
1867
- singleArgumentUnchanged: false,
1868
- }, ['identifiers', 'lineItem']);
1869
- sideEffects?.onError?.(err);
1870
- throw transformedError;
1871
- }
1872
- }
1873
- exports.updateOrderLineItem = updateOrderLineItem;
1874
- /**
1875
- * Adds a merchant comment to an order.
1876
- * > **Note:** Activities with type CustomActivity not supported
1877
- * @param _id - Order ID.
1878
- * @param activity - Activity info.
1879
- * @internal
1880
- * @documentationMaturity preview
1881
- * @requiredField _id
1882
- * @requiredField activity
1883
- * @permissionId ECOM.MODIFY_ORDERS
1884
- * @permissionScope Manage Stores - all permissions
1885
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1886
- * @permissionScope Manage Stores
1887
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1888
- * @permissionScope Manage Restaurants - all permissions
1889
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1890
- * @permissionScope Manage eCommerce - all permissions
1891
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1892
- * @permissionScope Manage Orders
1893
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1894
- * @applicableIdentity APP
1895
- * @fqn com.wix.ecom.orders.v1.Orders.AddActivity
1896
- * @deprecated
1897
- * @replacedBy com.wix.ecom.orders.v1.OrdersService.AddActivities
1898
- * @targetRemovalDate 2024-11-01
1899
- */
1900
- async function addActivity(_id, activity) {
1901
- // @ts-ignore
1902
- const { httpClient, sideEffects } = arguments[2];
1903
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1904
- id: _id,
1905
- activity: activity,
1906
- });
1907
- const reqOpts = ambassadorWixEcomV1Order.addActivity(payload);
1908
- sideEffects?.onSiteCall?.();
1909
- try {
1910
- const result = await httpClient.request(reqOpts);
1911
- sideEffects?.onSuccess?.(result);
1912
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1913
- {
1914
- transformFn: image_2.transformRESTImageToSDKImage,
1915
- paths: [{ path: 'order.lineItems.image' }],
1916
- },
1917
- {
1918
- transformFn: address_2.transformRESTAddressToSDKAddress,
1919
- paths: [
1920
- { path: 'order.billingInfo.address' },
1921
- {
1922
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1923
- },
1924
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1925
- { path: 'order.recipientInfo.address' },
1926
- ],
1927
- },
1928
- ]));
1929
- }
1930
- catch (err) {
1931
- const transformedError = (0, transform_error_1.transformError)(err, {
1932
- spreadPathsToArguments: {},
1933
- explicitPathsToArguments: { id: '$[0]', activity: '$[1]' },
1934
- singleArgumentUnchanged: false,
1935
- }, ['_id', 'activity']);
1936
- sideEffects?.onError?.(err);
1937
- throw transformedError;
1938
- }
1939
- }
1940
- exports.addActivity = addActivity;
1941
- /**
1942
- * Updates an order's activity.
1943
- * @param activity - Activity info.
1944
- * @internal
1945
- * @documentationMaturity preview
1946
- * @requiredField activity
1947
- * @requiredField identifiers
1948
- * @requiredField identifiers._id
1949
- * @requiredField identifiers.activityId
1950
- * @permissionId ECOM.MODIFY_ORDERS
1951
- * @permissionScope Manage Stores - all permissions
1952
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1953
- * @permissionScope Manage Stores
1954
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1955
- * @permissionScope Manage Restaurants - all permissions
1956
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1957
- * @permissionScope Manage eCommerce - all permissions
1958
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1959
- * @permissionScope Manage Orders
1960
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1961
- * @applicableIdentity APP
1962
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateActivity
1963
- */
1964
- async function updateActivity(identifiers, activity) {
1965
- // @ts-ignore
1966
- const { httpClient, sideEffects } = arguments[2];
1967
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1968
- id: identifiers?._id,
1969
- activityId: identifiers?.activityId,
1970
- activity: activity,
1971
- });
1972
- const reqOpts = ambassadorWixEcomV1Order.updateActivity(payload);
1973
- sideEffects?.onSiteCall?.();
1974
- try {
1975
- const result = await httpClient.request(reqOpts);
1976
- sideEffects?.onSuccess?.(result);
1977
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1978
- {
1979
- transformFn: image_2.transformRESTImageToSDKImage,
1980
- paths: [{ path: 'order.lineItems.image' }],
1981
- },
1982
- {
1983
- transformFn: address_2.transformRESTAddressToSDKAddress,
1984
- paths: [
1985
- { path: 'order.billingInfo.address' },
1986
- {
1987
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1988
- },
1989
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1990
- { path: 'order.recipientInfo.address' },
1991
- ],
1992
- },
1993
- ]));
1994
- }
1995
- catch (err) {
1996
- const transformedError = (0, transform_error_1.transformError)(err, {
1997
- spreadPathsToArguments: {},
1998
- explicitPathsToArguments: {
1999
- id: '$[0]._id',
2000
- activityId: '$[0].activityId',
2001
- activity: '$[1]',
2002
- },
2003
- singleArgumentUnchanged: false,
2004
- }, ['identifiers', 'activity']);
2005
- sideEffects?.onError?.(err);
2006
- throw transformedError;
2007
- }
2008
- }
2009
- exports.updateActivity = updateActivity;
2010
- /**
2011
- * Delete's an order's activity.
2012
- *
2013
- * Only custom activities and merchant comments can be deleted.
2014
- * @internal
2015
- * @documentationMaturity preview
2016
- * @requiredField identifiers
2017
- * @requiredField identifiers._id
2018
- * @requiredField identifiers.activityId
2019
- * @permissionId ECOM.MODIFY_ORDERS
2020
- * @permissionScope Manage Stores - all permissions
2021
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2022
- * @permissionScope Manage Stores
2023
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2024
- * @permissionScope Manage Restaurants - all permissions
2025
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2026
- * @permissionScope Manage eCommerce - all permissions
2027
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2028
- * @permissionScope Manage Orders
2029
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2030
- * @applicableIdentity APP
2031
- * @fqn com.wix.ecom.orders.v1.Orders.DeleteActivity
2032
- */
2033
- async function deleteActivity(identifiers) {
2034
- // @ts-ignore
2035
- const { httpClient, sideEffects } = arguments[1];
2036
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2037
- id: identifiers?._id,
2038
- activityId: identifiers?.activityId,
2039
- });
2040
- const reqOpts = ambassadorWixEcomV1Order.deleteActivity(payload);
2041
- sideEffects?.onSiteCall?.();
2042
- try {
2043
- const result = await httpClient.request(reqOpts);
2044
- sideEffects?.onSuccess?.(result);
2045
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
2046
- {
2047
- transformFn: image_2.transformRESTImageToSDKImage,
2048
- paths: [{ path: 'order.lineItems.image' }],
2049
- },
2050
- {
2051
- transformFn: address_2.transformRESTAddressToSDKAddress,
2052
- paths: [
2053
- { path: 'order.billingInfo.address' },
2054
- {
2055
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2056
- },
2057
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2058
- { path: 'order.recipientInfo.address' },
2059
- ],
2060
- },
2061
- ]));
2062
- }
2063
- catch (err) {
2064
- const transformedError = (0, transform_error_1.transformError)(err, {
2065
- spreadPathsToArguments: {},
2066
- explicitPathsToArguments: {
2067
- id: '$[0]._id',
2068
- activityId: '$[0].activityId',
2069
- },
2070
- singleArgumentUnchanged: false,
2071
- }, ['identifiers']);
2072
- sideEffects?.onError?.(err);
2073
- throw transformedError;
2074
- }
2075
- }
2076
- exports.deleteActivity = deleteActivity;
2077
- /**
2078
- * Cancels an order.
2079
- *
2080
- *
2081
- * The `cancelOrder()` function returns a Promise that resolves when the specified order is canceled and the `order.status` field changes to `CANCELED`.
2082
- * @param _id - Order ID.
2083
- * @public
2084
- * @requiredField _id
2085
- * @permissionId ECOM.MODIFY_ORDERS
2086
- * @permissionScope Manage Stores - all permissions
2087
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2088
- * @permissionScope Manage Stores
2089
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2090
- * @permissionScope Manage Restaurants - all permissions
2091
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2092
- * @permissionScope Manage eCommerce - all permissions
2093
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2094
- * @permissionScope Manage Orders
2095
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2096
- * @applicableIdentity APP
2097
- * @fqn com.wix.ecom.orders.v1.Orders.CancelOrder
2098
- */
2099
- async function cancelOrder(_id, options) {
2100
- // @ts-ignore
2101
- const { httpClient, sideEffects } = arguments[2];
2102
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2103
- id: _id,
2104
- sendOrderCanceledEmail: options?.sendOrderCanceledEmail,
2105
- customMessage: options?.customMessage,
2106
- restockAllItems: options?.restockAllItems,
2107
- });
2108
- const reqOpts = ambassadorWixEcomV1Order.cancelOrder(payload);
2109
- sideEffects?.onSiteCall?.();
2110
- try {
2111
- const result = await httpClient.request(reqOpts);
2112
- sideEffects?.onSuccess?.(result);
2113
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
2114
- {
2115
- transformFn: image_2.transformRESTImageToSDKImage,
2116
- paths: [{ path: 'order.lineItems.image' }],
2117
- },
2118
- {
2119
- transformFn: address_2.transformRESTAddressToSDKAddress,
2120
- paths: [
2121
- { path: 'order.billingInfo.address' },
2122
- {
2123
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2124
- },
2125
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2126
- { path: 'order.recipientInfo.address' },
2127
- ],
2128
- },
2129
- ]));
2130
- }
2131
- catch (err) {
2132
- const transformedError = (0, transform_error_1.transformError)(err, {
2133
- spreadPathsToArguments: {},
2134
- explicitPathsToArguments: {
2135
- id: '$[0]',
2136
- sendOrderCanceledEmail: '$[1].sendOrderCanceledEmail',
2137
- customMessage: '$[1].customMessage',
2138
- restockAllItems: '$[1].restockAllItems',
2139
- },
2140
- singleArgumentUnchanged: false,
2141
- }, ['_id', 'options']);
2142
- sideEffects?.onError?.(err);
2143
- throw transformedError;
2144
- }
2145
- }
2146
- exports.cancelOrder = cancelOrder;
2147
- /**
2148
- * Updates order status.
2149
- *
2150
- * >CANCELED and REJECTED are final statuses. Update from either of those will fail.
2151
- * >Updates into INITIALIZED are not supported.
2152
- *
2153
- * Approving order:
2154
- * APPROVED status can be set while order has one of [INITIALIZED, PENDING] statuses.
2155
- *
2156
- * Approving an order which was created with CreateOrderRequest.settings.order_approval_strategy = PAYMENT_METHOD_SAVED
2157
- * will cause an error.
2158
- *
2159
- * Setting PENDING status:
2160
- * Only orders in INITIALIZED status can be updated into PENDING.
2161
- * @param orderId - Order ID.
2162
- * @param status - New order status.
2163
- * @internal
2164
- * @documentationMaturity preview
2165
- * @requiredField orderId
2166
- * @requiredField status
2167
- * @permissionId ECOM.ORDER_UPDATE_STATUS
2168
- * @permissionScope Manage Stores - all permissions
2169
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2170
- * @permissionScope Manage Stores
2171
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2172
- * @permissionScope Manage Restaurants - all permissions
2173
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2174
- * @permissionScope Manage eCommerce - all permissions
2175
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2176
- * @permissionScope Manage Orders
2177
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2178
- * @applicableIdentity APP
2179
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrderStatus
2180
- */
2181
- async function updateOrderStatus(orderId, status) {
2182
- // @ts-ignore
2183
- const { httpClient, sideEffects } = arguments[2];
2184
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2185
- orderId: orderId,
2186
- status: status,
2187
- });
2188
- const reqOpts = ambassadorWixEcomV1Order.updateOrderStatus(payload);
2189
- sideEffects?.onSiteCall?.();
2190
- try {
2191
- const result = await httpClient.request(reqOpts);
2192
- sideEffects?.onSuccess?.(result);
2193
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
2194
- {
2195
- transformFn: image_2.transformRESTImageToSDKImage,
2196
- paths: [{ path: 'order.lineItems.image' }],
2197
- },
2198
- {
2199
- transformFn: address_2.transformRESTAddressToSDKAddress,
2200
- paths: [
2201
- { path: 'order.billingInfo.address' },
2202
- {
2203
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2204
- },
2205
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2206
- { path: 'order.recipientInfo.address' },
2207
- ],
2208
- },
2209
- ]));
2210
- }
2211
- catch (err) {
2212
- const transformedError = (0, transform_error_1.transformError)(err, {
2213
- spreadPathsToArguments: {},
2214
- explicitPathsToArguments: { orderId: '$[0]', status: '$[1]' },
2215
- singleArgumentUnchanged: false,
2216
- }, ['orderId', 'status']);
2217
- sideEffects?.onError?.(err);
2218
- throw transformedError;
2219
- }
2220
- }
2221
- exports.updateOrderStatus = updateOrderStatus;
2222
- /** @internal
2223
- * @documentationMaturity preview
2224
- * @requiredField options.aggregation
2225
- * @permissionId ECOM.READ_ORDERS
2226
- * @permissionScope Manage Stores - all permissions
2227
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2228
- * @permissionScope Manage Stores
2229
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2230
- * @permissionScope Read eCommerce - all read permissions
2231
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
2232
- * @permissionScope Read Orders
2233
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
2234
- * @permissionScope Read Stores - all read permissions
2235
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
2236
- * @permissionScope Manage Restaurants - all permissions
2237
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2238
- * @permissionScope Manage eCommerce - all permissions
2239
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2240
- * @permissionScope Manage Orders
2241
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2242
- * @applicableIdentity APP
2243
- * @fqn com.wix.ecom.orders.v1.Orders.AggregateOrders
2244
- */
2245
- async function aggregateOrders(options) {
2246
- // @ts-ignore
2247
- const { httpClient, sideEffects } = arguments[1];
2248
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2249
- filter: options?.filter,
2250
- aggregation: options?.aggregation,
2251
- hierarchySeparatorOverride: options?.hierarchySeparatorOverride,
2252
- });
2253
- const reqOpts = ambassadorWixEcomV1Order.aggregateOrders(payload);
2254
- sideEffects?.onSiteCall?.();
2255
- try {
2256
- const result = await httpClient.request(reqOpts);
2257
- sideEffects?.onSuccess?.(result);
2258
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
2259
- }
2260
- catch (err) {
2261
- const transformedError = (0, transform_error_1.transformError)(err, {
2262
- spreadPathsToArguments: {},
2263
- explicitPathsToArguments: {
2264
- filter: '$[0].filter',
2265
- aggregation: '$[0].aggregation',
2266
- hierarchySeparatorOverride: '$[0].hierarchySeparatorOverride',
2267
- },
2268
- singleArgumentUnchanged: false,
2269
- }, ['options']);
2270
- sideEffects?.onError?.(err);
2271
- throw transformedError;
2272
- }
2273
- }
2274
- exports.aggregateOrders = aggregateOrders;
2275
- /**
2276
- * Synchronously update tags on multiple orders, by list of order IDs.
2277
- *
2278
- * > **Note:** If the same tag is passed to both the `assignTags` and `unassignTags` fields, it will be assigned.
2279
- * @param orderIds - IDs of orders to update tags for.
2280
- * @public
2281
- * @requiredField orderIds
2282
- * @permissionId ECOM.MODIFY_ORDERS
2283
- * @permissionId ECOM.ORDER_MODIFY_PRIVATE_TAGS
2284
- * @permissionScope Manage Stores - all permissions
2285
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2286
- * @permissionScope Manage Stores
2287
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2288
- * @permissionScope Manage Restaurants - all permissions
2289
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2290
- * @permissionScope Manage eCommerce - all permissions
2291
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2292
- * @permissionScope Manage Orders
2293
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2294
- * @permissionScope Manage Stores - all permissions
2295
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2296
- * @permissionScope Manage Stores
2297
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
2298
- * @permissionScope Manage Restaurants - all permissions
2299
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2300
- * @permissionScope Manage eCommerce - all permissions
2301
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2302
- * @permissionScope Manage Orders
2303
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2304
- * @applicableIdentity APP
2305
- * @fqn com.wix.ecom.orders.v1.Orders.BulkUpdateOrderTags
2306
- */
2307
- async function bulkUpdateOrderTags(orderIds, options) {
2308
- // @ts-ignore
2309
- const { httpClient, sideEffects } = arguments[2];
2310
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2311
- orderIds: orderIds,
2312
- assignTags: options?.assignTags,
2313
- unassignTags: options?.unassignTags,
2314
- });
2315
- const reqOpts = ambassadorWixEcomV1Order.bulkUpdateOrderTags(payload);
2316
- sideEffects?.onSiteCall?.();
2317
- try {
2318
- const result = await httpClient.request(reqOpts);
2319
- sideEffects?.onSuccess?.(result);
2320
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
2321
- }
2322
- catch (err) {
2323
- const transformedError = (0, transform_error_1.transformError)(err, {
2324
- spreadPathsToArguments: {},
2325
- explicitPathsToArguments: {
2326
- orderIds: '$[0]',
2327
- assignTags: '$[1].assignTags',
2328
- unassignTags: '$[1].unassignTags',
2329
- },
2330
- singleArgumentUnchanged: false,
2331
- }, ['orderIds', 'options']);
2332
- sideEffects?.onError?.(err);
2333
- throw transformedError;
2334
- }
2335
- }
2336
- exports.bulkUpdateOrderTags = bulkUpdateOrderTags;
2337
- //# sourceMappingURL=ecom-v1-order-orders.universal.js.map