@wix/auto_sdk_ecom_cart 1.0.13 → 1.0.14

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-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-BIIZxJYL.d.mts} +504 -269
  2. package/build/{internal/cjs/src/ecom-v1-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-BIIZxJYL.d.ts} +504 -269
  3. package/build/index.d.mts +149 -0
  4. package/build/index.d.ts +149 -0
  5. package/build/index.js +1938 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +1875 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{es/src/ecom-v1-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-CJdmyIWv.d.mts} +668 -269
  10. package/build/{es/src/ecom-v1-cart-cart.types.d.ts → internal/ecom-v1-cart-cart.universal-CJdmyIWv.d.ts} +668 -269
  11. package/build/internal/index.d.mts +160 -0
  12. package/build/internal/index.d.ts +160 -0
  13. package/build/internal/index.js +1938 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +1875 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +2050 -0
  18. package/build/internal/meta.d.ts +2050 -0
  19. package/build/internal/meta.js +1027 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +989 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +2050 -0
  24. package/build/meta.d.ts +2050 -0
  25. package/build/meta.js +1027 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +989 -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-cart-cart.context.d.ts +0 -29
  40. package/build/cjs/src/ecom-v1-cart-cart.context.js +0 -59
  41. package/build/cjs/src/ecom-v1-cart-cart.context.js.map +0 -1
  42. package/build/cjs/src/ecom-v1-cart-cart.http.d.ts +0 -60
  43. package/build/cjs/src/ecom-v1-cart-cart.http.js +0 -818
  44. package/build/cjs/src/ecom-v1-cart-cart.http.js.map +0 -1
  45. package/build/cjs/src/ecom-v1-cart-cart.meta.d.ts +0 -46
  46. package/build/cjs/src/ecom-v1-cart-cart.meta.js +0 -256
  47. package/build/cjs/src/ecom-v1-cart-cart.meta.js.map +0 -1
  48. package/build/cjs/src/ecom-v1-cart-cart.public.d.ts +0 -129
  49. package/build/cjs/src/ecom-v1-cart-cart.public.js +0 -227
  50. package/build/cjs/src/ecom-v1-cart-cart.public.js.map +0 -1
  51. package/build/cjs/src/ecom-v1-cart-cart.types.js +0 -255
  52. package/build/cjs/src/ecom-v1-cart-cart.types.js.map +0 -1
  53. package/build/cjs/src/ecom-v1-cart-cart.universal.d.ts +0 -3263
  54. package/build/cjs/src/ecom-v1-cart-cart.universal.js +0 -1192
  55. package/build/cjs/src/ecom-v1-cart-cart.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/ecom-v1-cart-cart.context.d.ts +0 -29
  67. package/build/es/src/ecom-v1-cart-cart.context.js +0 -31
  68. package/build/es/src/ecom-v1-cart-cart.context.js.map +0 -1
  69. package/build/es/src/ecom-v1-cart-cart.http.d.ts +0 -60
  70. package/build/es/src/ecom-v1-cart-cart.http.js +0 -803
  71. package/build/es/src/ecom-v1-cart-cart.http.js.map +0 -1
  72. package/build/es/src/ecom-v1-cart-cart.meta.d.ts +0 -46
  73. package/build/es/src/ecom-v1-cart-cart.meta.js +0 -218
  74. package/build/es/src/ecom-v1-cart-cart.meta.js.map +0 -1
  75. package/build/es/src/ecom-v1-cart-cart.public.d.ts +0 -129
  76. package/build/es/src/ecom-v1-cart-cart.public.js +0 -187
  77. package/build/es/src/ecom-v1-cart-cart.public.js.map +0 -1
  78. package/build/es/src/ecom-v1-cart-cart.types.js +0 -252
  79. package/build/es/src/ecom-v1-cart-cart.types.js.map +0 -1
  80. package/build/es/src/ecom-v1-cart-cart.universal.d.ts +0 -3263
  81. package/build/es/src/ecom-v1-cart-cart.universal.js +0 -1154
  82. package/build/es/src/ecom-v1-cart-cart.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/ecom-v1-cart-cart.context.d.ts +0 -31
  93. package/build/internal/cjs/src/ecom-v1-cart-cart.context.js +0 -59
  94. package/build/internal/cjs/src/ecom-v1-cart-cart.context.js.map +0 -1
  95. package/build/internal/cjs/src/ecom-v1-cart-cart.http.d.ts +0 -60
  96. package/build/internal/cjs/src/ecom-v1-cart-cart.http.js +0 -818
  97. package/build/internal/cjs/src/ecom-v1-cart-cart.http.js.map +0 -1
  98. package/build/internal/cjs/src/ecom-v1-cart-cart.meta.d.ts +0 -46
  99. package/build/internal/cjs/src/ecom-v1-cart-cart.meta.js +0 -256
  100. package/build/internal/cjs/src/ecom-v1-cart-cart.meta.js.map +0 -1
  101. package/build/internal/cjs/src/ecom-v1-cart-cart.public.d.ts +0 -138
  102. package/build/internal/cjs/src/ecom-v1-cart-cart.public.js +0 -227
  103. package/build/internal/cjs/src/ecom-v1-cart-cart.public.js.map +0 -1
  104. package/build/internal/cjs/src/ecom-v1-cart-cart.types.js +0 -255
  105. package/build/internal/cjs/src/ecom-v1-cart-cart.types.js.map +0 -1
  106. package/build/internal/cjs/src/ecom-v1-cart-cart.universal.d.ts +0 -3457
  107. package/build/internal/cjs/src/ecom-v1-cart-cart.universal.js +0 -1192
  108. package/build/internal/cjs/src/ecom-v1-cart-cart.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/ecom-v1-cart-cart.context.d.ts +0 -31
  119. package/build/internal/es/src/ecom-v1-cart-cart.context.js +0 -31
  120. package/build/internal/es/src/ecom-v1-cart-cart.context.js.map +0 -1
  121. package/build/internal/es/src/ecom-v1-cart-cart.http.d.ts +0 -60
  122. package/build/internal/es/src/ecom-v1-cart-cart.http.js +0 -803
  123. package/build/internal/es/src/ecom-v1-cart-cart.http.js.map +0 -1
  124. package/build/internal/es/src/ecom-v1-cart-cart.meta.d.ts +0 -46
  125. package/build/internal/es/src/ecom-v1-cart-cart.meta.js +0 -218
  126. package/build/internal/es/src/ecom-v1-cart-cart.meta.js.map +0 -1
  127. package/build/internal/es/src/ecom-v1-cart-cart.public.d.ts +0 -138
  128. package/build/internal/es/src/ecom-v1-cart-cart.public.js +0 -187
  129. package/build/internal/es/src/ecom-v1-cart-cart.public.js.map +0 -1
  130. package/build/internal/es/src/ecom-v1-cart-cart.types.js +0 -252
  131. package/build/internal/es/src/ecom-v1-cart-cart.types.js.map +0 -1
  132. package/build/internal/es/src/ecom-v1-cart-cart.universal.d.ts +0 -3457
  133. package/build/internal/es/src/ecom-v1-cart-cart.universal.js +0 -1154
  134. package/build/internal/es/src/ecom-v1-cart-cart.universal.js.map +0 -1
