@wix/auto_sdk_ecom_orders 1.0.32 → 1.0.34

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.types.d.ts → ecom-v1-order-orders.universal-UflOyGzD.d.mts} +1109 -637
  2. package/build/{es/src/ecom-v1-order-orders.types.d.ts → ecom-v1-order-orders.universal-UflOyGzD.d.ts} +1109 -637
  3. package/build/index.d.mts +212 -0
  4. package/build/index.d.ts +212 -0
  5. package/build/index.js +3504 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +3401 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/{cjs/src/ecom-v1-order-orders.universal.d.ts → internal/ecom-v1-order-orders.universal-DkzM7BQ-.d.mts} +957 -1005
  10. package/build/{es/src/ecom-v1-order-orders.universal.d.ts → internal/ecom-v1-order-orders.universal-DkzM7BQ-.d.ts} +957 -1005
  11. package/build/internal/index.d.mts +391 -0
  12. package/build/internal/index.d.ts +391 -0
  13. package/build/internal/index.js +3504 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +3401 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +3192 -0
  18. package/build/internal/meta.d.ts +3192 -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 +3192 -0
  24. package/build/meta.d.ts +3192 -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 +13 -12
  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 -1
  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 -189
  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.js +0 -652
  52. package/build/cjs/src/ecom-v1-order-orders.types.js.map +0 -1
  53. package/build/cjs/src/ecom-v1-order-orders.universal.js +0 -2322
  54. package/build/cjs/src/ecom-v1-order-orders.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/package.json +0 -3
  65. package/build/es/src/ecom-v1-order-orders.context.d.ts +0 -34
  66. package/build/es/src/ecom-v1-order-orders.context.js +0 -62
  67. package/build/es/src/ecom-v1-order-orders.context.js.map +0 -1
  68. package/build/es/src/ecom-v1-order-orders.http.d.ts +0 -200
  69. package/build/es/src/ecom-v1-order-orders.http.js +0 -1582
  70. package/build/es/src/ecom-v1-order-orders.http.js.map +0 -1
  71. package/build/es/src/ecom-v1-order-orders.meta.d.ts +0 -78
  72. package/build/es/src/ecom-v1-order-orders.meta.js +0 -452
  73. package/build/es/src/ecom-v1-order-orders.meta.js.map +0 -1
  74. package/build/es/src/ecom-v1-order-orders.public.d.ts +0 -189
  75. package/build/es/src/ecom-v1-order-orders.public.js +0 -302
  76. package/build/es/src/ecom-v1-order-orders.public.js.map +0 -1
  77. package/build/es/src/ecom-v1-order-orders.types.js +0 -648
  78. package/build/es/src/ecom-v1-order-orders.types.js.map +0 -1
  79. package/build/es/src/ecom-v1-order-orders.universal.js +0 -2270
  80. package/build/es/src/ecom-v1-order-orders.universal.js.map +0 -1
  81. package/build/internal/cjs/index.d.ts +0 -1
  82. package/build/internal/cjs/index.js +0 -18
  83. package/build/internal/cjs/index.js.map +0 -1
  84. package/build/internal/cjs/index.typings.d.ts +0 -1
  85. package/build/internal/cjs/index.typings.js +0 -18
  86. package/build/internal/cjs/index.typings.js.map +0 -1
  87. package/build/internal/cjs/meta.d.ts +0 -1
  88. package/build/internal/cjs/meta.js +0 -18
  89. package/build/internal/cjs/meta.js.map +0 -1
  90. package/build/internal/cjs/src/ecom-v1-order-orders.context.d.ts +0 -62
  91. package/build/internal/cjs/src/ecom-v1-order-orders.context.js +0 -117
  92. package/build/internal/cjs/src/ecom-v1-order-orders.context.js.map +0 -1
  93. package/build/internal/cjs/src/ecom-v1-order-orders.http.d.ts +0 -200
  94. package/build/internal/cjs/src/ecom-v1-order-orders.http.js +0 -1610
  95. package/build/internal/cjs/src/ecom-v1-order-orders.http.js.map +0 -1
  96. package/build/internal/cjs/src/ecom-v1-order-orders.meta.d.ts +0 -78
  97. package/build/internal/cjs/src/ecom-v1-order-orders.meta.js +0 -503
  98. package/build/internal/cjs/src/ecom-v1-order-orders.meta.js.map +0 -1
  99. package/build/internal/cjs/src/ecom-v1-order-orders.public.d.ts +0 -340
  100. package/build/internal/cjs/src/ecom-v1-order-orders.public.js +0 -382
  101. package/build/internal/cjs/src/ecom-v1-order-orders.public.js.map +0 -1
  102. package/build/internal/cjs/src/ecom-v1-order-orders.types.d.ts +0 -6096
  103. package/build/internal/cjs/src/ecom-v1-order-orders.types.js +0 -652
  104. package/build/internal/cjs/src/ecom-v1-order-orders.types.js.map +0 -1
  105. package/build/internal/cjs/src/ecom-v1-order-orders.universal.d.ts +0 -7782
  106. package/build/internal/cjs/src/ecom-v1-order-orders.universal.js +0 -2322
  107. package/build/internal/cjs/src/ecom-v1-order-orders.universal.js.map +0 -1
  108. package/build/internal/es/index.d.ts +0 -1
  109. package/build/internal/es/index.js +0 -2
  110. package/build/internal/es/index.js.map +0 -1
  111. package/build/internal/es/index.typings.d.ts +0 -1
  112. package/build/internal/es/index.typings.js +0 -2
  113. package/build/internal/es/index.typings.js.map +0 -1
  114. package/build/internal/es/meta.d.ts +0 -1
  115. package/build/internal/es/meta.js +0 -2
  116. package/build/internal/es/meta.js.map +0 -1
  117. package/build/internal/es/src/ecom-v1-order-orders.context.d.ts +0 -62
  118. package/build/internal/es/src/ecom-v1-order-orders.context.js +0 -62
  119. package/build/internal/es/src/ecom-v1-order-orders.context.js.map +0 -1
  120. package/build/internal/es/src/ecom-v1-order-orders.http.d.ts +0 -200
  121. package/build/internal/es/src/ecom-v1-order-orders.http.js +0 -1582
  122. package/build/internal/es/src/ecom-v1-order-orders.http.js.map +0 -1
  123. package/build/internal/es/src/ecom-v1-order-orders.meta.d.ts +0 -78
  124. package/build/internal/es/src/ecom-v1-order-orders.meta.js +0 -452
  125. package/build/internal/es/src/ecom-v1-order-orders.meta.js.map +0 -1
  126. package/build/internal/es/src/ecom-v1-order-orders.public.d.ts +0 -340
  127. package/build/internal/es/src/ecom-v1-order-orders.public.js +0 -302
  128. package/build/internal/es/src/ecom-v1-order-orders.public.js.map +0 -1
  129. package/build/internal/es/src/ecom-v1-order-orders.types.d.ts +0 -6096
  130. package/build/internal/es/src/ecom-v1-order-orders.types.js +0 -648
  131. package/build/internal/es/src/ecom-v1-order-orders.types.js.map +0 -1
  132. package/build/internal/es/src/ecom-v1-order-orders.universal.d.ts +0 -7782
  133. package/build/internal/es/src/ecom-v1-order-orders.universal.js +0 -2270
  134. package/build/internal/es/src/ecom-v1-order-orders.universal.js.map +0 -1
