@wix/auto_sdk_ecom_cart 1.0.174 → 1.0.175

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