@wix/auto_sdk_ecom_cart-v-2 1.0.0

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 (39) hide show
  1. package/build/cjs/index.d.ts +2950 -0
  2. package/build/cjs/index.js +2183 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +2030 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2396 -0
  8. package/build/cjs/meta.js +1299 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/es/index.d.mts +2950 -0
  11. package/build/es/index.mjs +2120 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/es/index.typings.d.mts +1 -0
  14. package/build/es/index.typings.mjs +1967 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +2396 -0
  17. package/build/es/meta.mjs +1256 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/es/package.json +3 -0
  20. package/build/internal/cjs/index.d.ts +227 -0
  21. package/build/internal/cjs/index.js +2183 -0
  22. package/build/internal/cjs/index.js.map +1 -0
  23. package/build/internal/cjs/index.typings.d.ts +3207 -0
  24. package/build/internal/cjs/index.typings.js +2030 -0
  25. package/build/internal/cjs/index.typings.js.map +1 -0
  26. package/build/internal/cjs/meta.d.ts +2397 -0
  27. package/build/internal/cjs/meta.js +1299 -0
  28. package/build/internal/cjs/meta.js.map +1 -0
  29. package/build/internal/es/index.d.mts +227 -0
  30. package/build/internal/es/index.mjs +2120 -0
  31. package/build/internal/es/index.mjs.map +1 -0
  32. package/build/internal/es/index.typings.d.mts +3207 -0
  33. package/build/internal/es/index.typings.mjs +1967 -0
  34. package/build/internal/es/index.typings.mjs.map +1 -0
  35. package/build/internal/es/meta.d.mts +2397 -0
  36. package/build/internal/es/meta.mjs +1256 -0
  37. package/build/internal/es/meta.mjs.map +1 -0
  38. package/meta/package.json +3 -0
  39. package/package.json +54 -0
