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