@wix/ecom 1.0.764 → 1.0.766
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/service-plugins-context.d.ts +1 -0
- package/build/cjs/service-plugins-context.js +2 -1
- package/build/cjs/service-plugins-context.js.map +1 -1
- package/build/cjs/service-plugins.d.ts +1 -0
- package/build/cjs/service-plugins.js +2 -1
- package/build/cjs/service-plugins.js.map +1 -1
- package/build/es/service-plugins-context.d.ts +1 -0
- package/build/es/service-plugins-context.js +1 -0
- package/build/es/service-plugins-context.js.map +1 -1
- package/build/es/service-plugins.d.ts +1 -0
- package/build/es/service-plugins.js +1 -0
- package/build/es/service-plugins.js.map +1 -1
- package/package.json +5 -4
- package/type-bundles/context.bundle.d.ts +8 -9
- package/type-bundles/index.bundle.d.ts +8 -9
- package/type-bundles/meta.bundle.d.ts +8 -8
- package/type-bundles/service-plugins-context.bundle.d.ts +322 -53
- package/type-bundles/service-plugins.bundle.d.ts +333 -64
|
@@ -6,12 +6,12 @@ interface GetBalanceRequest {
|
|
|
6
6
|
/** Gift card code. */
|
|
7
7
|
code?: string;
|
|
8
8
|
/**
|
|
9
|
-
* App
|
|
10
|
-
* @deprecated App
|
|
9
|
+
* App ID of the Gift Card provider. Deprecated.
|
|
10
|
+
* @deprecated App ID of the Gift Card provider. Deprecated.
|
|
11
11
|
* @targetRemovalDate 2025-07-01
|
|
12
12
|
*/
|
|
13
13
|
appInstanceId?: string;
|
|
14
|
-
/** The physical location ID. */
|
|
14
|
+
/** The physical location ID. Can be based on the Locations API or an external provider. */
|
|
15
15
|
locationId?: string | null;
|
|
16
16
|
}
|
|
17
17
|
interface GetBalanceResponse {
|
|
@@ -29,18 +29,18 @@ interface RedeemRequest {
|
|
|
29
29
|
/** Gift card code. */
|
|
30
30
|
code?: string;
|
|
31
31
|
/**
|
|
32
|
-
* App
|
|
33
|
-
* @deprecated App
|
|
32
|
+
* App ID of the Gift Card provider. Deprecated.
|
|
33
|
+
* @deprecated App ID of the Gift Card provider. Deprecated.
|
|
34
34
|
* @targetRemovalDate 2025-07-01
|
|
35
35
|
*/
|
|
36
36
|
appInstanceId?: string;
|
|
37
37
|
/** Amount to redeem from the gift card. */
|
|
38
38
|
amount?: number;
|
|
39
|
-
/** Order ID the gift card transaction is applied to. */
|
|
39
|
+
/** Order ID the gift card transaction is applied to. Order details can be collected from eCommerce Search Orders. */
|
|
40
40
|
orderId?: string;
|
|
41
41
|
/** Currency code. */
|
|
42
42
|
currencyCode?: string;
|
|
43
|
-
/** Physical location ID. */
|
|
43
|
+
/** Physical location ID. Can be based on the Locations API or an external provider. */
|
|
44
44
|
locationId?: string | null;
|
|
45
45
|
}
|
|
46
46
|
interface RedeemResponse {
|
|
@@ -53,14 +53,14 @@ interface RedeemResponse {
|
|
|
53
53
|
}
|
|
54
54
|
interface VoidRequest {
|
|
55
55
|
/**
|
|
56
|
-
* App
|
|
57
|
-
* @deprecated App
|
|
56
|
+
* App ID of the Gift Card provider. Deprecated.
|
|
57
|
+
* @deprecated App ID of the Gift Card provider. Deprecated.
|
|
58
58
|
* @targetRemovalDate 2025-07-01
|
|
59
59
|
*/
|
|
60
60
|
appInstanceId?: string;
|
|
61
61
|
/** Transaction ID to void. */
|
|
62
62
|
transactionId?: string;
|
|
63
|
-
/** Physical location ID. */
|
|
63
|
+
/** Physical location ID. Can be based on the Locations API or an external provider. */
|
|
64
64
|
locationId?: string | null;
|
|
65
65
|
}
|
|
66
66
|
interface VoidResponse {
|
|
@@ -86,26 +86,26 @@ interface GiftCardProviderConfig {
|
|
|
86
86
|
* }
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
|
-
interface Context$
|
|
89
|
+
interface Context$7 {
|
|
90
90
|
/** 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. */
|
|
91
91
|
requestId?: string | null;
|
|
92
92
|
/** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. */
|
|
93
93
|
currency?: string | null;
|
|
94
94
|
/** An object that describes the identity that triggered this request. */
|
|
95
|
-
identity?: IdentificationData$
|
|
95
|
+
identity?: IdentificationData$7;
|
|
96
96
|
/** A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. */
|
|
97
97
|
languages?: string[];
|
|
98
98
|
/** The service provider app's instance ID. */
|
|
99
99
|
instanceId?: string | null;
|
|
100
100
|
}
|
|
101
|
-
declare enum IdentityType$
|
|
101
|
+
declare enum IdentityType$7 {
|
|
102
102
|
UNKNOWN = "UNKNOWN",
|
|
103
103
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
104
104
|
MEMBER = "MEMBER",
|
|
105
105
|
WIX_USER = "WIX_USER",
|
|
106
106
|
APP = "APP"
|
|
107
107
|
}
|
|
108
|
-
interface IdentificationData$
|
|
108
|
+
interface IdentificationData$7 extends IdentificationDataIdOneOf$7 {
|
|
109
109
|
/** ID of a site visitor that has not logged in to the site. */
|
|
110
110
|
anonymousVisitorId?: string;
|
|
111
111
|
/** ID of a site visitor that has logged in to the site. */
|
|
@@ -115,10 +115,10 @@ interface IdentificationData$6 extends IdentificationDataIdOneOf$6 {
|
|
|
115
115
|
/** ID of an app. */
|
|
116
116
|
appId?: string;
|
|
117
117
|
/** @readonly */
|
|
118
|
-
identityType?: IdentityType$
|
|
118
|
+
identityType?: IdentityType$7;
|
|
119
119
|
}
|
|
120
120
|
/** @oneof */
|
|
121
|
-
interface IdentificationDataIdOneOf$
|
|
121
|
+
interface IdentificationDataIdOneOf$7 {
|
|
122
122
|
/** ID of a site visitor that has not logged in to the site. */
|
|
123
123
|
anonymousVisitorId?: string;
|
|
124
124
|
/** ID of a site visitor that has logged in to the site. */
|
|
@@ -129,26 +129,26 @@ interface IdentificationDataIdOneOf$6 {
|
|
|
129
129
|
appId?: string;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
type ServicePluginMethodInput$
|
|
132
|
+
type ServicePluginMethodInput$f = {
|
|
133
133
|
request: any;
|
|
134
134
|
metadata: any;
|
|
135
135
|
};
|
|
136
|
-
type ServicePluginContract$
|
|
137
|
-
type ServicePluginMethodMetadata$
|
|
136
|
+
type ServicePluginContract$f = Record<string, (payload: ServicePluginMethodInput$f) => unknown | Promise<unknown>>;
|
|
137
|
+
type ServicePluginMethodMetadata$f = {
|
|
138
138
|
name: string;
|
|
139
139
|
primaryHttpMappingPath: string;
|
|
140
140
|
transformations: {
|
|
141
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$
|
|
141
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$f;
|
|
142
142
|
toREST: (...args: unknown[]) => unknown;
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
|
-
type ServicePluginDefinition$
|
|
145
|
+
type ServicePluginDefinition$f<Contract extends ServicePluginContract$f> = {
|
|
146
146
|
__type: 'service-plugin-definition';
|
|
147
147
|
componentType: string;
|
|
148
|
-
methods: ServicePluginMethodMetadata$
|
|
148
|
+
methods: ServicePluginMethodMetadata$f[];
|
|
149
149
|
__contract: Contract;
|
|
150
150
|
};
|
|
151
|
-
declare function ServicePluginDefinition$
|
|
151
|
+
declare function ServicePluginDefinition$f<Contract extends ServicePluginContract$f>(componentType: string, methods: ServicePluginMethodMetadata$f[]): ServicePluginDefinition$f<Contract>;
|
|
152
152
|
|
|
153
153
|
declare global {
|
|
154
154
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -164,17 +164,17 @@ declare global {
|
|
|
164
164
|
|
|
165
165
|
interface GetBalanceEnvelope {
|
|
166
166
|
request: GetBalanceRequest;
|
|
167
|
-
metadata: Context$
|
|
167
|
+
metadata: Context$7;
|
|
168
168
|
}
|
|
169
169
|
interface RedeemEnvelope {
|
|
170
170
|
request: RedeemRequest;
|
|
171
|
-
metadata: Context$
|
|
171
|
+
metadata: Context$7;
|
|
172
172
|
}
|
|
173
173
|
interface _voidEnvelope {
|
|
174
174
|
request: VoidRequest;
|
|
175
|
-
metadata: Context$
|
|
175
|
+
metadata: Context$7;
|
|
176
176
|
}
|
|
177
|
-
declare const provideHandlers$
|
|
177
|
+
declare const provideHandlers$f: ServicePluginDefinition$f<{
|
|
178
178
|
/**
|
|
179
179
|
*
|
|
180
180
|
* This method retrieves gift card data from your app.
|
|
@@ -192,27 +192,27 @@ declare const provideHandlers$d: ServicePluginDefinition$d<{
|
|
|
192
192
|
_void(payload: _voidEnvelope): VoidResponse | Promise<VoidResponse>;
|
|
193
193
|
}>;
|
|
194
194
|
|
|
195
|
-
type ServicePluginMethodInput$
|
|
195
|
+
type ServicePluginMethodInput$e = {
|
|
196
196
|
request: any;
|
|
197
197
|
metadata: any;
|
|
198
198
|
};
|
|
199
|
-
type ServicePluginContract$
|
|
200
|
-
type ServicePluginMethodMetadata$
|
|
199
|
+
type ServicePluginContract$e = Record<string, (payload: ServicePluginMethodInput$e) => unknown | Promise<unknown>>;
|
|
200
|
+
type ServicePluginMethodMetadata$e = {
|
|
201
201
|
name: string;
|
|
202
202
|
primaryHttpMappingPath: string;
|
|
203
203
|
transformations: {
|
|
204
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$
|
|
204
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$e;
|
|
205
205
|
toREST: (...args: unknown[]) => unknown;
|
|
206
206
|
};
|
|
207
207
|
};
|
|
208
|
-
type ServicePluginDefinition$
|
|
208
|
+
type ServicePluginDefinition$e<Contract extends ServicePluginContract$e> = {
|
|
209
209
|
__type: 'service-plugin-definition';
|
|
210
210
|
componentType: string;
|
|
211
|
-
methods: ServicePluginMethodMetadata$
|
|
211
|
+
methods: ServicePluginMethodMetadata$e[];
|
|
212
212
|
__contract: Contract;
|
|
213
213
|
};
|
|
214
|
-
declare function ServicePluginDefinition$
|
|
215
|
-
type BuildServicePluginDefinition$
|
|
214
|
+
declare function ServicePluginDefinition$e<Contract extends ServicePluginContract$e>(componentType: string, methods: ServicePluginMethodMetadata$e[]): ServicePluginDefinition$e<Contract>;
|
|
215
|
+
type BuildServicePluginDefinition$7<T extends ServicePluginDefinition$e<any>> = (implementation: T['__contract']) => void;
|
|
216
216
|
|
|
217
217
|
declare global {
|
|
218
218
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -221,10 +221,10 @@ declare global {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
declare function createServicePluginModule$
|
|
224
|
+
declare function createServicePluginModule$7<T extends ServicePluginDefinition$e<any>>(servicePluginDefinition: T): BuildServicePluginDefinition$7<T> & T;
|
|
225
225
|
|
|
226
|
-
type _publicProvideHandlersType$
|
|
227
|
-
declare const provideHandlers$
|
|
226
|
+
type _publicProvideHandlersType$7 = typeof provideHandlers$f;
|
|
227
|
+
declare const provideHandlers$e: ReturnType<typeof createServicePluginModule$7<_publicProvideHandlersType>>;
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
230
|
* Gift card not found
|
|
@@ -355,32 +355,301 @@ declare class AlreadyVoidedWixError extends Error {
|
|
|
355
355
|
static readonly __type = "wix_spi_error";
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
type index_d$
|
|
359
|
-
declare const index_d$
|
|
360
|
-
type index_d$
|
|
361
|
-
declare const index_d$
|
|
362
|
-
type index_d$
|
|
363
|
-
declare const index_d$
|
|
364
|
-
type index_d$
|
|
365
|
-
type index_d$
|
|
366
|
-
type index_d$
|
|
367
|
-
declare const index_d$
|
|
368
|
-
type index_d$
|
|
369
|
-
declare const index_d$
|
|
370
|
-
type index_d$
|
|
371
|
-
declare const index_d$
|
|
372
|
-
type index_d$
|
|
373
|
-
type index_d$
|
|
374
|
-
type index_d$
|
|
375
|
-
declare const index_d$
|
|
376
|
-
type index_d$
|
|
377
|
-
type index_d$
|
|
378
|
-
type index_d$
|
|
379
|
-
declare const index_d$
|
|
380
|
-
type index_d$
|
|
381
|
-
type index_d$
|
|
358
|
+
type index_d$7_AlreadyRedeemedWixError = AlreadyRedeemedWixError;
|
|
359
|
+
declare const index_d$7_AlreadyRedeemedWixError: typeof AlreadyRedeemedWixError;
|
|
360
|
+
type index_d$7_AlreadyVoidedWixError = AlreadyVoidedWixError;
|
|
361
|
+
declare const index_d$7_AlreadyVoidedWixError: typeof AlreadyVoidedWixError;
|
|
362
|
+
type index_d$7_CurrencyNotSupportedWixError = CurrencyNotSupportedWixError;
|
|
363
|
+
declare const index_d$7_CurrencyNotSupportedWixError: typeof CurrencyNotSupportedWixError;
|
|
364
|
+
type index_d$7_GetBalanceRequest = GetBalanceRequest;
|
|
365
|
+
type index_d$7_GetBalanceResponse = GetBalanceResponse;
|
|
366
|
+
type index_d$7_GiftCardDisabledWixError = GiftCardDisabledWixError;
|
|
367
|
+
declare const index_d$7_GiftCardDisabledWixError: typeof GiftCardDisabledWixError;
|
|
368
|
+
type index_d$7_GiftCardExpiredWixError = GiftCardExpiredWixError;
|
|
369
|
+
declare const index_d$7_GiftCardExpiredWixError: typeof GiftCardExpiredWixError;
|
|
370
|
+
type index_d$7_GiftCardNotFoundWixError = GiftCardNotFoundWixError;
|
|
371
|
+
declare const index_d$7_GiftCardNotFoundWixError: typeof GiftCardNotFoundWixError;
|
|
372
|
+
type index_d$7_GiftCardProviderConfig = GiftCardProviderConfig;
|
|
373
|
+
type index_d$7_GiftCardProviderEntity = GiftCardProviderEntity;
|
|
374
|
+
type index_d$7_InsufficientFundsWixError = InsufficientFundsWixError;
|
|
375
|
+
declare const index_d$7_InsufficientFundsWixError: typeof InsufficientFundsWixError;
|
|
376
|
+
type index_d$7_RedeemRequest = RedeemRequest;
|
|
377
|
+
type index_d$7_RedeemResponse = RedeemResponse;
|
|
378
|
+
type index_d$7_TransactionNotFoundWixError = TransactionNotFoundWixError;
|
|
379
|
+
declare const index_d$7_TransactionNotFoundWixError: typeof TransactionNotFoundWixError;
|
|
380
|
+
type index_d$7_VoidRequest = VoidRequest;
|
|
381
|
+
type index_d$7_VoidResponse = VoidResponse;
|
|
382
|
+
declare namespace index_d$7 {
|
|
383
|
+
export { index_d$7_AlreadyRedeemedWixError as AlreadyRedeemedWixError, index_d$7_AlreadyVoidedWixError as AlreadyVoidedWixError, type Context$7 as Context, index_d$7_CurrencyNotSupportedWixError as CurrencyNotSupportedWixError, type index_d$7_GetBalanceRequest as GetBalanceRequest, type index_d$7_GetBalanceResponse as GetBalanceResponse, index_d$7_GiftCardDisabledWixError as GiftCardDisabledWixError, index_d$7_GiftCardExpiredWixError as GiftCardExpiredWixError, index_d$7_GiftCardNotFoundWixError as GiftCardNotFoundWixError, type index_d$7_GiftCardProviderConfig as GiftCardProviderConfig, type index_d$7_GiftCardProviderEntity as GiftCardProviderEntity, type IdentificationData$7 as IdentificationData, type IdentificationDataIdOneOf$7 as IdentificationDataIdOneOf, IdentityType$7 as IdentityType, index_d$7_InsufficientFundsWixError as InsufficientFundsWixError, type index_d$7_RedeemRequest as RedeemRequest, type index_d$7_RedeemResponse as RedeemResponse, index_d$7_TransactionNotFoundWixError as TransactionNotFoundWixError, type index_d$7_VoidRequest as VoidRequest, type index_d$7_VoidResponse as VoidResponse, type _publicProvideHandlersType$7 as _publicProvideHandlersType, provideHandlers$e as provideHandlers, provideHandlers$f as publicProvideHandlers };
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** additional information can be passed via aspects, for example GEO */
|
|
387
|
+
interface GetRecommendationsRequest {
|
|
388
|
+
/** The set of items used by algorithms with the `RELATED_ITEMS` `algorithmType` to determine related item recommendations. */
|
|
389
|
+
items?: CatalogReference$6[];
|
|
390
|
+
/** List of algorithms used to find recommended items. Items will be returned in a separate object for each algorithm */
|
|
391
|
+
algorithmIds?: string[];
|
|
392
|
+
}
|
|
393
|
+
/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
|
|
394
|
+
interface CatalogReference$6 {
|
|
395
|
+
/** ID of the item within the catalog it belongs to. */
|
|
396
|
+
catalogItemId?: string;
|
|
397
|
+
/**
|
|
398
|
+
* ID of the app providing the catalog.
|
|
399
|
+
*
|
|
400
|
+
* You can get your app's ID from its page in the [Wix Dev Center](https://dev.wix.com/apps).
|
|
401
|
+
*
|
|
402
|
+
* For items from Wix catalogs, the following values always apply:
|
|
403
|
+
* + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
|
|
404
|
+
* + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
|
|
405
|
+
* + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
|
|
406
|
+
*/
|
|
407
|
+
appId?: string;
|
|
408
|
+
/**
|
|
409
|
+
* Additional item details in key:value pairs. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.
|
|
410
|
+
*
|
|
411
|
+
* For products and variants from a Wix Stores catalog, learn more about [eCommerce integration](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration).
|
|
412
|
+
*/
|
|
413
|
+
options?: Record<string, any> | null;
|
|
414
|
+
}
|
|
415
|
+
interface GetRecommendationsResponse {
|
|
416
|
+
/**
|
|
417
|
+
* Related items returned by each algorithm.
|
|
418
|
+
*
|
|
419
|
+
* Each object in the array contains an `algorithmId` and a list of the item recommendations provided by that algorithm.
|
|
420
|
+
*/
|
|
421
|
+
recommendationPerAlgorithm?: RecommendationForAlgorithm[];
|
|
422
|
+
}
|
|
423
|
+
interface RecommendationForAlgorithm {
|
|
424
|
+
/** Id of the algorithm that provided the recommendation. */
|
|
425
|
+
algorithmId?: string;
|
|
426
|
+
/** Item recommendations provided by the algorithm. Depending on the algorithm, these recommendations may be influenced by the items provided in the request. */
|
|
427
|
+
recommendedItems?: CatalogReference$6[];
|
|
428
|
+
}
|
|
429
|
+
interface RecommendationAlgorithmNotSupported {
|
|
430
|
+
/** Not supported algorithms. */
|
|
431
|
+
unsupportedAlgorithms?: string[];
|
|
432
|
+
}
|
|
433
|
+
interface ItemAppIdNotSupportedError {
|
|
434
|
+
/** Items with not supported catalogs. */
|
|
435
|
+
items?: CatalogReference$6[];
|
|
436
|
+
}
|
|
437
|
+
interface RecommendationsProviderConfig {
|
|
438
|
+
/** URI where the application implementing the SPI is deployed. */
|
|
439
|
+
deploymentUri?: string;
|
|
440
|
+
/** App IDs of catalogs for which recommended items can be found. */
|
|
441
|
+
catalogAppIds?: string[];
|
|
442
|
+
/** The algorithms that this application can use to calculate item recommendations. */
|
|
443
|
+
supportedAlgorithms?: AlgorithmConfig[];
|
|
444
|
+
}
|
|
445
|
+
interface AlgorithmConfig {
|
|
446
|
+
/** Algorithm ID. This must be unique for a specific app but does not have to be unique across all apps on the site or in the project. */
|
|
447
|
+
_id?: string;
|
|
448
|
+
/** Algorithm name. This value is not translatable. */
|
|
449
|
+
name?: string;
|
|
450
|
+
/** Algorithm description. This describes how the algorithm works and if it has any limitations regarding site content, number of items in the catalog, site traffic, and so on. This value is not translatable. */
|
|
451
|
+
description?: string;
|
|
452
|
+
/** A supplemental `description`. It can be used to help break up and organize information. You can, for example, display this information as a tooltip or as an additional section that is collapsed by default. */
|
|
453
|
+
additionalInfo?: string | null;
|
|
454
|
+
/**
|
|
455
|
+
* Algorithms may have the following types:
|
|
456
|
+
* * `RELATED_ITEMS` - This type of algorithm provides recommendations based on 1 or more other provided items. For example, when an item is added to a cart, the algorithm can suggest other items frequently bought together with that item.
|
|
457
|
+
* * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.
|
|
458
|
+
*/
|
|
459
|
+
algorithmType?: AlgorithmType;
|
|
460
|
+
/** Algorithm ID. This must be unique for a specific app but does not have to be unique across all apps on the site or in the project. */
|
|
461
|
+
algorithmId?: string | null;
|
|
462
|
+
}
|
|
463
|
+
declare enum AlgorithmType {
|
|
464
|
+
UNSPECIFIED = "UNSPECIFIED",
|
|
465
|
+
RELATED_ITEMS = "RELATED_ITEMS",
|
|
466
|
+
GLOBAL = "GLOBAL"
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* this message is not directly used by any service,
|
|
470
|
+
* it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.
|
|
471
|
+
* e.g. SPIs, event-handlers, etc..
|
|
472
|
+
* NOTE: this context object MUST be provided as the last argument in each Velo method signature.
|
|
473
|
+
*
|
|
474
|
+
* Example:
|
|
475
|
+
* ```typescript
|
|
476
|
+
* export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {
|
|
477
|
+
* ...
|
|
478
|
+
* }
|
|
479
|
+
* ```
|
|
480
|
+
*/
|
|
481
|
+
interface Context$6 {
|
|
482
|
+
/** 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. */
|
|
483
|
+
requestId?: string | null;
|
|
484
|
+
/** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. */
|
|
485
|
+
currency?: string | null;
|
|
486
|
+
/** An object that describes the identity that triggered this request. */
|
|
487
|
+
identity?: IdentificationData$6;
|
|
488
|
+
/** A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. */
|
|
489
|
+
languages?: string[];
|
|
490
|
+
/** The service provider app's instance ID. */
|
|
491
|
+
instanceId?: string | null;
|
|
492
|
+
}
|
|
493
|
+
declare enum IdentityType$6 {
|
|
494
|
+
UNKNOWN = "UNKNOWN",
|
|
495
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
496
|
+
MEMBER = "MEMBER",
|
|
497
|
+
WIX_USER = "WIX_USER",
|
|
498
|
+
APP = "APP"
|
|
499
|
+
}
|
|
500
|
+
interface IdentificationData$6 extends IdentificationDataIdOneOf$6 {
|
|
501
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
502
|
+
anonymousVisitorId?: string;
|
|
503
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
504
|
+
memberId?: string;
|
|
505
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
506
|
+
wixUserId?: string;
|
|
507
|
+
/** ID of an app. */
|
|
508
|
+
appId?: string;
|
|
509
|
+
/** @readonly */
|
|
510
|
+
identityType?: IdentityType$6;
|
|
511
|
+
}
|
|
512
|
+
/** @oneof */
|
|
513
|
+
interface IdentificationDataIdOneOf$6 {
|
|
514
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
515
|
+
anonymousVisitorId?: string;
|
|
516
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
517
|
+
memberId?: string;
|
|
518
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
519
|
+
wixUserId?: string;
|
|
520
|
+
/** ID of an app. */
|
|
521
|
+
appId?: string;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
type ServicePluginMethodInput$d = {
|
|
525
|
+
request: any;
|
|
526
|
+
metadata: any;
|
|
527
|
+
};
|
|
528
|
+
type ServicePluginContract$d = Record<string, (payload: ServicePluginMethodInput$d) => unknown | Promise<unknown>>;
|
|
529
|
+
type ServicePluginMethodMetadata$d = {
|
|
530
|
+
name: string;
|
|
531
|
+
primaryHttpMappingPath: string;
|
|
532
|
+
transformations: {
|
|
533
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$d;
|
|
534
|
+
toREST: (...args: unknown[]) => unknown;
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
type ServicePluginDefinition$d<Contract extends ServicePluginContract$d> = {
|
|
538
|
+
__type: 'service-plugin-definition';
|
|
539
|
+
componentType: string;
|
|
540
|
+
methods: ServicePluginMethodMetadata$d[];
|
|
541
|
+
__contract: Contract;
|
|
542
|
+
};
|
|
543
|
+
declare function ServicePluginDefinition$d<Contract extends ServicePluginContract$d>(componentType: string, methods: ServicePluginMethodMetadata$d[]): ServicePluginDefinition$d<Contract>;
|
|
544
|
+
|
|
545
|
+
declare global {
|
|
546
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
547
|
+
interface SymbolConstructor {
|
|
548
|
+
readonly observable: symbol;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
declare global {
|
|
553
|
+
interface ContextualClient {
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
interface GetRecommendationsEnvelope {
|
|
558
|
+
request: GetRecommendationsRequest;
|
|
559
|
+
metadata: Context$6;
|
|
560
|
+
}
|
|
561
|
+
declare const provideHandlers$d: ServicePluginDefinition$d<{
|
|
562
|
+
/**
|
|
563
|
+
*
|
|
564
|
+
* Returns lists of items recommended by each requested algorithm.
|
|
565
|
+
*
|
|
566
|
+
* If the algorithm's type is `RELATED_ITEMS` then the `items` field is required in the request, and the response will contain items related to those submitted.
|
|
567
|
+
* How the related items are selected based on the requested items depends on the algorithm. Some examples include items related by category or those frequently bought or watched together. */
|
|
568
|
+
getRecommendations(payload: GetRecommendationsEnvelope): GetRecommendationsResponse | Promise<GetRecommendationsResponse>;
|
|
569
|
+
}>;
|
|
570
|
+
|
|
571
|
+
type ServicePluginMethodInput$c = {
|
|
572
|
+
request: any;
|
|
573
|
+
metadata: any;
|
|
574
|
+
};
|
|
575
|
+
type ServicePluginContract$c = Record<string, (payload: ServicePluginMethodInput$c) => unknown | Promise<unknown>>;
|
|
576
|
+
type ServicePluginMethodMetadata$c = {
|
|
577
|
+
name: string;
|
|
578
|
+
primaryHttpMappingPath: string;
|
|
579
|
+
transformations: {
|
|
580
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$c;
|
|
581
|
+
toREST: (...args: unknown[]) => unknown;
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
type ServicePluginDefinition$c<Contract extends ServicePluginContract$c> = {
|
|
585
|
+
__type: 'service-plugin-definition';
|
|
586
|
+
componentType: string;
|
|
587
|
+
methods: ServicePluginMethodMetadata$c[];
|
|
588
|
+
__contract: Contract;
|
|
589
|
+
};
|
|
590
|
+
declare function ServicePluginDefinition$c<Contract extends ServicePluginContract$c>(componentType: string, methods: ServicePluginMethodMetadata$c[]): ServicePluginDefinition$c<Contract>;
|
|
591
|
+
type BuildServicePluginDefinition$6<T extends ServicePluginDefinition$c<any>> = (implementation: T['__contract']) => void;
|
|
592
|
+
|
|
593
|
+
declare global {
|
|
594
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
595
|
+
interface SymbolConstructor {
|
|
596
|
+
readonly observable: symbol;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
declare function createServicePluginModule$6<T extends ServicePluginDefinition$c<any>>(servicePluginDefinition: T): BuildServicePluginDefinition$6<T> & T;
|
|
601
|
+
|
|
602
|
+
type _publicProvideHandlersType$6 = typeof provideHandlers$d;
|
|
603
|
+
declare const provideHandlers$c: ReturnType<typeof createServicePluginModule$6<_publicProvideHandlersType>>;
|
|
604
|
+
|
|
605
|
+
declare class AlgorithmNotSupportedWixError extends Error {
|
|
606
|
+
/** @hidden */
|
|
607
|
+
httpCode: number;
|
|
608
|
+
/** @hidden */
|
|
609
|
+
statusCode: string;
|
|
610
|
+
/** @hidden */
|
|
611
|
+
applicationCode: string;
|
|
612
|
+
/** @hidden */
|
|
613
|
+
name: string;
|
|
614
|
+
/** @hidden */
|
|
615
|
+
errorSchemaName: string;
|
|
616
|
+
data: RecommendationAlgorithmNotSupported;
|
|
617
|
+
constructor(data: RecommendationAlgorithmNotSupported);
|
|
618
|
+
/** @hidden */
|
|
619
|
+
static readonly __type = "wix_spi_error";
|
|
620
|
+
}
|
|
621
|
+
declare class ItemAppIdNotSupportedWixError extends Error {
|
|
622
|
+
/** @hidden */
|
|
623
|
+
httpCode: number;
|
|
624
|
+
/** @hidden */
|
|
625
|
+
statusCode: string;
|
|
626
|
+
/** @hidden */
|
|
627
|
+
applicationCode: string;
|
|
628
|
+
/** @hidden */
|
|
629
|
+
name: string;
|
|
630
|
+
/** @hidden */
|
|
631
|
+
errorSchemaName: string;
|
|
632
|
+
data: ItemAppIdNotSupportedError;
|
|
633
|
+
constructor(data: ItemAppIdNotSupportedError);
|
|
634
|
+
/** @hidden */
|
|
635
|
+
static readonly __type = "wix_spi_error";
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
type index_d$6_AlgorithmConfig = AlgorithmConfig;
|
|
639
|
+
type index_d$6_AlgorithmNotSupportedWixError = AlgorithmNotSupportedWixError;
|
|
640
|
+
declare const index_d$6_AlgorithmNotSupportedWixError: typeof AlgorithmNotSupportedWixError;
|
|
641
|
+
type index_d$6_AlgorithmType = AlgorithmType;
|
|
642
|
+
declare const index_d$6_AlgorithmType: typeof AlgorithmType;
|
|
643
|
+
type index_d$6_GetRecommendationsRequest = GetRecommendationsRequest;
|
|
644
|
+
type index_d$6_GetRecommendationsResponse = GetRecommendationsResponse;
|
|
645
|
+
type index_d$6_ItemAppIdNotSupportedError = ItemAppIdNotSupportedError;
|
|
646
|
+
type index_d$6_ItemAppIdNotSupportedWixError = ItemAppIdNotSupportedWixError;
|
|
647
|
+
declare const index_d$6_ItemAppIdNotSupportedWixError: typeof ItemAppIdNotSupportedWixError;
|
|
648
|
+
type index_d$6_RecommendationAlgorithmNotSupported = RecommendationAlgorithmNotSupported;
|
|
649
|
+
type index_d$6_RecommendationForAlgorithm = RecommendationForAlgorithm;
|
|
650
|
+
type index_d$6_RecommendationsProviderConfig = RecommendationsProviderConfig;
|
|
382
651
|
declare namespace index_d$6 {
|
|
383
|
-
export { index_d$
|
|
652
|
+
export { type index_d$6_AlgorithmConfig as AlgorithmConfig, index_d$6_AlgorithmNotSupportedWixError as AlgorithmNotSupportedWixError, index_d$6_AlgorithmType as AlgorithmType, type CatalogReference$6 as CatalogReference, type Context$6 as Context, type index_d$6_GetRecommendationsRequest as GetRecommendationsRequest, type index_d$6_GetRecommendationsResponse as GetRecommendationsResponse, type IdentificationData$6 as IdentificationData, type IdentificationDataIdOneOf$6 as IdentificationDataIdOneOf, IdentityType$6 as IdentityType, type index_d$6_ItemAppIdNotSupportedError as ItemAppIdNotSupportedError, index_d$6_ItemAppIdNotSupportedWixError as ItemAppIdNotSupportedWixError, type index_d$6_RecommendationAlgorithmNotSupported as RecommendationAlgorithmNotSupported, type index_d$6_RecommendationForAlgorithm as RecommendationForAlgorithm, type index_d$6_RecommendationsProviderConfig as RecommendationsProviderConfig, type _publicProvideHandlersType$6 as _publicProvideHandlersType, provideHandlers$c as provideHandlers, provideHandlers$d as publicProvideHandlers };
|
|
384
653
|
}
|
|
385
654
|
|
|
386
655
|
interface GetShippingRatesRequest {
|
|
@@ -5913,4 +6182,4 @@ declare namespace index_d {
|
|
|
5913
6182
|
export { type index_d_Address as Address, type index_d_AddressLocation as AddressLocation, type index_d_AddressWithContact as AddressWithContact, type index_d_AppliedDiscount as AppliedDiscount, type index_d_AppliedDiscountDiscountSourceOneOf as AppliedDiscountDiscountSourceOneOf, type index_d_BuyerDetails as BuyerDetails, type index_d_CatalogReference as CatalogReference, index_d_CheckoutStage as CheckoutStage, type index_d_Context as Context, type index_d_Coupon as Coupon, type index_d_CustomField as CustomField, type index_d_CustomFields as CustomFields, type index_d_Description as Description, type index_d_DiscountRule as DiscountRule, type index_d_DiscountRuleName as DiscountRuleName, index_d_DiscountType as DiscountType, type index_d_ExtendedFields as ExtendedFields, type index_d_ExternalReference as ExternalReference, type index_d_FullAddressContactDetails as FullAddressContactDetails, type index_d_GetValidationViolationsRequest as GetValidationViolationsRequest, type index_d_GetValidationViolationsResponse as GetValidationViolationsResponse, type index_d_GiftCard as GiftCard, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, index_d_IdentityType as IdentityType, type index_d_ItemTaxFullDetails as ItemTaxFullDetails, type index_d_ItemType as ItemType, index_d_ItemTypeItemType as ItemTypeItemType, type index_d_ItemTypeItemTypeDataOneOf as ItemTypeItemTypeDataOneOf, index_d_JurisdictionType as JurisdictionType, type index_d_LineItem as LineItem, type index_d_LineItemPricesData as LineItemPricesData, type index_d_MerchantDiscount as MerchantDiscount, type index_d_MultiCurrencyPrice as MultiCurrencyPrice, index_d_NameInLineItem as NameInLineItem, index_d_NameInOther as NameInOther, type index_d_Other as Other, type index_d_PhysicalProperties as PhysicalProperties, type index_d_PriceSummary as PriceSummary, type index_d_ProductName as ProductName, type index_d_SelectedCarrierServiceOption as SelectedCarrierServiceOption, type index_d_SelectedCarrierServiceOptionPrices as SelectedCarrierServiceOptionPrices, index_d_Severity as Severity, type index_d_ShippingInfo as ShippingInfo, index_d_Source as Source, type index_d_SourceInfo as SourceInfo, type index_d_Stage as Stage, type index_d_StageStagesOneOf as StageStagesOneOf, type index_d_StreetAddress as StreetAddress, index_d_SubscriptionFrequency as SubscriptionFrequency, type index_d_SubscriptionOptionInfo as SubscriptionOptionInfo, type index_d_SubscriptionSettings as SubscriptionSettings, type index_d_Target as Target, type index_d_TargetLineItem as TargetLineItem, type index_d_TargetTargetTypeOneOf as TargetTargetTypeOneOf, type index_d_TaxBreakdown as TaxBreakdown, type index_d_Title as Title, type index_d_ValidationInfo as ValidationInfo, type index_d_ValidationsSPIConfig as ValidationsSPIConfig, type index_d_VatId as VatId, index_d_VatType as VatType, type index_d_Violation as Violation, index_d_WeightUnit as WeightUnit, type index_d__publicProvideHandlersType as _publicProvideHandlersType, index_d_provideHandlers as provideHandlers, provideHandlers$1 as publicProvideHandlers };
|
|
5914
6183
|
}
|
|
5915
6184
|
|
|
5916
|
-
export { index_d$4 as additionalFees, index_d$3 as customTriggers, index_d$2 as discounts, index_d$
|
|
6185
|
+
export { index_d$4 as additionalFees, index_d$3 as customTriggers, index_d$2 as discounts, index_d$7 as giftVouchersProvider, index_d$1 as paymentSettings, index_d$6 as recommendationsProvider, index_d$5 as shippingRates, index_d as validations };
|