@@ -0,0 +1,2120 @@
1
+ // src/ecom-v2-cart-cart-v-2.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import {
4
+ renameKeysFromSDKRequestToRESTRequest,
5
+ renameKeysFromRESTResponseToSDKResponse
6
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
7
+
8
+ // src/ecom-v2-cart-cart-v-2.http.ts
9
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
10
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
11
+ import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
12
+ import { transformRESTBytesToSDKBytes } from "@wix/sdk-runtime/transformations/bytes";
13
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
14
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
15
+ import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
16
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
17
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
18
+ function resolveWixEcomCartV2CartServiceUrl(opts) {
19
+ const domainToMappings = {
20
+ "api._api_base_domain_": [
21
+ {
22
+ srcPath: "/cart-v2",
23
+ destPath: ""
24
+ }
25
+ ],
26
+ _: [
27
+ {
28
+ srcPath: "/_api/cart-v2",
29
+ destPath: ""
30
+ }
31
+ ],
32
+ "*.dev.wix-code.com": [
33
+ {
34
+ srcPath: "/_api/cart-v2",
35
+ destPath: ""
36
+ }
37
+ ],
38
+ "www._base_domain_": [
39
+ {
40
+ srcPath: "/_api/cart-v2",
41
+ destPath: ""
42
+ }
43
+ ],
44
+ "editor._base_domain_": [
45
+ {
46
+ srcPath: "/_api/cart-v2",
47
+ destPath: ""
48
+ }
49
+ ],
50
+ "blocks._base_domain_": [
51
+ {
52
+ srcPath: "/_api/cart-v2",
53
+ destPath: ""
54
+ }
55
+ ],
56
+ "create.editorx": [
57
+ {
58
+ srcPath: "/_api/cart-v2",
59
+ destPath: ""
60
+ }
61
+ ],
62
+ "apps._base_domain_": [
63
+ {
64
+ srcPath: "/_api/cart-v2",
65
+ destPath: ""
66
+ }
67
+ ],
68
+ "manage._base_domain_": [
69
+ {
70
+ srcPath: "/_api/cart-v2",
71
+ destPath: ""
72
+ }
73
+ ],
74
+ "bo._base_domain_": [
75
+ {
76
+ srcPath: "/_api/cart-v2",
77
+ destPath: ""
78
+ }
79
+ ],
80
+ "wixbo.ai": [
81
+ {
82
+ srcPath: "/_api/cart-v2",
83
+ destPath: ""
84
+ }
85
+ ],
86
+ "wix-bo.com": [
87
+ {
88
+ srcPath: "/_api/cart-v2",
89
+ destPath: ""
90
+ }
91
+ ],
92
+ "www.wixapis.com": [
93
+ {
94
+ srcPath: "/ecom/v2/carts",
95
+ destPath: "/v2/carts"
96
+ }
97
+ ],
98
+ "editor.wixapps.net": [
99
+ {
100
+ srcPath: "/_api/cart-v2",
101
+ destPath: ""
102
+ }
103
+ ]
104
+ };
105
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
106
+ }
107
+ var PACKAGE_NAME = "@wix/auto_sdk_ecom_cart-v-2";
108
+ function createCart(payload) {
109
+ function __createCart({ host }) {
110
+ const serializedData = transformPaths(payload, [
111
+ {
112
+ transformFn: transformSDKTimestampToRESTTimestamp,
113
+ paths: [
114
+ { path: "cart.createdDate" },
115
+ { path: "cart.updatedDate" },
116
+ {
117
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
118
+ },
119
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
120
+ {
121
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
122
+ },
123
+ { path: "cart.lineItems.attributes.serviceProperties.scheduledDate" },
124
+ {
125
+ path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
126
+ },
127
+ { path: "customItems.attributes.image.urlExpirationDate" },
128
+ {
129
+ path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
130
+ },
131
+ { path: "customItems.attributes.serviceProperties.scheduledDate" }
132
+ ]
133
+ },
134
+ {
135
+ transformFn: transformSDKFloatToRESTFloat,
136
+ paths: [
137
+ {
138
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
139
+ },
140
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
141
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
142
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
143
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
144
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" },
145
+ {
146
+ path: "catalogItems.catalogOverrideFields.physicalProperties.weight"
147
+ },
148
+ { path: "customItems.attributes.physicalProperties.weight" }
149
+ ]
150
+ }
151
+ ]);
152
+ const metadata = {
153
+ entityFqdn: "wix.ecom.v2.cart",
154
+ method: "POST",
155
+ methodFqn: "wix.ecom.cart.v2.CartService.CreateCart",
156
+ packageName: PACKAGE_NAME,
157
+ url: resolveWixEcomCartV2CartServiceUrl({
158
+ protoPath: "/v2/carts",
159
+ data: serializedData,
160
+ host
161
+ }),
162
+ data: serializedData,
163
+ transformResponse: (payload2) => transformPaths(payload2, [
164
+ {
165
+ transformFn: transformRESTTimestampToSDKTimestamp,
166
+ paths: [
167
+ { path: "cart.createdDate" },
168
+ { path: "cart.updatedDate" },
169
+ {
170
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
171
+ },
172
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
173
+ {
174
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
175
+ },
176
+ {
177
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
178
+ }
179
+ ]
180
+ },
181
+ {
182
+ transformFn: transformRESTFloatToSDKFloat,
183
+ paths: [
184
+ {
185
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
186
+ },
187
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
188
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
189
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
190
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
191
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
192
+ ]
193
+ }
194
+ ])
195
+ };
196
+ return metadata;
197
+ }
198
+ return __createCart;
199
+ }
200
+ function getCart(payload) {
201
+ function __getCart({ host }) {
202
+ const metadata = {
203
+ entityFqdn: "wix.ecom.v2.cart",
204
+ method: "GET",
205
+ methodFqn: "wix.ecom.cart.v2.CartService.GetCart",
206
+ packageName: PACKAGE_NAME,
207
+ url: resolveWixEcomCartV2CartServiceUrl({
208
+ protoPath: "/v2/carts/{cartId}",
209
+ data: payload,
210
+ host
211
+ }),
212
+ params: toURLSearchParams(payload),
213
+ transformResponse: (payload2) => transformPaths(payload2, [
214
+ {
215
+ transformFn: transformRESTTimestampToSDKTimestamp,
216
+ paths: [
217
+ { path: "cart.createdDate" },
218
+ { path: "cart.updatedDate" },
219
+ {
220
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
221
+ },
222
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
223
+ {
224
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
225
+ },
226
+ {
227
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
228
+ }
229
+ ]
230
+ },
231
+ {
232
+ transformFn: transformRESTFloatToSDKFloat,
233
+ paths: [
234
+ {
235
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
236
+ },
237
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
238
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
239
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
240
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
241
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
242
+ ]
243
+ }
244
+ ])
245
+ };
246
+ return metadata;
247
+ }
248
+ return __getCart;
249
+ }
250
+ function updateCart(payload) {
251
+ function __updateCart({ host }) {
252
+ const serializedData = transformPaths(payload, [
253
+ {
254
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
255
+ paths: [{ path: "fieldMask" }]
256
+ },
257
+ {
258
+ transformFn: transformSDKTimestampToRESTTimestamp,
259
+ paths: [
260
+ { path: "cart.createdDate" },
261
+ { path: "cart.updatedDate" },
262
+ {
263
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
264
+ },
265
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
266
+ {
267
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
268
+ },
269
+ { path: "cart.lineItems.attributes.serviceProperties.scheduledDate" }
270
+ ]
271
+ },
272
+ {
273
+ transformFn: transformSDKFloatToRESTFloat,
274
+ paths: [
275
+ {
276
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
277
+ },
278
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
279
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
280
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
281
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
282
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
283
+ ]
284
+ }
285
+ ]);
286
+ const metadata = {
287
+ entityFqdn: "wix.ecom.v2.cart",
288
+ method: "PATCH",
289
+ methodFqn: "wix.ecom.cart.v2.CartService.UpdateCart",
290
+ packageName: PACKAGE_NAME,
291
+ url: resolveWixEcomCartV2CartServiceUrl({
292
+ protoPath: "/v2/carts/{cart.id}",
293
+ data: serializedData,
294
+ host
295
+ }),
296
+ data: serializedData,
297
+ transformResponse: (payload2) => transformPaths(payload2, [
298
+ {
299
+ transformFn: transformRESTTimestampToSDKTimestamp,
300
+ paths: [
301
+ { path: "cart.createdDate" },
302
+ { path: "cart.updatedDate" },
303
+ {
304
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
305
+ },
306
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
307
+ {
308
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
309
+ },
310
+ {
311
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ transformFn: transformRESTFloatToSDKFloat,
317
+ paths: [
318
+ {
319
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
320
+ },
321
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
322
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
323
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
324
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
325
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
326
+ ]
327
+ }
328
+ ])
329
+ };
330
+ return metadata;
331
+ }
332
+ return __updateCart;
333
+ }
334
+ function deleteCart(payload) {
335
+ function __deleteCart({ host }) {
336
+ const metadata = {
337
+ entityFqdn: "wix.ecom.v2.cart",
338
+ method: "DELETE",
339
+ methodFqn: "wix.ecom.cart.v2.CartService.DeleteCart",
340
+ packageName: PACKAGE_NAME,
341
+ url: resolveWixEcomCartV2CartServiceUrl({
342
+ protoPath: "/v2/carts/{cartId}",
343
+ data: payload,
344
+ host
345
+ }),
346
+ params: toURLSearchParams(payload)
347
+ };
348
+ return metadata;
349
+ }
350
+ return __deleteCart;
351
+ }
352
+ function refreshCart(payload) {
353
+ function __refreshCart({ host }) {
354
+ const metadata = {
355
+ entityFqdn: "wix.ecom.v2.cart",
356
+ method: "POST",
357
+ methodFqn: "wix.ecom.cart.v2.CartService.RefreshCart",
358
+ packageName: PACKAGE_NAME,
359
+ url: resolveWixEcomCartV2CartServiceUrl({
360
+ protoPath: "/v2/carts/{cartId}/refresh",
361
+ data: payload,
362
+ host
363
+ }),
364
+ data: payload,
365
+ transformResponse: (payload2) => transformPaths(payload2, [
366
+ {
367
+ transformFn: transformRESTTimestampToSDKTimestamp,
368
+ paths: [
369
+ { path: "cart.createdDate" },
370
+ { path: "cart.updatedDate" },
371
+ {
372
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
373
+ },
374
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
375
+ {
376
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
377
+ },
378
+ {
379
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
380
+ }
381
+ ]
382
+ },
383
+ {
384
+ transformFn: transformRESTFloatToSDKFloat,
385
+ paths: [
386
+ {
387
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
388
+ },
389
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
390
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
391
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
392
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
393
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
394
+ ]
395
+ }
396
+ ])
397
+ };
398
+ return metadata;
399
+ }
400
+ return __refreshCart;
401
+ }
402
+ function calculateCart(payload) {
403
+ function __calculateCart({ host }) {
404
+ const metadata = {
405
+ entityFqdn: "wix.ecom.v2.cart",
406
+ method: "POST",
407
+ methodFqn: "wix.ecom.cart.v2.CartService.CalculateCart",
408
+ packageName: PACKAGE_NAME,
409
+ url: resolveWixEcomCartV2CartServiceUrl({
410
+ protoPath: "/v2/carts/{cartId}/calculate",
411
+ data: payload,
412
+ host
413
+ }),
414
+ data: payload,
415
+ transformResponse: (payload2) => transformPaths(payload2, [
416
+ {
417
+ transformFn: transformRESTTimestampToSDKTimestamp,
418
+ paths: [
419
+ { path: "cart.createdDate" },
420
+ { path: "cart.updatedDate" },
421
+ {
422
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
423
+ },
424
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
425
+ {
426
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
427
+ },
428
+ {
429
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
430
+ }
431
+ ]
432
+ },
433
+ {
434
+ transformFn: transformRESTFloatToSDKFloat,
435
+ paths: [
436
+ {
437
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
438
+ },
439
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
440
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
441
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
442
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
443
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
444
+ ]
445
+ }
446
+ ])
447
+ };
448
+ return metadata;
449
+ }
450
+ return __calculateCart;
451
+ }
452
+ function getCheckoutUrl(payload) {
453
+ function __getCheckoutUrl({ host }) {
454
+ const metadata = {
455
+ entityFqdn: "wix.ecom.v2.cart",
456
+ method: "POST",
457
+ methodFqn: "wix.ecom.cart.v2.CartService.GetCheckoutURL",
458
+ packageName: PACKAGE_NAME,
459
+ url: resolveWixEcomCartV2CartServiceUrl({
460
+ protoPath: "/v2/carts/{cartId}/get-checkout-url",
461
+ data: payload,
462
+ host
463
+ }),
464
+ data: payload
465
+ };
466
+ return metadata;
467
+ }
468
+ return __getCheckoutUrl;
469
+ }
470
+ function completeCheckout(payload) {
471
+ function __completeCheckout({ host }) {
472
+ const metadata = {
473
+ entityFqdn: "wix.ecom.v2.cart",
474
+ method: "POST",
475
+ methodFqn: "wix.ecom.cart.v2.CartService.CompleteCheckout",
476
+ packageName: PACKAGE_NAME,
477
+ url: resolveWixEcomCartV2CartServiceUrl({
478
+ protoPath: "/v2/carts/{cartId}/complete-checkout",
479
+ data: payload,
480
+ host
481
+ }),
482
+ data: payload
483
+ };
484
+ return metadata;
485
+ }
486
+ return __completeCheckout;
487
+ }
488
+ function addLineItems(payload) {
489
+ function __addLineItems({ host }) {
490
+ const serializedData = transformPaths(payload, [
491
+ {
492
+ transformFn: transformSDKFloatToRESTFloat,
493
+ paths: [
494
+ {
495
+ path: "catalogItems.catalogOverrideFields.physicalProperties.weight"
496
+ },
497
+ { path: "customItems.attributes.physicalProperties.weight" }
498
+ ]
499
+ },
500
+ {
501
+ transformFn: transformSDKTimestampToRESTTimestamp,
502
+ paths: [
503
+ {
504
+ path: "catalogItems.catalogOverrideFields.image.urlExpirationDate"
505
+ },
506
+ { path: "customItems.attributes.image.urlExpirationDate" },
507
+ {
508
+ path: "customItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
509
+ },
510
+ { path: "customItems.attributes.serviceProperties.scheduledDate" }
511
+ ]
512
+ }
513
+ ]);
514
+ const metadata = {
515
+ entityFqdn: "wix.ecom.v2.cart",
516
+ method: "POST",
517
+ methodFqn: "wix.ecom.cart.v2.CartService.AddLineItems",
518
+ packageName: PACKAGE_NAME,
519
+ url: resolveWixEcomCartV2CartServiceUrl({
520
+ protoPath: "/v2/carts/{cartId}/add-line-items",
521
+ data: serializedData,
522
+ host
523
+ }),
524
+ data: serializedData,
525
+ transformResponse: (payload2) => transformPaths(payload2, [
526
+ {
527
+ transformFn: transformRESTTimestampToSDKTimestamp,
528
+ paths: [
529
+ { path: "cart.createdDate" },
530
+ { path: "cart.updatedDate" },
531
+ {
532
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
533
+ },
534
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
535
+ {
536
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
537
+ },
538
+ {
539
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
540
+ }
541
+ ]
542
+ },
543
+ {
544
+ transformFn: transformRESTFloatToSDKFloat,
545
+ paths: [
546
+ {
547
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
548
+ },
549
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
550
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
551
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
552
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
553
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
554
+ ]
555
+ }
556
+ ])
557
+ };
558
+ return metadata;
559
+ }
560
+ return __addLineItems;
561
+ }
562
+ function removeLineItems(payload) {
563
+ function __removeLineItems({ host }) {
564
+ const metadata = {
565
+ entityFqdn: "wix.ecom.v2.cart",
566
+ method: "POST",
567
+ methodFqn: "wix.ecom.cart.v2.CartService.RemoveLineItems",
568
+ packageName: PACKAGE_NAME,
569
+ url: resolveWixEcomCartV2CartServiceUrl({
570
+ protoPath: "/v2/carts/{cartId}/remove-line-items",
571
+ data: payload,
572
+ host
573
+ }),
574
+ data: payload,
575
+ transformResponse: (payload2) => transformPaths(payload2, [
576
+ {
577
+ transformFn: transformRESTTimestampToSDKTimestamp,
578
+ paths: [
579
+ { path: "cart.createdDate" },
580
+ { path: "cart.updatedDate" },
581
+ {
582
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
583
+ },
584
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
585
+ {
586
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
587
+ },
588
+ {
589
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
590
+ }
591
+ ]
592
+ },
593
+ {
594
+ transformFn: transformRESTFloatToSDKFloat,
595
+ paths: [
596
+ {
597
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
598
+ },
599
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
600
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
601
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
602
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
603
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
604
+ ]
605
+ }
606
+ ])
607
+ };
608
+ return metadata;
609
+ }
610
+ return __removeLineItems;
611
+ }
612
+ function addDiscount(payload) {
613
+ function __addDiscount({ host }) {
614
+ const metadata = {
615
+ entityFqdn: "wix.ecom.v2.cart",
616
+ method: "POST",
617
+ methodFqn: "wix.ecom.cart.v2.CartService.AddDiscount",
618
+ packageName: PACKAGE_NAME,
619
+ url: resolveWixEcomCartV2CartServiceUrl({
620
+ protoPath: "/v2/carts/{cartId}/add-discount",
621
+ data: payload,
622
+ host
623
+ }),
624
+ data: payload,
625
+ transformResponse: (payload2) => transformPaths(payload2, [
626
+ {
627
+ transformFn: transformRESTTimestampToSDKTimestamp,
628
+ paths: [
629
+ { path: "cart.createdDate" },
630
+ { path: "cart.updatedDate" },
631
+ {
632
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
633
+ },
634
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
635
+ {
636
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
637
+ },
638
+ {
639
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
640
+ }
641
+ ]
642
+ },
643
+ {
644
+ transformFn: transformRESTFloatToSDKFloat,
645
+ paths: [
646
+ {
647
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
648
+ },
649
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
650
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
651
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
652
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
653
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
654
+ ]
655
+ }
656
+ ])
657
+ };
658
+ return metadata;
659
+ }
660
+ return __addDiscount;
661
+ }
662
+ function removeDiscount(payload) {
663
+ function __removeDiscount({ host }) {
664
+ const metadata = {
665
+ entityFqdn: "wix.ecom.v2.cart",
666
+ method: "POST",
667
+ methodFqn: "wix.ecom.cart.v2.CartService.RemoveDiscount",
668
+ packageName: PACKAGE_NAME,
669
+ url: resolveWixEcomCartV2CartServiceUrl({
670
+ protoPath: "/v2/carts/{cartId}/remove-discount",
671
+ data: payload,
672
+ host
673
+ }),
674
+ data: payload,
675
+ transformResponse: (payload2) => transformPaths(payload2, [
676
+ {
677
+ transformFn: transformRESTTimestampToSDKTimestamp,
678
+ paths: [
679
+ { path: "cart.createdDate" },
680
+ { path: "cart.updatedDate" },
681
+ {
682
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
683
+ },
684
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
685
+ {
686
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
687
+ },
688
+ {
689
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
690
+ }
691
+ ]
692
+ },
693
+ {
694
+ transformFn: transformRESTFloatToSDKFloat,
695
+ paths: [
696
+ {
697
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
698
+ },
699
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
700
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
701
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
702
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
703
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
704
+ ]
705
+ }
706
+ ])
707
+ };
708
+ return metadata;
709
+ }
710
+ return __removeDiscount;
711
+ }
712
+ function addGiftCard(payload) {
713
+ function __addGiftCard({ host }) {
714
+ const metadata = {
715
+ entityFqdn: "wix.ecom.v2.cart",
716
+ method: "POST",
717
+ methodFqn: "wix.ecom.cart.v2.CartService.AddGiftCard",
718
+ packageName: PACKAGE_NAME,
719
+ url: resolveWixEcomCartV2CartServiceUrl({
720
+ protoPath: "/v2/carts/{cartId}/add-gift-card",
721
+ data: payload,
722
+ host
723
+ }),
724
+ data: payload,
725
+ transformResponse: (payload2) => transformPaths(payload2, [
726
+ {
727
+ transformFn: transformRESTTimestampToSDKTimestamp,
728
+ paths: [
729
+ { path: "cart.createdDate" },
730
+ { path: "cart.updatedDate" },
731
+ {
732
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
733
+ },
734
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
735
+ {
736
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
737
+ },
738
+ {
739
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
740
+ }
741
+ ]
742
+ },
743
+ {
744
+ transformFn: transformRESTFloatToSDKFloat,
745
+ paths: [
746
+ {
747
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
748
+ },
749
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
750
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
751
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
752
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
753
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
754
+ ]
755
+ }
756
+ ])
757
+ };
758
+ return metadata;
759
+ }
760
+ return __addGiftCard;
761
+ }
762
+ function removeGiftCard(payload) {
763
+ function __removeGiftCard({ host }) {
764
+ const metadata = {
765
+ entityFqdn: "wix.ecom.v2.cart",
766
+ method: "POST",
767
+ methodFqn: "wix.ecom.cart.v2.CartService.RemoveGiftCard",
768
+ packageName: PACKAGE_NAME,
769
+ url: resolveWixEcomCartV2CartServiceUrl({
770
+ protoPath: "/v2/carts/{cartId}/remove-gift-card",
771
+ data: payload,
772
+ host
773
+ }),
774
+ data: payload,
775
+ transformResponse: (payload2) => transformPaths(payload2, [
776
+ {
777
+ transformFn: transformRESTTimestampToSDKTimestamp,
778
+ paths: [
779
+ { path: "cart.createdDate" },
780
+ { path: "cart.updatedDate" },
781
+ {
782
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
783
+ },
784
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
785
+ {
786
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
787
+ },
788
+ {
789
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ transformFn: transformRESTFloatToSDKFloat,
795
+ paths: [
796
+ {
797
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
798
+ },
799
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
800
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
801
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
802
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
803
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
804
+ ]
805
+ }
806
+ ])
807
+ };
808
+ return metadata;
809
+ }
810
+ return __removeGiftCard;
811
+ }
812
+ function updateLineItems(payload) {
813
+ function __updateLineItems({ host }) {
814
+ const metadata = {
815
+ entityFqdn: "wix.ecom.v2.cart",
816
+ method: "POST",
817
+ methodFqn: "wix.ecom.cart.v2.CartService.UpdateLineItems",
818
+ packageName: PACKAGE_NAME,
819
+ url: resolveWixEcomCartV2CartServiceUrl({
820
+ protoPath: "/v2/carts/{cartId}/update-line-items",
821
+ data: payload,
822
+ host
823
+ }),
824
+ data: payload,
825
+ transformResponse: (payload2) => transformPaths(payload2, [
826
+ {
827
+ transformFn: transformRESTTimestampToSDKTimestamp,
828
+ paths: [
829
+ { path: "cart.createdDate" },
830
+ { path: "cart.updatedDate" },
831
+ {
832
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
833
+ },
834
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
835
+ {
836
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
837
+ },
838
+ {
839
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
840
+ }
841
+ ]
842
+ },
843
+ {
844
+ transformFn: transformRESTFloatToSDKFloat,
845
+ paths: [
846
+ {
847
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
848
+ },
849
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
850
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
851
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
852
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
853
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
854
+ ]
855
+ }
856
+ ])
857
+ };
858
+ return metadata;
859
+ }
860
+ return __updateLineItems;
861
+ }
862
+ function markCartAsCompleted(payload) {
863
+ function __markCartAsCompleted({ host }) {
864
+ const metadata = {
865
+ entityFqdn: "wix.ecom.v2.cart",
866
+ method: "POST",
867
+ methodFqn: "wix.ecom.cart.v2.CartService.MarkCartAsCompleted",
868
+ packageName: PACKAGE_NAME,
869
+ url: resolveWixEcomCartV2CartServiceUrl({
870
+ protoPath: "/v2/carts/{cartId}/mark-cart-as-completed",
871
+ data: payload,
872
+ host
873
+ }),
874
+ data: payload,
875
+ transformResponse: (payload2) => transformPaths(payload2, [
876
+ {
877
+ transformFn: transformRESTTimestampToSDKTimestamp,
878
+ paths: [
879
+ { path: "cart.createdDate" },
880
+ { path: "cart.updatedDate" },
881
+ {
882
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
883
+ },
884
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
885
+ {
886
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
887
+ },
888
+ {
889
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
890
+ }
891
+ ]
892
+ },
893
+ {
894
+ transformFn: transformRESTFloatToSDKFloat,
895
+ paths: [
896
+ {
897
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
898
+ },
899
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
900
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
901
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
902
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
903
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
904
+ ]
905
+ }
906
+ ])
907
+ };
908
+ return metadata;
909
+ }
910
+ return __markCartAsCompleted;
911
+ }
912
+ function handleAsyncCheckoutCompletion(payload) {
913
+ function __handleAsyncCheckoutCompletion({ host }) {
914
+ const metadata = {
915
+ entityFqdn: "wix.ecom.v2.cart",
916
+ method: "POST",
917
+ methodFqn: "wix.ecom.cart.v2.CartService.HandleAsyncCheckoutCompletion",
918
+ packageName: PACKAGE_NAME,
919
+ url: resolveWixEcomCartV2CartServiceUrl({
920
+ protoPath: "/v2/carts/handle-async-checkout-completion",
921
+ data: payload,
922
+ host
923
+ }),
924
+ data: payload,
925
+ transformResponse: (payload2) => transformPaths(payload2, [
926
+ {
927
+ transformFn: transformRESTBytesToSDKBytes,
928
+ paths: [{ path: "body" }]
929
+ }
930
+ ])
931
+ };
932
+ return metadata;
933
+ }
934
+ return __handleAsyncCheckoutCompletion;
935
+ }
936
+
937
+ // src/ecom-v2-cart-cart-v-2.universal.ts
938
+ import { transformSDKAddressToRESTAddress } from "@wix/sdk-runtime/transformations/address";
939
+ import { transformRESTAddressToSDKAddress } from "@wix/sdk-runtime/transformations/address";
940
+ import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
941
+ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
942
+ import { transformSDKPageURLV2ToRESTPageURLV2 } from "@wix/sdk-runtime/transformations/page-url-v2";
943
+ import { transformRESTPageURLV2ToSDKPageURLV2 } from "@wix/sdk-runtime/transformations/page-url-v2";
944
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
945
+ var DescriptionLineType = /* @__PURE__ */ ((DescriptionLineType2) => {
946
+ DescriptionLineType2["UNRECOGNISED"] = "UNRECOGNISED";
947
+ DescriptionLineType2["PLAIN_TEXT"] = "PLAIN_TEXT";
948
+ DescriptionLineType2["COLOR"] = "COLOR";
949
+ return DescriptionLineType2;
950
+ })(DescriptionLineType || {});
951
+ var PaymentOptionType = /* @__PURE__ */ ((PaymentOptionType2) => {
952
+ PaymentOptionType2["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
953
+ PaymentOptionType2["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
954
+ PaymentOptionType2["MEMBERSHIP"] = "MEMBERSHIP";
955
+ PaymentOptionType2["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
956
+ PaymentOptionType2["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
957
+ PaymentOptionType2["MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"] = "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER";
958
+ return PaymentOptionType2;
959
+ })(PaymentOptionType || {});
960
+ var ItemTypeItemType = /* @__PURE__ */ ((ItemTypeItemType2) => {
961
+ ItemTypeItemType2["UNRECOGNISED"] = "UNRECOGNISED";
962
+ ItemTypeItemType2["PHYSICAL"] = "PHYSICAL";
963
+ ItemTypeItemType2["DIGITAL"] = "DIGITAL";
964
+ ItemTypeItemType2["GIFT_CARD"] = "GIFT_CARD";
965
+ ItemTypeItemType2["SERVICE"] = "SERVICE";
966
+ return ItemTypeItemType2;
967
+ })(ItemTypeItemType || {});
968
+ var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
969
+ SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
970
+ SubscriptionFrequency2["DAY"] = "DAY";
971
+ SubscriptionFrequency2["WEEK"] = "WEEK";
972
+ SubscriptionFrequency2["MONTH"] = "MONTH";
973
+ SubscriptionFrequency2["YEAR"] = "YEAR";
974
+ return SubscriptionFrequency2;
975
+ })(SubscriptionFrequency || {});
976
+ var FileType = /* @__PURE__ */ ((FileType2) => {
977
+ FileType2["UNSPECIFIED"] = "UNSPECIFIED";
978
+ FileType2["SECURE_PICTURE"] = "SECURE_PICTURE";
979
+ FileType2["SECURE_VIDEO"] = "SECURE_VIDEO";
980
+ FileType2["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
981
+ FileType2["SECURE_MUSIC"] = "SECURE_MUSIC";
982
+ FileType2["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
983
+ return FileType2;
984
+ })(FileType || {});
985
+ var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
986
+ TaxableAddressType2["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
987
+ TaxableAddressType2["BUSINESS"] = "BUSINESS";
988
+ TaxableAddressType2["BILLING"] = "BILLING";
989
+ TaxableAddressType2["SHIPPING"] = "SHIPPING";
990
+ return TaxableAddressType2;
991
+ })(TaxableAddressType || {});
992
+ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
993
+ ItemStatus2["UNKNOWN_ITEM_STATUS"] = "UNKNOWN_ITEM_STATUS";
994
+ ItemStatus2["AVAILABLE"] = "AVAILABLE";
995
+ ItemStatus2["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
996
+ ItemStatus2["OUT_OF_STOCK"] = "OUT_OF_STOCK";
997
+ ItemStatus2["NOT_EXISTS"] = "NOT_EXISTS";
998
+ return ItemStatus2;
999
+ })(ItemStatus || {});
1000
+ var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
1001
+ DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
1002
+ DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
1003
+ DiscountSourceType2["COUPON"] = "COUPON";
1004
+ return DiscountSourceType2;
1005
+ })(DiscountSourceType || {});
1006
+ var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
1007
+ DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
1008
+ DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
1009
+ DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
1010
+ DiscountScope2["DELIVERY"] = "DELIVERY";
1011
+ return DiscountScope2;
1012
+ })(DiscountScope || {});
1013
+ var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
1014
+ DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
1015
+ DiscountStatus2["ACTIVE"] = "ACTIVE";
1016
+ DiscountStatus2["EXPIRED"] = "EXPIRED";
1017
+ DiscountStatus2["DELETED"] = "DELETED";
1018
+ DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
1019
+ return DiscountStatus2;
1020
+ })(DiscountStatus || {});
1021
+ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
1022
+ ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
1023
+ ChannelType2["WEB"] = "WEB";
1024
+ ChannelType2["POS"] = "POS";
1025
+ ChannelType2["EBAY"] = "EBAY";
1026
+ ChannelType2["AMAZON"] = "AMAZON";
1027
+ ChannelType2["OTHER_PLATFORM"] = "OTHER_PLATFORM";
1028
+ ChannelType2["WIX_APP_STORE"] = "WIX_APP_STORE";
1029
+ ChannelType2["WIX_INVOICES"] = "WIX_INVOICES";
1030
+ ChannelType2["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
1031
+ ChannelType2["WISH"] = "WISH";
1032
+ ChannelType2["CLASS_PASS"] = "CLASS_PASS";
1033
+ ChannelType2["GLOBAL_E"] = "GLOBAL_E";
1034
+ ChannelType2["FACEBOOK"] = "FACEBOOK";
1035
+ ChannelType2["ETSY"] = "ETSY";
1036
+ ChannelType2["TIKTOK"] = "TIKTOK";
1037
+ ChannelType2["FAIRE_COM"] = "FAIRE_COM";
1038
+ ChannelType2["PAYPAL_AGENTIC_CHECKOUT"] = "PAYPAL_AGENTIC_CHECKOUT";
1039
+ return ChannelType2;
1040
+ })(ChannelType || {});
1041
+ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
1042
+ WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
1043
+ WeightUnit2["KG"] = "KG";
1044
+ WeightUnit2["LB"] = "LB";
1045
+ return WeightUnit2;
1046
+ })(WeightUnit || {});
1047
+ var VatType = /* @__PURE__ */ ((VatType2) => {
1048
+ VatType2["UNSPECIFIED"] = "UNSPECIFIED";
1049
+ VatType2["CPF"] = "CPF";
1050
+ VatType2["CNPJ"] = "CNPJ";
1051
+ return VatType2;
1052
+ })(VatType || {});
1053
+ var CartStatus = /* @__PURE__ */ ((CartStatus2) => {
1054
+ CartStatus2["CREATED"] = "CREATED";
1055
+ CartStatus2["CHECKOUT_COMPLETED"] = "CHECKOUT_COMPLETED";
1056
+ return CartStatus2;
1057
+ })(CartStatus || {});
1058
+ var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
1059
+ CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
1060
+ CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
1061
+ CalculationComponent2["DELIVERY"] = "DELIVERY";
1062
+ CalculationComponent2["TAX"] = "TAX";
1063
+ CalculationComponent2["MEMBERSHIPS"] = "MEMBERSHIPS";
1064
+ CalculationComponent2["GIFT_CARDS"] = "GIFT_CARDS";
1065
+ return CalculationComponent2;
1066
+ })(CalculationComponent || {});
1067
+ var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
1068
+ ErrorCode2["UNKNOWN_ERROR_CODE"] = "UNKNOWN_ERROR_CODE";
1069
+ return ErrorCode2;
1070
+ })(ErrorCode || {});
1071
+ var RuleType = /* @__PURE__ */ ((RuleType2) => {
1072
+ RuleType2["VALIDATION"] = "VALIDATION";
1073
+ RuleType2["OTHER"] = "OTHER";
1074
+ RuleType2["MAX"] = "MAX";
1075
+ RuleType2["MIN"] = "MIN";
1076
+ RuleType2["MAX_LENGTH"] = "MAX_LENGTH";
1077
+ RuleType2["MIN_LENGTH"] = "MIN_LENGTH";
1078
+ RuleType2["MAX_SIZE"] = "MAX_SIZE";
1079
+ RuleType2["MIN_SIZE"] = "MIN_SIZE";
1080
+ RuleType2["FORMAT"] = "FORMAT";
1081
+ RuleType2["DECIMAL_LTE"] = "DECIMAL_LTE";
1082
+ RuleType2["DECIMAL_GTE"] = "DECIMAL_GTE";
1083
+ RuleType2["DECIMAL_LT"] = "DECIMAL_LT";
1084
+ RuleType2["DECIMAL_GT"] = "DECIMAL_GT";
1085
+ RuleType2["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
1086
+ RuleType2["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
1087
+ RuleType2["REQUIRED_FIELD"] = "REQUIRED_FIELD";
1088
+ RuleType2["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
1089
+ RuleType2["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
1090
+ RuleType2["EXACT_LENGTH"] = "EXACT_LENGTH";
1091
+ RuleType2["EXACT_SIZE"] = "EXACT_SIZE";
1092
+ RuleType2["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
1093
+ return RuleType2;
1094
+ })(RuleType || {});
1095
+ var Severity = /* @__PURE__ */ ((Severity2) => {
1096
+ Severity2["WARNING"] = "WARNING";
1097
+ Severity2["ERROR"] = "ERROR";
1098
+ return Severity2;
1099
+ })(Severity || {});
1100
+ var NameInOther = /* @__PURE__ */ ((NameInOther2) => {
1101
+ NameInOther2["OTHER_DEFAULT"] = "OTHER_DEFAULT";
1102
+ return NameInOther2;
1103
+ })(NameInOther || {});
1104
+ var NameInLineItem = /* @__PURE__ */ ((NameInLineItem2) => {
1105
+ NameInLineItem2["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
1106
+ return NameInLineItem2;
1107
+ })(NameInLineItem || {});
1108
+ var SuggestedFix = /* @__PURE__ */ ((SuggestedFix2) => {
1109
+ SuggestedFix2["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
1110
+ SuggestedFix2["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
1111
+ return SuggestedFix2;
1112
+ })(SuggestedFix || {});
1113
+ var ValidationsConfig = /* @__PURE__ */ ((ValidationsConfig2) => {
1114
+ ValidationsConfig2["UNKNOWN_VALIDATIONS_CONFIG"] = "UNKNOWN_VALIDATIONS_CONFIG";
1115
+ ValidationsConfig2["SKIP_VALIDATIONS"] = "SKIP_VALIDATIONS";
1116
+ ValidationsConfig2["PRE_CHECKOUT_VALIDATIONS"] = "PRE_CHECKOUT_VALIDATIONS";
1117
+ ValidationsConfig2["CHECKOUT_VALIDATIONS"] = "CHECKOUT_VALIDATIONS";
1118
+ return ValidationsConfig2;
1119
+ })(ValidationsConfig || {});
1120
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
1121
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
1122
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
1123
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
1124
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
1125
+ WebhookIdentityType2["APP"] = "APP";
1126
+ return WebhookIdentityType2;
1127
+ })(WebhookIdentityType || {});
1128
+ async function createCart2(options) {
1129
+ const { httpClient, sideEffects } = arguments[1];
1130
+ const payload = transformPaths2(
1131
+ renameKeysFromSDKRequestToRESTRequest({
1132
+ cart: options?.cart,
1133
+ catalogItems: options?.catalogItems,
1134
+ customItems: options?.customItems,
1135
+ couponCodes: options?.couponCodes,
1136
+ giftCardCodes: options?.giftCardCodes
1137
+ }),
1138
+ [
1139
+ {
1140
+ transformFn: transformSDKImageToRESTImage,
1141
+ paths: [
1142
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1143
+ { path: "cart.lineItems.attributes.image" },
1144
+ { path: "catalogItems.catalogOverrideFields.image" },
1145
+ { path: "customItems.attributes.image" }
1146
+ ]
1147
+ },
1148
+ {
1149
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
1150
+ paths: [
1151
+ { path: "cart.lineItems.attributes.url" },
1152
+ { path: "customItems.attributes.url" }
1153
+ ]
1154
+ },
1155
+ {
1156
+ transformFn: transformSDKAddressToRESTAddress,
1157
+ paths: [
1158
+ { path: "cart.deliveryInfo.address" },
1159
+ { path: "cart.paymentInfo.billingAddress" }
1160
+ ]
1161
+ }
1162
+ ]
1163
+ );
1164
+ const reqOpts = createCart(payload);
1165
+ sideEffects?.onSiteCall?.();
1166
+ try {
1167
+ const result = await httpClient.request(reqOpts);
1168
+ sideEffects?.onSuccess?.(result);
1169
+ return renameKeysFromRESTResponseToSDKResponse(
1170
+ transformPaths2(result.data, [
1171
+ {
1172
+ transformFn: transformRESTImageToSDKImage,
1173
+ paths: [
1174
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1175
+ { path: "cart.lineItems.attributes.image" }
1176
+ ]
1177
+ },
1178
+ {
1179
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1180
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1181
+ },
1182
+ {
1183
+ transformFn: transformRESTAddressToSDKAddress,
1184
+ paths: [
1185
+ { path: "cart.deliveryInfo.address" },
1186
+ { path: "cart.paymentInfo.billingAddress" }
1187
+ ]
1188
+ }
1189
+ ])
1190
+ )?.cart;
1191
+ } catch (err) {
1192
+ const transformedError = sdkTransformError(
1193
+ err,
1194
+ {
1195
+ spreadPathsToArguments: {},
1196
+ explicitPathsToArguments: {
1197
+ cart: "$[0].cart",
1198
+ catalogItems: "$[0].catalogItems",
1199
+ customItems: "$[0].customItems",
1200
+ couponCodes: "$[0].couponCodes",
1201
+ giftCardCodes: "$[0].giftCardCodes"
1202
+ },
1203
+ singleArgumentUnchanged: false
1204
+ },
1205
+ ["options"]
1206
+ );
1207
+ sideEffects?.onError?.(err);
1208
+ throw transformedError;
1209
+ }
1210
+ }
1211
+ async function getCart2(cartId) {
1212
+ const { httpClient, sideEffects } = arguments[1];
1213
+ const payload = renameKeysFromSDKRequestToRESTRequest({ cartId });
1214
+ const reqOpts = getCart(payload);
1215
+ sideEffects?.onSiteCall?.();
1216
+ try {
1217
+ const result = await httpClient.request(reqOpts);
1218
+ sideEffects?.onSuccess?.(result);
1219
+ return renameKeysFromRESTResponseToSDKResponse(
1220
+ transformPaths2(result.data, [
1221
+ {
1222
+ transformFn: transformRESTImageToSDKImage,
1223
+ paths: [
1224
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1225
+ { path: "cart.lineItems.attributes.image" }
1226
+ ]
1227
+ },
1228
+ {
1229
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1230
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1231
+ },
1232
+ {
1233
+ transformFn: transformRESTAddressToSDKAddress,
1234
+ paths: [
1235
+ { path: "cart.deliveryInfo.address" },
1236
+ { path: "cart.paymentInfo.billingAddress" }
1237
+ ]
1238
+ }
1239
+ ])
1240
+ )?.cart;
1241
+ } catch (err) {
1242
+ const transformedError = sdkTransformError(
1243
+ err,
1244
+ {
1245
+ spreadPathsToArguments: {},
1246
+ explicitPathsToArguments: { cartId: "$[0]" },
1247
+ singleArgumentUnchanged: false
1248
+ },
1249
+ ["cartId"]
1250
+ );
1251
+ sideEffects?.onError?.(err);
1252
+ throw transformedError;
1253
+ }
1254
+ }
1255
+ async function updateCart2(_id, cart) {
1256
+ const { httpClient, sideEffects } = arguments[2];
1257
+ const payload = transformPaths2(
1258
+ renameKeysFromSDKRequestToRESTRequest({ cart: { ...cart, id: _id } }),
1259
+ [
1260
+ {
1261
+ transformFn: transformSDKImageToRESTImage,
1262
+ paths: [
1263
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1264
+ { path: "cart.lineItems.attributes.image" }
1265
+ ]
1266
+ },
1267
+ {
1268
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
1269
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1270
+ },
1271
+ {
1272
+ transformFn: transformSDKAddressToRESTAddress,
1273
+ paths: [
1274
+ { path: "cart.deliveryInfo.address" },
1275
+ { path: "cart.paymentInfo.billingAddress" }
1276
+ ]
1277
+ }
1278
+ ]
1279
+ );
1280
+ const reqOpts = updateCart(payload);
1281
+ sideEffects?.onSiteCall?.();
1282
+ try {
1283
+ const result = await httpClient.request(reqOpts);
1284
+ sideEffects?.onSuccess?.(result);
1285
+ return renameKeysFromRESTResponseToSDKResponse(
1286
+ transformPaths2(result.data, [
1287
+ {
1288
+ transformFn: transformRESTImageToSDKImage,
1289
+ paths: [
1290
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1291
+ { path: "cart.lineItems.attributes.image" }
1292
+ ]
1293
+ },
1294
+ {
1295
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1296
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1297
+ },
1298
+ {
1299
+ transformFn: transformRESTAddressToSDKAddress,
1300
+ paths: [
1301
+ { path: "cart.deliveryInfo.address" },
1302
+ { path: "cart.paymentInfo.billingAddress" }
1303
+ ]
1304
+ }
1305
+ ])
1306
+ )?.cart;
1307
+ } catch (err) {
1308
+ const transformedError = sdkTransformError(
1309
+ err,
1310
+ {
1311
+ spreadPathsToArguments: { cart: "$[1]" },
1312
+ explicitPathsToArguments: { "cart.id": "$[0]" },
1313
+ singleArgumentUnchanged: false
1314
+ },
1315
+ ["_id", "cart"]
1316
+ );
1317
+ sideEffects?.onError?.(err);
1318
+ throw transformedError;
1319
+ }
1320
+ }
1321
+ async function deleteCart2(cartId) {
1322
+ const { httpClient, sideEffects } = arguments[1];
1323
+ const payload = renameKeysFromSDKRequestToRESTRequest({ cartId });
1324
+ const reqOpts = deleteCart(payload);
1325
+ sideEffects?.onSiteCall?.();
1326
+ try {
1327
+ const result = await httpClient.request(reqOpts);
1328
+ sideEffects?.onSuccess?.(result);
1329
+ } catch (err) {
1330
+ const transformedError = sdkTransformError(
1331
+ err,
1332
+ {
1333
+ spreadPathsToArguments: {},
1334
+ explicitPathsToArguments: { cartId: "$[0]" },
1335
+ singleArgumentUnchanged: false
1336
+ },
1337
+ ["cartId"]
1338
+ );
1339
+ sideEffects?.onError?.(err);
1340
+ throw transformedError;
1341
+ }
1342
+ }
1343
+ async function refreshCart2(cartId) {
1344
+ const { httpClient, sideEffects } = arguments[1];
1345
+ const payload = renameKeysFromSDKRequestToRESTRequest({ cartId });
1346
+ const reqOpts = refreshCart(payload);
1347
+ sideEffects?.onSiteCall?.();
1348
+ try {
1349
+ const result = await httpClient.request(reqOpts);
1350
+ sideEffects?.onSuccess?.(result);
1351
+ return renameKeysFromRESTResponseToSDKResponse(
1352
+ transformPaths2(result.data, [
1353
+ {
1354
+ transformFn: transformRESTImageToSDKImage,
1355
+ paths: [
1356
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1357
+ { path: "cart.lineItems.attributes.image" }
1358
+ ]
1359
+ },
1360
+ {
1361
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1362
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1363
+ },
1364
+ {
1365
+ transformFn: transformRESTAddressToSDKAddress,
1366
+ paths: [
1367
+ { path: "cart.deliveryInfo.address" },
1368
+ { path: "cart.paymentInfo.billingAddress" }
1369
+ ]
1370
+ }
1371
+ ])
1372
+ );
1373
+ } catch (err) {
1374
+ const transformedError = sdkTransformError(
1375
+ err,
1376
+ {
1377
+ spreadPathsToArguments: {},
1378
+ explicitPathsToArguments: { cartId: "$[0]" },
1379
+ singleArgumentUnchanged: false
1380
+ },
1381
+ ["cartId"]
1382
+ );
1383
+ sideEffects?.onError?.(err);
1384
+ throw transformedError;
1385
+ }
1386
+ }
1387
+ async function calculateCart2(cartId, options) {
1388
+ const { httpClient, sideEffects } = arguments[2];
1389
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1390
+ cartId,
1391
+ validationsConfig: options?.validationsConfig,
1392
+ customCalculationConfig: options?.customCalculationConfig
1393
+ });
1394
+ const reqOpts = calculateCart(payload);
1395
+ sideEffects?.onSiteCall?.();
1396
+ try {
1397
+ const result = await httpClient.request(reqOpts);
1398
+ sideEffects?.onSuccess?.(result);
1399
+ return renameKeysFromRESTResponseToSDKResponse(
1400
+ transformPaths2(result.data, [
1401
+ {
1402
+ transformFn: transformRESTImageToSDKImage,
1403
+ paths: [
1404
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1405
+ { path: "cart.lineItems.attributes.image" }
1406
+ ]
1407
+ },
1408
+ {
1409
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1410
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1411
+ },
1412
+ {
1413
+ transformFn: transformRESTAddressToSDKAddress,
1414
+ paths: [
1415
+ { path: "cart.deliveryInfo.address" },
1416
+ { path: "cart.paymentInfo.billingAddress" }
1417
+ ]
1418
+ }
1419
+ ])
1420
+ );
1421
+ } catch (err) {
1422
+ const transformedError = sdkTransformError(
1423
+ err,
1424
+ {
1425
+ spreadPathsToArguments: {},
1426
+ explicitPathsToArguments: {
1427
+ cartId: "$[0]",
1428
+ validationsConfig: "$[1].validationsConfig",
1429
+ customCalculationConfig: "$[1].customCalculationConfig"
1430
+ },
1431
+ singleArgumentUnchanged: false
1432
+ },
1433
+ ["cartId", "options"]
1434
+ );
1435
+ sideEffects?.onError?.(err);
1436
+ throw transformedError;
1437
+ }
1438
+ }
1439
+ async function getCheckoutUrl2(cartId, options) {
1440
+ const { httpClient, sideEffects } = arguments[2];
1441
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1442
+ cartId,
1443
+ currencyCode: options?.currencyCode
1444
+ });
1445
+ const reqOpts = getCheckoutUrl(payload);
1446
+ sideEffects?.onSiteCall?.();
1447
+ try {
1448
+ const result = await httpClient.request(reqOpts);
1449
+ sideEffects?.onSuccess?.(result);
1450
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1451
+ } catch (err) {
1452
+ const transformedError = sdkTransformError(
1453
+ err,
1454
+ {
1455
+ spreadPathsToArguments: {},
1456
+ explicitPathsToArguments: {
1457
+ cartId: "$[0]",
1458
+ currencyCode: "$[1].currencyCode"
1459
+ },
1460
+ singleArgumentUnchanged: false
1461
+ },
1462
+ ["cartId", "options"]
1463
+ );
1464
+ sideEffects?.onError?.(err);
1465
+ throw transformedError;
1466
+ }
1467
+ }
1468
+ async function completeCheckout2(cartId, options) {
1469
+ const { httpClient, sideEffects } = arguments[2];
1470
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1471
+ cartId,
1472
+ pricingToken: options?.pricingToken,
1473
+ redirectUrls: options?.redirectUrls,
1474
+ savePaymentMethod: options?.savePaymentMethod,
1475
+ delayCapture: options?.delayCapture
1476
+ });
1477
+ const reqOpts = completeCheckout(payload);
1478
+ sideEffects?.onSiteCall?.();
1479
+ try {
1480
+ const result = await httpClient.request(reqOpts);
1481
+ sideEffects?.onSuccess?.(result);
1482
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1483
+ } catch (err) {
1484
+ const transformedError = sdkTransformError(
1485
+ err,
1486
+ {
1487
+ spreadPathsToArguments: {},
1488
+ explicitPathsToArguments: {
1489
+ cartId: "$[0]",
1490
+ pricingToken: "$[1].pricingToken",
1491
+ redirectUrls: "$[1].redirectUrls",
1492
+ savePaymentMethod: "$[1].savePaymentMethod",
1493
+ delayCapture: "$[1].delayCapture"
1494
+ },
1495
+ singleArgumentUnchanged: false
1496
+ },
1497
+ ["cartId", "options"]
1498
+ );
1499
+ sideEffects?.onError?.(err);
1500
+ throw transformedError;
1501
+ }
1502
+ }
1503
+ async function addLineItems2(cartId, options) {
1504
+ const { httpClient, sideEffects } = arguments[2];
1505
+ const payload = transformPaths2(
1506
+ renameKeysFromSDKRequestToRESTRequest({
1507
+ cartId,
1508
+ catalogItems: options?.catalogItems,
1509
+ customItems: options?.customItems
1510
+ }),
1511
+ [
1512
+ {
1513
+ transformFn: transformSDKImageToRESTImage,
1514
+ paths: [
1515
+ { path: "catalogItems.catalogOverrideFields.image" },
1516
+ { path: "customItems.attributes.image" }
1517
+ ]
1518
+ },
1519
+ {
1520
+ transformFn: transformSDKPageURLV2ToRESTPageURLV2,
1521
+ paths: [{ path: "customItems.attributes.url" }]
1522
+ }
1523
+ ]
1524
+ );
1525
+ const reqOpts = addLineItems(payload);
1526
+ sideEffects?.onSiteCall?.();
1527
+ try {
1528
+ const result = await httpClient.request(reqOpts);
1529
+ sideEffects?.onSuccess?.(result);
1530
+ return renameKeysFromRESTResponseToSDKResponse(
1531
+ transformPaths2(result.data, [
1532
+ {
1533
+ transformFn: transformRESTImageToSDKImage,
1534
+ paths: [
1535
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1536
+ { path: "cart.lineItems.attributes.image" }
1537
+ ]
1538
+ },
1539
+ {
1540
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1541
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1542
+ },
1543
+ {
1544
+ transformFn: transformRESTAddressToSDKAddress,
1545
+ paths: [
1546
+ { path: "cart.deliveryInfo.address" },
1547
+ { path: "cart.paymentInfo.billingAddress" }
1548
+ ]
1549
+ }
1550
+ ])
1551
+ );
1552
+ } catch (err) {
1553
+ const transformedError = sdkTransformError(
1554
+ err,
1555
+ {
1556
+ spreadPathsToArguments: {},
1557
+ explicitPathsToArguments: {
1558
+ cartId: "$[0]",
1559
+ catalogItems: "$[1].catalogItems",
1560
+ customItems: "$[1].customItems"
1561
+ },
1562
+ singleArgumentUnchanged: false
1563
+ },
1564
+ ["cartId", "options"]
1565
+ );
1566
+ sideEffects?.onError?.(err);
1567
+ throw transformedError;
1568
+ }
1569
+ }
1570
+ async function removeLineItems2(cartId, lineItemIds) {
1571
+ const { httpClient, sideEffects } = arguments[2];
1572
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1573
+ cartId,
1574
+ lineItemIds
1575
+ });
1576
+ const reqOpts = removeLineItems(payload);
1577
+ sideEffects?.onSiteCall?.();
1578
+ try {
1579
+ const result = await httpClient.request(reqOpts);
1580
+ sideEffects?.onSuccess?.(result);
1581
+ return renameKeysFromRESTResponseToSDKResponse(
1582
+ transformPaths2(result.data, [
1583
+ {
1584
+ transformFn: transformRESTImageToSDKImage,
1585
+ paths: [
1586
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1587
+ { path: "cart.lineItems.attributes.image" }
1588
+ ]
1589
+ },
1590
+ {
1591
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1592
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1593
+ },
1594
+ {
1595
+ transformFn: transformRESTAddressToSDKAddress,
1596
+ paths: [
1597
+ { path: "cart.deliveryInfo.address" },
1598
+ { path: "cart.paymentInfo.billingAddress" }
1599
+ ]
1600
+ }
1601
+ ])
1602
+ );
1603
+ } catch (err) {
1604
+ const transformedError = sdkTransformError(
1605
+ err,
1606
+ {
1607
+ spreadPathsToArguments: {},
1608
+ explicitPathsToArguments: { cartId: "$[0]", lineItemIds: "$[1]" },
1609
+ singleArgumentUnchanged: false
1610
+ },
1611
+ ["cartId", "lineItemIds"]
1612
+ );
1613
+ sideEffects?.onError?.(err);
1614
+ throw transformedError;
1615
+ }
1616
+ }
1617
+ async function addDiscount2(cartId, couponCode) {
1618
+ const { httpClient, sideEffects } = arguments[2];
1619
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1620
+ cartId,
1621
+ couponCode
1622
+ });
1623
+ const reqOpts = addDiscount(payload);
1624
+ sideEffects?.onSiteCall?.();
1625
+ try {
1626
+ const result = await httpClient.request(reqOpts);
1627
+ sideEffects?.onSuccess?.(result);
1628
+ return renameKeysFromRESTResponseToSDKResponse(
1629
+ transformPaths2(result.data, [
1630
+ {
1631
+ transformFn: transformRESTImageToSDKImage,
1632
+ paths: [
1633
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1634
+ { path: "cart.lineItems.attributes.image" }
1635
+ ]
1636
+ },
1637
+ {
1638
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1639
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1640
+ },
1641
+ {
1642
+ transformFn: transformRESTAddressToSDKAddress,
1643
+ paths: [
1644
+ { path: "cart.deliveryInfo.address" },
1645
+ { path: "cart.paymentInfo.billingAddress" }
1646
+ ]
1647
+ }
1648
+ ])
1649
+ );
1650
+ } catch (err) {
1651
+ const transformedError = sdkTransformError(
1652
+ err,
1653
+ {
1654
+ spreadPathsToArguments: {},
1655
+ explicitPathsToArguments: { cartId: "$[0]", couponCode: "$[1]" },
1656
+ singleArgumentUnchanged: false
1657
+ },
1658
+ ["cartId", "couponCode"]
1659
+ );
1660
+ sideEffects?.onError?.(err);
1661
+ throw transformedError;
1662
+ }
1663
+ }
1664
+ async function removeDiscount2(cartId, discountId) {
1665
+ const { httpClient, sideEffects } = arguments[2];
1666
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1667
+ cartId,
1668
+ discountId
1669
+ });
1670
+ const reqOpts = removeDiscount(payload);
1671
+ sideEffects?.onSiteCall?.();
1672
+ try {
1673
+ const result = await httpClient.request(reqOpts);
1674
+ sideEffects?.onSuccess?.(result);
1675
+ return renameKeysFromRESTResponseToSDKResponse(
1676
+ transformPaths2(result.data, [
1677
+ {
1678
+ transformFn: transformRESTImageToSDKImage,
1679
+ paths: [
1680
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1681
+ { path: "cart.lineItems.attributes.image" }
1682
+ ]
1683
+ },
1684
+ {
1685
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1686
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1687
+ },
1688
+ {
1689
+ transformFn: transformRESTAddressToSDKAddress,
1690
+ paths: [
1691
+ { path: "cart.deliveryInfo.address" },
1692
+ { path: "cart.paymentInfo.billingAddress" }
1693
+ ]
1694
+ }
1695
+ ])
1696
+ );
1697
+ } catch (err) {
1698
+ const transformedError = sdkTransformError(
1699
+ err,
1700
+ {
1701
+ spreadPathsToArguments: {},
1702
+ explicitPathsToArguments: { cartId: "$[0]", discountId: "$[1]" },
1703
+ singleArgumentUnchanged: false
1704
+ },
1705
+ ["cartId", "discountId"]
1706
+ );
1707
+ sideEffects?.onError?.(err);
1708
+ throw transformedError;
1709
+ }
1710
+ }
1711
+ async function addGiftCard2(cartId, giftCardCode) {
1712
+ const { httpClient, sideEffects } = arguments[2];
1713
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1714
+ cartId,
1715
+ giftCardCode
1716
+ });
1717
+ const reqOpts = addGiftCard(payload);
1718
+ sideEffects?.onSiteCall?.();
1719
+ try {
1720
+ const result = await httpClient.request(reqOpts);
1721
+ sideEffects?.onSuccess?.(result);
1722
+ return renameKeysFromRESTResponseToSDKResponse(
1723
+ transformPaths2(result.data, [
1724
+ {
1725
+ transformFn: transformRESTImageToSDKImage,
1726
+ paths: [
1727
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1728
+ { path: "cart.lineItems.attributes.image" }
1729
+ ]
1730
+ },
1731
+ {
1732
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1733
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1734
+ },
1735
+ {
1736
+ transformFn: transformRESTAddressToSDKAddress,
1737
+ paths: [
1738
+ { path: "cart.deliveryInfo.address" },
1739
+ { path: "cart.paymentInfo.billingAddress" }
1740
+ ]
1741
+ }
1742
+ ])
1743
+ );
1744
+ } catch (err) {
1745
+ const transformedError = sdkTransformError(
1746
+ err,
1747
+ {
1748
+ spreadPathsToArguments: {},
1749
+ explicitPathsToArguments: { cartId: "$[0]", giftCardCode: "$[1]" },
1750
+ singleArgumentUnchanged: false
1751
+ },
1752
+ ["cartId", "giftCardCode"]
1753
+ );
1754
+ sideEffects?.onError?.(err);
1755
+ throw transformedError;
1756
+ }
1757
+ }
1758
+ async function removeGiftCard2(cartId, giftCardId) {
1759
+ const { httpClient, sideEffects } = arguments[2];
1760
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1761
+ cartId,
1762
+ giftCardId
1763
+ });
1764
+ const reqOpts = removeGiftCard(payload);
1765
+ sideEffects?.onSiteCall?.();
1766
+ try {
1767
+ const result = await httpClient.request(reqOpts);
1768
+ sideEffects?.onSuccess?.(result);
1769
+ return renameKeysFromRESTResponseToSDKResponse(
1770
+ transformPaths2(result.data, [
1771
+ {
1772
+ transformFn: transformRESTImageToSDKImage,
1773
+ paths: [
1774
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1775
+ { path: "cart.lineItems.attributes.image" }
1776
+ ]
1777
+ },
1778
+ {
1779
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1780
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1781
+ },
1782
+ {
1783
+ transformFn: transformRESTAddressToSDKAddress,
1784
+ paths: [
1785
+ { path: "cart.deliveryInfo.address" },
1786
+ { path: "cart.paymentInfo.billingAddress" }
1787
+ ]
1788
+ }
1789
+ ])
1790
+ );
1791
+ } catch (err) {
1792
+ const transformedError = sdkTransformError(
1793
+ err,
1794
+ {
1795
+ spreadPathsToArguments: {},
1796
+ explicitPathsToArguments: { cartId: "$[0]", giftCardId: "$[1]" },
1797
+ singleArgumentUnchanged: false
1798
+ },
1799
+ ["cartId", "giftCardId"]
1800
+ );
1801
+ sideEffects?.onError?.(err);
1802
+ throw transformedError;
1803
+ }
1804
+ }
1805
+ async function updateLineItems2(cartId, options) {
1806
+ const { httpClient, sideEffects } = arguments[2];
1807
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1808
+ cartId,
1809
+ lineItemUpdates: options?.lineItemUpdates
1810
+ });
1811
+ const reqOpts = updateLineItems(payload);
1812
+ sideEffects?.onSiteCall?.();
1813
+ try {
1814
+ const result = await httpClient.request(reqOpts);
1815
+ sideEffects?.onSuccess?.(result);
1816
+ return renameKeysFromRESTResponseToSDKResponse(
1817
+ transformPaths2(result.data, [
1818
+ {
1819
+ transformFn: transformRESTImageToSDKImage,
1820
+ paths: [
1821
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1822
+ { path: "cart.lineItems.attributes.image" }
1823
+ ]
1824
+ },
1825
+ {
1826
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1827
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1828
+ },
1829
+ {
1830
+ transformFn: transformRESTAddressToSDKAddress,
1831
+ paths: [
1832
+ { path: "cart.deliveryInfo.address" },
1833
+ { path: "cart.paymentInfo.billingAddress" }
1834
+ ]
1835
+ }
1836
+ ])
1837
+ );
1838
+ } catch (err) {
1839
+ const transformedError = sdkTransformError(
1840
+ err,
1841
+ {
1842
+ spreadPathsToArguments: {},
1843
+ explicitPathsToArguments: {
1844
+ cartId: "$[0]",
1845
+ lineItemUpdates: "$[1].lineItemUpdates"
1846
+ },
1847
+ singleArgumentUnchanged: false
1848
+ },
1849
+ ["cartId", "options"]
1850
+ );
1851
+ sideEffects?.onError?.(err);
1852
+ throw transformedError;
1853
+ }
1854
+ }
1855
+ async function markCartAsCompleted2(cartId, options) {
1856
+ const { httpClient, sideEffects } = arguments[2];
1857
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1858
+ cartId,
1859
+ orderId: options?.orderId
1860
+ });
1861
+ const reqOpts = markCartAsCompleted(payload);
1862
+ sideEffects?.onSiteCall?.();
1863
+ try {
1864
+ const result = await httpClient.request(reqOpts);
1865
+ sideEffects?.onSuccess?.(result);
1866
+ return renameKeysFromRESTResponseToSDKResponse(
1867
+ transformPaths2(result.data, [
1868
+ {
1869
+ transformFn: transformRESTImageToSDKImage,
1870
+ paths: [
1871
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1872
+ { path: "cart.lineItems.attributes.image" }
1873
+ ]
1874
+ },
1875
+ {
1876
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1877
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1878
+ },
1879
+ {
1880
+ transformFn: transformRESTAddressToSDKAddress,
1881
+ paths: [
1882
+ { path: "cart.deliveryInfo.address" },
1883
+ { path: "cart.paymentInfo.billingAddress" }
1884
+ ]
1885
+ }
1886
+ ])
1887
+ );
1888
+ } catch (err) {
1889
+ const transformedError = sdkTransformError(
1890
+ err,
1891
+ {
1892
+ spreadPathsToArguments: {},
1893
+ explicitPathsToArguments: { cartId: "$[0]", orderId: "$[1].orderId" },
1894
+ singleArgumentUnchanged: false
1895
+ },
1896
+ ["cartId", "options"]
1897
+ );
1898
+ sideEffects?.onError?.(err);
1899
+ throw transformedError;
1900
+ }
1901
+ }
1902
+ async function handleAsyncCheckoutCompletion2(token) {
1903
+ const { httpClient, sideEffects } = arguments[1];
1904
+ const payload = renameKeysFromSDKRequestToRESTRequest({ token });
1905
+ const reqOpts = handleAsyncCheckoutCompletion(payload);
1906
+ sideEffects?.onSiteCall?.();
1907
+ try {
1908
+ const result = await httpClient.request(reqOpts);
1909
+ sideEffects?.onSuccess?.(result);
1910
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1911
+ } catch (err) {
1912
+ const transformedError = sdkTransformError(
1913
+ err,
1914
+ {
1915
+ spreadPathsToArguments: {},
1916
+ explicitPathsToArguments: { token: "$[0]" },
1917
+ singleArgumentUnchanged: false
1918
+ },
1919
+ ["token"]
1920
+ );
1921
+ sideEffects?.onError?.(err);
1922
+ throw transformedError;
1923
+ }
1924
+ }
1925
+
1926
+ // src/ecom-v2-cart-cart-v-2.public.ts
1927
+ function createCart3(httpClient) {
1928
+ return (options) => createCart2(
1929
+ options,
1930
+ // @ts-ignore
1931
+ { httpClient }
1932
+ );
1933
+ }
1934
+ function getCart3(httpClient) {
1935
+ return (cartId) => getCart2(
1936
+ cartId,
1937
+ // @ts-ignore
1938
+ { httpClient }
1939
+ );
1940
+ }
1941
+ function updateCart3(httpClient) {
1942
+ return (_id, cart) => updateCart2(
1943
+ _id,
1944
+ cart,
1945
+ // @ts-ignore
1946
+ { httpClient }
1947
+ );
1948
+ }
1949
+ function deleteCart3(httpClient) {
1950
+ return (cartId) => deleteCart2(
1951
+ cartId,
1952
+ // @ts-ignore
1953
+ { httpClient }
1954
+ );
1955
+ }
1956
+ function refreshCart3(httpClient) {
1957
+ return (cartId) => refreshCart2(
1958
+ cartId,
1959
+ // @ts-ignore
1960
+ { httpClient }
1961
+ );
1962
+ }
1963
+ function calculateCart3(httpClient) {
1964
+ return (cartId, options) => calculateCart2(
1965
+ cartId,
1966
+ options,
1967
+ // @ts-ignore
1968
+ { httpClient }
1969
+ );
1970
+ }
1971
+ function getCheckoutUrl3(httpClient) {
1972
+ return (cartId, options) => getCheckoutUrl2(
1973
+ cartId,
1974
+ options,
1975
+ // @ts-ignore
1976
+ { httpClient }
1977
+ );
1978
+ }
1979
+ function completeCheckout3(httpClient) {
1980
+ return (cartId, options) => completeCheckout2(
1981
+ cartId,
1982
+ options,
1983
+ // @ts-ignore
1984
+ { httpClient }
1985
+ );
1986
+ }
1987
+ function addLineItems3(httpClient) {
1988
+ return (cartId, options) => addLineItems2(
1989
+ cartId,
1990
+ options,
1991
+ // @ts-ignore
1992
+ { httpClient }
1993
+ );
1994
+ }
1995
+ function removeLineItems3(httpClient) {
1996
+ return (cartId, lineItemIds) => removeLineItems2(
1997
+ cartId,
1998
+ lineItemIds,
1999
+ // @ts-ignore
2000
+ { httpClient }
2001
+ );
2002
+ }
2003
+ function addDiscount3(httpClient) {
2004
+ return (cartId, couponCode) => addDiscount2(
2005
+ cartId,
2006
+ couponCode,
2007
+ // @ts-ignore
2008
+ { httpClient }
2009
+ );
2010
+ }
2011
+ function removeDiscount3(httpClient) {
2012
+ return (cartId, discountId) => removeDiscount2(
2013
+ cartId,
2014
+ discountId,
2015
+ // @ts-ignore
2016
+ { httpClient }
2017
+ );
2018
+ }
2019
+ function addGiftCard3(httpClient) {
2020
+ return (cartId, giftCardCode) => addGiftCard2(
2021
+ cartId,
2022
+ giftCardCode,
2023
+ // @ts-ignore
2024
+ { httpClient }
2025
+ );
2026
+ }
2027
+ function removeGiftCard3(httpClient) {
2028
+ return (cartId, giftCardId) => removeGiftCard2(
2029
+ cartId,
2030
+ giftCardId,
2031
+ // @ts-ignore
2032
+ { httpClient }
2033
+ );
2034
+ }
2035
+ function updateLineItems3(httpClient) {
2036
+ return (cartId, options) => updateLineItems2(
2037
+ cartId,
2038
+ options,
2039
+ // @ts-ignore
2040
+ { httpClient }
2041
+ );
2042
+ }
2043
+ function markCartAsCompleted3(httpClient) {
2044
+ return (cartId, options) => markCartAsCompleted2(
2045
+ cartId,
2046
+ options,
2047
+ // @ts-ignore
2048
+ { httpClient }
2049
+ );
2050
+ }
2051
+ function handleAsyncCheckoutCompletion3(httpClient) {
2052
+ return (token) => handleAsyncCheckoutCompletion2(
2053
+ token,
2054
+ // @ts-ignore
2055
+ { httpClient }
2056
+ );
2057
+ }
2058
+
2059
+ // src/ecom-v2-cart-cart-v-2.context.ts
2060
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
2061
+ var createCart4 = /* @__PURE__ */ createRESTModule(createCart3);
2062
+ var getCart4 = /* @__PURE__ */ createRESTModule(getCart3);
2063
+ var updateCart4 = /* @__PURE__ */ createRESTModule(updateCart3);
2064
+ var deleteCart4 = /* @__PURE__ */ createRESTModule(deleteCart3);
2065
+ var refreshCart4 = /* @__PURE__ */ createRESTModule(refreshCart3);
2066
+ var calculateCart4 = /* @__PURE__ */ createRESTModule(calculateCart3);
2067
+ var getCheckoutUrl4 = /* @__PURE__ */ createRESTModule(getCheckoutUrl3);
2068
+ var completeCheckout4 = /* @__PURE__ */ createRESTModule(completeCheckout3);
2069
+ var addLineItems4 = /* @__PURE__ */ createRESTModule(addLineItems3);
2070
+ var removeLineItems4 = /* @__PURE__ */ createRESTModule(removeLineItems3);
2071
+ var addDiscount4 = /* @__PURE__ */ createRESTModule(addDiscount3);
2072
+ var removeDiscount4 = /* @__PURE__ */ createRESTModule(removeDiscount3);
2073
+ var addGiftCard4 = /* @__PURE__ */ createRESTModule(addGiftCard3);
2074
+ var removeGiftCard4 = /* @__PURE__ */ createRESTModule(removeGiftCard3);
2075
+ var updateLineItems4 = /* @__PURE__ */ createRESTModule(updateLineItems3);
2076
+ var markCartAsCompleted4 = /* @__PURE__ */ createRESTModule(markCartAsCompleted3);
2077
+ var handleAsyncCheckoutCompletion4 = /* @__PURE__ */ createRESTModule(handleAsyncCheckoutCompletion3);
2078
+ export {
2079
+ CalculationComponent,
2080
+ CartStatus,
2081
+ ChannelType,
2082
+ DescriptionLineType,
2083
+ DiscountScope,
2084
+ DiscountSourceType,
2085
+ DiscountStatus,
2086
+ ErrorCode,
2087
+ FileType,
2088
+ ItemStatus,
2089
+ ItemTypeItemType,
2090
+ NameInLineItem,
2091
+ NameInOther,
2092
+ PaymentOptionType,
2093
+ RuleType,
2094
+ Severity,
2095
+ SubscriptionFrequency,
2096
+ SuggestedFix,
2097
+ TaxableAddressType,
2098
+ ValidationsConfig,
2099
+ VatType,
2100
+ WebhookIdentityType,
2101
+ WeightUnit,
2102
+ addDiscount4 as addDiscount,
2103
+ addGiftCard4 as addGiftCard,
2104
+ addLineItems4 as addLineItems,
2105
+ calculateCart4 as calculateCart,
2106
+ completeCheckout4 as completeCheckout,
2107
+ createCart4 as createCart,
2108
+ deleteCart4 as deleteCart,
2109
+ getCart4 as getCart,
2110
+ getCheckoutUrl4 as getCheckoutUrl,
2111
+ handleAsyncCheckoutCompletion4 as handleAsyncCheckoutCompletion,
2112
+ markCartAsCompleted4 as markCartAsCompleted,
2113
+ refreshCart4 as refreshCart,
2114
+ removeDiscount4 as removeDiscount,
2115
+ removeGiftCard4 as removeGiftCard,
2116
+ removeLineItems4 as removeLineItems,
2117
+ updateCart4 as updateCart,
2118
+ updateLineItems4 as updateLineItems
2119
+ };
2120
+ //# sourceMappingURL=index.mjs.map