@@ -1,2322 +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 Restaurants - all permissions
698
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
699
- * @permissionScope Picasso private app mega scope
700
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
701
- * @applicableIdentity APP
702
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.PreparePaymentCollection
703
- */
704
- async function preparePaymentCollection(ecomOrderId, amount, options) {
705
- // @ts-ignore
706
- const { httpClient, sideEffects } = arguments[3];
707
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
708
- ecomOrderId: ecomOrderId,
709
- amount: amount,
710
- paymentGatewayOrderId: options?.paymentGatewayOrderId,
711
- delayedCapture: options?.delayedCapture,
712
- delayedCaptureSettings: options?.delayedCaptureSettings,
713
- });
714
- const reqOpts = ambassadorWixEcomV1Order.preparePaymentCollection(payload);
715
- sideEffects?.onSiteCall?.();
716
- try {
717
- const result = await httpClient.request(reqOpts);
718
- sideEffects?.onSuccess?.(result);
719
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
720
- }
721
- catch (err) {
722
- const transformedError = (0, transform_error_1.transformError)(err, {
723
- spreadPathsToArguments: {},
724
- explicitPathsToArguments: {
725
- ecomOrderId: '$[0]',
726
- amount: '$[1]',
727
- paymentGatewayOrderId: '$[2].paymentGatewayOrderId',
728
- delayedCapture: '$[2].delayedCapture',
729
- delayedCaptureSettings: '$[2].delayedCaptureSettings',
730
- },
731
- singleArgumentUnchanged: false,
732
- }, ['ecomOrderId', 'amount', 'options']);
733
- sideEffects?.onError?.(err);
734
- throw transformedError;
735
- }
736
- }
737
- exports.preparePaymentCollection = preparePaymentCollection;
738
- /**
739
- * Provides payment collectability status for given order. If payment collection is possible
740
- * response will contain collectable amount for given ecom order. If not - response will contain
741
- * reason why payment collection is not possible.
742
- * @param ecomOrderId - Ecom order ID.
743
- * @public
744
- * @documentationMaturity preview
745
- * @requiredField ecomOrderId
746
- * @permissionId ECOM.COLLECT_PAYMENTS
747
- * @permissionScope Manage Restaurants - all permissions
748
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
749
- * @permissionScope Picasso private app mega scope
750
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
751
- * @applicableIdentity APP
752
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.GetPaymentCollectabilityStatus
753
- */
754
- async function getPaymentCollectabilityStatus(ecomOrderId) {
755
- // @ts-ignore
756
- const { httpClient, sideEffects } = arguments[1];
757
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
758
- ecomOrderId: ecomOrderId,
759
- });
760
- const reqOpts = ambassadorWixEcomV1Order.getPaymentCollectabilityStatus(payload);
761
- sideEffects?.onSiteCall?.();
762
- try {
763
- const result = await httpClient.request(reqOpts);
764
- sideEffects?.onSuccess?.(result);
765
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
766
- }
767
- catch (err) {
768
- const transformedError = (0, transform_error_1.transformError)(err, {
769
- spreadPathsToArguments: {},
770
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
771
- singleArgumentUnchanged: false,
772
- }, ['ecomOrderId']);
773
- sideEffects?.onError?.(err);
774
- throw transformedError;
775
- }
776
- }
777
- exports.getPaymentCollectabilityStatus = getPaymentCollectabilityStatus;
778
- /**
779
- * Records and approves new manual payment with provided custom amount on given order.
780
- * Existing pending payments are ignored.
781
- * 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)
782
- * @param orderId - Order ID.
783
- * @param amount - Amount to be recorded as approved manual payment for given order
784
- * @internal
785
- * @documentationMaturity preview
786
- * @requiredField amount
787
- * @requiredField orderId
788
- * @permissionId ECOM.COLLECT_PAYMENTS
789
- * @permissionScope Manage Restaurants - all permissions
790
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
791
- * @permissionScope Picasso private app mega scope
792
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
793
- * @applicableIdentity APP
794
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.RecordManuallyCollectedPayment
795
- */
796
- async function recordManuallyCollectedPayment(orderId, amount) {
797
- // @ts-ignore
798
- const { httpClient, sideEffects } = arguments[2];
799
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
800
- orderId: orderId,
801
- amount: amount,
802
- });
803
- const reqOpts = ambassadorWixEcomV1Order.recordManuallyCollectedPayment(payload);
804
- sideEffects?.onSiteCall?.();
805
- try {
806
- const result = await httpClient.request(reqOpts);
807
- sideEffects?.onSuccess?.(result);
808
- }
809
- catch (err) {
810
- const transformedError = (0, transform_error_1.transformError)(err, {
811
- spreadPathsToArguments: {},
812
- explicitPathsToArguments: { orderId: '$[0]', amount: '$[1]' },
813
- singleArgumentUnchanged: false,
814
- }, ['orderId', 'amount']);
815
- sideEffects?.onError?.(err);
816
- throw transformedError;
817
- }
818
- }
819
- exports.recordManuallyCollectedPayment = recordManuallyCollectedPayment;
820
- /**
821
- * Marks the order as paid. `order.paymentStatus` field *eventually* changes to `PAID`.
822
- * In case the order already has an offline payment transaction associated with it
823
- * (usually when manual payment method is chosen at checkout) - This transaction will become approved.
824
- * In case the order has no payment transactions associated with it
825
- * (usually when the item is set to be paid offline after checkout or when an order is created from the backoffice) - A payment transaction
826
- * will be created and approved.
827
- * @param ecomOrderId - Ecom order ID.
828
- * @internal
829
- * @documentationMaturity preview
830
- * @requiredField ecomOrderId
831
- * @permissionId ECOM.MODIFY_ORDERS
832
- * @permissionScope Manage Stores - all permissions
833
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
834
- * @permissionScope Manage Restaurants - all permissions
835
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
836
- * @permissionScope Manage eCommerce - all permissions
837
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
838
- * @permissionScope Picasso private app mega scope
839
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
840
- * @permissionScope Manage Orders
841
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
842
- * @applicableIdentity APP
843
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.MarkOrderAsPaid
844
- */
845
- async function paymentCollectionMarkOrderAsPaid(ecomOrderId) {
846
- // @ts-ignore
847
- const { httpClient, sideEffects } = arguments[1];
848
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
849
- ecomOrderId: ecomOrderId,
850
- });
851
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionMarkOrderAsPaid(payload);
852
- sideEffects?.onSiteCall?.();
853
- try {
854
- const result = await httpClient.request(reqOpts);
855
- sideEffects?.onSuccess?.(result);
856
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
857
- {
858
- transformFn: image_2.transformRESTImageToSDKImage,
859
- paths: [{ path: 'order.lineItems.image' }],
860
- },
861
- {
862
- transformFn: address_2.transformRESTAddressToSDKAddress,
863
- paths: [
864
- { path: 'order.billingInfo.address' },
865
- {
866
- path: 'order.shippingInfo.logistics.shippingDestination.address',
867
- },
868
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
869
- { path: 'order.recipientInfo.address' },
870
- ],
871
- },
872
- ]));
873
- }
874
- catch (err) {
875
- const transformedError = (0, transform_error_1.transformError)(err, {
876
- spreadPathsToArguments: {},
877
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
878
- singleArgumentUnchanged: false,
879
- }, ['ecomOrderId']);
880
- sideEffects?.onError?.(err);
881
- throw transformedError;
882
- }
883
- }
884
- exports.paymentCollectionMarkOrderAsPaid = paymentCollectionMarkOrderAsPaid;
885
- /**
886
- * Marks multiple orders as paid. `order.paymentStatus` field *eventually* changes to `PAID`.
887
- * @param ecomOrderIds - IDs of orders to mark as paid.
888
- * @internal
889
- * @documentationMaturity preview
890
- * @requiredField ecomOrderIds
891
- * @permissionId ECOM.MODIFY_ORDERS
892
- * @permissionScope Manage Stores - all permissions
893
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
894
- * @permissionScope Manage Restaurants - all permissions
895
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
896
- * @permissionScope Manage eCommerce - all permissions
897
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
898
- * @permissionScope Picasso private app mega scope
899
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
900
- * @permissionScope Manage Orders
901
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
902
- * @applicableIdentity APP
903
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.BulkMarkOrdersAsPaid
904
- */
905
- async function paymentCollectionBulkMarkOrdersAsPaid(ecomOrderIds) {
906
- // @ts-ignore
907
- const { httpClient, sideEffects } = arguments[1];
908
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
909
- ecomOrderIds: ecomOrderIds,
910
- });
911
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionBulkMarkOrdersAsPaid(payload);
912
- sideEffects?.onSiteCall?.();
913
- try {
914
- const result = await httpClient.request(reqOpts);
915
- sideEffects?.onSuccess?.(result);
916
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
917
- {
918
- transformFn: image_2.transformRESTImageToSDKImage,
919
- paths: [{ path: 'results.item.lineItems.image' }],
920
- },
921
- {
922
- transformFn: address_2.transformRESTAddressToSDKAddress,
923
- paths: [
924
- { path: 'results.item.billingInfo.address' },
925
- {
926
- path: 'results.item.shippingInfo.logistics.shippingDestination.address',
927
- },
928
- {
929
- path: 'results.item.shippingInfo.logistics.pickupDetails.address',
930
- },
931
- { path: 'results.item.recipientInfo.address' },
932
- ],
933
- },
934
- ]));
935
- }
936
- catch (err) {
937
- const transformedError = (0, transform_error_1.transformError)(err, {
938
- spreadPathsToArguments: {},
939
- explicitPathsToArguments: { ecomOrderIds: '$[0]' },
940
- singleArgumentUnchanged: false,
941
- }, ['ecomOrderIds']);
942
- sideEffects?.onError?.(err);
943
- throw transformedError;
944
- }
945
- }
946
- exports.paymentCollectionBulkMarkOrdersAsPaid = paymentCollectionBulkMarkOrdersAsPaid;
947
- /**
948
- * Checks whether this order can be refunded.
949
- * @param ecomOrderId - Order ID.
950
- * @internal
951
- * @documentationMaturity preview
952
- * @requiredField ecomOrderId
953
- * @permissionId ECOM.READ_TRANSACTIONS
954
- * @permissionScope Manage Stores - all permissions
955
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
956
- * @permissionScope Read eCommerce - all read permissions
957
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
958
- * @permissionScope Read Orders
959
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
960
- * @permissionScope Read Stores - all read permissions
961
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
962
- * @permissionScope Manage Restaurants - all permissions
963
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
964
- * @permissionScope Manage eCommerce - all permissions
965
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
966
- * @permissionScope Picasso private app mega scope
967
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
968
- * @permissionScope Manage Orders
969
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
970
- * @applicableIdentity APP
971
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.GetRefundabilityStatus
972
- */
973
- async function getRefundabilityStatus(ecomOrderId) {
974
- // @ts-ignore
975
- const { httpClient, sideEffects } = arguments[1];
976
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
977
- ecomOrderId: ecomOrderId,
978
- });
979
- const reqOpts = ambassadorWixEcomV1Order.getRefundabilityStatus(payload);
980
- sideEffects?.onSiteCall?.();
981
- try {
982
- const result = await httpClient.request(reqOpts);
983
- sideEffects?.onSuccess?.(result);
984
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
985
- }
986
- catch (err) {
987
- const transformedError = (0, transform_error_1.transformError)(err, {
988
- spreadPathsToArguments: {},
989
- explicitPathsToArguments: { ecomOrderId: '$[0]' },
990
- singleArgumentUnchanged: false,
991
- }, ['ecomOrderId']);
992
- sideEffects?.onError?.(err);
993
- throw transformedError;
994
- }
995
- }
996
- exports.getRefundabilityStatus = getRefundabilityStatus;
997
- /**
998
- * Call this endpoint to create an order in the payment gateway system. The amount of the order would be either:
999
- * 1. An explicit amount provided in the request, or;
1000
- * 2. If an explicit amount is not provided - the remaining amount to complete the payment of that eCom order.
1001
- * As a result, an ID of the created payment gateway order would be returned.
1002
- * 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).
1003
- * @param ecomOrderId - Ecom order ID.
1004
- * @internal
1005
- * @documentationMaturity preview
1006
- * @requiredField ecomOrderId
1007
- * @permissionId ECOM.MODIFY_ORDERS
1008
- * @permissionScope Manage Stores - all permissions
1009
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1010
- * @permissionScope Manage Restaurants - all permissions
1011
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1012
- * @permissionScope Manage eCommerce - all permissions
1013
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1014
- * @permissionScope Picasso private app mega scope
1015
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1016
- * @permissionScope Manage Orders
1017
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1018
- * @applicableIdentity APP
1019
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.CreatePaymentGatewayOrder
1020
- */
1021
- async function paymentCollectionCreatePaymentGatewayOrder(ecomOrderId, options) {
1022
- // @ts-ignore
1023
- const { httpClient, sideEffects } = arguments[2];
1024
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1025
- ecomOrderId: ecomOrderId,
1026
- chargedBy: options?.chargedBy,
1027
- });
1028
- const reqOpts = ambassadorWixEcomV1Order.paymentCollectionCreatePaymentGatewayOrder(payload);
1029
- sideEffects?.onSiteCall?.();
1030
- try {
1031
- const result = await httpClient.request(reqOpts);
1032
- sideEffects?.onSuccess?.(result);
1033
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1034
- }
1035
- catch (err) {
1036
- const transformedError = (0, transform_error_1.transformError)(err, {
1037
- spreadPathsToArguments: {},
1038
- explicitPathsToArguments: {
1039
- ecomOrderId: '$[0]',
1040
- chargedBy: '$[1].chargedBy',
1041
- },
1042
- singleArgumentUnchanged: false,
1043
- }, ['ecomOrderId', 'options']);
1044
- sideEffects?.onError?.(err);
1045
- throw transformedError;
1046
- }
1047
- }
1048
- exports.paymentCollectionCreatePaymentGatewayOrder = paymentCollectionCreatePaymentGatewayOrder;
1049
- /** @param ecomOrderId - Order ID.
1050
- * @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
1051
- * but a user which is using the membership on behalf of the a member
1052
- * @internal
1053
- * @documentationMaturity preview
1054
- * @requiredField ecomOrderId
1055
- * @requiredField memberId
1056
- * @requiredField options.membershipCharges.appId
1057
- * @requiredField options.membershipCharges.catalogReference
1058
- * @requiredField options.membershipCharges.catalogReference.appId
1059
- * @requiredField options.membershipCharges.catalogReference.catalogItemId
1060
- * @requiredField options.membershipCharges.membershipId
1061
- * @requiredField options.membershipCharges.membershipName
1062
- * @requiredField options.membershipCharges.membershipName.original
1063
- * @requiredField options.membershipCharges.rootCatalogItemId
1064
- * @permissionId ECOM.MODIFY_TRANSACTIONS
1065
- * @permissionScope Manage Stores - all permissions
1066
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1067
- * @permissionScope Manage Restaurants - all permissions
1068
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1069
- * @permissionScope Manage eCommerce - all permissions
1070
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1071
- * @permissionScope Picasso private app mega scope
1072
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1073
- * @permissionScope Manage Orders
1074
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1075
- * @applicableIdentity APP
1076
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.ChargeMemberships
1077
- */
1078
- async function chargeMemberships(ecomOrderId, memberId, options) {
1079
- // @ts-ignore
1080
- const { httpClient, sideEffects } = arguments[3];
1081
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1082
- ecomOrderId: ecomOrderId,
1083
- memberId: memberId,
1084
- membershipCharges: options?.membershipCharges,
1085
- });
1086
- const reqOpts = ambassadorWixEcomV1Order.chargeMemberships(payload);
1087
- sideEffects?.onSiteCall?.();
1088
- try {
1089
- const result = await httpClient.request(reqOpts);
1090
- sideEffects?.onSuccess?.(result);
1091
- }
1092
- catch (err) {
1093
- const transformedError = (0, transform_error_1.transformError)(err, {
1094
- spreadPathsToArguments: {},
1095
- explicitPathsToArguments: {
1096
- ecomOrderId: '$[0]',
1097
- memberId: '$[1]',
1098
- membershipCharges: '$[2].membershipCharges',
1099
- },
1100
- singleArgumentUnchanged: false,
1101
- }, ['ecomOrderId', 'memberId', 'options']);
1102
- sideEffects?.onError?.(err);
1103
- throw transformedError;
1104
- }
1105
- }
1106
- exports.chargeMemberships = chargeMemberships;
1107
- /**
1108
- * Calls corresponding payment providers and creates refund transactions for requested payments.
1109
- * Updates order transactions based on refund results.
1110
- * For requested payments with `TriggerRefundRequest.payments.external_refund = true` will not call payment providers and
1111
- * will only update order transactions.
1112
- * @param ecomOrderId - The order this refund related to
1113
- * @param payments - Refund operations information
1114
- * @internal
1115
- * @documentationMaturity preview
1116
- * @requiredField ecomOrderId
1117
- * @requiredField payments
1118
- * @requiredField payments.paymentId
1119
- * @permissionId ECOM.MODIFY_TRANSACTIONS
1120
- * @permissionScope Manage Stores - all permissions
1121
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1122
- * @permissionScope Manage Restaurants - all permissions
1123
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1124
- * @permissionScope Manage eCommerce - all permissions
1125
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1126
- * @permissionScope Picasso private app mega scope
1127
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1128
- * @permissionScope Manage Orders
1129
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1130
- * @applicableIdentity APP
1131
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.TriggerRefund
1132
- */
1133
- async function triggerRefund(ecomOrderId, payments, options) {
1134
- // @ts-ignore
1135
- const { httpClient, sideEffects } = arguments[3];
1136
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1137
- ecomOrderId: ecomOrderId,
1138
- payments: payments,
1139
- details: options?.details,
1140
- sideEffects: options?.sideEffects,
1141
- });
1142
- const reqOpts = ambassadorWixEcomV1Order.triggerRefund(payload);
1143
- sideEffects?.onSiteCall?.();
1144
- try {
1145
- const result = await httpClient.request(reqOpts);
1146
- sideEffects?.onSuccess?.(result);
1147
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1148
- }
1149
- catch (err) {
1150
- const transformedError = (0, transform_error_1.transformError)(err, {
1151
- spreadPathsToArguments: {},
1152
- explicitPathsToArguments: {
1153
- ecomOrderId: '$[0]',
1154
- payments: '$[1]',
1155
- details: '$[2].details',
1156
- sideEffects: '$[2].sideEffects',
1157
- },
1158
- singleArgumentUnchanged: false,
1159
- }, ['ecomOrderId', 'payments', 'options']);
1160
- sideEffects?.onError?.(err);
1161
- throw transformedError;
1162
- }
1163
- }
1164
- exports.triggerRefund = triggerRefund;
1165
- /**
1166
- * Void authorized payments
1167
- * Transaction statuses for related payments will be updated in async way
1168
- * @param ecomOrderId - Wix eCommerce order ID
1169
- * @param paymentIds - Payment IDs
1170
- * @public
1171
- * @documentationMaturity preview
1172
- * @requiredField ecomOrderId
1173
- * @requiredField paymentIds
1174
- * @permissionId ECOM.ORDER_VOID_AUTHORIZED_PAYMENT
1175
- * @permissionScope Manage Stores - all permissions
1176
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1177
- * @permissionScope Manage Restaurants - all permissions
1178
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1179
- * @permissionScope Manage eCommerce - all permissions
1180
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1181
- * @permissionScope Picasso private app mega scope
1182
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1183
- * @permissionScope Manage Orders
1184
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1185
- * @applicableIdentity APP
1186
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.VoidAuthorizedPayments
1187
- */
1188
- async function voidAuthorizedPayments(ecomOrderId, paymentIds) {
1189
- // @ts-ignore
1190
- const { httpClient, sideEffects } = arguments[2];
1191
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1192
- ecomOrderId: ecomOrderId,
1193
- paymentIds: paymentIds,
1194
- });
1195
- const reqOpts = ambassadorWixEcomV1Order.voidAuthorizedPayments(payload);
1196
- sideEffects?.onSiteCall?.();
1197
- try {
1198
- const result = await httpClient.request(reqOpts);
1199
- sideEffects?.onSuccess?.(result);
1200
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1201
- }
1202
- catch (err) {
1203
- const transformedError = (0, transform_error_1.transformError)(err, {
1204
- spreadPathsToArguments: {},
1205
- explicitPathsToArguments: { ecomOrderId: '$[0]', paymentIds: '$[1]' },
1206
- singleArgumentUnchanged: false,
1207
- }, ['ecomOrderId', 'paymentIds']);
1208
- sideEffects?.onError?.(err);
1209
- throw transformedError;
1210
- }
1211
- }
1212
- exports.voidAuthorizedPayments = voidAuthorizedPayments;
1213
- /**
1214
- * Capture authorized payments
1215
- * Transaction statuses for related payments will be updated in async way
1216
- * @param ecomOrderId - Wix eCommerce order ID
1217
- * @param payments - Capture payments information
1218
- * @public
1219
- * @documentationMaturity preview
1220
- * @requiredField ecomOrderId
1221
- * @requiredField payments
1222
- * @requiredField payments.paymentId
1223
- * @permissionId ECOM.ORDER_CAPTURE_AUTHORIZED_PAYMENT
1224
- * @permissionScope Manage Stores - all permissions
1225
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1226
- * @permissionScope Manage Restaurants - all permissions
1227
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1228
- * @permissionScope Manage eCommerce - all permissions
1229
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1230
- * @permissionScope Picasso private app mega scope
1231
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1232
- * @permissionScope Manage Orders
1233
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1234
- * @applicableIdentity APP
1235
- * @fqn com.wix.ecom.orders.payments_collector.v1.PaymentsCollector.CaptureAuthorizedPayments
1236
- */
1237
- async function captureAuthorizedPayments(ecomOrderId, payments) {
1238
- // @ts-ignore
1239
- const { httpClient, sideEffects } = arguments[2];
1240
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1241
- ecomOrderId: ecomOrderId,
1242
- payments: payments,
1243
- });
1244
- const reqOpts = ambassadorWixEcomV1Order.captureAuthorizedPayments(payload);
1245
- sideEffects?.onSiteCall?.();
1246
- try {
1247
- const result = await httpClient.request(reqOpts);
1248
- sideEffects?.onSuccess?.(result);
1249
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1250
- }
1251
- catch (err) {
1252
- const transformedError = (0, transform_error_1.transformError)(err, {
1253
- spreadPathsToArguments: {},
1254
- explicitPathsToArguments: { ecomOrderId: '$[0]', payments: '$[1]' },
1255
- singleArgumentUnchanged: false,
1256
- }, ['ecomOrderId', 'payments']);
1257
- sideEffects?.onError?.(err);
1258
- throw transformedError;
1259
- }
1260
- }
1261
- exports.captureAuthorizedPayments = captureAuthorizedPayments;
1262
- /**
1263
- * Retrieves an order.
1264
- *
1265
- *
1266
- * The `getOrder()` function returns a Promise that resolves when the specified order is retrieved.
1267
- *
1268
- * 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).
1269
- * @param _id - ID of the order to retrieve.
1270
- * @public
1271
- * @requiredField _id
1272
- * @permissionId ECOM.READ_ORDERS
1273
- * @permissionId ECOM.ORDER_READ_ALL_EXTENDED_FIELDS
1274
- * @permissionScope Manage Stores - all permissions
1275
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1276
- * @permissionScope Read eCommerce - all read permissions
1277
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
1278
- * @permissionScope Read Orders
1279
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
1280
- * @permissionScope Read Stores - all read permissions
1281
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1282
- * @permissionScope Manage Restaurants - all permissions
1283
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1284
- * @permissionScope Manage eCommerce - all permissions
1285
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1286
- * @permissionScope Picasso private app mega scope
1287
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1288
- * @permissionScope Manage Orders
1289
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1290
- * @applicableIdentity APP
1291
- * @returns Fulfilled - The requested order.
1292
- * @fqn com.wix.ecom.orders.v1.Orders.GetOrder
1293
- */
1294
- async function getOrder(_id) {
1295
- // @ts-ignore
1296
- const { httpClient, sideEffects } = arguments[1];
1297
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
1298
- const reqOpts = ambassadorWixEcomV1Order.getOrder(payload);
1299
- sideEffects?.onSiteCall?.();
1300
- try {
1301
- const result = await httpClient.request(reqOpts);
1302
- sideEffects?.onSuccess?.(result);
1303
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1304
- {
1305
- transformFn: image_2.transformRESTImageToSDKImage,
1306
- paths: [{ path: 'order.lineItems.image' }],
1307
- },
1308
- {
1309
- transformFn: address_2.transformRESTAddressToSDKAddress,
1310
- paths: [
1311
- { path: 'order.billingInfo.address' },
1312
- {
1313
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1314
- },
1315
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1316
- { path: 'order.recipientInfo.address' },
1317
- ],
1318
- },
1319
- ]))?.order;
1320
- }
1321
- catch (err) {
1322
- const transformedError = (0, transform_error_1.transformError)(err, {
1323
- spreadPathsToArguments: {},
1324
- explicitPathsToArguments: { id: '$[0]' },
1325
- singleArgumentUnchanged: false,
1326
- }, ['_id']);
1327
- sideEffects?.onError?.(err);
1328
- throw transformedError;
1329
- }
1330
- }
1331
- exports.getOrder = getOrder;
1332
- /**
1333
- * Retrieves a list of orders, given the provided paging, filtering, and sorting.
1334
- *
1335
- *
1336
- * Search Orders runs with these defaults, which you can override:
1337
- *
1338
- * - `createdDate` is sorted in `DESC` order
1339
- * - `cursorPaging.limit` is `100`
1340
- * - `filter: {"status": {"$ne": "INITIALIZED"}}` - other order statuses can be queried, but orders with `status: "INITIALIZED"` are never returned
1341
- *
1342
- * 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).
1343
- *
1344
- * To learn about working with _Search_ endpoints, see
1345
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language), and
1346
- * [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
1347
- * @public
1348
- * @permissionId ECOM.READ_ORDERS
1349
- * @permissionScope Manage Stores - all permissions
1350
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1351
- * @permissionScope Read eCommerce - all read permissions
1352
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
1353
- * @permissionScope Read Orders
1354
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
1355
- * @permissionScope Read Stores - all read permissions
1356
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1357
- * @permissionScope Manage Restaurants - all permissions
1358
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1359
- * @permissionScope Manage eCommerce - all permissions
1360
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1361
- * @permissionScope Picasso private app mega scope
1362
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1363
- * @permissionScope Manage Orders
1364
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1365
- * @applicableIdentity APP
1366
- * @fqn com.wix.ecom.orders.v1.Orders.SearchOrders
1367
- */
1368
- async function searchOrders(options) {
1369
- // @ts-ignore
1370
- const { httpClient, sideEffects } = arguments[1];
1371
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1372
- search: options?.search,
1373
- });
1374
- const reqOpts = ambassadorWixEcomV1Order.searchOrders(payload);
1375
- sideEffects?.onSiteCall?.();
1376
- try {
1377
- const result = await httpClient.request(reqOpts);
1378
- sideEffects?.onSuccess?.(result);
1379
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1380
- {
1381
- transformFn: image_2.transformRESTImageToSDKImage,
1382
- paths: [{ path: 'orders.lineItems.image' }],
1383
- },
1384
- {
1385
- transformFn: address_2.transformRESTAddressToSDKAddress,
1386
- paths: [
1387
- { path: 'orders.billingInfo.address' },
1388
- {
1389
- path: 'orders.shippingInfo.logistics.shippingDestination.address',
1390
- },
1391
- { path: 'orders.shippingInfo.logistics.pickupDetails.address' },
1392
- { path: 'orders.recipientInfo.address' },
1393
- ],
1394
- },
1395
- ]));
1396
- }
1397
- catch (err) {
1398
- const transformedError = (0, transform_error_1.transformError)(err, {
1399
- spreadPathsToArguments: {},
1400
- explicitPathsToArguments: { search: '$[0].search' },
1401
- singleArgumentUnchanged: false,
1402
- }, ['options']);
1403
- sideEffects?.onError?.(err);
1404
- throw transformedError;
1405
- }
1406
- }
1407
- exports.searchOrders = searchOrders;
1408
- /**
1409
- * Creates an order.
1410
- *
1411
- *
1412
- * The `createOrder()` function returns a Promise that resolves when the order is created.
1413
- *
1414
- * > **Notes:**
1415
- * > + If an item is digital - `lineItems[i].itemType.preset: DIGITAL` - then `lineItems[i].digitalFile` must be provided.
1416
- * > + If `lineItems[i].id` is passed, it must be either a valid GUID, or empty.
1417
- * @param order - Order info.
1418
- * @public
1419
- * @requiredField order
1420
- * @requiredField order.billingInfo.contactDetails
1421
- * @requiredField order.channelInfo
1422
- * @requiredField order.currencyConversionDetails.conversionRate
1423
- * @requiredField order.currencyConversionDetails.originalCurrency
1424
- * @requiredField order.lineItems
1425
- * @requiredField order.lineItems.catalogReference.appId
1426
- * @requiredField order.lineItems.catalogReference.catalogItemId
1427
- * @requiredField order.lineItems.itemType
1428
- * @requiredField order.lineItems.price
1429
- * @requiredField order.lineItems.productName
1430
- * @requiredField order.lineItems.productName.original
1431
- * @requiredField order.lineItems.quantity
1432
- * @requiredField order.priceSummary
1433
- * @permissionId ECOM.CREATE_ORDERS
1434
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1435
- * @permissionScope Manage Stores - all permissions
1436
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1437
- * @permissionScope Manage Restaurants - all permissions
1438
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1439
- * @permissionScope Manage eCommerce - all permissions
1440
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1441
- * @permissionScope Picasso private app mega scope
1442
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1443
- * @permissionScope Manage Orders
1444
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1445
- * @applicableIdentity APP
1446
- * @returns Newly created order.
1447
- * @fqn com.wix.ecom.orders.v1.Orders.CreateOrder
1448
- */
1449
- async function createOrder(order, options) {
1450
- // @ts-ignore
1451
- const { httpClient, sideEffects } = arguments[2];
1452
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1453
- order: order,
1454
- settings: options?.settings,
1455
- }), [
1456
- {
1457
- transformFn: image_1.transformSDKImageToRESTImage,
1458
- paths: [{ path: 'order.lineItems.image' }],
1459
- },
1460
- {
1461
- transformFn: address_1.transformSDKAddressToRESTAddress,
1462
- paths: [
1463
- { path: 'order.billingInfo.address' },
1464
- { path: 'order.shippingInfo.logistics.shippingDestination.address' },
1465
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1466
- { path: 'order.recipientInfo.address' },
1467
- ],
1468
- },
1469
- ]);
1470
- const reqOpts = ambassadorWixEcomV1Order.createOrder(payload);
1471
- sideEffects?.onSiteCall?.();
1472
- try {
1473
- const result = await httpClient.request(reqOpts);
1474
- sideEffects?.onSuccess?.(result);
1475
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1476
- {
1477
- transformFn: image_2.transformRESTImageToSDKImage,
1478
- paths: [{ path: 'order.lineItems.image' }],
1479
- },
1480
- {
1481
- transformFn: address_2.transformRESTAddressToSDKAddress,
1482
- paths: [
1483
- { path: 'order.billingInfo.address' },
1484
- {
1485
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1486
- },
1487
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1488
- { path: 'order.recipientInfo.address' },
1489
- ],
1490
- },
1491
- ]))?.order;
1492
- }
1493
- catch (err) {
1494
- const transformedError = (0, transform_error_1.transformError)(err, {
1495
- spreadPathsToArguments: {},
1496
- explicitPathsToArguments: { order: '$[0]', settings: '$[1].settings' },
1497
- singleArgumentUnchanged: false,
1498
- }, ['order', 'options']);
1499
- sideEffects?.onError?.(err);
1500
- throw transformedError;
1501
- }
1502
- }
1503
- exports.createOrder = createOrder;
1504
- /**
1505
- * Updates an order.
1506
- *
1507
- *
1508
- * The `updateOrder()` function returns a Promise that resolves when the specified order's information is updated.
1509
- *
1510
- * Currently, the following fields can be updated:
1511
- * + `order.buyerInfo.email`
1512
- * + `order.buyerLanguage`
1513
- * + `order.weightUnit`
1514
- * + `order.billingInfo.address`
1515
- * + `order.billingInfo.contactDetails`
1516
- * + `order.archived`
1517
- * + `order.attributionSource`
1518
- * + `order.seenByAHuman`
1519
- * + `order.recipientInfo.address`
1520
- * + `order.recipientInfo.contactDetails`
1521
- * + `order.shippingInfo.logistics.shippingDestination.address`
1522
- * + `order.shippingInfo.logistics.shippingDestination.contactDetails`
1523
- *
1524
- * To update a field's value, include the new value in the `order` object in the method parameters.
1525
- * To remove a field's value, pass `null`.
1526
- *
1527
- * > **Note:** Removing `buyerInfo` or `contactDetails` fields results in an error.
1528
- *
1529
- * To update an order's payment status, use [`updatePaymentStatus( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus).
1530
- * @param _id - Order ID.
1531
- * @public
1532
- * @requiredField _id
1533
- * @requiredField order
1534
- * @permissionId ECOM.MODIFY_ORDERS
1535
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1536
- * @permissionScope Manage Stores - all permissions
1537
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1538
- * @permissionScope Manage Restaurants - all permissions
1539
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1540
- * @permissionScope Manage eCommerce - all permissions
1541
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1542
- * @permissionScope Picasso private app mega scope
1543
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1544
- * @permissionScope Manage Orders
1545
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1546
- * @applicableIdentity APP
1547
- * @returns Newly created order.
1548
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrder
1549
- */
1550
- async function updateOrder(_id, order) {
1551
- // @ts-ignore
1552
- const { httpClient, sideEffects } = arguments[2];
1553
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ order: { ...order, id: _id } }), [
1554
- {
1555
- transformFn: image_1.transformSDKImageToRESTImage,
1556
- paths: [{ path: 'order.lineItems.image' }],
1557
- },
1558
- {
1559
- transformFn: address_1.transformSDKAddressToRESTAddress,
1560
- paths: [
1561
- { path: 'order.billingInfo.address' },
1562
- { path: 'order.shippingInfo.logistics.shippingDestination.address' },
1563
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1564
- { path: 'order.recipientInfo.address' },
1565
- ],
1566
- },
1567
- ]);
1568
- const reqOpts = ambassadorWixEcomV1Order.updateOrder(payload);
1569
- sideEffects?.onSiteCall?.();
1570
- try {
1571
- const result = await httpClient.request(reqOpts);
1572
- sideEffects?.onSuccess?.(result);
1573
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1574
- {
1575
- transformFn: image_2.transformRESTImageToSDKImage,
1576
- paths: [{ path: 'order.lineItems.image' }],
1577
- },
1578
- {
1579
- transformFn: address_2.transformRESTAddressToSDKAddress,
1580
- paths: [
1581
- { path: 'order.billingInfo.address' },
1582
- {
1583
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1584
- },
1585
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1586
- { path: 'order.recipientInfo.address' },
1587
- ],
1588
- },
1589
- ]))?.order;
1590
- }
1591
- catch (err) {
1592
- const transformedError = (0, transform_error_1.transformError)(err, {
1593
- spreadPathsToArguments: { order: '$[1]' },
1594
- explicitPathsToArguments: { 'order.id': '$[0]' },
1595
- singleArgumentUnchanged: false,
1596
- }, ['_id', 'order']);
1597
- sideEffects?.onError?.(err);
1598
- throw transformedError;
1599
- }
1600
- }
1601
- exports.updateOrder = updateOrder;
1602
- /**
1603
- * Updates up to 100 orders.
1604
- *
1605
- *
1606
- * The `bulkUpdateOrders()` function returns a Promise that resolves when the specified orders' information is updated.
1607
- *
1608
- * Currently, the following fields can be updated:
1609
- * + `order.buyerInfo.email`
1610
- * + `order.buyerLanguage`
1611
- * + `order.weightUnit`
1612
- * + `order.billingInfo.address`
1613
- * + `order.billingInfo.contactDetails`
1614
- * + `order.archived`
1615
- * + `order.attributionSource`
1616
- * + `order.seenByAHuman`
1617
- * + `order.recipientInfo.address`
1618
- * + `order.recipientInfo.contactDetails`
1619
- * + `order.shippingInfo.logistics.shippingDestination.address`
1620
- * + `order.shippingInfo.logistics.shippingDestination.contactDetails`
1621
- *
1622
- * To update a field's value, include the new value in the `orders.order` object in the method parameters.
1623
- * To remove a field's value, pass `null`.
1624
- *
1625
- * > **Note:** Removing `buyerInfo` or `contactDetails` fields results in an error.
1626
- *
1627
- * To update an order's payment status, use [`updatePaymentStatus( )`](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus).
1628
- * @param orders - Orders to update.
1629
- * @public
1630
- * @requiredField orders
1631
- * @requiredField orders.order
1632
- * @requiredField orders.order._id
1633
- * @permissionId ECOM.MODIFY_ORDERS
1634
- * @permissionScope Manage Stores - all permissions
1635
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1636
- * @permissionScope Manage Restaurants - all permissions
1637
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1638
- * @permissionScope Manage eCommerce - all permissions
1639
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1640
- * @permissionScope Picasso private app mega scope
1641
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1642
- * @permissionScope Manage Orders
1643
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1644
- * @applicableIdentity APP
1645
- * @fqn com.wix.ecom.orders.v1.Orders.BulkUpdateOrders
1646
- */
1647
- async function bulkUpdateOrders(orders, options) {
1648
- // @ts-ignore
1649
- const { httpClient, sideEffects } = arguments[2];
1650
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1651
- orders: orders,
1652
- returnEntity: options?.returnEntity,
1653
- }), [
1654
- {
1655
- transformFn: image_1.transformSDKImageToRESTImage,
1656
- paths: [{ path: 'orders.order.lineItems.image' }],
1657
- },
1658
- {
1659
- transformFn: address_1.transformSDKAddressToRESTAddress,
1660
- paths: [
1661
- { path: 'orders.order.billingInfo.address' },
1662
- {
1663
- path: 'orders.order.shippingInfo.logistics.shippingDestination.address',
1664
- },
1665
- { path: 'orders.order.shippingInfo.logistics.pickupDetails.address' },
1666
- { path: 'orders.order.recipientInfo.address' },
1667
- ],
1668
- },
1669
- ]);
1670
- const reqOpts = ambassadorWixEcomV1Order.bulkUpdateOrders(payload);
1671
- sideEffects?.onSiteCall?.();
1672
- try {
1673
- const result = await httpClient.request(reqOpts);
1674
- sideEffects?.onSuccess?.(result);
1675
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1676
- {
1677
- transformFn: image_2.transformRESTImageToSDKImage,
1678
- paths: [{ path: 'results.item.lineItems.image' }],
1679
- },
1680
- {
1681
- transformFn: address_2.transformRESTAddressToSDKAddress,
1682
- paths: [
1683
- { path: 'results.item.billingInfo.address' },
1684
- {
1685
- path: 'results.item.shippingInfo.logistics.shippingDestination.address',
1686
- },
1687
- {
1688
- path: 'results.item.shippingInfo.logistics.pickupDetails.address',
1689
- },
1690
- { path: 'results.item.recipientInfo.address' },
1691
- ],
1692
- },
1693
- ]));
1694
- }
1695
- catch (err) {
1696
- const transformedError = (0, transform_error_1.transformError)(err, {
1697
- spreadPathsToArguments: {},
1698
- explicitPathsToArguments: {
1699
- orders: '$[0]',
1700
- returnEntity: '$[1].returnEntity',
1701
- },
1702
- singleArgumentUnchanged: false,
1703
- }, ['orders', 'options']);
1704
- sideEffects?.onError?.(err);
1705
- throw transformedError;
1706
- }
1707
- }
1708
- exports.bulkUpdateOrders = bulkUpdateOrders;
1709
- /** @param _id - Order id to be updated
1710
- * @internal
1711
- * @documentationMaturity preview
1712
- * @requiredField _id
1713
- * @requiredField options.changes
1714
- * @requiredField options.changes.priceSummary.subtotal
1715
- * @requiredField options.changes.priceSummary.total
1716
- * @permissionId ECOM.ORDERS_DELTAS_COMMIT
1717
- * @permissionId ECOM.ORDER_WRITE_ALL_EXTENDED_FIELDS
1718
- * @fqn com.wix.ecom.orders.v1.Orders.CommitDeltas
1719
- */
1720
- async function commitDeltas(_id, options) {
1721
- // @ts-ignore
1722
- const { httpClient, sideEffects } = arguments[2];
1723
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1724
- id: _id,
1725
- draftOrderId: options?.draftOrderId,
1726
- changes: options?.changes,
1727
- commitSettings: options?.commitSettings,
1728
- reason: options?.reason,
1729
- }), [
1730
- {
1731
- transformFn: address_1.transformSDKAddressToRESTAddress,
1732
- paths: [
1733
- {
1734
- path: 'changes.changedShippingInfo.logistics.shippingDestination.address',
1735
- },
1736
- {
1737
- path: 'changes.changedShippingInfo.logistics.pickupDetails.address',
1738
- },
1739
- { path: 'changes.changedBillingInfo.address' },
1740
- { path: 'changes.changedRecipientInfo.address' },
1741
- ],
1742
- },
1743
- {
1744
- transformFn: image_1.transformSDKImageToRESTImage,
1745
- paths: [{ path: 'changes.lineItems.lineItem.image' }],
1746
- },
1747
- ]);
1748
- const reqOpts = ambassadorWixEcomV1Order.commitDeltas(payload);
1749
- sideEffects?.onSiteCall?.();
1750
- try {
1751
- const result = await httpClient.request(reqOpts);
1752
- sideEffects?.onSuccess?.(result);
1753
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1754
- {
1755
- transformFn: image_2.transformRESTImageToSDKImage,
1756
- paths: [{ path: 'order.lineItems.image' }],
1757
- },
1758
- {
1759
- transformFn: address_2.transformRESTAddressToSDKAddress,
1760
- paths: [
1761
- { path: 'order.billingInfo.address' },
1762
- {
1763
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1764
- },
1765
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1766
- { path: 'order.recipientInfo.address' },
1767
- ],
1768
- },
1769
- ]));
1770
- }
1771
- catch (err) {
1772
- const transformedError = (0, transform_error_1.transformError)(err, {
1773
- spreadPathsToArguments: {},
1774
- explicitPathsToArguments: {
1775
- id: '$[0]',
1776
- draftOrderId: '$[1].draftOrderId',
1777
- changes: '$[1].changes',
1778
- commitSettings: '$[1].commitSettings',
1779
- reason: '$[1].reason',
1780
- },
1781
- singleArgumentUnchanged: false,
1782
- }, ['_id', 'options']);
1783
- sideEffects?.onError?.(err);
1784
- throw transformedError;
1785
- }
1786
- }
1787
- exports.commitDeltas = commitDeltas;
1788
- /** @internal
1789
- * @documentationMaturity preview
1790
- * @requiredField identifiers
1791
- * @requiredField identifiers._id
1792
- * @requiredField identifiers.lineItemId
1793
- * @requiredField lineItem
1794
- * @permissionId ECOM.MODIFY_ORDERS
1795
- * @permissionScope Manage Stores - all permissions
1796
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1797
- * @permissionScope Manage Restaurants - all permissions
1798
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1799
- * @permissionScope Manage eCommerce - all permissions
1800
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1801
- * @permissionScope Picasso private app mega scope
1802
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1803
- * @permissionScope Manage Orders
1804
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1805
- * @applicableIdentity APP
1806
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrderLineItem
1807
- * @deprecated
1808
- * @targetRemovalDate 2024-02-15
1809
- */
1810
- async function updateOrderLineItem(identifiers, lineItem) {
1811
- // @ts-ignore
1812
- const { httpClient, sideEffects } = arguments[2];
1813
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1814
- id: identifiers?._id,
1815
- lineItem: { ...lineItem, id: identifiers?.lineItemId },
1816
- }), [
1817
- {
1818
- transformFn: image_1.transformSDKImageToRESTImage,
1819
- paths: [{ path: 'lineItem.image' }],
1820
- },
1821
- ]);
1822
- const reqOpts = ambassadorWixEcomV1Order.updateOrderLineItem(payload);
1823
- sideEffects?.onSiteCall?.();
1824
- try {
1825
- const result = await httpClient.request(reqOpts);
1826
- sideEffects?.onSuccess?.(result);
1827
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1828
- {
1829
- transformFn: image_2.transformRESTImageToSDKImage,
1830
- paths: [{ path: 'order.lineItems.image' }],
1831
- },
1832
- {
1833
- transformFn: address_2.transformRESTAddressToSDKAddress,
1834
- paths: [
1835
- { path: 'order.billingInfo.address' },
1836
- {
1837
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1838
- },
1839
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1840
- { path: 'order.recipientInfo.address' },
1841
- ],
1842
- },
1843
- ]));
1844
- }
1845
- catch (err) {
1846
- const transformedError = (0, transform_error_1.transformError)(err, {
1847
- spreadPathsToArguments: { lineItem: '$[1]' },
1848
- explicitPathsToArguments: {
1849
- id: '$[0]._id',
1850
- 'lineItem.id': '$[0].lineItemId',
1851
- },
1852
- singleArgumentUnchanged: false,
1853
- }, ['identifiers', 'lineItem']);
1854
- sideEffects?.onError?.(err);
1855
- throw transformedError;
1856
- }
1857
- }
1858
- exports.updateOrderLineItem = updateOrderLineItem;
1859
- /**
1860
- * Adds a merchant comment to an order.
1861
- * > **Note:** Activities with type CustomActivity not supported
1862
- * @param _id - Order ID.
1863
- * @param activity - Activity info.
1864
- * @internal
1865
- * @documentationMaturity preview
1866
- * @requiredField _id
1867
- * @requiredField activity
1868
- * @permissionId ECOM.MODIFY_ORDERS
1869
- * @permissionScope Manage Stores - all permissions
1870
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1871
- * @permissionScope Manage Restaurants - all permissions
1872
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1873
- * @permissionScope Manage eCommerce - all permissions
1874
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1875
- * @permissionScope Picasso private app mega scope
1876
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1877
- * @permissionScope Manage Orders
1878
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1879
- * @applicableIdentity APP
1880
- * @fqn com.wix.ecom.orders.v1.Orders.AddActivity
1881
- * @deprecated
1882
- * @replacedBy com.wix.ecom.orders.v1.OrdersService.AddActivities
1883
- * @targetRemovalDate 2024-11-01
1884
- */
1885
- async function addActivity(_id, activity) {
1886
- // @ts-ignore
1887
- const { httpClient, sideEffects } = arguments[2];
1888
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1889
- id: _id,
1890
- activity: activity,
1891
- });
1892
- const reqOpts = ambassadorWixEcomV1Order.addActivity(payload);
1893
- sideEffects?.onSiteCall?.();
1894
- try {
1895
- const result = await httpClient.request(reqOpts);
1896
- sideEffects?.onSuccess?.(result);
1897
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1898
- {
1899
- transformFn: image_2.transformRESTImageToSDKImage,
1900
- paths: [{ path: 'order.lineItems.image' }],
1901
- },
1902
- {
1903
- transformFn: address_2.transformRESTAddressToSDKAddress,
1904
- paths: [
1905
- { path: 'order.billingInfo.address' },
1906
- {
1907
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1908
- },
1909
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1910
- { path: 'order.recipientInfo.address' },
1911
- ],
1912
- },
1913
- ]));
1914
- }
1915
- catch (err) {
1916
- const transformedError = (0, transform_error_1.transformError)(err, {
1917
- spreadPathsToArguments: {},
1918
- explicitPathsToArguments: { id: '$[0]', activity: '$[1]' },
1919
- singleArgumentUnchanged: false,
1920
- }, ['_id', 'activity']);
1921
- sideEffects?.onError?.(err);
1922
- throw transformedError;
1923
- }
1924
- }
1925
- exports.addActivity = addActivity;
1926
- /**
1927
- * Updates an order's activity.
1928
- * @param activity - Activity info.
1929
- * @internal
1930
- * @documentationMaturity preview
1931
- * @requiredField activity
1932
- * @requiredField identifiers
1933
- * @requiredField identifiers._id
1934
- * @requiredField identifiers.activityId
1935
- * @permissionId ECOM.MODIFY_ORDERS
1936
- * @permissionScope Manage Stores - all permissions
1937
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1938
- * @permissionScope Manage Restaurants - all permissions
1939
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1940
- * @permissionScope Manage eCommerce - all permissions
1941
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
1942
- * @permissionScope Picasso private app mega scope
1943
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
1944
- * @permissionScope Manage Orders
1945
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1946
- * @applicableIdentity APP
1947
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateActivity
1948
- */
1949
- async function updateActivity(identifiers, activity) {
1950
- // @ts-ignore
1951
- const { httpClient, sideEffects } = arguments[2];
1952
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1953
- id: identifiers?._id,
1954
- activityId: identifiers?.activityId,
1955
- activity: activity,
1956
- });
1957
- const reqOpts = ambassadorWixEcomV1Order.updateActivity(payload);
1958
- sideEffects?.onSiteCall?.();
1959
- try {
1960
- const result = await httpClient.request(reqOpts);
1961
- sideEffects?.onSuccess?.(result);
1962
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1963
- {
1964
- transformFn: image_2.transformRESTImageToSDKImage,
1965
- paths: [{ path: 'order.lineItems.image' }],
1966
- },
1967
- {
1968
- transformFn: address_2.transformRESTAddressToSDKAddress,
1969
- paths: [
1970
- { path: 'order.billingInfo.address' },
1971
- {
1972
- path: 'order.shippingInfo.logistics.shippingDestination.address',
1973
- },
1974
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
1975
- { path: 'order.recipientInfo.address' },
1976
- ],
1977
- },
1978
- ]));
1979
- }
1980
- catch (err) {
1981
- const transformedError = (0, transform_error_1.transformError)(err, {
1982
- spreadPathsToArguments: {},
1983
- explicitPathsToArguments: {
1984
- id: '$[0]._id',
1985
- activityId: '$[0].activityId',
1986
- activity: '$[1]',
1987
- },
1988
- singleArgumentUnchanged: false,
1989
- }, ['identifiers', 'activity']);
1990
- sideEffects?.onError?.(err);
1991
- throw transformedError;
1992
- }
1993
- }
1994
- exports.updateActivity = updateActivity;
1995
- /**
1996
- * Delete's an order's activity.
1997
- *
1998
- * Only custom activities and merchant comments can be deleted.
1999
- * @internal
2000
- * @documentationMaturity preview
2001
- * @requiredField identifiers
2002
- * @requiredField identifiers._id
2003
- * @requiredField identifiers.activityId
2004
- * @permissionId ECOM.MODIFY_ORDERS
2005
- * @permissionScope Manage Stores - all permissions
2006
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2007
- * @permissionScope Manage Restaurants - all permissions
2008
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2009
- * @permissionScope Manage eCommerce - all permissions
2010
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2011
- * @permissionScope Picasso private app mega scope
2012
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2013
- * @permissionScope Manage Orders
2014
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2015
- * @applicableIdentity APP
2016
- * @fqn com.wix.ecom.orders.v1.Orders.DeleteActivity
2017
- */
2018
- async function deleteActivity(identifiers) {
2019
- // @ts-ignore
2020
- const { httpClient, sideEffects } = arguments[1];
2021
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2022
- id: identifiers?._id,
2023
- activityId: identifiers?.activityId,
2024
- });
2025
- const reqOpts = ambassadorWixEcomV1Order.deleteActivity(payload);
2026
- sideEffects?.onSiteCall?.();
2027
- try {
2028
- const result = await httpClient.request(reqOpts);
2029
- sideEffects?.onSuccess?.(result);
2030
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
2031
- {
2032
- transformFn: image_2.transformRESTImageToSDKImage,
2033
- paths: [{ path: 'order.lineItems.image' }],
2034
- },
2035
- {
2036
- transformFn: address_2.transformRESTAddressToSDKAddress,
2037
- paths: [
2038
- { path: 'order.billingInfo.address' },
2039
- {
2040
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2041
- },
2042
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2043
- { path: 'order.recipientInfo.address' },
2044
- ],
2045
- },
2046
- ]));
2047
- }
2048
- catch (err) {
2049
- const transformedError = (0, transform_error_1.transformError)(err, {
2050
- spreadPathsToArguments: {},
2051
- explicitPathsToArguments: {
2052
- id: '$[0]._id',
2053
- activityId: '$[0].activityId',
2054
- },
2055
- singleArgumentUnchanged: false,
2056
- }, ['identifiers']);
2057
- sideEffects?.onError?.(err);
2058
- throw transformedError;
2059
- }
2060
- }
2061
- exports.deleteActivity = deleteActivity;
2062
- /**
2063
- * Cancels an order.
2064
- *
2065
- *
2066
- * The `cancelOrder()` function returns a Promise that resolves when the specified order is canceled and the `order.status` field changes to `CANCELED`.
2067
- * @param _id - Order ID.
2068
- * @public
2069
- * @requiredField _id
2070
- * @permissionId ECOM.MODIFY_ORDERS
2071
- * @permissionScope Manage Stores - all permissions
2072
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2073
- * @permissionScope Manage Restaurants - all permissions
2074
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2075
- * @permissionScope Manage eCommerce - all permissions
2076
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2077
- * @permissionScope Picasso private app mega scope
2078
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2079
- * @permissionScope Manage Orders
2080
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2081
- * @applicableIdentity APP
2082
- * @fqn com.wix.ecom.orders.v1.Orders.CancelOrder
2083
- */
2084
- async function cancelOrder(_id, options) {
2085
- // @ts-ignore
2086
- const { httpClient, sideEffects } = arguments[2];
2087
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2088
- id: _id,
2089
- sendOrderCanceledEmail: options?.sendOrderCanceledEmail,
2090
- customMessage: options?.customMessage,
2091
- restockAllItems: options?.restockAllItems,
2092
- });
2093
- const reqOpts = ambassadorWixEcomV1Order.cancelOrder(payload);
2094
- sideEffects?.onSiteCall?.();
2095
- try {
2096
- const result = await httpClient.request(reqOpts);
2097
- sideEffects?.onSuccess?.(result);
2098
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
2099
- {
2100
- transformFn: image_2.transformRESTImageToSDKImage,
2101
- paths: [{ path: 'order.lineItems.image' }],
2102
- },
2103
- {
2104
- transformFn: address_2.transformRESTAddressToSDKAddress,
2105
- paths: [
2106
- { path: 'order.billingInfo.address' },
2107
- {
2108
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2109
- },
2110
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2111
- { path: 'order.recipientInfo.address' },
2112
- ],
2113
- },
2114
- ]));
2115
- }
2116
- catch (err) {
2117
- const transformedError = (0, transform_error_1.transformError)(err, {
2118
- spreadPathsToArguments: {},
2119
- explicitPathsToArguments: {
2120
- id: '$[0]',
2121
- sendOrderCanceledEmail: '$[1].sendOrderCanceledEmail',
2122
- customMessage: '$[1].customMessage',
2123
- restockAllItems: '$[1].restockAllItems',
2124
- },
2125
- singleArgumentUnchanged: false,
2126
- }, ['_id', 'options']);
2127
- sideEffects?.onError?.(err);
2128
- throw transformedError;
2129
- }
2130
- }
2131
- exports.cancelOrder = cancelOrder;
2132
- /**
2133
- * Updates order status.
2134
- *
2135
- * >CANCELED and REJECTED are final statuses. Update from either of those will fail.
2136
- * >Updates into INITIALIZED are not supported.
2137
- *
2138
- * Approving order:
2139
- * APPROVED status can be set while order has one of [INITIALIZED, PENDING] statuses.
2140
- *
2141
- * Approving an order which was created with CreateOrderRequest.settings.order_approval_strategy = PAYMENT_METHOD_SAVED
2142
- * will cause an error.
2143
- *
2144
- * Setting PENDING status:
2145
- * Only orders in INITIALIZED status can be updated into PENDING.
2146
- * @param orderId - Order ID.
2147
- * @param status - New order status.
2148
- * @internal
2149
- * @documentationMaturity preview
2150
- * @requiredField orderId
2151
- * @requiredField status
2152
- * @permissionId ECOM.ORDER_UPDATE_STATUS
2153
- * @permissionScope Manage Stores - all permissions
2154
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2155
- * @permissionScope Manage Restaurants - all permissions
2156
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2157
- * @permissionScope Manage eCommerce - all permissions
2158
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2159
- * @permissionScope Picasso private app mega scope
2160
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2161
- * @permissionScope Manage Orders
2162
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2163
- * @applicableIdentity APP
2164
- * @fqn com.wix.ecom.orders.v1.Orders.UpdateOrderStatus
2165
- */
2166
- async function updateOrderStatus(orderId, status) {
2167
- // @ts-ignore
2168
- const { httpClient, sideEffects } = arguments[2];
2169
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2170
- orderId: orderId,
2171
- status: status,
2172
- });
2173
- const reqOpts = ambassadorWixEcomV1Order.updateOrderStatus(payload);
2174
- sideEffects?.onSiteCall?.();
2175
- try {
2176
- const result = await httpClient.request(reqOpts);
2177
- sideEffects?.onSuccess?.(result);
2178
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
2179
- {
2180
- transformFn: image_2.transformRESTImageToSDKImage,
2181
- paths: [{ path: 'order.lineItems.image' }],
2182
- },
2183
- {
2184
- transformFn: address_2.transformRESTAddressToSDKAddress,
2185
- paths: [
2186
- { path: 'order.billingInfo.address' },
2187
- {
2188
- path: 'order.shippingInfo.logistics.shippingDestination.address',
2189
- },
2190
- { path: 'order.shippingInfo.logistics.pickupDetails.address' },
2191
- { path: 'order.recipientInfo.address' },
2192
- ],
2193
- },
2194
- ]));
2195
- }
2196
- catch (err) {
2197
- const transformedError = (0, transform_error_1.transformError)(err, {
2198
- spreadPathsToArguments: {},
2199
- explicitPathsToArguments: { orderId: '$[0]', status: '$[1]' },
2200
- singleArgumentUnchanged: false,
2201
- }, ['orderId', 'status']);
2202
- sideEffects?.onError?.(err);
2203
- throw transformedError;
2204
- }
2205
- }
2206
- exports.updateOrderStatus = updateOrderStatus;
2207
- /** @internal
2208
- * @documentationMaturity preview
2209
- * @requiredField options.aggregation
2210
- * @permissionId ECOM.READ_ORDERS
2211
- * @permissionScope Manage Stores - all permissions
2212
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2213
- * @permissionScope Read eCommerce - all read permissions
2214
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
2215
- * @permissionScope Read Orders
2216
- * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
2217
- * @permissionScope Read Stores - all read permissions
2218
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
2219
- * @permissionScope Manage Restaurants - all permissions
2220
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2221
- * @permissionScope Manage eCommerce - all permissions
2222
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2223
- * @permissionScope Picasso private app mega scope
2224
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2225
- * @permissionScope Manage Orders
2226
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2227
- * @applicableIdentity APP
2228
- * @fqn com.wix.ecom.orders.v1.Orders.AggregateOrders
2229
- */
2230
- async function aggregateOrders(options) {
2231
- // @ts-ignore
2232
- const { httpClient, sideEffects } = arguments[1];
2233
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2234
- filter: options?.filter,
2235
- aggregation: options?.aggregation,
2236
- hierarchySeparatorOverride: options?.hierarchySeparatorOverride,
2237
- });
2238
- const reqOpts = ambassadorWixEcomV1Order.aggregateOrders(payload);
2239
- sideEffects?.onSiteCall?.();
2240
- try {
2241
- const result = await httpClient.request(reqOpts);
2242
- sideEffects?.onSuccess?.(result);
2243
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
2244
- }
2245
- catch (err) {
2246
- const transformedError = (0, transform_error_1.transformError)(err, {
2247
- spreadPathsToArguments: {},
2248
- explicitPathsToArguments: {
2249
- filter: '$[0].filter',
2250
- aggregation: '$[0].aggregation',
2251
- hierarchySeparatorOverride: '$[0].hierarchySeparatorOverride',
2252
- },
2253
- singleArgumentUnchanged: false,
2254
- }, ['options']);
2255
- sideEffects?.onError?.(err);
2256
- throw transformedError;
2257
- }
2258
- }
2259
- exports.aggregateOrders = aggregateOrders;
2260
- /**
2261
- * Synchronously update tags on multiple orders, by list of order IDs.
2262
- *
2263
- * > **Note:** If the same tag is passed to both the `assignTags` and `unassignTags` fields, it will be assigned.
2264
- * @param orderIds - IDs of orders to update tags for.
2265
- * @public
2266
- * @requiredField orderIds
2267
- * @permissionId ECOM.MODIFY_ORDERS
2268
- * @permissionId ECOM.ORDER_MODIFY_PRIVATE_TAGS
2269
- * @permissionScope Manage Stores - all permissions
2270
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2271
- * @permissionScope Manage Restaurants - all permissions
2272
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2273
- * @permissionScope Manage eCommerce - all permissions
2274
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2275
- * @permissionScope Picasso private app mega scope
2276
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2277
- * @permissionScope Manage Orders
2278
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2279
- * @permissionScope Manage Stores - all permissions
2280
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
2281
- * @permissionScope Manage Restaurants - all permissions
2282
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2283
- * @permissionScope Manage eCommerce - all permissions
2284
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
2285
- * @permissionScope Picasso private app mega scope
2286
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
2287
- * @permissionScope Manage Orders
2288
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
2289
- * @applicableIdentity APP
2290
- * @fqn com.wix.ecom.orders.v1.Orders.BulkUpdateOrderTags
2291
- */
2292
- async function bulkUpdateOrderTags(orderIds, options) {
2293
- // @ts-ignore
2294
- const { httpClient, sideEffects } = arguments[2];
2295
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
2296
- orderIds: orderIds,
2297
- assignTags: options?.assignTags,
2298
- unassignTags: options?.unassignTags,
2299
- });
2300
- const reqOpts = ambassadorWixEcomV1Order.bulkUpdateOrderTags(payload);
2301
- sideEffects?.onSiteCall?.();
2302
- try {
2303
- const result = await httpClient.request(reqOpts);
2304
- sideEffects?.onSuccess?.(result);
2305
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
2306
- }
2307
- catch (err) {
2308
- const transformedError = (0, transform_error_1.transformError)(err, {
2309
- spreadPathsToArguments: {},
2310
- explicitPathsToArguments: {
2311
- orderIds: '$[0]',
2312
- assignTags: '$[1].assignTags',
2313
- unassignTags: '$[1].unassignTags',
2314
- },
2315
- singleArgumentUnchanged: false,
2316
- }, ['orderIds', 'options']);
2317
- sideEffects?.onError?.(err);
2318
- throw transformedError;
2319
- }
2320
- }
2321
- exports.bulkUpdateOrderTags = bulkUpdateOrderTags;
2322
- //# sourceMappingURL=ecom-v1-order-orders.universal.js.map