@wix/auto_sdk_ecom_current-cart 1.0.184 → 1.0.185

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