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