@wix/auto_sdk_ecom_checkout 1.0.168 → 1.0.170

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