@wix/auto_sdk_ecom_checkout 1.0.43 → 1.0.45

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