@wix/auto_sdk_ecom_checkout-templates 1.0.149 → 1.0.151

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,1173 +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
- SortOrder: () => SortOrder,
46
- Status: () => Status,
47
- SubscriptionFrequency: () => SubscriptionFrequency,
48
- SuggestedFix: () => SuggestedFix,
49
- TaxableAddressType: () => TaxableAddressType,
50
- VatType: () => VatType,
51
- WebhookIdentityType: () => WebhookIdentityType,
52
- WeightUnit: () => WeightUnit,
53
- bulkCreateCheckoutTemplates: () => bulkCreateCheckoutTemplates2,
54
- createAndRedirectToCheckout: () => createAndRedirectToCheckout2,
55
- createCheckoutFromTemplate: () => createCheckoutFromTemplate2,
56
- createCheckoutTemplate: () => createCheckoutTemplate2,
57
- deleteCheckoutTemplate: () => deleteCheckoutTemplate2,
58
- getCheckoutTemplate: () => getCheckoutTemplate2,
59
- queryCheckoutTemplates: () => queryCheckoutTemplates2,
60
- typedQueryCheckoutTemplates: () => typedQueryCheckoutTemplates,
61
- updateCheckoutTemplate: () => updateCheckoutTemplate2,
62
- utils: () => utils
63
- });
64
- module.exports = __toCommonJS(index_typings_exports);
65
-
66
- // src/ecom-v1-checkout-template-checkout-templates.universal.ts
67
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
68
- var import_query_builder = require("@wix/sdk-runtime/query-builder");
69
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
70
-
71
- // src/ecom-v1-checkout-template-checkout-templates.http.ts
72
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
73
- var import_float = require("@wix/sdk-runtime/transformations/float");
74
- var import_float2 = require("@wix/sdk-runtime/transformations/float");
75
- var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
76
- var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
77
- var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
78
- var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
79
- var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
80
- var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
81
- function resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl(opts) {
82
- const domainToMappings = {
83
- "www._base_domain_": [
84
- {
85
- srcPath: "/ecom/v1/checkout-templates",
86
- destPath: "/v1/checkout-templates"
87
- }
88
- ],
89
- "www.wixapis.com": [
90
- {
91
- srcPath: "/ecom/v1/checkout-templates",
92
- destPath: "/v1/checkout-templates"
93
- }
94
- ],
95
- "*.dev.wix-code.com": [
96
- {
97
- srcPath: "/ecom/v1/checkout-templates",
98
- destPath: "/v1/checkout-templates"
99
- }
100
- ],
101
- _: [
102
- {
103
- srcPath: "/ecom/v1/checkout-templates",
104
- destPath: "/v1/checkout-templates"
105
- }
106
- ],
107
- "api._api_base_domain_": [
108
- {
109
- srcPath: "/checkout-template",
110
- destPath: ""
111
- }
112
- ]
113
- };
114
- return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
115
- }
116
- var PACKAGE_NAME = "@wix/auto_sdk_ecom_checkout-templates";
117
- function createCheckoutTemplate(payload) {
118
- function __createCheckoutTemplate({ host }) {
119
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
120
- {
121
- transformFn: import_float.transformSDKFloatToRESTFloat,
122
- paths: [
123
- {
124
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
125
- },
126
- {
127
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
128
- }
129
- ]
130
- },
131
- {
132
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
133
- paths: [
134
- {
135
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
136
- },
137
- {
138
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
139
- },
140
- {
141
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
142
- }
143
- ]
144
- }
145
- ]);
146
- const metadata = {
147
- entityFqdn: "wix.ecom.v1.checkout_template",
148
- method: "POST",
149
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateCheckoutTemplate",
150
- packageName: PACKAGE_NAME,
151
- migrationOptions: {
152
- optInTransformResponse: true
153
- },
154
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
155
- protoPath: "/v1/checkout-templates",
156
- data: serializedData,
157
- host
158
- }),
159
- data: serializedData,
160
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
161
- {
162
- transformFn: import_float2.transformRESTFloatToSDKFloat,
163
- paths: [
164
- {
165
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
166
- },
167
- {
168
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
169
- }
170
- ]
171
- },
172
- {
173
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
174
- paths: [
175
- {
176
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
177
- },
178
- {
179
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
180
- },
181
- {
182
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
183
- }
184
- ]
185
- }
186
- ])
187
- };
188
- return metadata;
189
- }
190
- return __createCheckoutTemplate;
191
- }
192
- function bulkCreateCheckoutTemplates(payload) {
193
- function __bulkCreateCheckoutTemplates({ host }) {
194
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
195
- {
196
- transformFn: import_float.transformSDKFloatToRESTFloat,
197
- paths: [
198
- {
199
- path: "checkoutTemplates.lineItems.catalogOverrideFields.physicalProperties.weight"
200
- },
201
- {
202
- path: "checkoutTemplates.customLineItems.physicalProperties.weight"
203
- }
204
- ]
205
- },
206
- {
207
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
208
- paths: [
209
- {
210
- path: "checkoutTemplates.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
211
- },
212
- {
213
- path: "checkoutTemplates.customLineItems.serviceProperties.scheduledDate"
214
- },
215
- {
216
- path: "checkoutTemplates.customLineItems.serviceProperties.endDate"
217
- }
218
- ]
219
- }
220
- ]);
221
- const metadata = {
222
- entityFqdn: "wix.ecom.v1.checkout_template",
223
- method: "POST",
224
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.BulkCreateCheckoutTemplates",
225
- packageName: PACKAGE_NAME,
226
- migrationOptions: {
227
- optInTransformResponse: true
228
- },
229
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
230
- protoPath: "/v1/bulk/checkout-templates/create",
231
- data: serializedData,
232
- host
233
- }),
234
- data: serializedData,
235
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
236
- {
237
- transformFn: import_float2.transformRESTFloatToSDKFloat,
238
- paths: [
239
- {
240
- path: "results.item.lineItems.catalogOverrideFields.physicalProperties.weight"
241
- },
242
- {
243
- path: "results.item.customLineItems.physicalProperties.weight"
244
- }
245
- ]
246
- },
247
- {
248
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
249
- paths: [
250
- {
251
- path: "results.item.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
252
- },
253
- {
254
- path: "results.item.customLineItems.serviceProperties.scheduledDate"
255
- },
256
- {
257
- path: "results.item.customLineItems.serviceProperties.endDate"
258
- }
259
- ]
260
- }
261
- ])
262
- };
263
- return metadata;
264
- }
265
- return __bulkCreateCheckoutTemplates;
266
- }
267
- function getCheckoutTemplate(payload) {
268
- function __getCheckoutTemplate({ host }) {
269
- const metadata = {
270
- entityFqdn: "wix.ecom.v1.checkout_template",
271
- method: "GET",
272
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.GetCheckoutTemplate",
273
- packageName: PACKAGE_NAME,
274
- migrationOptions: {
275
- optInTransformResponse: true
276
- },
277
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
278
- protoPath: "/v1/checkout-templates/{checkoutTemplateId}",
279
- data: payload,
280
- host
281
- }),
282
- params: (0, import_rest_modules.toURLSearchParams)(payload),
283
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
284
- {
285
- transformFn: import_float2.transformRESTFloatToSDKFloat,
286
- paths: [
287
- {
288
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
289
- },
290
- {
291
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
292
- }
293
- ]
294
- },
295
- {
296
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
297
- paths: [
298
- {
299
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
300
- },
301
- {
302
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
303
- },
304
- {
305
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
306
- }
307
- ]
308
- }
309
- ])
310
- };
311
- return metadata;
312
- }
313
- return __getCheckoutTemplate;
314
- }
315
- function updateCheckoutTemplate(payload) {
316
- function __updateCheckoutTemplate({ host }) {
317
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
318
- {
319
- transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
320
- paths: [{ path: "fieldMask" }]
321
- },
322
- {
323
- transformFn: import_float.transformSDKFloatToRESTFloat,
324
- paths: [
325
- {
326
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
327
- },
328
- {
329
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
330
- }
331
- ]
332
- },
333
- {
334
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
335
- paths: [
336
- {
337
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
338
- },
339
- {
340
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
341
- },
342
- {
343
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
344
- }
345
- ]
346
- }
347
- ]);
348
- const metadata = {
349
- entityFqdn: "wix.ecom.v1.checkout_template",
350
- method: "PATCH",
351
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.UpdateCheckoutTemplate",
352
- packageName: PACKAGE_NAME,
353
- migrationOptions: {
354
- optInTransformResponse: true
355
- },
356
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
357
- protoPath: "/v1/checkout-templates/{checkoutTemplate.id}",
358
- data: serializedData,
359
- host
360
- }),
361
- data: serializedData,
362
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
363
- {
364
- transformFn: import_float2.transformRESTFloatToSDKFloat,
365
- paths: [
366
- {
367
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
368
- },
369
- {
370
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
371
- }
372
- ]
373
- },
374
- {
375
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
376
- paths: [
377
- {
378
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
379
- },
380
- {
381
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
382
- },
383
- {
384
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
385
- }
386
- ]
387
- }
388
- ])
389
- };
390
- return metadata;
391
- }
392
- return __updateCheckoutTemplate;
393
- }
394
- function deleteCheckoutTemplate(payload) {
395
- function __deleteCheckoutTemplate({ host }) {
396
- const metadata = {
397
- entityFqdn: "wix.ecom.v1.checkout_template",
398
- method: "DELETE",
399
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.DeleteCheckoutTemplate",
400
- packageName: PACKAGE_NAME,
401
- migrationOptions: {
402
- optInTransformResponse: true
403
- },
404
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
405
- protoPath: "/v1/checkout-templates/{checkoutTemplateId}",
406
- data: payload,
407
- host
408
- }),
409
- params: (0, import_rest_modules.toURLSearchParams)(payload)
410
- };
411
- return metadata;
412
- }
413
- return __deleteCheckoutTemplate;
414
- }
415
- function queryCheckoutTemplates(payload) {
416
- function __queryCheckoutTemplates({ host }) {
417
- const metadata = {
418
- entityFqdn: "wix.ecom.v1.checkout_template",
419
- method: "POST",
420
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.QueryCheckoutTemplates",
421
- packageName: PACKAGE_NAME,
422
- migrationOptions: {
423
- optInTransformResponse: true
424
- },
425
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
426
- protoPath: "/v1/checkout-templates/query",
427
- data: payload,
428
- host
429
- }),
430
- data: payload,
431
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
432
- {
433
- transformFn: import_float2.transformRESTFloatToSDKFloat,
434
- paths: [
435
- {
436
- path: "checkoutTemplates.lineItems.catalogOverrideFields.physicalProperties.weight"
437
- },
438
- {
439
- path: "checkoutTemplates.customLineItems.physicalProperties.weight"
440
- }
441
- ]
442
- },
443
- {
444
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
445
- paths: [
446
- {
447
- path: "checkoutTemplates.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
448
- },
449
- {
450
- path: "checkoutTemplates.customLineItems.serviceProperties.scheduledDate"
451
- },
452
- {
453
- path: "checkoutTemplates.customLineItems.serviceProperties.endDate"
454
- }
455
- ]
456
- }
457
- ])
458
- };
459
- return metadata;
460
- }
461
- return __queryCheckoutTemplates;
462
- }
463
- function createCheckoutFromTemplate(payload) {
464
- function __createCheckoutFromTemplate({ host }) {
465
- const metadata = {
466
- entityFqdn: "wix.ecom.v1.checkout_template",
467
- method: "POST",
468
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateCheckoutFromTemplate",
469
- packageName: PACKAGE_NAME,
470
- migrationOptions: {
471
- optInTransformResponse: true
472
- },
473
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
474
- protoPath: "/v1/checkout-templates/{checkoutTemplateId}/create-checkout-from-template",
475
- data: payload,
476
- host
477
- }),
478
- data: payload
479
- };
480
- return metadata;
481
- }
482
- return __createCheckoutFromTemplate;
483
- }
484
- function createAndRedirectToCheckout(payload) {
485
- function __createAndRedirectToCheckout({ host }) {
486
- const metadata = {
487
- entityFqdn: "wix.ecom.v1.checkout_template",
488
- method: "GET",
489
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateAndRedirectToCheckout",
490
- packageName: PACKAGE_NAME,
491
- migrationOptions: {
492
- optInTransformResponse: true
493
- },
494
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
495
- protoPath: "/v1/checkout-templates/{checkoutTemplateId}/create-and-redirect-to-checkout",
496
- data: payload,
497
- host
498
- }),
499
- params: (0, import_rest_modules.toURLSearchParams)(payload),
500
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
501
- {
502
- transformFn: import_bytes.transformRESTBytesToSDKBytes,
503
- paths: [{ path: "body" }]
504
- }
505
- ])
506
- };
507
- return metadata;
508
- }
509
- return __createAndRedirectToCheckout;
510
- }
511
-
512
- // src/ecom-v1-checkout-template-checkout-templates.universal.ts
513
- var import_image = require("@wix/sdk-runtime/transformations/image");
514
- var import_image2 = require("@wix/sdk-runtime/transformations/image");
515
- var import_page_url_v2 = require("@wix/sdk-runtime/transformations/page-url-v2");
516
- var import_page_url_v22 = require("@wix/sdk-runtime/transformations/page-url-v2");
517
- var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
518
- var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
519
- var Status = /* @__PURE__ */ ((Status2) => {
520
- Status2["ACTIVE"] = "ACTIVE";
521
- Status2["INACTIVE"] = "INACTIVE";
522
- return Status2;
523
- })(Status || {});
524
- var DescriptionLineType = /* @__PURE__ */ ((DescriptionLineType2) => {
525
- DescriptionLineType2["UNRECOGNISED"] = "UNRECOGNISED";
526
- DescriptionLineType2["PLAIN_TEXT"] = "PLAIN_TEXT";
527
- DescriptionLineType2["COLOR"] = "COLOR";
528
- return DescriptionLineType2;
529
- })(DescriptionLineType || {});
530
- var DimensionsUnit = /* @__PURE__ */ ((DimensionsUnit2) => {
531
- DimensionsUnit2["UNKNOWN_DIMENSIONS_UNIT"] = "UNKNOWN_DIMENSIONS_UNIT";
532
- DimensionsUnit2["MM"] = "MM";
533
- DimensionsUnit2["CM"] = "CM";
534
- DimensionsUnit2["M"] = "M";
535
- DimensionsUnit2["IN"] = "IN";
536
- DimensionsUnit2["FT"] = "FT";
537
- DimensionsUnit2["YD"] = "YD";
538
- return DimensionsUnit2;
539
- })(DimensionsUnit || {});
540
- var PaymentOptionType = /* @__PURE__ */ ((PaymentOptionType2) => {
541
- PaymentOptionType2["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
542
- PaymentOptionType2["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
543
- PaymentOptionType2["MEMBERSHIP"] = "MEMBERSHIP";
544
- PaymentOptionType2["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
545
- PaymentOptionType2["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
546
- PaymentOptionType2["MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"] = "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER";
547
- return PaymentOptionType2;
548
- })(PaymentOptionType || {});
549
- var ItemTypePreset = /* @__PURE__ */ ((ItemTypePreset2) => {
550
- ItemTypePreset2["UNRECOGNISED"] = "UNRECOGNISED";
551
- ItemTypePreset2["PHYSICAL"] = "PHYSICAL";
552
- ItemTypePreset2["DIGITAL"] = "DIGITAL";
553
- ItemTypePreset2["GIFT_CARD"] = "GIFT_CARD";
554
- ItemTypePreset2["SERVICE"] = "SERVICE";
555
- return ItemTypePreset2;
556
- })(ItemTypePreset || {});
557
- var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
558
- SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
559
- SubscriptionFrequency2["DAY"] = "DAY";
560
- SubscriptionFrequency2["WEEK"] = "WEEK";
561
- SubscriptionFrequency2["MONTH"] = "MONTH";
562
- SubscriptionFrequency2["YEAR"] = "YEAR";
563
- return SubscriptionFrequency2;
564
- })(SubscriptionFrequency || {});
565
- var ProductPeriodAlignment = /* @__PURE__ */ ((ProductPeriodAlignment2) => {
566
- ProductPeriodAlignment2["ALIGNED_WITH_BILLING_PERIOD"] = "ALIGNED_WITH_BILLING_PERIOD";
567
- ProductPeriodAlignment2["NOT_ALIGNED_WITH_BILLING_PERIOD"] = "NOT_ALIGNED_WITH_BILLING_PERIOD";
568
- return ProductPeriodAlignment2;
569
- })(ProductPeriodAlignment || {});
570
- var FileType = /* @__PURE__ */ ((FileType2) => {
571
- FileType2["UNSPECIFIED"] = "UNSPECIFIED";
572
- FileType2["SECURE_PICTURE"] = "SECURE_PICTURE";
573
- FileType2["SECURE_VIDEO"] = "SECURE_VIDEO";
574
- FileType2["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
575
- FileType2["SECURE_MUSIC"] = "SECURE_MUSIC";
576
- FileType2["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
577
- FileType2["SECURE_RAW"] = "SECURE_RAW";
578
- return FileType2;
579
- })(FileType || {});
580
- var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
581
- TaxableAddressType2["BUSINESS"] = "BUSINESS";
582
- TaxableAddressType2["BILLING"] = "BILLING";
583
- TaxableAddressType2["SHIPPING"] = "SHIPPING";
584
- return TaxableAddressType2;
585
- })(TaxableAddressType || {});
586
- var JurisdictionType = /* @__PURE__ */ ((JurisdictionType2) => {
587
- JurisdictionType2["UNDEFINED"] = "UNDEFINED";
588
- JurisdictionType2["COUNTRY"] = "COUNTRY";
589
- JurisdictionType2["STATE"] = "STATE";
590
- JurisdictionType2["COUNTY"] = "COUNTY";
591
- JurisdictionType2["CITY"] = "CITY";
592
- JurisdictionType2["SPECIAL"] = "SPECIAL";
593
- return JurisdictionType2;
594
- })(JurisdictionType || {});
595
- var ItemAvailabilityStatus = /* @__PURE__ */ ((ItemAvailabilityStatus2) => {
596
- ItemAvailabilityStatus2["AVAILABLE"] = "AVAILABLE";
597
- ItemAvailabilityStatus2["NOT_FOUND"] = "NOT_FOUND";
598
- ItemAvailabilityStatus2["NOT_AVAILABLE"] = "NOT_AVAILABLE";
599
- ItemAvailabilityStatus2["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
600
- return ItemAvailabilityStatus2;
601
- })(ItemAvailabilityStatus || {});
602
- var PlatformFeeChargeType = /* @__PURE__ */ ((PlatformFeeChargeType2) => {
603
- PlatformFeeChargeType2["PASS_ON"] = "PASS_ON";
604
- PlatformFeeChargeType2["ABSORBED"] = "ABSORBED";
605
- return PlatformFeeChargeType2;
606
- })(PlatformFeeChargeType || {});
607
- var VatType = /* @__PURE__ */ ((VatType2) => {
608
- VatType2["UNSPECIFIED"] = "UNSPECIFIED";
609
- VatType2["CPF"] = "CPF";
610
- VatType2["CNPJ"] = "CNPJ";
611
- return VatType2;
612
- })(VatType || {});
613
- var PickupMethod = /* @__PURE__ */ ((PickupMethod2) => {
614
- PickupMethod2["STORE_PICKUP"] = "STORE_PICKUP";
615
- PickupMethod2["PICKUP_POINT"] = "PICKUP_POINT";
616
- return PickupMethod2;
617
- })(PickupMethod || {});
618
- var ChargeType = /* @__PURE__ */ ((ChargeType2) => {
619
- ChargeType2["HANDLING_FEE"] = "HANDLING_FEE";
620
- ChargeType2["INSURANCE"] = "INSURANCE";
621
- return ChargeType2;
622
- })(ChargeType || {});
623
- var RuleType = /* @__PURE__ */ ((RuleType2) => {
624
- RuleType2["VALIDATION"] = "VALIDATION";
625
- RuleType2["OTHER"] = "OTHER";
626
- RuleType2["MAX"] = "MAX";
627
- RuleType2["MIN"] = "MIN";
628
- RuleType2["MAX_LENGTH"] = "MAX_LENGTH";
629
- RuleType2["MIN_LENGTH"] = "MIN_LENGTH";
630
- RuleType2["MAX_SIZE"] = "MAX_SIZE";
631
- RuleType2["MIN_SIZE"] = "MIN_SIZE";
632
- RuleType2["FORMAT"] = "FORMAT";
633
- RuleType2["DECIMAL_LTE"] = "DECIMAL_LTE";
634
- RuleType2["DECIMAL_GTE"] = "DECIMAL_GTE";
635
- RuleType2["DECIMAL_LT"] = "DECIMAL_LT";
636
- RuleType2["DECIMAL_GT"] = "DECIMAL_GT";
637
- RuleType2["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
638
- RuleType2["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
639
- RuleType2["REQUIRED_FIELD"] = "REQUIRED_FIELD";
640
- RuleType2["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
641
- RuleType2["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
642
- RuleType2["EXACT_LENGTH"] = "EXACT_LENGTH";
643
- RuleType2["EXACT_SIZE"] = "EXACT_SIZE";
644
- RuleType2["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
645
- return RuleType2;
646
- })(RuleType || {});
647
- var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
648
- DiscountType2["GLOBAL"] = "GLOBAL";
649
- DiscountType2["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
650
- DiscountType2["SHIPPING"] = "SHIPPING";
651
- return DiscountType2;
652
- })(DiscountType || {});
653
- var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
654
- WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
655
- WeightUnit2["KG"] = "KG";
656
- WeightUnit2["LB"] = "LB";
657
- return WeightUnit2;
658
- })(WeightUnit || {});
659
- var RateType = /* @__PURE__ */ ((RateType2) => {
660
- RateType2["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
661
- RateType2["MANUAL_RATE"] = "MANUAL_RATE";
662
- RateType2["AUTO_RATE"] = "AUTO_RATE";
663
- RateType2["FALLBACK_RATE"] = "FALLBACK_RATE";
664
- return RateType2;
665
- })(RateType || {});
666
- var ManualCalculationReason = /* @__PURE__ */ ((ManualCalculationReason2) => {
667
- ManualCalculationReason2["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
668
- ManualCalculationReason2["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
669
- return ManualCalculationReason2;
670
- })(ManualCalculationReason || {});
671
- var FallbackReason = /* @__PURE__ */ ((FallbackReason2) => {
672
- FallbackReason2["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
673
- FallbackReason2["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
674
- return FallbackReason2;
675
- })(FallbackReason || {});
676
- var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
677
- ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
678
- ChannelType2["WEB"] = "WEB";
679
- ChannelType2["POS"] = "POS";
680
- ChannelType2["EBAY"] = "EBAY";
681
- ChannelType2["AMAZON"] = "AMAZON";
682
- ChannelType2["OTHER_PLATFORM"] = "OTHER_PLATFORM";
683
- ChannelType2["WIX_APP_STORE"] = "WIX_APP_STORE";
684
- ChannelType2["WIX_INVOICES"] = "WIX_INVOICES";
685
- ChannelType2["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
686
- ChannelType2["WISH"] = "WISH";
687
- ChannelType2["CLASS_PASS"] = "CLASS_PASS";
688
- ChannelType2["GLOBAL_E"] = "GLOBAL_E";
689
- ChannelType2["FACEBOOK"] = "FACEBOOK";
690
- ChannelType2["ETSY"] = "ETSY";
691
- ChannelType2["TIKTOK"] = "TIKTOK";
692
- ChannelType2["FAIRE_COM"] = "FAIRE_COM";
693
- ChannelType2["PAYPAL_AGENTIC_CHECKOUT"] = "PAYPAL_AGENTIC_CHECKOUT";
694
- ChannelType2["STRIPE_AGENTIC_CHECKOUT"] = "STRIPE_AGENTIC_CHECKOUT";
695
- ChannelType2["WIX_INVOICES_PLATFORM"] = "WIX_INVOICES_PLATFORM";
696
- ChannelType2["UCP_AGENTIC_CHECKOUT"] = "UCP_AGENTIC_CHECKOUT";
697
- return ChannelType2;
698
- })(ChannelType || {});
699
- var BalanceType = /* @__PURE__ */ ((BalanceType2) => {
700
- BalanceType2["PUNCH_CARD"] = "PUNCH_CARD";
701
- BalanceType2["CREDIT"] = "CREDIT";
702
- return BalanceType2;
703
- })(BalanceType || {});
704
- var AdditionalFeeSource = /* @__PURE__ */ ((AdditionalFeeSource2) => {
705
- AdditionalFeeSource2["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
706
- AdditionalFeeSource2["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
707
- AdditionalFeeSource2["ITEM"] = "ITEM";
708
- AdditionalFeeSource2["MANUAL"] = "MANUAL";
709
- AdditionalFeeSource2["SHIPPING"] = "SHIPPING";
710
- AdditionalFeeSource2["PLATFORM"] = "PLATFORM";
711
- return AdditionalFeeSource2;
712
- })(AdditionalFeeSource || {});
713
- var Severity = /* @__PURE__ */ ((Severity2) => {
714
- Severity2["WARNING"] = "WARNING";
715
- Severity2["ERROR"] = "ERROR";
716
- return Severity2;
717
- })(Severity || {});
718
- var NameInOther = /* @__PURE__ */ ((NameInOther2) => {
719
- NameInOther2["OTHER_DEFAULT"] = "OTHER_DEFAULT";
720
- return NameInOther2;
721
- })(NameInOther || {});
722
- var NameInLineItem = /* @__PURE__ */ ((NameInLineItem2) => {
723
- NameInLineItem2["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
724
- return NameInLineItem2;
725
- })(NameInLineItem || {});
726
- var SuggestedFix = /* @__PURE__ */ ((SuggestedFix2) => {
727
- SuggestedFix2["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
728
- SuggestedFix2["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
729
- return SuggestedFix2;
730
- })(SuggestedFix || {});
731
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
732
- SortOrder2["ASC"] = "ASC";
733
- SortOrder2["DESC"] = "DESC";
734
- return SortOrder2;
735
- })(SortOrder || {});
736
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
737
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
738
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
739
- WebhookIdentityType2["MEMBER"] = "MEMBER";
740
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
741
- WebhookIdentityType2["APP"] = "APP";
742
- return WebhookIdentityType2;
743
- })(WebhookIdentityType || {});
744
- async function createCheckoutTemplate2(checkoutTemplate) {
745
- const { httpClient, sideEffects } = arguments[1];
746
- const payload = (0, import_transform_paths2.transformPaths)(
747
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
748
- checkoutTemplate
749
- }),
750
- [
751
- {
752
- transformFn: import_image.transformSDKImageToRESTImage,
753
- paths: [
754
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
755
- { path: "checkoutTemplate.customLineItems.media" }
756
- ]
757
- },
758
- {
759
- transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
760
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
761
- }
762
- ]
763
- );
764
- const reqOpts = createCheckoutTemplate(payload);
765
- sideEffects?.onSiteCall?.();
766
- try {
767
- const result = await httpClient.request(reqOpts);
768
- sideEffects?.onSuccess?.(result);
769
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
770
- (0, import_transform_paths2.transformPaths)(result.data, [
771
- {
772
- transformFn: import_image2.transformRESTImageToSDKImage,
773
- paths: [
774
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
775
- { path: "checkoutTemplate.customLineItems.media" }
776
- ]
777
- },
778
- {
779
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
780
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
781
- }
782
- ])
783
- )?.checkoutTemplate;
784
- } catch (err) {
785
- const transformedError = (0, import_transform_error.transformError)(
786
- err,
787
- {
788
- spreadPathsToArguments: {},
789
- explicitPathsToArguments: { checkoutTemplate: "$[0]" },
790
- singleArgumentUnchanged: false
791
- },
792
- ["checkoutTemplate"]
793
- );
794
- sideEffects?.onError?.(err);
795
- throw transformedError;
796
- }
797
- }
798
- async function bulkCreateCheckoutTemplates2(checkoutTemplates, options) {
799
- const { httpClient, sideEffects } = arguments[2];
800
- const payload = (0, import_transform_paths2.transformPaths)(
801
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
802
- checkoutTemplates,
803
- returnEntity: options?.returnEntity
804
- }),
805
- [
806
- {
807
- transformFn: import_image.transformSDKImageToRESTImage,
808
- paths: [
809
- { path: "checkoutTemplates.lineItems.catalogOverrideFields.image" },
810
- { path: "checkoutTemplates.customLineItems.media" }
811
- ]
812
- },
813
- {
814
- transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
815
- paths: [{ path: "checkoutTemplates.customLineItems.url" }]
816
- }
817
- ]
818
- );
819
- const reqOpts = bulkCreateCheckoutTemplates(payload);
820
- sideEffects?.onSiteCall?.();
821
- try {
822
- const result = await httpClient.request(reqOpts);
823
- sideEffects?.onSuccess?.(result);
824
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
825
- (0, import_transform_paths2.transformPaths)(result.data, [
826
- {
827
- transformFn: import_image2.transformRESTImageToSDKImage,
828
- paths: [
829
- { path: "results.item.lineItems.catalogOverrideFields.image" },
830
- { path: "results.item.customLineItems.media" }
831
- ]
832
- },
833
- {
834
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
835
- paths: [{ path: "results.item.customLineItems.url" }]
836
- }
837
- ])
838
- );
839
- } catch (err) {
840
- const transformedError = (0, import_transform_error.transformError)(
841
- err,
842
- {
843
- spreadPathsToArguments: {},
844
- explicitPathsToArguments: {
845
- checkoutTemplates: "$[0]",
846
- returnEntity: "$[1].returnEntity"
847
- },
848
- singleArgumentUnchanged: false
849
- },
850
- ["checkoutTemplates", "options"]
851
- );
852
- sideEffects?.onError?.(err);
853
- throw transformedError;
854
- }
855
- }
856
- async function getCheckoutTemplate2(checkoutTemplateId) {
857
- const { httpClient, sideEffects } = arguments[1];
858
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
859
- checkoutTemplateId
860
- });
861
- const reqOpts = getCheckoutTemplate(payload);
862
- sideEffects?.onSiteCall?.();
863
- try {
864
- const result = await httpClient.request(reqOpts);
865
- sideEffects?.onSuccess?.(result);
866
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
867
- (0, import_transform_paths2.transformPaths)(result.data, [
868
- {
869
- transformFn: import_image2.transformRESTImageToSDKImage,
870
- paths: [
871
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
872
- { path: "checkoutTemplate.customLineItems.media" }
873
- ]
874
- },
875
- {
876
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
877
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
878
- }
879
- ])
880
- )?.checkoutTemplate;
881
- } catch (err) {
882
- const transformedError = (0, import_transform_error.transformError)(
883
- err,
884
- {
885
- spreadPathsToArguments: {},
886
- explicitPathsToArguments: { checkoutTemplateId: "$[0]" },
887
- singleArgumentUnchanged: false
888
- },
889
- ["checkoutTemplateId"]
890
- );
891
- sideEffects?.onError?.(err);
892
- throw transformedError;
893
- }
894
- }
895
- async function updateCheckoutTemplate2(_id, checkoutTemplate) {
896
- const { httpClient, sideEffects } = arguments[2];
897
- const payload = (0, import_transform_paths2.transformPaths)(
898
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
899
- checkoutTemplate: { ...checkoutTemplate, id: _id }
900
- }),
901
- [
902
- {
903
- transformFn: import_image.transformSDKImageToRESTImage,
904
- paths: [
905
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
906
- { path: "checkoutTemplate.customLineItems.media" }
907
- ]
908
- },
909
- {
910
- transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
911
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
912
- }
913
- ]
914
- );
915
- const reqOpts = updateCheckoutTemplate(payload);
916
- sideEffects?.onSiteCall?.();
917
- try {
918
- const result = await httpClient.request(reqOpts);
919
- sideEffects?.onSuccess?.(result);
920
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
921
- (0, import_transform_paths2.transformPaths)(result.data, [
922
- {
923
- transformFn: import_image2.transformRESTImageToSDKImage,
924
- paths: [
925
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
926
- { path: "checkoutTemplate.customLineItems.media" }
927
- ]
928
- },
929
- {
930
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
931
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
932
- }
933
- ])
934
- )?.checkoutTemplate;
935
- } catch (err) {
936
- const transformedError = (0, import_transform_error.transformError)(
937
- err,
938
- {
939
- spreadPathsToArguments: { checkoutTemplate: "$[1]" },
940
- explicitPathsToArguments: { "checkoutTemplate.id": "$[0]" },
941
- singleArgumentUnchanged: false
942
- },
943
- ["_id", "checkoutTemplate"]
944
- );
945
- sideEffects?.onError?.(err);
946
- throw transformedError;
947
- }
948
- }
949
- async function deleteCheckoutTemplate2(checkoutTemplateId) {
950
- const { httpClient, sideEffects } = arguments[1];
951
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
952
- checkoutTemplateId
953
- });
954
- const reqOpts = deleteCheckoutTemplate(payload);
955
- sideEffects?.onSiteCall?.();
956
- try {
957
- const result = await httpClient.request(reqOpts);
958
- sideEffects?.onSuccess?.(result);
959
- } catch (err) {
960
- const transformedError = (0, import_transform_error.transformError)(
961
- err,
962
- {
963
- spreadPathsToArguments: {},
964
- explicitPathsToArguments: { checkoutTemplateId: "$[0]" },
965
- singleArgumentUnchanged: false
966
- },
967
- ["checkoutTemplateId"]
968
- );
969
- sideEffects?.onError?.(err);
970
- throw transformedError;
971
- }
972
- }
973
- function queryCheckoutTemplates2() {
974
- const { httpClient, sideEffects } = arguments[0];
975
- return (0, import_query_builder.queryBuilder)({
976
- func: async (payload) => {
977
- const reqOpts = queryCheckoutTemplates(payload);
978
- sideEffects?.onSiteCall?.();
979
- try {
980
- const result = await httpClient.request(reqOpts);
981
- sideEffects?.onSuccess?.(result);
982
- return result;
983
- } catch (err) {
984
- sideEffects?.onError?.(err);
985
- throw err;
986
- }
987
- },
988
- requestTransformer: (query) => {
989
- const args = [query, {}];
990
- return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
991
- ...args?.[1],
992
- query: args?.[0]
993
- });
994
- },
995
- responseTransformer: ({
996
- data
997
- }) => {
998
- const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
999
- (0, import_transform_paths2.transformPaths)(data, [
1000
- {
1001
- transformFn: import_image2.transformRESTImageToSDKImage,
1002
- paths: [
1003
- {
1004
- path: "checkoutTemplates.lineItems.catalogOverrideFields.image"
1005
- },
1006
- { path: "checkoutTemplates.customLineItems.media" }
1007
- ]
1008
- },
1009
- {
1010
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
1011
- paths: [{ path: "checkoutTemplates.customLineItems.url" }]
1012
- }
1013
- ])
1014
- );
1015
- return {
1016
- items: transformedData?.checkoutTemplates,
1017
- pagingMetadata: transformedData?.pagingMetadata
1018
- };
1019
- },
1020
- errorTransformer: (err) => {
1021
- const transformedError = (0, import_transform_error.transformError)(err, {
1022
- spreadPathsToArguments: {},
1023
- explicitPathsToArguments: { query: "$[0]" },
1024
- singleArgumentUnchanged: false
1025
- });
1026
- throw transformedError;
1027
- },
1028
- pagingMethod: "CURSOR",
1029
- transformationPaths: {}
1030
- });
1031
- }
1032
- async function typedQueryCheckoutTemplates(query) {
1033
- const { httpClient, sideEffects } = arguments[1];
1034
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
1035
- const reqOpts = queryCheckoutTemplates(payload);
1036
- sideEffects?.onSiteCall?.();
1037
- try {
1038
- const result = await httpClient.request(reqOpts);
1039
- sideEffects?.onSuccess?.(result);
1040
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1041
- (0, import_transform_paths2.transformPaths)(result.data, [
1042
- {
1043
- transformFn: import_image2.transformRESTImageToSDKImage,
1044
- paths: [
1045
- { path: "checkoutTemplates.lineItems.catalogOverrideFields.image" },
1046
- { path: "checkoutTemplates.customLineItems.media" }
1047
- ]
1048
- },
1049
- {
1050
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
1051
- paths: [{ path: "checkoutTemplates.customLineItems.url" }]
1052
- }
1053
- ])
1054
- );
1055
- } catch (err) {
1056
- const transformedError = (0, import_transform_error.transformError)(
1057
- err,
1058
- {
1059
- spreadPathsToArguments: {},
1060
- explicitPathsToArguments: { query: "$[0]" },
1061
- singleArgumentUnchanged: false
1062
- },
1063
- ["query"]
1064
- );
1065
- sideEffects?.onError?.(err);
1066
- throw transformedError;
1067
- }
1068
- }
1069
- var utils = {
1070
- query: /* @__PURE__ */ (0, import_query_builder_utils.createQueryUtils)()
1071
- };
1072
- async function createCheckoutFromTemplate2(checkoutTemplateId, siteId) {
1073
- const { httpClient, sideEffects } = arguments[2];
1074
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1075
- checkoutTemplateId,
1076
- siteId
1077
- });
1078
- const reqOpts = createCheckoutFromTemplate(payload);
1079
- sideEffects?.onSiteCall?.();
1080
- try {
1081
- const result = await httpClient.request(reqOpts);
1082
- sideEffects?.onSuccess?.(result);
1083
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1084
- } catch (err) {
1085
- const transformedError = (0, import_transform_error.transformError)(
1086
- err,
1087
- {
1088
- spreadPathsToArguments: {},
1089
- explicitPathsToArguments: {
1090
- checkoutTemplateId: "$[0]",
1091
- siteId: "$[1]"
1092
- },
1093
- singleArgumentUnchanged: false
1094
- },
1095
- ["checkoutTemplateId", "siteId"]
1096
- );
1097
- sideEffects?.onError?.(err);
1098
- throw transformedError;
1099
- }
1100
- }
1101
- async function createAndRedirectToCheckout2(checkoutTemplateId, siteId) {
1102
- const { httpClient, sideEffects } = arguments[2];
1103
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1104
- checkoutTemplateId,
1105
- siteId
1106
- });
1107
- const reqOpts = createAndRedirectToCheckout(payload);
1108
- sideEffects?.onSiteCall?.();
1109
- try {
1110
- const result = await httpClient.request(reqOpts);
1111
- sideEffects?.onSuccess?.(result);
1112
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1113
- } catch (err) {
1114
- const transformedError = (0, import_transform_error.transformError)(
1115
- err,
1116
- {
1117
- spreadPathsToArguments: {},
1118
- explicitPathsToArguments: {
1119
- checkoutTemplateId: "$[0]",
1120
- siteId: "$[1]"
1121
- },
1122
- singleArgumentUnchanged: false
1123
- },
1124
- ["checkoutTemplateId", "siteId"]
1125
- );
1126
- sideEffects?.onError?.(err);
1127
- throw transformedError;
1128
- }
1129
- }
1130
- // Annotate the CommonJS export names for ESM import in node:
1131
- 0 && (module.exports = {
1132
- AdditionalFeeSource,
1133
- BalanceType,
1134
- ChannelType,
1135
- ChargeType,
1136
- DescriptionLineType,
1137
- DimensionsUnit,
1138
- DiscountType,
1139
- FallbackReason,
1140
- FileType,
1141
- ItemAvailabilityStatus,
1142
- ItemTypePreset,
1143
- JurisdictionType,
1144
- ManualCalculationReason,
1145
- NameInLineItem,
1146
- NameInOther,
1147
- PaymentOptionType,
1148
- PickupMethod,
1149
- PlatformFeeChargeType,
1150
- ProductPeriodAlignment,
1151
- RateType,
1152
- RuleType,
1153
- Severity,
1154
- SortOrder,
1155
- Status,
1156
- SubscriptionFrequency,
1157
- SuggestedFix,
1158
- TaxableAddressType,
1159
- VatType,
1160
- WebhookIdentityType,
1161
- WeightUnit,
1162
- bulkCreateCheckoutTemplates,
1163
- createAndRedirectToCheckout,
1164
- createCheckoutFromTemplate,
1165
- createCheckoutTemplate,
1166
- deleteCheckoutTemplate,
1167
- getCheckoutTemplate,
1168
- queryCheckoutTemplates,
1169
- typedQueryCheckoutTemplates,
1170
- updateCheckoutTemplate,
1171
- utils
1172
- });
1173
- //# sourceMappingURL=index.typings.js.map