@@ -1,818 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeBusinessLocation = exports.deleteCart = exports.estimateTotals = exports.updateLineItemsQuantity = exports.removeCoupon = exports.createCheckout = exports.removeLineItems = exports.addToCart = exports.getCartByCheckoutId = exports.getCart = exports.updateCart = exports.createCart = void 0;
4
- const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
- const float_1 = require("@wix/sdk-runtime/transformations/float");
6
- const float_2 = require("@wix/sdk-runtime/transformations/float");
7
- const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
8
- const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
9
- const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
10
- const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
11
- const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
12
- function resolveComWixEcomCartApiV1CartServiceUrl(opts) {
13
- const domainToMappings = {
14
- 'api._api_base_domain_': [
15
- {
16
- srcPath: '/cart',
17
- destPath: '',
18
- },
19
- ],
20
- 'www.wixapis.com': [
21
- {
22
- srcPath: '/ecom/v1/carts',
23
- destPath: '/v1/carts',
24
- },
25
- ],
26
- 'www.wixgateway.com': [
27
- {
28
- srcPath: '/ecom/v1/carts',
29
- destPath: '/v1/carts',
30
- },
31
- ],
32
- _: [
33
- {
34
- srcPath: '/_api/ecom-cart',
35
- destPath: '',
36
- },
37
- {
38
- srcPath: '/_api/cart',
39
- destPath: '',
40
- },
41
- {
42
- srcPath: '/ecom/v1/carts',
43
- destPath: '/v1/carts',
44
- },
45
- ],
46
- 'manage._base_domain_': [
47
- {
48
- srcPath: '/ecom/v1/carts',
49
- destPath: '/v1/carts',
50
- },
51
- ],
52
- 'editor._base_domain_': [
53
- {
54
- srcPath: '/_api/ecom-cart',
55
- destPath: '',
56
- },
57
- ],
58
- 'blocks._base_domain_': [
59
- {
60
- srcPath: '/_api/ecom-cart',
61
- destPath: '',
62
- },
63
- ],
64
- 'create.editorx': [
65
- {
66
- srcPath: '/_api/ecom-cart',
67
- destPath: '',
68
- },
69
- ],
70
- '*.dev.wix-code.com': [
71
- {
72
- srcPath: '/_api/ecom-cart',
73
- destPath: '',
74
- },
75
- ],
76
- 'www._base_domain_': [
77
- {
78
- srcPath: '/_api/ecom-cart',
79
- destPath: '',
80
- },
81
- ],
82
- 'bo._base_domain_': [
83
- {
84
- srcPath: '/ecom/v1/carts',
85
- destPath: '/v1/carts',
86
- },
87
- ],
88
- 'wixbo.ai': [
89
- {
90
- srcPath: '/ecom/v1/carts',
91
- destPath: '/v1/carts',
92
- },
93
- ],
94
- 'wix-bo.com': [
95
- {
96
- srcPath: '/ecom/v1/carts',
97
- destPath: '/v1/carts',
98
- },
99
- ],
100
- 'editor.wixapps.net': [
101
- {
102
- srcPath: '/_api/ecom-cart',
103
- destPath: '',
104
- },
105
- ],
106
- };
107
- return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
108
- }
109
- const PACKAGE_NAME = '@wix/auto_sdk_ecom_cart';
110
- /**
111
- * Creates a cart.
112
- *
113
- * > **Note:** When adding catalog line items, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
114
- */
115
- function createCart(payload) {
116
- function __createCart({ host }) {
117
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
118
- {
119
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
120
- paths: [
121
- { path: 'cartInfo.createdDate' },
122
- { path: 'cartInfo.updatedDate' },
123
- { path: 'cartInfo.lineItems.image.urlExpirationDate' },
124
- {
125
- path: 'cartInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
126
- },
127
- { path: 'cartInfo.lineItems.serviceProperties.scheduledDate' },
128
- { path: 'lineItems.image.urlExpirationDate' },
129
- {
130
- path: 'lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
131
- },
132
- { path: 'lineItems.serviceProperties.scheduledDate' },
133
- {
134
- path: 'customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
135
- },
136
- { path: 'customLineItems.serviceProperties.scheduledDate' },
137
- ],
138
- },
139
- {
140
- transformFn: float_1.transformSDKFloatToRESTFloat,
141
- paths: [
142
- { path: 'cartInfo.lineItems.image.focalPoint.x' },
143
- { path: 'cartInfo.lineItems.image.focalPoint.y' },
144
- { path: 'lineItems.image.focalPoint.x' },
145
- { path: 'lineItems.image.focalPoint.y' },
146
- { path: 'cartInfo.lineItems.physicalProperties.weight' },
147
- {
148
- path: 'cartInfo.lineItems.catalogOverrideFields.physicalProperties.weight',
149
- },
150
- { path: 'cartInfo.contactInfo.address.geocode.latitude' },
151
- { path: 'cartInfo.contactInfo.address.geocode.longitude' },
152
- { path: 'lineItems.physicalProperties.weight' },
153
- { path: 'lineItems.catalogOverrideFields.physicalProperties.weight' },
154
- { path: 'customLineItems.physicalProperties.weight' },
155
- ],
156
- },
157
- ]);
158
- const metadata = {
159
- entityFqdn: 'wix.ecom.v1.cart',
160
- method: 'POST',
161
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.CreateCart',
162
- packageName: PACKAGE_NAME,
163
- url: resolveComWixEcomCartApiV1CartServiceUrl({
164
- protoPath: '/v1/carts',
165
- data: serializedData,
166
- host,
167
- }),
168
- data: serializedData,
169
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
170
- {
171
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
172
- paths: [
173
- { path: 'cart.createdDate' },
174
- { path: 'cart.updatedDate' },
175
- { path: 'cart.lineItems.image.urlExpirationDate' },
176
- {
177
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
178
- },
179
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
180
- ],
181
- },
182
- {
183
- transformFn: float_2.transformRESTFloatToSDKFloat,
184
- paths: [
185
- { path: 'cart.lineItems.image.focalPoint.x' },
186
- { path: 'cart.lineItems.image.focalPoint.y' },
187
- { path: 'cart.lineItems.physicalProperties.weight' },
188
- {
189
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
190
- },
191
- { path: 'cart.contactInfo.address.geocode.latitude' },
192
- { path: 'cart.contactInfo.address.geocode.longitude' },
193
- ],
194
- },
195
- ]),
196
- };
197
- return metadata;
198
- }
199
- return __createCart;
200
- }
201
- exports.createCart = createCart;
202
- /**
203
- * Updates a cart's properties.
204
- *
205
- * > **Note:** When updating line items, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
206
- */
207
- function updateCart(payload) {
208
- function __updateCart({ host }) {
209
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
210
- {
211
- transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
212
- paths: [{ path: 'cartFieldmask' }],
213
- },
214
- {
215
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
216
- paths: [
217
- { path: 'cartInfo.createdDate' },
218
- { path: 'cartInfo.updatedDate' },
219
- { path: 'cartInfo.lineItems.image.urlExpirationDate' },
220
- {
221
- path: 'cartInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
222
- },
223
- { path: 'cartInfo.lineItems.serviceProperties.scheduledDate' },
224
- { path: 'lineItems.image.urlExpirationDate' },
225
- {
226
- path: 'lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
227
- },
228
- { path: 'lineItems.serviceProperties.scheduledDate' },
229
- {
230
- path: 'customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
231
- },
232
- { path: 'customLineItems.serviceProperties.scheduledDate' },
233
- ],
234
- },
235
- {
236
- transformFn: float_1.transformSDKFloatToRESTFloat,
237
- paths: [
238
- { path: 'cartInfo.lineItems.image.focalPoint.x' },
239
- { path: 'cartInfo.lineItems.image.focalPoint.y' },
240
- { path: 'lineItems.image.focalPoint.x' },
241
- { path: 'lineItems.image.focalPoint.y' },
242
- { path: 'cartInfo.lineItems.physicalProperties.weight' },
243
- {
244
- path: 'cartInfo.lineItems.catalogOverrideFields.physicalProperties.weight',
245
- },
246
- { path: 'cartInfo.contactInfo.address.geocode.latitude' },
247
- { path: 'cartInfo.contactInfo.address.geocode.longitude' },
248
- { path: 'lineItems.physicalProperties.weight' },
249
- { path: 'lineItems.catalogOverrideFields.physicalProperties.weight' },
250
- { path: 'customLineItems.physicalProperties.weight' },
251
- ],
252
- },
253
- ]);
254
- const metadata = {
255
- entityFqdn: 'wix.ecom.v1.cart',
256
- method: 'PATCH',
257
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.UpdateCart',
258
- packageName: PACKAGE_NAME,
259
- url: resolveComWixEcomCartApiV1CartServiceUrl({
260
- protoPath: '/v1/carts/{cartInfo.id}',
261
- data: serializedData,
262
- host,
263
- }),
264
- data: serializedData,
265
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
266
- {
267
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
268
- paths: [
269
- { path: 'cart.createdDate' },
270
- { path: 'cart.updatedDate' },
271
- { path: 'cart.lineItems.image.urlExpirationDate' },
272
- {
273
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
274
- },
275
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
276
- ],
277
- },
278
- {
279
- transformFn: float_2.transformRESTFloatToSDKFloat,
280
- paths: [
281
- { path: 'cart.lineItems.image.focalPoint.x' },
282
- { path: 'cart.lineItems.image.focalPoint.y' },
283
- { path: 'cart.lineItems.physicalProperties.weight' },
284
- {
285
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
286
- },
287
- { path: 'cart.contactInfo.address.geocode.latitude' },
288
- { path: 'cart.contactInfo.address.geocode.longitude' },
289
- ],
290
- },
291
- ]),
292
- };
293
- return metadata;
294
- }
295
- return __updateCart;
296
- }
297
- exports.updateCart = updateCart;
298
- /** Retrieves a cart. */
299
- function getCart(payload) {
300
- function __getCart({ host }) {
301
- const metadata = {
302
- entityFqdn: 'wix.ecom.v1.cart',
303
- method: 'GET',
304
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.GetCart',
305
- packageName: PACKAGE_NAME,
306
- url: resolveComWixEcomCartApiV1CartServiceUrl({
307
- protoPath: '/v1/carts/{id}',
308
- data: payload,
309
- host,
310
- }),
311
- params: (0, rest_modules_1.toURLSearchParams)(payload),
312
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
313
- {
314
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
315
- paths: [
316
- { path: 'cart.createdDate' },
317
- { path: 'cart.updatedDate' },
318
- { path: 'cart.lineItems.image.urlExpirationDate' },
319
- {
320
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
321
- },
322
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
323
- ],
324
- },
325
- {
326
- transformFn: float_2.transformRESTFloatToSDKFloat,
327
- paths: [
328
- { path: 'cart.lineItems.image.focalPoint.x' },
329
- { path: 'cart.lineItems.image.focalPoint.y' },
330
- { path: 'cart.lineItems.physicalProperties.weight' },
331
- {
332
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
333
- },
334
- { path: 'cart.contactInfo.address.geocode.latitude' },
335
- { path: 'cart.contactInfo.address.geocode.longitude' },
336
- ],
337
- },
338
- ]),
339
- };
340
- return metadata;
341
- }
342
- return __getCart;
343
- }
344
- exports.getCart = getCart;
345
- /** Retrieves the cart associated with a specified checkout. */
346
- function getCartByCheckoutId(payload) {
347
- function __getCartByCheckoutId({ host }) {
348
- const metadata = {
349
- entityFqdn: 'wix.ecom.v1.cart',
350
- method: 'GET',
351
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.GetCartByCheckoutId',
352
- packageName: PACKAGE_NAME,
353
- url: resolveComWixEcomCartApiV1CartServiceUrl({
354
- protoPath: '/v1/carts/by-checkout-id/{id}',
355
- data: payload,
356
- host,
357
- }),
358
- params: (0, rest_modules_1.toURLSearchParams)(payload),
359
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
360
- {
361
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
362
- paths: [
363
- { path: 'cart.createdDate' },
364
- { path: 'cart.updatedDate' },
365
- { path: 'cart.lineItems.image.urlExpirationDate' },
366
- {
367
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
368
- },
369
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
370
- ],
371
- },
372
- {
373
- transformFn: float_2.transformRESTFloatToSDKFloat,
374
- paths: [
375
- { path: 'cart.lineItems.image.focalPoint.x' },
376
- { path: 'cart.lineItems.image.focalPoint.y' },
377
- { path: 'cart.lineItems.physicalProperties.weight' },
378
- {
379
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
380
- },
381
- { path: 'cart.contactInfo.address.geocode.latitude' },
382
- { path: 'cart.contactInfo.address.geocode.longitude' },
383
- ],
384
- },
385
- ]),
386
- };
387
- return metadata;
388
- }
389
- return __getCartByCheckoutId;
390
- }
391
- exports.getCartByCheckoutId = getCartByCheckoutId;
392
- /**
393
- * Adds catalog ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)) line items to a cart.
394
- *
395
- * >**Note:** When adding catalog line items to a cart, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
396
- */
397
- function addToCart(payload) {
398
- function __addToCart({ host }) {
399
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
400
- {
401
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
402
- paths: [
403
- { path: 'lineItems.image.urlExpirationDate' },
404
- {
405
- path: 'lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
406
- },
407
- { path: 'lineItems.serviceProperties.scheduledDate' },
408
- {
409
- path: 'customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
410
- },
411
- { path: 'customLineItems.serviceProperties.scheduledDate' },
412
- ],
413
- },
414
- {
415
- transformFn: float_1.transformSDKFloatToRESTFloat,
416
- paths: [
417
- { path: 'lineItems.image.focalPoint.x' },
418
- { path: 'lineItems.image.focalPoint.y' },
419
- { path: 'lineItems.physicalProperties.weight' },
420
- { path: 'lineItems.catalogOverrideFields.physicalProperties.weight' },
421
- { path: 'customLineItems.physicalProperties.weight' },
422
- ],
423
- },
424
- ]);
425
- const metadata = {
426
- entityFqdn: 'wix.ecom.v1.cart',
427
- method: 'POST',
428
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.AddToCart',
429
- packageName: PACKAGE_NAME,
430
- url: resolveComWixEcomCartApiV1CartServiceUrl({
431
- protoPath: '/v1/carts/{id}/add-to-cart',
432
- data: serializedData,
433
- host,
434
- }),
435
- data: serializedData,
436
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
437
- {
438
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
439
- paths: [
440
- { path: 'cart.createdDate' },
441
- { path: 'cart.updatedDate' },
442
- { path: 'cart.lineItems.image.urlExpirationDate' },
443
- {
444
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
445
- },
446
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
447
- ],
448
- },
449
- {
450
- transformFn: float_2.transformRESTFloatToSDKFloat,
451
- paths: [
452
- { path: 'cart.lineItems.image.focalPoint.x' },
453
- { path: 'cart.lineItems.image.focalPoint.y' },
454
- { path: 'cart.lineItems.physicalProperties.weight' },
455
- {
456
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
457
- },
458
- { path: 'cart.contactInfo.address.geocode.latitude' },
459
- { path: 'cart.contactInfo.address.geocode.longitude' },
460
- ],
461
- },
462
- ]),
463
- };
464
- return metadata;
465
- }
466
- return __addToCart;
467
- }
468
- exports.addToCart = addToCart;
469
- /** Removes line items from a cart. */
470
- function removeLineItems(payload) {
471
- function __removeLineItems({ host }) {
472
- const metadata = {
473
- entityFqdn: 'wix.ecom.v1.cart',
474
- method: 'POST',
475
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.RemoveLineItems',
476
- packageName: PACKAGE_NAME,
477
- url: resolveComWixEcomCartApiV1CartServiceUrl({
478
- protoPath: '/v1/carts/{id}/remove-line-items',
479
- data: payload,
480
- host,
481
- }),
482
- data: payload,
483
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
484
- {
485
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
486
- paths: [
487
- { path: 'cart.createdDate' },
488
- { path: 'cart.updatedDate' },
489
- { path: 'cart.lineItems.image.urlExpirationDate' },
490
- {
491
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
492
- },
493
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
494
- ],
495
- },
496
- {
497
- transformFn: float_2.transformRESTFloatToSDKFloat,
498
- paths: [
499
- { path: 'cart.lineItems.image.focalPoint.x' },
500
- { path: 'cart.lineItems.image.focalPoint.y' },
501
- { path: 'cart.lineItems.physicalProperties.weight' },
502
- {
503
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
504
- },
505
- { path: 'cart.contactInfo.address.geocode.latitude' },
506
- { path: 'cart.contactInfo.address.geocode.longitude' },
507
- ],
508
- },
509
- ]),
510
- };
511
- return metadata;
512
- }
513
- return __removeLineItems;
514
- }
515
- exports.removeLineItems = removeLineItems;
516
- /**
517
- * Creates a checkout from a cart.
518
- *
519
- * If a checkout for the specified cart already exists, that checkout is
520
- * updated with any new information from the cart.
521
- *
522
- * > **Note:** `channelType` is a required field.
523
- */
524
- function createCheckout(payload) {
525
- function __createCheckout({ host }) {
526
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
527
- {
528
- transformFn: float_1.transformSDKFloatToRESTFloat,
529
- paths: [
530
- { path: 'shippingAddress.geocode.latitude' },
531
- { path: 'shippingAddress.geocode.longitude' },
532
- { path: 'billingAddress.geocode.latitude' },
533
- { path: 'billingAddress.geocode.longitude' },
534
- ],
535
- },
536
- ]);
537
- const metadata = {
538
- entityFqdn: 'wix.ecom.v1.cart',
539
- method: 'POST',
540
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.CreateCheckout',
541
- packageName: PACKAGE_NAME,
542
- url: resolveComWixEcomCartApiV1CartServiceUrl({
543
- protoPath: '/v1/carts/{id}/create-checkout',
544
- data: serializedData,
545
- host,
546
- }),
547
- data: serializedData,
548
- };
549
- return metadata;
550
- }
551
- return __createCheckout;
552
- }
553
- exports.createCheckout = createCheckout;
554
- /** Removes the coupon from a cart. */
555
- function removeCoupon(payload) {
556
- function __removeCoupon({ host }) {
557
- const metadata = {
558
- entityFqdn: 'wix.ecom.v1.cart',
559
- method: 'POST',
560
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.RemoveCoupon',
561
- packageName: PACKAGE_NAME,
562
- url: resolveComWixEcomCartApiV1CartServiceUrl({
563
- protoPath: '/v1/carts/{id}/remove-coupon',
564
- data: payload,
565
- host,
566
- }),
567
- data: payload,
568
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
569
- {
570
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
571
- paths: [
572
- { path: 'cart.createdDate' },
573
- { path: 'cart.updatedDate' },
574
- { path: 'cart.lineItems.image.urlExpirationDate' },
575
- {
576
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
577
- },
578
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
579
- ],
580
- },
581
- {
582
- transformFn: float_2.transformRESTFloatToSDKFloat,
583
- paths: [
584
- { path: 'cart.lineItems.image.focalPoint.x' },
585
- { path: 'cart.lineItems.image.focalPoint.y' },
586
- { path: 'cart.lineItems.physicalProperties.weight' },
587
- {
588
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
589
- },
590
- { path: 'cart.contactInfo.address.geocode.latitude' },
591
- { path: 'cart.contactInfo.address.geocode.longitude' },
592
- ],
593
- },
594
- ]),
595
- };
596
- return metadata;
597
- }
598
- return __removeCoupon;
599
- }
600
- exports.removeCoupon = removeCoupon;
601
- /**
602
- * Updates the quantity of one or more line items in a cart.
603
- *
604
- * This method is only for updating the quantity of line items.
605
- * To entirely remove a line item from the cart, use Remove Line Items.
606
- * To add a new line item to the cart, use Add To Cart.
607
- *
608
- * This method checks the amount of stock remaining for this line item.
609
- * If the specified quantity is greater than the remaining stock,
610
- * then the quantity returned in the response is the total amount of remaining stock.
611
- */
612
- function updateLineItemsQuantity(payload) {
613
- function __updateLineItemsQuantity({ host }) {
614
- const metadata = {
615
- entityFqdn: 'wix.ecom.v1.cart',
616
- method: 'POST',
617
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.UpdateLineItemsQuantity',
618
- packageName: PACKAGE_NAME,
619
- url: resolveComWixEcomCartApiV1CartServiceUrl({
620
- protoPath: '/v1/carts/{id}/update-line-items-quantity',
621
- data: payload,
622
- host,
623
- }),
624
- data: payload,
625
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
626
- {
627
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
628
- paths: [
629
- { path: 'cart.createdDate' },
630
- { path: 'cart.updatedDate' },
631
- { path: 'cart.lineItems.image.urlExpirationDate' },
632
- {
633
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
634
- },
635
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
636
- ],
637
- },
638
- {
639
- transformFn: float_2.transformRESTFloatToSDKFloat,
640
- paths: [
641
- { path: 'cart.lineItems.image.focalPoint.x' },
642
- { path: 'cart.lineItems.image.focalPoint.y' },
643
- { path: 'cart.lineItems.physicalProperties.weight' },
644
- {
645
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
646
- },
647
- { path: 'cart.contactInfo.address.geocode.latitude' },
648
- { path: 'cart.contactInfo.address.geocode.longitude' },
649
- ],
650
- },
651
- ]),
652
- };
653
- return metadata;
654
- }
655
- return __updateLineItemsQuantity;
656
- }
657
- exports.updateLineItemsQuantity = updateLineItemsQuantity;
658
- /**
659
- * Estimates the subtotal and total for current site visitor’s cart.
660
- *
661
- * Totals include tax and are based on the selected carrier service, shipping address, and billing information.
662
- *
663
- * > **Note:** Not passing any optional parameters will only estimate the cart items price totals.
664
- */
665
- function estimateTotals(payload) {
666
- function __estimateTotals({ host }) {
667
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
668
- {
669
- transformFn: float_1.transformSDKFloatToRESTFloat,
670
- paths: [
671
- { path: 'shippingAddress.geocode.latitude' },
672
- { path: 'shippingAddress.geocode.longitude' },
673
- { path: 'billingAddress.geocode.latitude' },
674
- { path: 'billingAddress.geocode.longitude' },
675
- ],
676
- },
677
- ]);
678
- const metadata = {
679
- entityFqdn: 'wix.ecom.v1.cart',
680
- method: 'POST',
681
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.EstimateTotals',
682
- packageName: PACKAGE_NAME,
683
- url: resolveComWixEcomCartApiV1CartServiceUrl({
684
- protoPath: '/v1/carts/{id}/estimate-totals',
685
- data: serializedData,
686
- host,
687
- }),
688
- data: serializedData,
689
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
690
- {
691
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
692
- paths: [
693
- { path: 'cart.createdDate' },
694
- { path: 'cart.updatedDate' },
695
- { path: 'cart.lineItems.image.urlExpirationDate' },
696
- {
697
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
698
- },
699
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
700
- {
701
- path: 'shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from',
702
- },
703
- {
704
- path: 'shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to',
705
- },
706
- {
707
- path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from',
708
- },
709
- {
710
- path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to',
711
- },
712
- { path: 'membershipOptions.eligibleMemberships.expirationDate' },
713
- {
714
- path: 'membershipOptions.invalidMemberships.membership.expirationDate',
715
- },
716
- ],
717
- },
718
- {
719
- transformFn: float_2.transformRESTFloatToSDKFloat,
720
- paths: [
721
- { path: 'cart.lineItems.image.focalPoint.x' },
722
- { path: 'cart.lineItems.image.focalPoint.y' },
723
- { path: 'cart.lineItems.physicalProperties.weight' },
724
- {
725
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
726
- },
727
- { path: 'cart.contactInfo.address.geocode.latitude' },
728
- { path: 'cart.contactInfo.address.geocode.longitude' },
729
- {
730
- path: 'shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.latitude',
731
- },
732
- {
733
- path: 'shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address.geocode.longitude',
734
- },
735
- {
736
- path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.latitude',
737
- },
738
- {
739
- path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address.geocode.longitude',
740
- },
741
- { path: 'appliedDiscounts.merchantDiscount.percentage' },
742
- ],
743
- },
744
- ]),
745
- };
746
- return metadata;
747
- }
748
- return __estimateTotals;
749
- }
750
- exports.estimateTotals = estimateTotals;
751
- /** Deletes a cart. */
752
- function deleteCart(payload) {
753
- function __deleteCart({ host }) {
754
- const metadata = {
755
- entityFqdn: 'wix.ecom.v1.cart',
756
- method: 'DELETE',
757
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.DeleteCart',
758
- packageName: PACKAGE_NAME,
759
- url: resolveComWixEcomCartApiV1CartServiceUrl({
760
- protoPath: '/v1/carts/{id}',
761
- data: payload,
762
- host,
763
- }),
764
- params: (0, rest_modules_1.toURLSearchParams)(payload),
765
- };
766
- return metadata;
767
- }
768
- return __deleteCart;
769
- }
770
- exports.deleteCart = deleteCart;
771
- /** Removes the location associated with a cart. */
772
- function removeBusinessLocation(payload) {
773
- function __removeBusinessLocation({ host }) {
774
- const metadata = {
775
- entityFqdn: 'wix.ecom.v1.cart',
776
- method: 'POST',
777
- methodFqn: 'com.wix.ecom.cart.api.v1.CartService.RemoveBusinessLocation',
778
- packageName: PACKAGE_NAME,
779
- url: resolveComWixEcomCartApiV1CartServiceUrl({
780
- protoPath: '/v1/carts/{id}/remove-business-location',
781
- data: payload,
782
- host,
783
- }),
784
- data: payload,
785
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
786
- {
787
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
788
- paths: [
789
- { path: 'cart.createdDate' },
790
- { path: 'cart.updatedDate' },
791
- { path: 'cart.lineItems.image.urlExpirationDate' },
792
- {
793
- path: 'cart.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
794
- },
795
- { path: 'cart.lineItems.serviceProperties.scheduledDate' },
796
- ],
797
- },
798
- {
799
- transformFn: float_2.transformRESTFloatToSDKFloat,
800
- paths: [
801
- { path: 'cart.lineItems.image.focalPoint.x' },
802
- { path: 'cart.lineItems.image.focalPoint.y' },
803
- { path: 'cart.lineItems.physicalProperties.weight' },
804
- {
805
- path: 'cart.lineItems.catalogOverrideFields.physicalProperties.weight',
806
- },
807
- { path: 'cart.contactInfo.address.geocode.latitude' },
808
- { path: 'cart.contactInfo.address.geocode.longitude' },
809
- ],
810
- },
811
- ]),
812
- };
813
- return metadata;
814
- }
815
- return __removeBusinessLocation;
816
- }
817
- exports.removeBusinessLocation = removeBusinessLocation;
818
- //# sourceMappingURL=ecom-v1-cart-cart.http.js.map