import { ListAvailableAlgorithmsRequest as ListAvailableAlgorithmsRequest$1, ListAvailableAlgorithmsResponse as ListAvailableAlgorithmsResponse$1, GetRecommendationRequest as GetRecommendationRequest$1, GetRecommendationResponse as GetRecommendationResponse$1 } from './index.typings.js'; import '@wix/sdk-types'; interface Recommendation { /** * Recommended items. * @maxSize 100 */ items?: CatalogReference[]; /** The algorithm used to provide the recommendation. */ algorithm?: Algorithm; } /** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */ interface CatalogReference { /** * ID of the item within the catalog it belongs to. * @minLength 1 * @maxLength 36 */ catalogItemId?: string; /** * ID of the app providing the catalog. * * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/). * * For items from Wix catalogs, the following values always apply: * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"` * @minLength 1 */ appId?: string; /** * Additional item details in `key:value` pairs. * * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items. * * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration) * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction). */ options?: Record | null; } interface Algorithm { /** * ID of the algorithm, as defined by the app that provides it. * @format GUID */ id?: string; /** * ID of the app providing the algorithm. This can be an app built by Wix or a 3rd-party app. * * See app IDs for [apps built by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix). * @minLength 1 * @maxLength 36 */ appId?: string; } interface ListAvailableAlgorithmsRequest { } interface ListAvailableAlgorithmsResponse { /** * List of algorithms available for use on a site. * @maxSize 500 */ availableAlgorithms?: AlgorithmInfo[]; } interface AlgorithmInfo { /** Algorithm configuration. */ config?: AlgorithmConfig; /** * ID of the app that provides the algorithm. This can be an app built by Wix or a 3rd-party app. * * See app IDs for [apps built by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix). * @minLength 1 * @maxLength 36 */ appId?: string; /** * IDs of apps with catalogs that this algorithm supports. This can be an app built by Wix or a 3rd-party app. * * See app IDs for [apps built by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix). * @minSize 1 * @maxSize 100 * @minLength 1 * @maxLength 36 */ catalogAppIds?: string[]; } interface AlgorithmConfig { /** * Algorithm name. This value is not translatable. * @minLength 1 * @maxLength 50 */ name?: string; /** * 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. * @minLength 1 * @maxLength 500 */ description?: string; /** * 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. * @minLength 1 * @maxLength 300 */ additionalInfo?: string | null; /** * Algorithms may have the following types: * * `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. * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals. */ algorithmType?: AlgorithmTypeWithLiterals; /** * 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. * @format GUID */ algorithmId?: string; } declare enum AlgorithmType { UNSPECIFIED = "UNSPECIFIED", RELATED_ITEMS = "RELATED_ITEMS", GLOBAL = "GLOBAL" } /** @enumType */ type AlgorithmTypeWithLiterals = AlgorithmType | 'UNSPECIFIED' | 'RELATED_ITEMS' | 'GLOBAL'; interface GetRecommendationRequest { /** * Catalog items to base recommendations on. Required if the algorithm's `algorithmType` is `RELATED_ITEMS`. * @maxSize 300 */ items?: CatalogReference[]; /** * Algorithms to specify for generating recommendations, ordered by preference. The method processes algorithms in order and provides recommendations from the first algorithm that meets the `minimumRecommendedItems` threshold. * @minSize 1 * @maxSize 10 */ algorithms: Algorithm[]; /** * Minimum number of items an algorithm must provide for its recommendations to be returned in the response. If no algorithm provides enough items, an empty array is returned. * @max 100 */ minimumRecommendedItems?: number; } interface GetRecommendationResponse { /** The recommended items and the algorithm that provided them. Empty if no algorithm met the `minimumRecommendedItems` threshold. */ recommendation?: Recommendation; } interface ItemAppIdNotSupportedByProvider { /** * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the app dashboard. * @minSize 1 * @maxSize 300 */ items?: CatalogReference[]; /** * Algorithms that don't support the requested items. * @minSize 1 * @maxSize 10 */ algorithms?: Algorithm[]; } interface RecommendationAlgorithmNotSupported { /** * Algorithms not supported by the provider. * @minSize 1 * @maxSize 10 */ unsupportedAlgorithms?: Algorithm[]; } /** @docsIgnore */ type GetRecommendationApplicationErrors = { code?: 'ITEM_APP_ID_NOT_SUPPORTED'; description?: string; data?: ItemAppIdNotSupportedByProvider; } | { code?: 'ALGORITHM_NOT_SUPPORTED'; description?: string; data?: RecommendationAlgorithmNotSupported; } | { code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND'; description?: string; data?: Record; }; type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function listAvailableAlgorithms(): __PublicMethodMetaInfo<'GET', {}, ListAvailableAlgorithmsRequest$1, ListAvailableAlgorithmsRequest, ListAvailableAlgorithmsResponse$1, ListAvailableAlgorithmsResponse>; declare function getRecommendation(): __PublicMethodMetaInfo<'POST', {}, GetRecommendationRequest$1, GetRecommendationRequest, GetRecommendationResponse$1, GetRecommendationResponse>; export { type AlgorithmConfig as AlgorithmConfigOriginal, type AlgorithmInfo as AlgorithmInfoOriginal, type Algorithm as AlgorithmOriginal, AlgorithmType as AlgorithmTypeOriginal, type AlgorithmTypeWithLiterals as AlgorithmTypeWithLiteralsOriginal, type CatalogReference as CatalogReferenceOriginal, type GetRecommendationApplicationErrors as GetRecommendationApplicationErrorsOriginal, type GetRecommendationRequest as GetRecommendationRequestOriginal, type GetRecommendationResponse as GetRecommendationResponseOriginal, type ItemAppIdNotSupportedByProvider as ItemAppIdNotSupportedByProviderOriginal, type ListAvailableAlgorithmsRequest as ListAvailableAlgorithmsRequestOriginal, type ListAvailableAlgorithmsResponse as ListAvailableAlgorithmsResponseOriginal, type RecommendationAlgorithmNotSupported as RecommendationAlgorithmNotSupportedOriginal, type Recommendation as RecommendationOriginal, type __PublicMethodMetaInfo, getRecommendation, listAvailableAlgorithms };