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