@wix/auto_sdk_ecom_cart 1.0.174 → 1.0.176

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