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