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