@wix/auto_sdk_ecom_catalog 1.0.9 → 1.0.10
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.
- package/build/{cjs/src/service-plugins-types.d.ts → index.d.mts} +95 -56
- package/build/{internal/cjs/src/service-plugins-types.d.ts → index.d.ts} +95 -56
- package/build/index.js +161 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +128 -0
- package/build/index.mjs.map +1 -0
- package/build/{es/src/service-plugins-types.d.ts → internal/index.d.mts} +95 -56
- package/build/internal/{es/src/service-plugins-types.d.ts → index.d.ts} +95 -56
- package/build/internal/index.js +161 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +128 -0
- package/build/internal/index.mjs.map +1 -0
- package/package.json +13 -12
- package/build/cjs/index.d.ts +0 -2
- package/build/cjs/index.js +0 -19
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -29
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.d.ts +0 -5
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.js +0 -9
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.js.map +0 -1
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.d.ts +0 -33
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.js +0 -49
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.js.map +0 -1
- package/build/cjs/src/service-plugins-types.js +0 -77
- package/build/cjs/src/service-plugins-types.js.map +0 -1
- package/build/es/index.d.ts +0 -2
- package/build/es/index.js +0 -3
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -29
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.context.d.ts +0 -5
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.context.js +0 -6
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.context.js.map +0 -1
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.public.d.ts +0 -33
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.public.js +0 -46
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.public.js.map +0 -1
- package/build/es/src/service-plugins-types.js +0 -74
- package/build/es/src/service-plugins-types.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -2
- package/build/internal/cjs/index.js +0 -19
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -29
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.d.ts +0 -5
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.js +0 -9
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.js.map +0 -1
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.d.ts +0 -33
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.js +0 -49
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.js.map +0 -1
- package/build/internal/cjs/src/service-plugins-types.js +0 -77
- package/build/internal/cjs/src/service-plugins-types.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -2
- package/build/internal/es/index.js +0 -3
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -29
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.context.d.ts +0 -5
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.context.js +0 -6
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.context.js.map +0 -1
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.public.d.ts +0 -33
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.public.js +0 -46
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.public.js.map +0 -1
- package/build/internal/es/src/service-plugins-types.js +0 -74
- package/build/internal/es/src/service-plugins-types.js.map +0 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';
|
|
2
|
+
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
3
|
+
|
|
4
|
+
interface GetCatalogItemsRequest {
|
|
2
5
|
/**
|
|
3
6
|
* Catalog reference details for the items to retrieve, including quantity of each item.
|
|
4
7
|
* @minSize 1
|
|
@@ -19,14 +22,14 @@ export interface GetCatalogItemsRequest {
|
|
|
19
22
|
*/
|
|
20
23
|
currency?: string;
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
interface CatalogReferenceAndQuantity {
|
|
23
26
|
/** Catalog and item reference info. Holds IDs for the item and the catalog it belongs to, as well as further optional details. This is identical in the request and response. */
|
|
24
27
|
catalogReference?: CatalogReference;
|
|
25
28
|
/** Item quantity. */
|
|
26
29
|
quantity?: number;
|
|
27
30
|
}
|
|
28
31
|
/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
|
|
29
|
-
|
|
32
|
+
interface CatalogReference {
|
|
30
33
|
/**
|
|
31
34
|
* ID of the item within the catalog it belongs to.
|
|
32
35
|
* @minLength 1
|
|
@@ -52,7 +55,7 @@ export interface CatalogReference {
|
|
|
52
55
|
*/
|
|
53
56
|
options?: Record<string, any> | null;
|
|
54
57
|
}
|
|
55
|
-
|
|
58
|
+
declare enum WeightUnit {
|
|
56
59
|
/** Weight unit can't be classified due to an error. */
|
|
57
60
|
UNSPECIFIED_WEIGHT_UNIT = "UNSPECIFIED_WEIGHT_UNIT",
|
|
58
61
|
/** Kilograms. */
|
|
@@ -61,7 +64,7 @@ export declare enum WeightUnit {
|
|
|
61
64
|
LB = "LB"
|
|
62
65
|
}
|
|
63
66
|
/** Buyer Info */
|
|
64
|
-
|
|
67
|
+
interface BuyerInfo extends BuyerInfoIdOneOf {
|
|
65
68
|
/**
|
|
66
69
|
* Visitor ID - if the buyer is **not** a site member.
|
|
67
70
|
* @format GUID
|
|
@@ -92,7 +95,7 @@ export interface BuyerInfo extends BuyerInfoIdOneOf {
|
|
|
92
95
|
email?: string | null;
|
|
93
96
|
}
|
|
94
97
|
/** @oneof */
|
|
95
|
-
|
|
98
|
+
interface BuyerInfoIdOneOf {
|
|
96
99
|
/**
|
|
97
100
|
* Visitor ID - if the buyer is **not** a site member.
|
|
98
101
|
* @format GUID
|
|
@@ -112,20 +115,20 @@ export interface BuyerInfoIdOneOf {
|
|
|
112
115
|
*/
|
|
113
116
|
userId?: string;
|
|
114
117
|
}
|
|
115
|
-
|
|
118
|
+
interface GetCatalogItemsResponse {
|
|
116
119
|
/**
|
|
117
120
|
* Details for each item, including catalog reference details and item data. Any items that don't exist in the catalog are excluded.
|
|
118
121
|
* If none of the requested items exist in the catalog, this array must be empty.
|
|
119
122
|
*/
|
|
120
123
|
catalogItems?: Item[];
|
|
121
124
|
}
|
|
122
|
-
|
|
125
|
+
interface Item {
|
|
123
126
|
/** Catalog and item reference info. Holds IDs for the item and the catalog it belongs to, as well as further optional details. This is identical in the request and response. */
|
|
124
127
|
catalogReference?: CatalogReference;
|
|
125
128
|
/** Item data. Contains full details about the item. */
|
|
126
129
|
data?: ItemData;
|
|
127
130
|
}
|
|
128
|
-
|
|
131
|
+
interface ItemData {
|
|
129
132
|
/** __Required.__ Item name. */
|
|
130
133
|
productName?: ProductName;
|
|
131
134
|
/**
|
|
@@ -221,7 +224,7 @@ export interface ItemData {
|
|
|
221
224
|
*/
|
|
222
225
|
savePaymentMethod?: boolean;
|
|
223
226
|
}
|
|
224
|
-
|
|
227
|
+
interface ProductName {
|
|
225
228
|
/**
|
|
226
229
|
* __Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
|
|
227
230
|
*
|
|
@@ -242,27 +245,27 @@ export interface ProductName {
|
|
|
242
245
|
*/
|
|
243
246
|
translated?: string | null;
|
|
244
247
|
}
|
|
245
|
-
|
|
248
|
+
interface ItemType extends ItemTypeItemTypeDataOneOf {
|
|
246
249
|
/** Preset item type. */
|
|
247
250
|
preset?: ItemTypeItemType;
|
|
248
251
|
/** Custom item type. When none of the preset types are suitable, specifies the custom type. */
|
|
249
252
|
custom?: string;
|
|
250
253
|
}
|
|
251
254
|
/** @oneof */
|
|
252
|
-
|
|
255
|
+
interface ItemTypeItemTypeDataOneOf {
|
|
253
256
|
/** Preset item type. */
|
|
254
257
|
preset?: ItemTypeItemType;
|
|
255
258
|
/** Custom item type. When none of the preset types are suitable, specifies the custom type. */
|
|
256
259
|
custom?: string;
|
|
257
260
|
}
|
|
258
|
-
|
|
261
|
+
declare enum ItemTypeItemType {
|
|
259
262
|
UNRECOGNISED = "UNRECOGNISED",
|
|
260
263
|
PHYSICAL = "PHYSICAL",
|
|
261
264
|
DIGITAL = "DIGITAL",
|
|
262
265
|
GIFT_CARD = "GIFT_CARD",
|
|
263
266
|
SERVICE = "SERVICE"
|
|
264
267
|
}
|
|
265
|
-
|
|
268
|
+
interface DescriptionLine extends DescriptionLineValueOneOf, DescriptionLineDescriptionLineValueOneOf {
|
|
266
269
|
/** Description line plain text value. */
|
|
267
270
|
plainText?: PlainTextValue;
|
|
268
271
|
/** Description line color value. */
|
|
@@ -271,16 +274,16 @@ export interface DescriptionLine extends DescriptionLineValueOneOf, DescriptionL
|
|
|
271
274
|
name?: DescriptionLineName;
|
|
272
275
|
}
|
|
273
276
|
/** @oneof */
|
|
274
|
-
|
|
277
|
+
interface DescriptionLineValueOneOf {
|
|
275
278
|
/** Description line plain text value. */
|
|
276
279
|
plainText?: PlainTextValue;
|
|
277
280
|
/** Description line color value. */
|
|
278
281
|
colorInfo?: Color;
|
|
279
282
|
}
|
|
280
283
|
/** @oneof */
|
|
281
|
-
|
|
284
|
+
interface DescriptionLineDescriptionLineValueOneOf {
|
|
282
285
|
}
|
|
283
|
-
|
|
286
|
+
interface DescriptionLineName {
|
|
284
287
|
/**
|
|
285
288
|
* Description line name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
|
|
286
289
|
* @maxLength 100
|
|
@@ -294,7 +297,7 @@ export interface DescriptionLineName {
|
|
|
294
297
|
*/
|
|
295
298
|
translated?: string | null;
|
|
296
299
|
}
|
|
297
|
-
|
|
300
|
+
interface PlainTextValue {
|
|
298
301
|
/**
|
|
299
302
|
* Description line plain text value in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
|
|
300
303
|
* @maxLength 600
|
|
@@ -308,7 +311,7 @@ export interface PlainTextValue {
|
|
|
308
311
|
*/
|
|
309
312
|
translated?: string | null;
|
|
310
313
|
}
|
|
311
|
-
|
|
314
|
+
interface Color {
|
|
312
315
|
/**
|
|
313
316
|
* Description line color name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
|
|
314
317
|
* @maxLength 500
|
|
@@ -324,7 +327,7 @@ export interface Color {
|
|
|
324
327
|
/** HEX or RGB color code for display. */
|
|
325
328
|
code?: string | null;
|
|
326
329
|
}
|
|
327
|
-
|
|
330
|
+
declare enum DescriptionLineType {
|
|
328
331
|
/** Unrecognized type. */
|
|
329
332
|
UNRECOGNISED = "UNRECOGNISED",
|
|
330
333
|
/** Plain text type. */
|
|
@@ -332,7 +335,7 @@ export declare enum DescriptionLineType {
|
|
|
332
335
|
/** Color type. */
|
|
333
336
|
COLOR = "COLOR"
|
|
334
337
|
}
|
|
335
|
-
|
|
338
|
+
interface PhysicalProperties {
|
|
336
339
|
/** Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request. */
|
|
337
340
|
weight?: number | null;
|
|
338
341
|
/**
|
|
@@ -343,19 +346,19 @@ export interface PhysicalProperties {
|
|
|
343
346
|
/** Whether this line item is shippable. */
|
|
344
347
|
shippable?: boolean;
|
|
345
348
|
}
|
|
346
|
-
|
|
349
|
+
interface Scope {
|
|
347
350
|
/** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */
|
|
348
351
|
namespace?: string;
|
|
349
352
|
/** Coupon scope's applied group (e.g., event or ticket in Wix Events) */
|
|
350
353
|
group?: Group;
|
|
351
354
|
}
|
|
352
|
-
|
|
355
|
+
interface Group {
|
|
353
356
|
/** Coupon scope's group (e.g., product or collection in Wix Stores). See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */
|
|
354
357
|
name?: string;
|
|
355
358
|
/** Item ID (when the coupon scope is limited to just one item). */
|
|
356
359
|
entityId?: string | null;
|
|
357
360
|
}
|
|
358
|
-
|
|
361
|
+
interface SubscriptionOptionInfo {
|
|
359
362
|
/** Subscription option settings. */
|
|
360
363
|
subscriptionSettings?: SubscriptionSettings;
|
|
361
364
|
/** Subscription option title. */
|
|
@@ -363,7 +366,7 @@ export interface SubscriptionOptionInfo {
|
|
|
363
366
|
/** Subscription option description. */
|
|
364
367
|
description?: Description;
|
|
365
368
|
}
|
|
366
|
-
|
|
369
|
+
interface SubscriptionSettings {
|
|
367
370
|
/** Frequency of recurring payment. */
|
|
368
371
|
frequency?: SubscriptionFrequency;
|
|
369
372
|
/**
|
|
@@ -384,14 +387,14 @@ export interface SubscriptionSettings {
|
|
|
384
387
|
billingCycles?: number | null;
|
|
385
388
|
}
|
|
386
389
|
/** Frequency unit of recurring payment */
|
|
387
|
-
|
|
390
|
+
declare enum SubscriptionFrequency {
|
|
388
391
|
UNDEFINED = "UNDEFINED",
|
|
389
392
|
DAY = "DAY",
|
|
390
393
|
WEEK = "WEEK",
|
|
391
394
|
MONTH = "MONTH",
|
|
392
395
|
YEAR = "YEAR"
|
|
393
396
|
}
|
|
394
|
-
|
|
397
|
+
interface FreeTrialPeriod {
|
|
395
398
|
/** Frequency of period. Values: DAY, WEEK, MONTH, YEAR */
|
|
396
399
|
frequency?: SubscriptionFrequency;
|
|
397
400
|
/**
|
|
@@ -401,7 +404,7 @@ export interface FreeTrialPeriod {
|
|
|
401
404
|
*/
|
|
402
405
|
interval?: number;
|
|
403
406
|
}
|
|
404
|
-
|
|
407
|
+
interface Title {
|
|
405
408
|
/**
|
|
406
409
|
* Subscription option name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
|
|
407
410
|
* @minLength 1
|
|
@@ -417,7 +420,7 @@ export interface Title {
|
|
|
417
420
|
*/
|
|
418
421
|
translated?: string | null;
|
|
419
422
|
}
|
|
420
|
-
|
|
423
|
+
interface Description {
|
|
421
424
|
/**
|
|
422
425
|
* Subscription option description.
|
|
423
426
|
* @maxLength 500
|
|
@@ -429,7 +432,7 @@ export interface Description {
|
|
|
429
432
|
*/
|
|
430
433
|
translated?: string | null;
|
|
431
434
|
}
|
|
432
|
-
|
|
435
|
+
interface SecuredMedia {
|
|
433
436
|
/**
|
|
434
437
|
* Media ID in Wix Media Manager.
|
|
435
438
|
* @minLength 1
|
|
@@ -445,7 +448,7 @@ export interface SecuredMedia {
|
|
|
445
448
|
/** File type. */
|
|
446
449
|
fileType?: FileType;
|
|
447
450
|
}
|
|
448
|
-
|
|
451
|
+
declare enum FileType {
|
|
449
452
|
UNSPECIFIED = "UNSPECIFIED",
|
|
450
453
|
SECURE_PICTURE = "SECURE_PICTURE",
|
|
451
454
|
SECURE_VIDEO = "SECURE_VIDEO",
|
|
@@ -454,7 +457,7 @@ export declare enum FileType {
|
|
|
454
457
|
SECURE_ARCHIVE = "SECURE_ARCHIVE"
|
|
455
458
|
}
|
|
456
459
|
/** Type of selected payment option for catalog item */
|
|
457
|
-
|
|
460
|
+
declare enum PaymentOptionType {
|
|
458
461
|
/** The entire payment for this item happens as part of the checkout. */
|
|
459
462
|
FULL_PAYMENT_ONLINE = "FULL_PAYMENT_ONLINE",
|
|
460
463
|
/** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
|
|
@@ -466,7 +469,7 @@ export declare enum PaymentOptionType {
|
|
|
466
469
|
/** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
|
|
467
470
|
MEMBERSHIP_OFFLINE = "MEMBERSHIP_OFFLINE"
|
|
468
471
|
}
|
|
469
|
-
|
|
472
|
+
interface ServiceProperties {
|
|
470
473
|
/**
|
|
471
474
|
* Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.
|
|
472
475
|
* For example, the start time of a class.
|
|
@@ -479,7 +482,7 @@ export interface ServiceProperties {
|
|
|
479
482
|
*/
|
|
480
483
|
numberOfParticipants?: number | null;
|
|
481
484
|
}
|
|
482
|
-
|
|
485
|
+
interface PriceDescription {
|
|
483
486
|
/**
|
|
484
487
|
* __Required.__ Price description in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
|
|
485
488
|
* @minLength 1
|
|
@@ -495,22 +498,22 @@ export interface PriceDescription {
|
|
|
495
498
|
*/
|
|
496
499
|
translated?: string | null;
|
|
497
500
|
}
|
|
498
|
-
|
|
501
|
+
interface TaxableAddress extends TaxableAddressTaxableAddressDataOneOf {
|
|
499
502
|
/** taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly. */
|
|
500
503
|
addressType?: TaxableAddressType;
|
|
501
504
|
}
|
|
502
505
|
/** @oneof */
|
|
503
|
-
|
|
506
|
+
interface TaxableAddressTaxableAddressDataOneOf {
|
|
504
507
|
/** taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly. */
|
|
505
508
|
addressType?: TaxableAddressType;
|
|
506
509
|
}
|
|
507
|
-
|
|
510
|
+
declare enum TaxableAddressType {
|
|
508
511
|
UNKNOWN_TAXABLE_ADDRESS = "UNKNOWN_TAXABLE_ADDRESS",
|
|
509
512
|
BUSINESS = "BUSINESS",
|
|
510
513
|
BILLING = "BILLING",
|
|
511
514
|
SHIPPING = "SHIPPING"
|
|
512
515
|
}
|
|
513
|
-
|
|
516
|
+
interface Policy {
|
|
514
517
|
/**
|
|
515
518
|
* Policy title - should be translated
|
|
516
519
|
* @minLength 1
|
|
@@ -524,7 +527,7 @@ export interface Policy {
|
|
|
524
527
|
*/
|
|
525
528
|
content?: string;
|
|
526
529
|
}
|
|
527
|
-
|
|
530
|
+
interface AdditionalFee {
|
|
528
531
|
/**
|
|
529
532
|
* Additional fee's unique code or ID.
|
|
530
533
|
* @minLength 1
|
|
@@ -552,7 +555,7 @@ export interface AdditionalFee {
|
|
|
552
555
|
taxDetails?: TaxDetails;
|
|
553
556
|
}
|
|
554
557
|
/** Tax details. */
|
|
555
|
-
|
|
558
|
+
interface TaxDetails {
|
|
556
559
|
/** Whether additional fee is taxable. */
|
|
557
560
|
taxable?: boolean;
|
|
558
561
|
/**
|
|
@@ -561,7 +564,7 @@ export interface TaxDetails {
|
|
|
561
564
|
*/
|
|
562
565
|
taxGroupId?: string | null;
|
|
563
566
|
}
|
|
564
|
-
|
|
567
|
+
interface ModifierGroup {
|
|
565
568
|
/**
|
|
566
569
|
* Modifier group id.
|
|
567
570
|
* @minLength 1
|
|
@@ -577,7 +580,7 @@ export interface ModifierGroup {
|
|
|
577
580
|
*/
|
|
578
581
|
modifiers?: ItemModifier[];
|
|
579
582
|
}
|
|
580
|
-
|
|
583
|
+
interface TranslatableString {
|
|
581
584
|
/**
|
|
582
585
|
* __Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
|
|
583
586
|
*
|
|
@@ -598,7 +601,7 @@ export interface TranslatableString {
|
|
|
598
601
|
*/
|
|
599
602
|
translated?: string | null;
|
|
600
603
|
}
|
|
601
|
-
|
|
604
|
+
interface ItemModifier {
|
|
602
605
|
/**
|
|
603
606
|
* Modifier ID.
|
|
604
607
|
* @minLength 1
|
|
@@ -621,7 +624,7 @@ export interface ItemModifier {
|
|
|
621
624
|
*/
|
|
622
625
|
price?: string | null;
|
|
623
626
|
}
|
|
624
|
-
|
|
627
|
+
interface QueryCatalogItemsRequest {
|
|
625
628
|
/**
|
|
626
629
|
* A list of itemIDs to filter by. If exists, the result will only include the items with the IDs passed.
|
|
627
630
|
* @minLength 1
|
|
@@ -643,19 +646,19 @@ export interface QueryCatalogItemsRequest {
|
|
|
643
646
|
*/
|
|
644
647
|
lastNumericId?: string | null;
|
|
645
648
|
}
|
|
646
|
-
|
|
649
|
+
interface Paging {
|
|
647
650
|
/** Number of items to load. */
|
|
648
651
|
limit?: number | null;
|
|
649
652
|
/** Number of items to skip in the current sort order. */
|
|
650
653
|
offset?: number | null;
|
|
651
654
|
}
|
|
652
|
-
|
|
655
|
+
interface QueryCatalogItemsResponse {
|
|
653
656
|
/** Catalog info and item data. */
|
|
654
657
|
catalogItems?: BasicItem[];
|
|
655
658
|
/** Paging metadata. */
|
|
656
659
|
metadata?: PagingMetadata;
|
|
657
660
|
}
|
|
658
|
-
|
|
661
|
+
interface BasicItem {
|
|
659
662
|
/**
|
|
660
663
|
* The ID of the item.
|
|
661
664
|
* @minLength 1
|
|
@@ -676,13 +679,13 @@ export interface BasicItem {
|
|
|
676
679
|
*/
|
|
677
680
|
numericId?: string | null;
|
|
678
681
|
}
|
|
679
|
-
|
|
682
|
+
interface NumericPropertyRange {
|
|
680
683
|
/** Minimum value. */
|
|
681
684
|
minValue?: number;
|
|
682
685
|
/** Maximum value. */
|
|
683
686
|
maxValue?: number;
|
|
684
687
|
}
|
|
685
|
-
|
|
688
|
+
interface PagingMetadata {
|
|
686
689
|
/** Number of items returned in the response. */
|
|
687
690
|
count?: number | null;
|
|
688
691
|
/** Offset that was requested. */
|
|
@@ -692,7 +695,7 @@ export interface PagingMetadata {
|
|
|
692
695
|
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
693
696
|
tooManyToCount?: boolean | null;
|
|
694
697
|
}
|
|
695
|
-
|
|
698
|
+
interface CatalogSPIConfig {
|
|
696
699
|
/** Base URI which Wix eCommerce will call to access Catalog service plugin endpoints. For example, to call the Get Catalog Items endpoint at `https://my-external-catalog.com/get-catalog-items`, the base URI you provide here is `https://my-external-catalog.com`. */
|
|
697
700
|
deploymentUri?: string;
|
|
698
701
|
/** Configuration details for discounts applied to all items in the catalog. */
|
|
@@ -701,7 +704,7 @@ export interface CatalogSPIConfig {
|
|
|
701
704
|
specificItemsDiscount?: SpecificItemsDiscountConfig;
|
|
702
705
|
}
|
|
703
706
|
/** Configuration for all items discount functionality in the catalog. */
|
|
704
|
-
|
|
707
|
+
interface AllItemsDiscountConfig {
|
|
705
708
|
/**
|
|
706
709
|
* Whether the discount is enabled.
|
|
707
710
|
*
|
|
@@ -717,7 +720,7 @@ export interface AllItemsDiscountConfig {
|
|
|
717
720
|
name?: string | null;
|
|
718
721
|
}
|
|
719
722
|
/** Configuration for discount functionality in the catalog. */
|
|
720
|
-
|
|
723
|
+
interface SpecificItemsDiscountConfig {
|
|
721
724
|
/**
|
|
722
725
|
* Whether the discount is enabled.
|
|
723
726
|
*
|
|
@@ -744,7 +747,7 @@ export interface SpecificItemsDiscountConfig {
|
|
|
744
747
|
* }
|
|
745
748
|
* ```
|
|
746
749
|
*/
|
|
747
|
-
|
|
750
|
+
interface Context {
|
|
748
751
|
/** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */
|
|
749
752
|
requestId?: string | null;
|
|
750
753
|
/**
|
|
@@ -762,14 +765,14 @@ export interface Context {
|
|
|
762
765
|
*/
|
|
763
766
|
instanceId?: string | null;
|
|
764
767
|
}
|
|
765
|
-
|
|
768
|
+
declare enum IdentityType {
|
|
766
769
|
UNKNOWN = "UNKNOWN",
|
|
767
770
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
768
771
|
MEMBER = "MEMBER",
|
|
769
772
|
WIX_USER = "WIX_USER",
|
|
770
773
|
APP = "APP"
|
|
771
774
|
}
|
|
772
|
-
|
|
775
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
773
776
|
/**
|
|
774
777
|
* ID of a site visitor that has not logged in to the site.
|
|
775
778
|
* @format GUID
|
|
@@ -794,7 +797,7 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
|
794
797
|
identityType?: IdentityType;
|
|
795
798
|
}
|
|
796
799
|
/** @oneof */
|
|
797
|
-
|
|
800
|
+
interface IdentificationDataIdOneOf {
|
|
798
801
|
/**
|
|
799
802
|
* ID of a site visitor that has not logged in to the site.
|
|
800
803
|
* @format GUID
|
|
@@ -816,3 +819,39 @@ export interface IdentificationDataIdOneOf {
|
|
|
816
819
|
*/
|
|
817
820
|
appId?: string;
|
|
818
821
|
}
|
|
822
|
+
|
|
823
|
+
interface GetCatalogItemsEnvelope {
|
|
824
|
+
request: GetCatalogItemsRequest;
|
|
825
|
+
metadata: Context;
|
|
826
|
+
}
|
|
827
|
+
declare const provideHandlers$1: ServicePluginDefinition<{
|
|
828
|
+
/**
|
|
829
|
+
*
|
|
830
|
+
* Retrieves data for specified items in a specified catalog.
|
|
831
|
+
*
|
|
832
|
+
* Wix calls this method whenever a cart or checkout is updated, and when an item is added to an order.
|
|
833
|
+
*
|
|
834
|
+
* The method receives a `catalogReferences` array. Each catalog reference in the array contains:
|
|
835
|
+
* + The ID of the item whose latest information Wix needs to retrieve.
|
|
836
|
+
* + The ID of the app providing the catalog containing the item.
|
|
837
|
+
* + Optional details about preferences or customization of the item.
|
|
838
|
+
*
|
|
839
|
+
* The method also receives preferences for the currency and weight unit to be used in the response.
|
|
840
|
+
*
|
|
841
|
+
* Your external catalog can store and organize item details in any way you prefer.
|
|
842
|
+
* When implementing the Catalog service plugin, learn how to handle item variants ([REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalog-service-plugin/handle-item-variants) | [SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/service-plugins/catalog/handle-item-variants)) in a way that meets your needs.
|
|
843
|
+
*
|
|
844
|
+
* The method's response must contain a `catalogItems` array. Each item in the array must contain:
|
|
845
|
+
* + A `catalogReference` object. This must be identical to the `catalogReference` object received in the request.
|
|
846
|
+
* + A `data` object with full details about the item.
|
|
847
|
+
*
|
|
848
|
+
* > **Notes:**
|
|
849
|
+
* > + If an item doesn't exist in the catalog, the response must exclude it from the `catalogItems` array in the response.
|
|
850
|
+
* > + When none of the items requested exist in the catalog, `catalogItems` must contain an empty array.
|
|
851
|
+
* > + Wix calls the method every time a cart or checkout is updated. If the response doesn't include an item that was already in the cart or checkout, Wix removes the item from the cart or checkout. */
|
|
852
|
+
getCatalogItems(payload: GetCatalogItemsEnvelope): GetCatalogItemsResponse | Promise<GetCatalogItemsResponse>;
|
|
853
|
+
}>;
|
|
854
|
+
|
|
855
|
+
declare const provideHandlers: ReturnType<typeof createServicePluginModule<typeof publicProvideHandlers>>;
|
|
856
|
+
|
|
857
|
+
export { type AdditionalFee, type AllItemsDiscountConfig, type BasicItem, type BuyerInfo, type BuyerInfoIdOneOf, type CatalogReference, type CatalogReferenceAndQuantity, type CatalogSPIConfig, type Color, type Context, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineValueOneOf, FileType, type FreeTrialPeriod, type GetCatalogItemsRequest, type GetCatalogItemsResponse, type Group, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type Item, type ItemData, type ItemModifier, type ItemType, ItemTypeItemType, type ItemTypeItemTypeDataOneOf, type ModifierGroup, type NumericPropertyRange, type Paging, type PagingMetadata, PaymentOptionType, type PhysicalProperties, type PlainTextValue, type Policy, type PriceDescription, type ProductName, type QueryCatalogItemsRequest, type QueryCatalogItemsResponse, type Scope, type SecuredMedia, type ServiceProperties, type SpecificItemsDiscountConfig, SubscriptionFrequency, type SubscriptionOptionInfo, type SubscriptionSettings, type TaxDetails, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type Title, type TranslatableString, WeightUnit, provideHandlers, provideHandlers$1 as publicProvideHandlers };
|
|
@@ -0,0 +1,161 @@
|
|
|
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
|
+
DescriptionLineType: () => DescriptionLineType,
|
|
24
|
+
FileType: () => FileType,
|
|
25
|
+
IdentityType: () => IdentityType,
|
|
26
|
+
ItemTypeItemType: () => ItemTypeItemType,
|
|
27
|
+
PaymentOptionType: () => PaymentOptionType,
|
|
28
|
+
SubscriptionFrequency: () => SubscriptionFrequency,
|
|
29
|
+
TaxableAddressType: () => TaxableAddressType,
|
|
30
|
+
WeightUnit: () => WeightUnit,
|
|
31
|
+
provideHandlers: () => provideHandlers2,
|
|
32
|
+
publicProvideHandlers: () => provideHandlers
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(index_exports);
|
|
35
|
+
|
|
36
|
+
// src/service-plugins-types.ts
|
|
37
|
+
var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
38
|
+
WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
39
|
+
WeightUnit2["KG"] = "KG";
|
|
40
|
+
WeightUnit2["LB"] = "LB";
|
|
41
|
+
return WeightUnit2;
|
|
42
|
+
})(WeightUnit || {});
|
|
43
|
+
var ItemTypeItemType = /* @__PURE__ */ ((ItemTypeItemType2) => {
|
|
44
|
+
ItemTypeItemType2["UNRECOGNISED"] = "UNRECOGNISED";
|
|
45
|
+
ItemTypeItemType2["PHYSICAL"] = "PHYSICAL";
|
|
46
|
+
ItemTypeItemType2["DIGITAL"] = "DIGITAL";
|
|
47
|
+
ItemTypeItemType2["GIFT_CARD"] = "GIFT_CARD";
|
|
48
|
+
ItemTypeItemType2["SERVICE"] = "SERVICE";
|
|
49
|
+
return ItemTypeItemType2;
|
|
50
|
+
})(ItemTypeItemType || {});
|
|
51
|
+
var DescriptionLineType = /* @__PURE__ */ ((DescriptionLineType2) => {
|
|
52
|
+
DescriptionLineType2["UNRECOGNISED"] = "UNRECOGNISED";
|
|
53
|
+
DescriptionLineType2["PLAIN_TEXT"] = "PLAIN_TEXT";
|
|
54
|
+
DescriptionLineType2["COLOR"] = "COLOR";
|
|
55
|
+
return DescriptionLineType2;
|
|
56
|
+
})(DescriptionLineType || {});
|
|
57
|
+
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
58
|
+
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
59
|
+
SubscriptionFrequency2["DAY"] = "DAY";
|
|
60
|
+
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
61
|
+
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
62
|
+
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
63
|
+
return SubscriptionFrequency2;
|
|
64
|
+
})(SubscriptionFrequency || {});
|
|
65
|
+
var FileType = /* @__PURE__ */ ((FileType2) => {
|
|
66
|
+
FileType2["UNSPECIFIED"] = "UNSPECIFIED";
|
|
67
|
+
FileType2["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
68
|
+
FileType2["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
69
|
+
FileType2["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
70
|
+
FileType2["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
71
|
+
FileType2["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
72
|
+
return FileType2;
|
|
73
|
+
})(FileType || {});
|
|
74
|
+
var PaymentOptionType = /* @__PURE__ */ ((PaymentOptionType2) => {
|
|
75
|
+
PaymentOptionType2["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
|
|
76
|
+
PaymentOptionType2["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
|
|
77
|
+
PaymentOptionType2["MEMBERSHIP"] = "MEMBERSHIP";
|
|
78
|
+
PaymentOptionType2["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
|
|
79
|
+
PaymentOptionType2["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
|
|
80
|
+
return PaymentOptionType2;
|
|
81
|
+
})(PaymentOptionType || {});
|
|
82
|
+
var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
|
|
83
|
+
TaxableAddressType2["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
|
|
84
|
+
TaxableAddressType2["BUSINESS"] = "BUSINESS";
|
|
85
|
+
TaxableAddressType2["BILLING"] = "BILLING";
|
|
86
|
+
TaxableAddressType2["SHIPPING"] = "SHIPPING";
|
|
87
|
+
return TaxableAddressType2;
|
|
88
|
+
})(TaxableAddressType || {});
|
|
89
|
+
var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
|
|
90
|
+
IdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
91
|
+
IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
92
|
+
IdentityType2["MEMBER"] = "MEMBER";
|
|
93
|
+
IdentityType2["WIX_USER"] = "WIX_USER";
|
|
94
|
+
IdentityType2["APP"] = "APP";
|
|
95
|
+
return IdentityType2;
|
|
96
|
+
})(IdentityType || {});
|
|
97
|
+
|
|
98
|
+
// src/interfaces-ecommerce-v1-catalog-provider.public.ts
|
|
99
|
+
var import_sdk_types = require("@wix/sdk-types");
|
|
100
|
+
var import_image = require("@wix/sdk-runtime/transformations/image");
|
|
101
|
+
var import_page_url_v2 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
102
|
+
var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
103
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
104
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
105
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
106
|
+
var provideHandlers = (0, import_sdk_types.ServicePluginDefinition)("ECOM_CATALOG", [
|
|
107
|
+
{
|
|
108
|
+
name: "getCatalogItems",
|
|
109
|
+
primaryHttpMappingPath: "/get-catalog-items",
|
|
110
|
+
transformations: {
|
|
111
|
+
toREST: (payload) => {
|
|
112
|
+
const toRestResponse = (0, import_transform_paths.transformPaths)(payload, [
|
|
113
|
+
{
|
|
114
|
+
transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
|
|
115
|
+
paths: [{ path: "catalogItems.data.url" }]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
transformFn: import_image.transformSDKImageToRESTImage,
|
|
119
|
+
paths: [{ path: "catalogItems.data.media" }]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
123
|
+
paths: [{ path: "catalogItems.data.physicalProperties.weight" }]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
127
|
+
paths: [
|
|
128
|
+
{
|
|
129
|
+
path: "catalogItems.data.subscriptionOptionInfo.subscriptionSettings.startDate"
|
|
130
|
+
},
|
|
131
|
+
{ path: "catalogItems.data.serviceProperties.scheduledDate" }
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
]);
|
|
135
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
136
|
+
},
|
|
137
|
+
fromREST: (payload) => {
|
|
138
|
+
const fromRestRequest = payload;
|
|
139
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
]);
|
|
144
|
+
|
|
145
|
+
// src/interfaces-ecommerce-v1-catalog-provider.context.ts
|
|
146
|
+
var import_service_plugin_modules = require("@wix/sdk-runtime/service-plugin-modules");
|
|
147
|
+
var provideHandlers2 = (0, import_service_plugin_modules.createServicePluginModule)(provideHandlers);
|
|
148
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
149
|
+
0 && (module.exports = {
|
|
150
|
+
DescriptionLineType,
|
|
151
|
+
FileType,
|
|
152
|
+
IdentityType,
|
|
153
|
+
ItemTypeItemType,
|
|
154
|
+
PaymentOptionType,
|
|
155
|
+
SubscriptionFrequency,
|
|
156
|
+
TaxableAddressType,
|
|
157
|
+
WeightUnit,
|
|
158
|
+
provideHandlers,
|
|
159
|
+
publicProvideHandlers
|
|
160
|
+
});
|
|
161
|
+
//# sourceMappingURL=index.js.map
|