@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,1512 +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.ts
21
- var index_exports = {};
22
- __export(index_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: () => bulkCreateCheckoutTemplates4,
54
- createAndRedirectToCheckout: () => createAndRedirectToCheckout4,
55
- createCheckoutFromTemplate: () => createCheckoutFromTemplate4,
56
- createCheckoutTemplate: () => createCheckoutTemplate4,
57
- deleteCheckoutTemplate: () => deleteCheckoutTemplate4,
58
- getCheckoutTemplate: () => getCheckoutTemplate4,
59
- onCheckoutTemplateCreated: () => onCheckoutTemplateCreated2,
60
- onCheckoutTemplateDeleted: () => onCheckoutTemplateDeleted2,
61
- onCheckoutTemplateUpdated: () => onCheckoutTemplateUpdated2,
62
- onCheckoutTemplateUsed: () => onCheckoutTemplateUsed2,
63
- queryCheckoutTemplates: () => queryCheckoutTemplates4,
64
- updateCheckoutTemplate: () => updateCheckoutTemplate4,
65
- utils: () => utils
66
- });
67
- module.exports = __toCommonJS(index_exports);
68
-
69
- // src/ecom-v1-checkout-template-checkout-templates.public.ts
70
- var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
71
- var import_address = require("@wix/sdk-runtime/transformations/address");
72
- var import_float3 = require("@wix/sdk-runtime/transformations/float");
73
- var import_image3 = require("@wix/sdk-runtime/transformations/image");
74
- var import_page_url_v23 = require("@wix/sdk-runtime/transformations/page-url-v2");
75
- var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
76
- var import_transform_paths3 = require("@wix/sdk-runtime/transformations/transform-paths");
77
- var import_sdk_types = require("@wix/sdk-types");
78
-
79
- // src/ecom-v1-checkout-template-checkout-templates.universal.ts
80
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
81
- var import_query_builder = require("@wix/sdk-runtime/query-builder");
82
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
83
-
84
- // src/ecom-v1-checkout-template-checkout-templates.http.ts
85
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
86
- var import_float = require("@wix/sdk-runtime/transformations/float");
87
- var import_float2 = require("@wix/sdk-runtime/transformations/float");
88
- var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
89
- var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
90
- var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
91
- var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
92
- var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
93
- var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
94
- function resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl(opts) {
95
- const domainToMappings = {
96
- "www._base_domain_": [
97
- {
98
- srcPath: "/ecom/v1/checkout-templates",
99
- destPath: "/v1/checkout-templates"
100
- }
101
- ],
102
- "www.wixapis.com": [
103
- {
104
- srcPath: "/ecom/v1/checkout-templates",
105
- destPath: "/v1/checkout-templates"
106
- }
107
- ],
108
- "*.dev.wix-code.com": [
109
- {
110
- srcPath: "/ecom/v1/checkout-templates",
111
- destPath: "/v1/checkout-templates"
112
- }
113
- ],
114
- _: [
115
- {
116
- srcPath: "/ecom/v1/checkout-templates",
117
- destPath: "/v1/checkout-templates"
118
- }
119
- ],
120
- "api._api_base_domain_": [
121
- {
122
- srcPath: "/checkout-template",
123
- destPath: ""
124
- }
125
- ]
126
- };
127
- return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
128
- }
129
- var PACKAGE_NAME = "@wix/auto_sdk_ecom_checkout-templates";
130
- function createCheckoutTemplate(payload) {
131
- function __createCheckoutTemplate({ host }) {
132
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
133
- {
134
- transformFn: import_float.transformSDKFloatToRESTFloat,
135
- paths: [
136
- {
137
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
138
- },
139
- {
140
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
141
- }
142
- ]
143
- },
144
- {
145
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
146
- paths: [
147
- {
148
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
149
- },
150
- {
151
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
152
- },
153
- {
154
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
155
- }
156
- ]
157
- }
158
- ]);
159
- const metadata = {
160
- entityFqdn: "wix.ecom.v1.checkout_template",
161
- method: "POST",
162
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateCheckoutTemplate",
163
- packageName: PACKAGE_NAME,
164
- migrationOptions: {
165
- optInTransformResponse: true
166
- },
167
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
168
- protoPath: "/v1/checkout-templates",
169
- data: serializedData,
170
- host
171
- }),
172
- data: serializedData,
173
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
174
- {
175
- transformFn: import_float2.transformRESTFloatToSDKFloat,
176
- paths: [
177
- {
178
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
179
- },
180
- {
181
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
182
- }
183
- ]
184
- },
185
- {
186
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
187
- paths: [
188
- {
189
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
190
- },
191
- {
192
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
193
- },
194
- {
195
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
196
- }
197
- ]
198
- }
199
- ])
200
- };
201
- return metadata;
202
- }
203
- return __createCheckoutTemplate;
204
- }
205
- function bulkCreateCheckoutTemplates(payload) {
206
- function __bulkCreateCheckoutTemplates({ host }) {
207
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
208
- {
209
- transformFn: import_float.transformSDKFloatToRESTFloat,
210
- paths: [
211
- {
212
- path: "checkoutTemplates.lineItems.catalogOverrideFields.physicalProperties.weight"
213
- },
214
- {
215
- path: "checkoutTemplates.customLineItems.physicalProperties.weight"
216
- }
217
- ]
218
- },
219
- {
220
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
221
- paths: [
222
- {
223
- path: "checkoutTemplates.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
224
- },
225
- {
226
- path: "checkoutTemplates.customLineItems.serviceProperties.scheduledDate"
227
- },
228
- {
229
- path: "checkoutTemplates.customLineItems.serviceProperties.endDate"
230
- }
231
- ]
232
- }
233
- ]);
234
- const metadata = {
235
- entityFqdn: "wix.ecom.v1.checkout_template",
236
- method: "POST",
237
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.BulkCreateCheckoutTemplates",
238
- packageName: PACKAGE_NAME,
239
- migrationOptions: {
240
- optInTransformResponse: true
241
- },
242
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
243
- protoPath: "/v1/bulk/checkout-templates/create",
244
- data: serializedData,
245
- host
246
- }),
247
- data: serializedData,
248
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
249
- {
250
- transformFn: import_float2.transformRESTFloatToSDKFloat,
251
- paths: [
252
- {
253
- path: "results.item.lineItems.catalogOverrideFields.physicalProperties.weight"
254
- },
255
- {
256
- path: "results.item.customLineItems.physicalProperties.weight"
257
- }
258
- ]
259
- },
260
- {
261
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
262
- paths: [
263
- {
264
- path: "results.item.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
265
- },
266
- {
267
- path: "results.item.customLineItems.serviceProperties.scheduledDate"
268
- },
269
- {
270
- path: "results.item.customLineItems.serviceProperties.endDate"
271
- }
272
- ]
273
- }
274
- ])
275
- };
276
- return metadata;
277
- }
278
- return __bulkCreateCheckoutTemplates;
279
- }
280
- function getCheckoutTemplate(payload) {
281
- function __getCheckoutTemplate({ host }) {
282
- const metadata = {
283
- entityFqdn: "wix.ecom.v1.checkout_template",
284
- method: "GET",
285
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.GetCheckoutTemplate",
286
- packageName: PACKAGE_NAME,
287
- migrationOptions: {
288
- optInTransformResponse: true
289
- },
290
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
291
- protoPath: "/v1/checkout-templates/{checkoutTemplateId}",
292
- data: payload,
293
- host
294
- }),
295
- params: (0, import_rest_modules.toURLSearchParams)(payload),
296
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
297
- {
298
- transformFn: import_float2.transformRESTFloatToSDKFloat,
299
- paths: [
300
- {
301
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
302
- },
303
- {
304
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
305
- }
306
- ]
307
- },
308
- {
309
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
310
- paths: [
311
- {
312
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
313
- },
314
- {
315
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
316
- },
317
- {
318
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
319
- }
320
- ]
321
- }
322
- ])
323
- };
324
- return metadata;
325
- }
326
- return __getCheckoutTemplate;
327
- }
328
- function updateCheckoutTemplate(payload) {
329
- function __updateCheckoutTemplate({ host }) {
330
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
331
- {
332
- transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
333
- paths: [{ path: "fieldMask" }]
334
- },
335
- {
336
- transformFn: import_float.transformSDKFloatToRESTFloat,
337
- paths: [
338
- {
339
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
340
- },
341
- {
342
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
343
- }
344
- ]
345
- },
346
- {
347
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
348
- paths: [
349
- {
350
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
351
- },
352
- {
353
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
354
- },
355
- {
356
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
357
- }
358
- ]
359
- }
360
- ]);
361
- const metadata = {
362
- entityFqdn: "wix.ecom.v1.checkout_template",
363
- method: "PATCH",
364
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.UpdateCheckoutTemplate",
365
- packageName: PACKAGE_NAME,
366
- migrationOptions: {
367
- optInTransformResponse: true
368
- },
369
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
370
- protoPath: "/v1/checkout-templates/{checkoutTemplate.id}",
371
- data: serializedData,
372
- host
373
- }),
374
- data: serializedData,
375
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
376
- {
377
- transformFn: import_float2.transformRESTFloatToSDKFloat,
378
- paths: [
379
- {
380
- path: "checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
381
- },
382
- {
383
- path: "checkoutTemplate.customLineItems.physicalProperties.weight"
384
- }
385
- ]
386
- },
387
- {
388
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
389
- paths: [
390
- {
391
- path: "checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
392
- },
393
- {
394
- path: "checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
395
- },
396
- {
397
- path: "checkoutTemplate.customLineItems.serviceProperties.endDate"
398
- }
399
- ]
400
- }
401
- ])
402
- };
403
- return metadata;
404
- }
405
- return __updateCheckoutTemplate;
406
- }
407
- function deleteCheckoutTemplate(payload) {
408
- function __deleteCheckoutTemplate({ host }) {
409
- const metadata = {
410
- entityFqdn: "wix.ecom.v1.checkout_template",
411
- method: "DELETE",
412
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.DeleteCheckoutTemplate",
413
- packageName: PACKAGE_NAME,
414
- migrationOptions: {
415
- optInTransformResponse: true
416
- },
417
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
418
- protoPath: "/v1/checkout-templates/{checkoutTemplateId}",
419
- data: payload,
420
- host
421
- }),
422
- params: (0, import_rest_modules.toURLSearchParams)(payload)
423
- };
424
- return metadata;
425
- }
426
- return __deleteCheckoutTemplate;
427
- }
428
- function queryCheckoutTemplates(payload) {
429
- function __queryCheckoutTemplates({ host }) {
430
- const metadata = {
431
- entityFqdn: "wix.ecom.v1.checkout_template",
432
- method: "POST",
433
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.QueryCheckoutTemplates",
434
- packageName: PACKAGE_NAME,
435
- migrationOptions: {
436
- optInTransformResponse: true
437
- },
438
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
439
- protoPath: "/v1/checkout-templates/query",
440
- data: payload,
441
- host
442
- }),
443
- data: payload,
444
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
445
- {
446
- transformFn: import_float2.transformRESTFloatToSDKFloat,
447
- paths: [
448
- {
449
- path: "checkoutTemplates.lineItems.catalogOverrideFields.physicalProperties.weight"
450
- },
451
- {
452
- path: "checkoutTemplates.customLineItems.physicalProperties.weight"
453
- }
454
- ]
455
- },
456
- {
457
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
458
- paths: [
459
- {
460
- path: "checkoutTemplates.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
461
- },
462
- {
463
- path: "checkoutTemplates.customLineItems.serviceProperties.scheduledDate"
464
- },
465
- {
466
- path: "checkoutTemplates.customLineItems.serviceProperties.endDate"
467
- }
468
- ]
469
- }
470
- ])
471
- };
472
- return metadata;
473
- }
474
- return __queryCheckoutTemplates;
475
- }
476
- function createCheckoutFromTemplate(payload) {
477
- function __createCheckoutFromTemplate({ host }) {
478
- const metadata = {
479
- entityFqdn: "wix.ecom.v1.checkout_template",
480
- method: "POST",
481
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateCheckoutFromTemplate",
482
- packageName: PACKAGE_NAME,
483
- migrationOptions: {
484
- optInTransformResponse: true
485
- },
486
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
487
- protoPath: "/v1/checkout-templates/{checkoutTemplateId}/create-checkout-from-template",
488
- data: payload,
489
- host
490
- }),
491
- data: payload
492
- };
493
- return metadata;
494
- }
495
- return __createCheckoutFromTemplate;
496
- }
497
- function createAndRedirectToCheckout(payload) {
498
- function __createAndRedirectToCheckout({ host }) {
499
- const metadata = {
500
- entityFqdn: "wix.ecom.v1.checkout_template",
501
- method: "GET",
502
- methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateAndRedirectToCheckout",
503
- packageName: PACKAGE_NAME,
504
- migrationOptions: {
505
- optInTransformResponse: true
506
- },
507
- url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
508
- protoPath: "/v1/checkout-templates/{checkoutTemplateId}/create-and-redirect-to-checkout",
509
- data: payload,
510
- host
511
- }),
512
- params: (0, import_rest_modules.toURLSearchParams)(payload),
513
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
514
- {
515
- transformFn: import_bytes.transformRESTBytesToSDKBytes,
516
- paths: [{ path: "body" }]
517
- }
518
- ])
519
- };
520
- return metadata;
521
- }
522
- return __createAndRedirectToCheckout;
523
- }
524
-
525
- // src/ecom-v1-checkout-template-checkout-templates.universal.ts
526
- var import_image = require("@wix/sdk-runtime/transformations/image");
527
- var import_image2 = require("@wix/sdk-runtime/transformations/image");
528
- var import_page_url_v2 = require("@wix/sdk-runtime/transformations/page-url-v2");
529
- var import_page_url_v22 = require("@wix/sdk-runtime/transformations/page-url-v2");
530
- var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
531
- var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
532
- var Status = /* @__PURE__ */ ((Status2) => {
533
- Status2["ACTIVE"] = "ACTIVE";
534
- Status2["INACTIVE"] = "INACTIVE";
535
- return Status2;
536
- })(Status || {});
537
- var DescriptionLineType = /* @__PURE__ */ ((DescriptionLineType2) => {
538
- DescriptionLineType2["UNRECOGNISED"] = "UNRECOGNISED";
539
- DescriptionLineType2["PLAIN_TEXT"] = "PLAIN_TEXT";
540
- DescriptionLineType2["COLOR"] = "COLOR";
541
- return DescriptionLineType2;
542
- })(DescriptionLineType || {});
543
- var DimensionsUnit = /* @__PURE__ */ ((DimensionsUnit2) => {
544
- DimensionsUnit2["UNKNOWN_DIMENSIONS_UNIT"] = "UNKNOWN_DIMENSIONS_UNIT";
545
- DimensionsUnit2["MM"] = "MM";
546
- DimensionsUnit2["CM"] = "CM";
547
- DimensionsUnit2["M"] = "M";
548
- DimensionsUnit2["IN"] = "IN";
549
- DimensionsUnit2["FT"] = "FT";
550
- DimensionsUnit2["YD"] = "YD";
551
- return DimensionsUnit2;
552
- })(DimensionsUnit || {});
553
- var PaymentOptionType = /* @__PURE__ */ ((PaymentOptionType2) => {
554
- PaymentOptionType2["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
555
- PaymentOptionType2["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
556
- PaymentOptionType2["MEMBERSHIP"] = "MEMBERSHIP";
557
- PaymentOptionType2["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
558
- PaymentOptionType2["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
559
- PaymentOptionType2["MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"] = "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER";
560
- return PaymentOptionType2;
561
- })(PaymentOptionType || {});
562
- var ItemTypePreset = /* @__PURE__ */ ((ItemTypePreset2) => {
563
- ItemTypePreset2["UNRECOGNISED"] = "UNRECOGNISED";
564
- ItemTypePreset2["PHYSICAL"] = "PHYSICAL";
565
- ItemTypePreset2["DIGITAL"] = "DIGITAL";
566
- ItemTypePreset2["GIFT_CARD"] = "GIFT_CARD";
567
- ItemTypePreset2["SERVICE"] = "SERVICE";
568
- return ItemTypePreset2;
569
- })(ItemTypePreset || {});
570
- var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
571
- SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
572
- SubscriptionFrequency2["DAY"] = "DAY";
573
- SubscriptionFrequency2["WEEK"] = "WEEK";
574
- SubscriptionFrequency2["MONTH"] = "MONTH";
575
- SubscriptionFrequency2["YEAR"] = "YEAR";
576
- return SubscriptionFrequency2;
577
- })(SubscriptionFrequency || {});
578
- var ProductPeriodAlignment = /* @__PURE__ */ ((ProductPeriodAlignment2) => {
579
- ProductPeriodAlignment2["ALIGNED_WITH_BILLING_PERIOD"] = "ALIGNED_WITH_BILLING_PERIOD";
580
- ProductPeriodAlignment2["NOT_ALIGNED_WITH_BILLING_PERIOD"] = "NOT_ALIGNED_WITH_BILLING_PERIOD";
581
- return ProductPeriodAlignment2;
582
- })(ProductPeriodAlignment || {});
583
- var FileType = /* @__PURE__ */ ((FileType2) => {
584
- FileType2["UNSPECIFIED"] = "UNSPECIFIED";
585
- FileType2["SECURE_PICTURE"] = "SECURE_PICTURE";
586
- FileType2["SECURE_VIDEO"] = "SECURE_VIDEO";
587
- FileType2["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
588
- FileType2["SECURE_MUSIC"] = "SECURE_MUSIC";
589
- FileType2["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
590
- FileType2["SECURE_RAW"] = "SECURE_RAW";
591
- return FileType2;
592
- })(FileType || {});
593
- var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
594
- TaxableAddressType2["BUSINESS"] = "BUSINESS";
595
- TaxableAddressType2["BILLING"] = "BILLING";
596
- TaxableAddressType2["SHIPPING"] = "SHIPPING";
597
- return TaxableAddressType2;
598
- })(TaxableAddressType || {});
599
- var JurisdictionType = /* @__PURE__ */ ((JurisdictionType2) => {
600
- JurisdictionType2["UNDEFINED"] = "UNDEFINED";
601
- JurisdictionType2["COUNTRY"] = "COUNTRY";
602
- JurisdictionType2["STATE"] = "STATE";
603
- JurisdictionType2["COUNTY"] = "COUNTY";
604
- JurisdictionType2["CITY"] = "CITY";
605
- JurisdictionType2["SPECIAL"] = "SPECIAL";
606
- return JurisdictionType2;
607
- })(JurisdictionType || {});
608
- var ItemAvailabilityStatus = /* @__PURE__ */ ((ItemAvailabilityStatus2) => {
609
- ItemAvailabilityStatus2["AVAILABLE"] = "AVAILABLE";
610
- ItemAvailabilityStatus2["NOT_FOUND"] = "NOT_FOUND";
611
- ItemAvailabilityStatus2["NOT_AVAILABLE"] = "NOT_AVAILABLE";
612
- ItemAvailabilityStatus2["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
613
- return ItemAvailabilityStatus2;
614
- })(ItemAvailabilityStatus || {});
615
- var PlatformFeeChargeType = /* @__PURE__ */ ((PlatformFeeChargeType2) => {
616
- PlatformFeeChargeType2["PASS_ON"] = "PASS_ON";
617
- PlatformFeeChargeType2["ABSORBED"] = "ABSORBED";
618
- return PlatformFeeChargeType2;
619
- })(PlatformFeeChargeType || {});
620
- var VatType = /* @__PURE__ */ ((VatType2) => {
621
- VatType2["UNSPECIFIED"] = "UNSPECIFIED";
622
- VatType2["CPF"] = "CPF";
623
- VatType2["CNPJ"] = "CNPJ";
624
- return VatType2;
625
- })(VatType || {});
626
- var PickupMethod = /* @__PURE__ */ ((PickupMethod2) => {
627
- PickupMethod2["STORE_PICKUP"] = "STORE_PICKUP";
628
- PickupMethod2["PICKUP_POINT"] = "PICKUP_POINT";
629
- return PickupMethod2;
630
- })(PickupMethod || {});
631
- var ChargeType = /* @__PURE__ */ ((ChargeType2) => {
632
- ChargeType2["HANDLING_FEE"] = "HANDLING_FEE";
633
- ChargeType2["INSURANCE"] = "INSURANCE";
634
- return ChargeType2;
635
- })(ChargeType || {});
636
- var RuleType = /* @__PURE__ */ ((RuleType2) => {
637
- RuleType2["VALIDATION"] = "VALIDATION";
638
- RuleType2["OTHER"] = "OTHER";
639
- RuleType2["MAX"] = "MAX";
640
- RuleType2["MIN"] = "MIN";
641
- RuleType2["MAX_LENGTH"] = "MAX_LENGTH";
642
- RuleType2["MIN_LENGTH"] = "MIN_LENGTH";
643
- RuleType2["MAX_SIZE"] = "MAX_SIZE";
644
- RuleType2["MIN_SIZE"] = "MIN_SIZE";
645
- RuleType2["FORMAT"] = "FORMAT";
646
- RuleType2["DECIMAL_LTE"] = "DECIMAL_LTE";
647
- RuleType2["DECIMAL_GTE"] = "DECIMAL_GTE";
648
- RuleType2["DECIMAL_LT"] = "DECIMAL_LT";
649
- RuleType2["DECIMAL_GT"] = "DECIMAL_GT";
650
- RuleType2["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
651
- RuleType2["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
652
- RuleType2["REQUIRED_FIELD"] = "REQUIRED_FIELD";
653
- RuleType2["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
654
- RuleType2["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
655
- RuleType2["EXACT_LENGTH"] = "EXACT_LENGTH";
656
- RuleType2["EXACT_SIZE"] = "EXACT_SIZE";
657
- RuleType2["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
658
- return RuleType2;
659
- })(RuleType || {});
660
- var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
661
- DiscountType2["GLOBAL"] = "GLOBAL";
662
- DiscountType2["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
663
- DiscountType2["SHIPPING"] = "SHIPPING";
664
- return DiscountType2;
665
- })(DiscountType || {});
666
- var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
667
- WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
668
- WeightUnit2["KG"] = "KG";
669
- WeightUnit2["LB"] = "LB";
670
- return WeightUnit2;
671
- })(WeightUnit || {});
672
- var RateType = /* @__PURE__ */ ((RateType2) => {
673
- RateType2["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
674
- RateType2["MANUAL_RATE"] = "MANUAL_RATE";
675
- RateType2["AUTO_RATE"] = "AUTO_RATE";
676
- RateType2["FALLBACK_RATE"] = "FALLBACK_RATE";
677
- return RateType2;
678
- })(RateType || {});
679
- var ManualCalculationReason = /* @__PURE__ */ ((ManualCalculationReason2) => {
680
- ManualCalculationReason2["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
681
- ManualCalculationReason2["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
682
- return ManualCalculationReason2;
683
- })(ManualCalculationReason || {});
684
- var FallbackReason = /* @__PURE__ */ ((FallbackReason2) => {
685
- FallbackReason2["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
686
- FallbackReason2["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
687
- return FallbackReason2;
688
- })(FallbackReason || {});
689
- var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
690
- ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
691
- ChannelType2["WEB"] = "WEB";
692
- ChannelType2["POS"] = "POS";
693
- ChannelType2["EBAY"] = "EBAY";
694
- ChannelType2["AMAZON"] = "AMAZON";
695
- ChannelType2["OTHER_PLATFORM"] = "OTHER_PLATFORM";
696
- ChannelType2["WIX_APP_STORE"] = "WIX_APP_STORE";
697
- ChannelType2["WIX_INVOICES"] = "WIX_INVOICES";
698
- ChannelType2["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
699
- ChannelType2["WISH"] = "WISH";
700
- ChannelType2["CLASS_PASS"] = "CLASS_PASS";
701
- ChannelType2["GLOBAL_E"] = "GLOBAL_E";
702
- ChannelType2["FACEBOOK"] = "FACEBOOK";
703
- ChannelType2["ETSY"] = "ETSY";
704
- ChannelType2["TIKTOK"] = "TIKTOK";
705
- ChannelType2["FAIRE_COM"] = "FAIRE_COM";
706
- ChannelType2["PAYPAL_AGENTIC_CHECKOUT"] = "PAYPAL_AGENTIC_CHECKOUT";
707
- ChannelType2["STRIPE_AGENTIC_CHECKOUT"] = "STRIPE_AGENTIC_CHECKOUT";
708
- ChannelType2["WIX_INVOICES_PLATFORM"] = "WIX_INVOICES_PLATFORM";
709
- ChannelType2["UCP_AGENTIC_CHECKOUT"] = "UCP_AGENTIC_CHECKOUT";
710
- return ChannelType2;
711
- })(ChannelType || {});
712
- var BalanceType = /* @__PURE__ */ ((BalanceType2) => {
713
- BalanceType2["PUNCH_CARD"] = "PUNCH_CARD";
714
- BalanceType2["CREDIT"] = "CREDIT";
715
- return BalanceType2;
716
- })(BalanceType || {});
717
- var AdditionalFeeSource = /* @__PURE__ */ ((AdditionalFeeSource2) => {
718
- AdditionalFeeSource2["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
719
- AdditionalFeeSource2["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
720
- AdditionalFeeSource2["ITEM"] = "ITEM";
721
- AdditionalFeeSource2["MANUAL"] = "MANUAL";
722
- AdditionalFeeSource2["SHIPPING"] = "SHIPPING";
723
- AdditionalFeeSource2["PLATFORM"] = "PLATFORM";
724
- return AdditionalFeeSource2;
725
- })(AdditionalFeeSource || {});
726
- var Severity = /* @__PURE__ */ ((Severity2) => {
727
- Severity2["WARNING"] = "WARNING";
728
- Severity2["ERROR"] = "ERROR";
729
- return Severity2;
730
- })(Severity || {});
731
- var NameInOther = /* @__PURE__ */ ((NameInOther2) => {
732
- NameInOther2["OTHER_DEFAULT"] = "OTHER_DEFAULT";
733
- return NameInOther2;
734
- })(NameInOther || {});
735
- var NameInLineItem = /* @__PURE__ */ ((NameInLineItem2) => {
736
- NameInLineItem2["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
737
- return NameInLineItem2;
738
- })(NameInLineItem || {});
739
- var SuggestedFix = /* @__PURE__ */ ((SuggestedFix2) => {
740
- SuggestedFix2["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
741
- SuggestedFix2["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
742
- return SuggestedFix2;
743
- })(SuggestedFix || {});
744
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
745
- SortOrder2["ASC"] = "ASC";
746
- SortOrder2["DESC"] = "DESC";
747
- return SortOrder2;
748
- })(SortOrder || {});
749
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
750
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
751
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
752
- WebhookIdentityType2["MEMBER"] = "MEMBER";
753
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
754
- WebhookIdentityType2["APP"] = "APP";
755
- return WebhookIdentityType2;
756
- })(WebhookIdentityType || {});
757
- async function createCheckoutTemplate2(checkoutTemplate) {
758
- const { httpClient, sideEffects } = arguments[1];
759
- const payload = (0, import_transform_paths2.transformPaths)(
760
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
761
- checkoutTemplate
762
- }),
763
- [
764
- {
765
- transformFn: import_image.transformSDKImageToRESTImage,
766
- paths: [
767
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
768
- { path: "checkoutTemplate.customLineItems.media" }
769
- ]
770
- },
771
- {
772
- transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
773
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
774
- }
775
- ]
776
- );
777
- const reqOpts = createCheckoutTemplate(payload);
778
- sideEffects?.onSiteCall?.();
779
- try {
780
- const result = await httpClient.request(reqOpts);
781
- sideEffects?.onSuccess?.(result);
782
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
783
- (0, import_transform_paths2.transformPaths)(result.data, [
784
- {
785
- transformFn: import_image2.transformRESTImageToSDKImage,
786
- paths: [
787
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
788
- { path: "checkoutTemplate.customLineItems.media" }
789
- ]
790
- },
791
- {
792
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
793
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
794
- }
795
- ])
796
- )?.checkoutTemplate;
797
- } catch (err) {
798
- const transformedError = (0, import_transform_error.transformError)(
799
- err,
800
- {
801
- spreadPathsToArguments: {},
802
- explicitPathsToArguments: { checkoutTemplate: "$[0]" },
803
- singleArgumentUnchanged: false
804
- },
805
- ["checkoutTemplate"]
806
- );
807
- sideEffects?.onError?.(err);
808
- throw transformedError;
809
- }
810
- }
811
- async function bulkCreateCheckoutTemplates2(checkoutTemplates, options) {
812
- const { httpClient, sideEffects } = arguments[2];
813
- const payload = (0, import_transform_paths2.transformPaths)(
814
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
815
- checkoutTemplates,
816
- returnEntity: options?.returnEntity
817
- }),
818
- [
819
- {
820
- transformFn: import_image.transformSDKImageToRESTImage,
821
- paths: [
822
- { path: "checkoutTemplates.lineItems.catalogOverrideFields.image" },
823
- { path: "checkoutTemplates.customLineItems.media" }
824
- ]
825
- },
826
- {
827
- transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
828
- paths: [{ path: "checkoutTemplates.customLineItems.url" }]
829
- }
830
- ]
831
- );
832
- const reqOpts = bulkCreateCheckoutTemplates(payload);
833
- sideEffects?.onSiteCall?.();
834
- try {
835
- const result = await httpClient.request(reqOpts);
836
- sideEffects?.onSuccess?.(result);
837
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
838
- (0, import_transform_paths2.transformPaths)(result.data, [
839
- {
840
- transformFn: import_image2.transformRESTImageToSDKImage,
841
- paths: [
842
- { path: "results.item.lineItems.catalogOverrideFields.image" },
843
- { path: "results.item.customLineItems.media" }
844
- ]
845
- },
846
- {
847
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
848
- paths: [{ path: "results.item.customLineItems.url" }]
849
- }
850
- ])
851
- );
852
- } catch (err) {
853
- const transformedError = (0, import_transform_error.transformError)(
854
- err,
855
- {
856
- spreadPathsToArguments: {},
857
- explicitPathsToArguments: {
858
- checkoutTemplates: "$[0]",
859
- returnEntity: "$[1].returnEntity"
860
- },
861
- singleArgumentUnchanged: false
862
- },
863
- ["checkoutTemplates", "options"]
864
- );
865
- sideEffects?.onError?.(err);
866
- throw transformedError;
867
- }
868
- }
869
- async function getCheckoutTemplate2(checkoutTemplateId) {
870
- const { httpClient, sideEffects } = arguments[1];
871
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
872
- checkoutTemplateId
873
- });
874
- const reqOpts = getCheckoutTemplate(payload);
875
- sideEffects?.onSiteCall?.();
876
- try {
877
- const result = await httpClient.request(reqOpts);
878
- sideEffects?.onSuccess?.(result);
879
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
880
- (0, import_transform_paths2.transformPaths)(result.data, [
881
- {
882
- transformFn: import_image2.transformRESTImageToSDKImage,
883
- paths: [
884
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
885
- { path: "checkoutTemplate.customLineItems.media" }
886
- ]
887
- },
888
- {
889
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
890
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
891
- }
892
- ])
893
- )?.checkoutTemplate;
894
- } catch (err) {
895
- const transformedError = (0, import_transform_error.transformError)(
896
- err,
897
- {
898
- spreadPathsToArguments: {},
899
- explicitPathsToArguments: { checkoutTemplateId: "$[0]" },
900
- singleArgumentUnchanged: false
901
- },
902
- ["checkoutTemplateId"]
903
- );
904
- sideEffects?.onError?.(err);
905
- throw transformedError;
906
- }
907
- }
908
- async function updateCheckoutTemplate2(_id, checkoutTemplate) {
909
- const { httpClient, sideEffects } = arguments[2];
910
- const payload = (0, import_transform_paths2.transformPaths)(
911
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
912
- checkoutTemplate: { ...checkoutTemplate, id: _id }
913
- }),
914
- [
915
- {
916
- transformFn: import_image.transformSDKImageToRESTImage,
917
- paths: [
918
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
919
- { path: "checkoutTemplate.customLineItems.media" }
920
- ]
921
- },
922
- {
923
- transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
924
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
925
- }
926
- ]
927
- );
928
- const reqOpts = updateCheckoutTemplate(payload);
929
- sideEffects?.onSiteCall?.();
930
- try {
931
- const result = await httpClient.request(reqOpts);
932
- sideEffects?.onSuccess?.(result);
933
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
934
- (0, import_transform_paths2.transformPaths)(result.data, [
935
- {
936
- transformFn: import_image2.transformRESTImageToSDKImage,
937
- paths: [
938
- { path: "checkoutTemplate.lineItems.catalogOverrideFields.image" },
939
- { path: "checkoutTemplate.customLineItems.media" }
940
- ]
941
- },
942
- {
943
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
944
- paths: [{ path: "checkoutTemplate.customLineItems.url" }]
945
- }
946
- ])
947
- )?.checkoutTemplate;
948
- } catch (err) {
949
- const transformedError = (0, import_transform_error.transformError)(
950
- err,
951
- {
952
- spreadPathsToArguments: { checkoutTemplate: "$[1]" },
953
- explicitPathsToArguments: { "checkoutTemplate.id": "$[0]" },
954
- singleArgumentUnchanged: false
955
- },
956
- ["_id", "checkoutTemplate"]
957
- );
958
- sideEffects?.onError?.(err);
959
- throw transformedError;
960
- }
961
- }
962
- async function deleteCheckoutTemplate2(checkoutTemplateId) {
963
- const { httpClient, sideEffects } = arguments[1];
964
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
965
- checkoutTemplateId
966
- });
967
- const reqOpts = deleteCheckoutTemplate(payload);
968
- sideEffects?.onSiteCall?.();
969
- try {
970
- const result = await httpClient.request(reqOpts);
971
- sideEffects?.onSuccess?.(result);
972
- } catch (err) {
973
- const transformedError = (0, import_transform_error.transformError)(
974
- err,
975
- {
976
- spreadPathsToArguments: {},
977
- explicitPathsToArguments: { checkoutTemplateId: "$[0]" },
978
- singleArgumentUnchanged: false
979
- },
980
- ["checkoutTemplateId"]
981
- );
982
- sideEffects?.onError?.(err);
983
- throw transformedError;
984
- }
985
- }
986
- function queryCheckoutTemplates2() {
987
- const { httpClient, sideEffects } = arguments[0];
988
- return (0, import_query_builder.queryBuilder)({
989
- func: async (payload) => {
990
- const reqOpts = queryCheckoutTemplates(payload);
991
- sideEffects?.onSiteCall?.();
992
- try {
993
- const result = await httpClient.request(reqOpts);
994
- sideEffects?.onSuccess?.(result);
995
- return result;
996
- } catch (err) {
997
- sideEffects?.onError?.(err);
998
- throw err;
999
- }
1000
- },
1001
- requestTransformer: (query) => {
1002
- const args = [query, {}];
1003
- return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1004
- ...args?.[1],
1005
- query: args?.[0]
1006
- });
1007
- },
1008
- responseTransformer: ({
1009
- data
1010
- }) => {
1011
- const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1012
- (0, import_transform_paths2.transformPaths)(data, [
1013
- {
1014
- transformFn: import_image2.transformRESTImageToSDKImage,
1015
- paths: [
1016
- {
1017
- path: "checkoutTemplates.lineItems.catalogOverrideFields.image"
1018
- },
1019
- { path: "checkoutTemplates.customLineItems.media" }
1020
- ]
1021
- },
1022
- {
1023
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
1024
- paths: [{ path: "checkoutTemplates.customLineItems.url" }]
1025
- }
1026
- ])
1027
- );
1028
- return {
1029
- items: transformedData?.checkoutTemplates,
1030
- pagingMetadata: transformedData?.pagingMetadata
1031
- };
1032
- },
1033
- errorTransformer: (err) => {
1034
- const transformedError = (0, import_transform_error.transformError)(err, {
1035
- spreadPathsToArguments: {},
1036
- explicitPathsToArguments: { query: "$[0]" },
1037
- singleArgumentUnchanged: false
1038
- });
1039
- throw transformedError;
1040
- },
1041
- pagingMethod: "CURSOR",
1042
- transformationPaths: {}
1043
- });
1044
- }
1045
- async function typedQueryCheckoutTemplates(query) {
1046
- const { httpClient, sideEffects } = arguments[1];
1047
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
1048
- const reqOpts = queryCheckoutTemplates(payload);
1049
- sideEffects?.onSiteCall?.();
1050
- try {
1051
- const result = await httpClient.request(reqOpts);
1052
- sideEffects?.onSuccess?.(result);
1053
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1054
- (0, import_transform_paths2.transformPaths)(result.data, [
1055
- {
1056
- transformFn: import_image2.transformRESTImageToSDKImage,
1057
- paths: [
1058
- { path: "checkoutTemplates.lineItems.catalogOverrideFields.image" },
1059
- { path: "checkoutTemplates.customLineItems.media" }
1060
- ]
1061
- },
1062
- {
1063
- transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
1064
- paths: [{ path: "checkoutTemplates.customLineItems.url" }]
1065
- }
1066
- ])
1067
- );
1068
- } catch (err) {
1069
- const transformedError = (0, import_transform_error.transformError)(
1070
- err,
1071
- {
1072
- spreadPathsToArguments: {},
1073
- explicitPathsToArguments: { query: "$[0]" },
1074
- singleArgumentUnchanged: false
1075
- },
1076
- ["query"]
1077
- );
1078
- sideEffects?.onError?.(err);
1079
- throw transformedError;
1080
- }
1081
- }
1082
- var utils = {
1083
- query: /* @__PURE__ */ (0, import_query_builder_utils.createQueryUtils)()
1084
- };
1085
- async function createCheckoutFromTemplate2(checkoutTemplateId, siteId) {
1086
- const { httpClient, sideEffects } = arguments[2];
1087
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1088
- checkoutTemplateId,
1089
- siteId
1090
- });
1091
- const reqOpts = createCheckoutFromTemplate(payload);
1092
- sideEffects?.onSiteCall?.();
1093
- try {
1094
- const result = await httpClient.request(reqOpts);
1095
- sideEffects?.onSuccess?.(result);
1096
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1097
- } catch (err) {
1098
- const transformedError = (0, import_transform_error.transformError)(
1099
- err,
1100
- {
1101
- spreadPathsToArguments: {},
1102
- explicitPathsToArguments: {
1103
- checkoutTemplateId: "$[0]",
1104
- siteId: "$[1]"
1105
- },
1106
- singleArgumentUnchanged: false
1107
- },
1108
- ["checkoutTemplateId", "siteId"]
1109
- );
1110
- sideEffects?.onError?.(err);
1111
- throw transformedError;
1112
- }
1113
- }
1114
- async function createAndRedirectToCheckout2(checkoutTemplateId, siteId) {
1115
- const { httpClient, sideEffects } = arguments[2];
1116
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1117
- checkoutTemplateId,
1118
- siteId
1119
- });
1120
- const reqOpts = createAndRedirectToCheckout(payload);
1121
- sideEffects?.onSiteCall?.();
1122
- try {
1123
- const result = await httpClient.request(reqOpts);
1124
- sideEffects?.onSuccess?.(result);
1125
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1126
- } catch (err) {
1127
- const transformedError = (0, import_transform_error.transformError)(
1128
- err,
1129
- {
1130
- spreadPathsToArguments: {},
1131
- explicitPathsToArguments: {
1132
- checkoutTemplateId: "$[0]",
1133
- siteId: "$[1]"
1134
- },
1135
- singleArgumentUnchanged: false
1136
- },
1137
- ["checkoutTemplateId", "siteId"]
1138
- );
1139
- sideEffects?.onError?.(err);
1140
- throw transformedError;
1141
- }
1142
- }
1143
-
1144
- // src/ecom-v1-checkout-template-checkout-templates.public.ts
1145
- function createCheckoutTemplate3(httpClient) {
1146
- return (checkoutTemplate) => createCheckoutTemplate2(
1147
- checkoutTemplate,
1148
- // @ts-ignore
1149
- { httpClient }
1150
- );
1151
- }
1152
- function bulkCreateCheckoutTemplates3(httpClient) {
1153
- return (checkoutTemplates, options) => bulkCreateCheckoutTemplates2(
1154
- checkoutTemplates,
1155
- options,
1156
- // @ts-ignore
1157
- { httpClient }
1158
- );
1159
- }
1160
- function getCheckoutTemplate3(httpClient) {
1161
- return (checkoutTemplateId) => getCheckoutTemplate2(
1162
- checkoutTemplateId,
1163
- // @ts-ignore
1164
- { httpClient }
1165
- );
1166
- }
1167
- function updateCheckoutTemplate3(httpClient) {
1168
- return (_id, checkoutTemplate) => updateCheckoutTemplate2(
1169
- _id,
1170
- checkoutTemplate,
1171
- // @ts-ignore
1172
- { httpClient }
1173
- );
1174
- }
1175
- function deleteCheckoutTemplate3(httpClient) {
1176
- return (checkoutTemplateId) => deleteCheckoutTemplate2(
1177
- checkoutTemplateId,
1178
- // @ts-ignore
1179
- { httpClient }
1180
- );
1181
- }
1182
- function queryCheckoutTemplates3(httpClient) {
1183
- return () => queryCheckoutTemplates2(
1184
- // @ts-ignore
1185
- { httpClient }
1186
- );
1187
- }
1188
- function typedQueryCheckoutTemplates2(httpClient) {
1189
- return (query) => typedQueryCheckoutTemplates(
1190
- query,
1191
- // @ts-ignore
1192
- { httpClient }
1193
- );
1194
- }
1195
- function createCheckoutFromTemplate3(httpClient) {
1196
- return (checkoutTemplateId, siteId) => createCheckoutFromTemplate2(
1197
- checkoutTemplateId,
1198
- siteId,
1199
- // @ts-ignore
1200
- { httpClient }
1201
- );
1202
- }
1203
- function createAndRedirectToCheckout3(httpClient) {
1204
- return (checkoutTemplateId, siteId) => createAndRedirectToCheckout2(
1205
- checkoutTemplateId,
1206
- siteId,
1207
- // @ts-ignore
1208
- { httpClient }
1209
- );
1210
- }
1211
- var onCheckoutTemplateCreated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
1212
- "wix.ecom.v1.checkout_template_created",
1213
- true,
1214
- (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
1215
- (0, import_transform_paths3.transformPaths)(event, [
1216
- {
1217
- transformFn: import_image3.transformRESTImageToSDKImage,
1218
- paths: [
1219
- { path: "entity.lineItems.catalogOverrideFields.image" },
1220
- { path: "entity.customLineItems.media" }
1221
- ]
1222
- },
1223
- {
1224
- transformFn: import_float3.transformRESTFloatToSDKFloat,
1225
- paths: [
1226
- {
1227
- path: "entity.lineItems.catalogOverrideFields.physicalProperties.weight"
1228
- },
1229
- { path: "entity.customLineItems.physicalProperties.weight" }
1230
- ]
1231
- },
1232
- {
1233
- transformFn: import_page_url_v23.transformRESTPageURLV2ToSDKPageURLV2,
1234
- paths: [{ path: "entity.customLineItems.url" }]
1235
- },
1236
- {
1237
- transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
1238
- paths: [
1239
- {
1240
- path: "entity.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
1241
- },
1242
- { path: "entity.customLineItems.serviceProperties.scheduledDate" },
1243
- { path: "entity.customLineItems.serviceProperties.endDate" },
1244
- { path: "metadata.eventTime" }
1245
- ]
1246
- }
1247
- ])
1248
- )
1249
- )();
1250
- var onCheckoutTemplateDeleted = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
1251
- "wix.ecom.v1.checkout_template_deleted",
1252
- true,
1253
- (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
1254
- (0, import_transform_paths3.transformPaths)(event, [
1255
- {
1256
- transformFn: import_image3.transformRESTImageToSDKImage,
1257
- paths: [
1258
- { path: "undefined.lineItems.catalogOverrideFields.image" },
1259
- { path: "undefined.customLineItems.media" }
1260
- ]
1261
- },
1262
- {
1263
- transformFn: import_float3.transformRESTFloatToSDKFloat,
1264
- paths: [
1265
- {
1266
- path: "undefined.lineItems.catalogOverrideFields.physicalProperties.weight"
1267
- },
1268
- { path: "undefined.customLineItems.physicalProperties.weight" }
1269
- ]
1270
- },
1271
- {
1272
- transformFn: import_page_url_v23.transformRESTPageURLV2ToSDKPageURLV2,
1273
- paths: [{ path: "undefined.customLineItems.url" }]
1274
- },
1275
- {
1276
- transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
1277
- paths: [
1278
- {
1279
- path: "undefined.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
1280
- },
1281
- {
1282
- path: "undefined.customLineItems.serviceProperties.scheduledDate"
1283
- },
1284
- { path: "undefined.customLineItems.serviceProperties.endDate" },
1285
- { path: "metadata.eventTime" }
1286
- ]
1287
- }
1288
- ])
1289
- )
1290
- )();
1291
- var onCheckoutTemplateUpdated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
1292
- "wix.ecom.v1.checkout_template_updated",
1293
- true,
1294
- (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
1295
- (0, import_transform_paths3.transformPaths)(event, [
1296
- {
1297
- transformFn: import_image3.transformRESTImageToSDKImage,
1298
- paths: [
1299
- { path: "entity.lineItems.catalogOverrideFields.image" },
1300
- { path: "entity.customLineItems.media" }
1301
- ]
1302
- },
1303
- {
1304
- transformFn: import_float3.transformRESTFloatToSDKFloat,
1305
- paths: [
1306
- {
1307
- path: "entity.lineItems.catalogOverrideFields.physicalProperties.weight"
1308
- },
1309
- { path: "entity.customLineItems.physicalProperties.weight" }
1310
- ]
1311
- },
1312
- {
1313
- transformFn: import_page_url_v23.transformRESTPageURLV2ToSDKPageURLV2,
1314
- paths: [{ path: "entity.customLineItems.url" }]
1315
- },
1316
- {
1317
- transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
1318
- paths: [
1319
- {
1320
- path: "entity.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
1321
- },
1322
- { path: "entity.customLineItems.serviceProperties.scheduledDate" },
1323
- { path: "entity.customLineItems.serviceProperties.endDate" },
1324
- { path: "metadata.eventTime" }
1325
- ]
1326
- }
1327
- ])
1328
- )
1329
- )();
1330
- var onCheckoutTemplateUsed = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
1331
- "wix.ecom.v1.checkout_template_used",
1332
- true,
1333
- (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
1334
- (0, import_transform_paths3.transformPaths)(event, [
1335
- {
1336
- transformFn: import_image3.transformRESTImageToSDKImage,
1337
- paths: [
1338
- {
1339
- path: "data.checkoutTemplate.lineItems.catalogOverrideFields.image"
1340
- },
1341
- { path: "data.checkoutTemplate.customLineItems.media" },
1342
- { path: "data.checkout.lineItems.media" },
1343
- { path: "data.checkout.lineItems.catalogOverrideFields.image" }
1344
- ]
1345
- },
1346
- {
1347
- transformFn: import_float3.transformRESTFloatToSDKFloat,
1348
- paths: [
1349
- {
1350
- path: "data.checkoutTemplate.lineItems.catalogOverrideFields.physicalProperties.weight"
1351
- },
1352
- {
1353
- path: "data.checkoutTemplate.customLineItems.physicalProperties.weight"
1354
- },
1355
- { path: "data.checkout.lineItems.physicalProperties.weight" },
1356
- {
1357
- path: "data.checkout.lineItems.catalogOverrideFields.physicalProperties.weight"
1358
- },
1359
- {
1360
- path: "data.checkout.appliedDiscounts.merchantDiscount.percentage"
1361
- }
1362
- ]
1363
- },
1364
- {
1365
- transformFn: import_page_url_v23.transformRESTPageURLV2ToSDKPageURLV2,
1366
- paths: [
1367
- { path: "data.checkoutTemplate.customLineItems.url" },
1368
- { path: "data.checkout.lineItems.url" }
1369
- ]
1370
- },
1371
- {
1372
- transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
1373
- paths: [
1374
- {
1375
- path: "data.checkoutTemplate.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
1376
- },
1377
- {
1378
- path: "data.checkoutTemplate.customLineItems.serviceProperties.scheduledDate"
1379
- },
1380
- {
1381
- path: "data.checkoutTemplate.customLineItems.serviceProperties.endDate"
1382
- },
1383
- { path: "data.checkout.createdDate" },
1384
- { path: "data.checkout.updatedDate" },
1385
- {
1386
- path: "data.checkout.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
1387
- },
1388
- { path: "data.checkout.lineItems.serviceProperties.scheduledDate" },
1389
- { path: "data.checkout.lineItems.serviceProperties.endDate" },
1390
- {
1391
- path: "data.checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.from"
1392
- },
1393
- {
1394
- path: "data.checkout.shippingInfo.selectedCarrierServiceOption.logistics.deliveryTimeSlot.to"
1395
- },
1396
- {
1397
- path: "data.checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.from"
1398
- },
1399
- {
1400
- path: "data.checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.deliveryTimeSlot.to"
1401
- },
1402
- {
1403
- path: "data.checkout.membershipOptions.eligibleMemberships.expirationDate"
1404
- },
1405
- {
1406
- path: "data.checkout.membershipOptions.invalidMemberships.membership.expirationDate"
1407
- },
1408
- {
1409
- path: "data.checkout.subscriptionCharges.charges.cycleBillingDate"
1410
- },
1411
- { path: "metadata.eventTime" }
1412
- ]
1413
- },
1414
- {
1415
- transformFn: import_address.transformRESTAddressToSDKAddress,
1416
- paths: [
1417
- { path: "data.checkout.billingInfo.address" },
1418
- { path: "data.checkout.shippingInfo.shippingDestination.address" },
1419
- {
1420
- path: "data.checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address"
1421
- },
1422
- {
1423
- path: "data.checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address"
1424
- }
1425
- ]
1426
- }
1427
- ])
1428
- )
1429
- )();
1430
-
1431
- // src/ecom-v1-checkout-template-checkout-templates.context.ts
1432
- var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
1433
- var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
1434
- var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
1435
- function customQueryCheckoutTemplates(httpClient) {
1436
- const router = /* @__PURE__ */ (0, import_query_method_router.createQueryOverloadRouter)({
1437
- builderQueryFunction: () => queryCheckoutTemplates3(httpClient)(),
1438
- typedQueryFunction: (query) => typedQueryCheckoutTemplates2(httpClient)(query),
1439
- hasOptionsParameter: false
1440
- });
1441
- function overloadedQuery(query) {
1442
- return router(...arguments);
1443
- }
1444
- return overloadedQuery;
1445
- }
1446
- var createCheckoutTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createCheckoutTemplate3);
1447
- var bulkCreateCheckoutTemplates4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateCheckoutTemplates3);
1448
- var getCheckoutTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCheckoutTemplate3);
1449
- var updateCheckoutTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateCheckoutTemplate3);
1450
- var deleteCheckoutTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteCheckoutTemplate3);
1451
- var createCheckoutFromTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createCheckoutFromTemplate3);
1452
- var createAndRedirectToCheckout4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createAndRedirectToCheckout3);
1453
- var queryCheckoutTemplates4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryCheckoutTemplates);
1454
- var onCheckoutTemplateCreated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1455
- onCheckoutTemplateCreated
1456
- );
1457
- var onCheckoutTemplateDeleted2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1458
- onCheckoutTemplateDeleted
1459
- );
1460
- var onCheckoutTemplateUpdated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1461
- onCheckoutTemplateUpdated
1462
- );
1463
- var onCheckoutTemplateUsed2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1464
- onCheckoutTemplateUsed
1465
- );
1466
- // Annotate the CommonJS export names for ESM import in node:
1467
- 0 && (module.exports = {
1468
- AdditionalFeeSource,
1469
- BalanceType,
1470
- ChannelType,
1471
- ChargeType,
1472
- DescriptionLineType,
1473
- DimensionsUnit,
1474
- DiscountType,
1475
- FallbackReason,
1476
- FileType,
1477
- ItemAvailabilityStatus,
1478
- ItemTypePreset,
1479
- JurisdictionType,
1480
- ManualCalculationReason,
1481
- NameInLineItem,
1482
- NameInOther,
1483
- PaymentOptionType,
1484
- PickupMethod,
1485
- PlatformFeeChargeType,
1486
- ProductPeriodAlignment,
1487
- RateType,
1488
- RuleType,
1489
- Severity,
1490
- SortOrder,
1491
- Status,
1492
- SubscriptionFrequency,
1493
- SuggestedFix,
1494
- TaxableAddressType,
1495
- VatType,
1496
- WebhookIdentityType,
1497
- WeightUnit,
1498
- bulkCreateCheckoutTemplates,
1499
- createAndRedirectToCheckout,
1500
- createCheckoutFromTemplate,
1501
- createCheckoutTemplate,
1502
- deleteCheckoutTemplate,
1503
- getCheckoutTemplate,
1504
- onCheckoutTemplateCreated,
1505
- onCheckoutTemplateDeleted,
1506
- onCheckoutTemplateUpdated,
1507
- onCheckoutTemplateUsed,
1508
- queryCheckoutTemplates,
1509
- updateCheckoutTemplate,
1510
- utils
1511
- });
1512
- //# sourceMappingURL=index.js.map