@wix/auto_sdk_ecom_checkout 1.0.168 → 1.0.170

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