@wix/auto_sdk_ecom_recommendations 1.0.37 → 1.0.39

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 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.universal.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.public.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.context.ts"],"sourcesContent":["export * from './src/ecom-recommendations-v1-recommendation-recommendations.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';\n\nexport interface Recommendation {\n /**\n * Recommended items.\n * @maxSize 100\n */\n items?: CatalogReference[];\n /** The algorithm used to provide the recommendation. */\n algorithm?: Algorithm;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * 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.\n *\n * 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).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface Algorithm {\n /**\n * Algorithm ID defined by the app providing the algorithm.\n * @format GUID\n */\n _id?: string;\n /**\n * App ID of the Wix or 3rd-party app providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n}\n\nexport interface ListAvailableAlgorithmsRequest {}\n\nexport interface ListAvailableAlgorithmsResponse {\n /**\n * Algorithms available for use on your Wix site or project. See the method description for more information.\n * @maxSize 500\n */\n availableAlgorithms?: AlgorithmInfo[];\n}\n\nexport interface AlgorithmInfo {\n /** How the algorithm is configured. */\n config?: AlgorithmConfig;\n /**\n * The app ID of the application providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n /**\n * App IDs of catalogs to which the algorithm can be applied.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minSize 1\n * @maxSize 100\n * @minLength 1\n * @maxLength 36\n */\n catalogAppIds?: string[];\n}\n\nexport interface AlgorithmConfig {\n /**\n * Algorithm name. This value is not translatable.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 500\n */\n description?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 300\n */\n additionalInfo?: string | null;\n /**\n * Algorithms may have the following types:\n * * `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.\n * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.\n */\n algorithmType?: AlgorithmTypeWithLiterals;\n /**\n * 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.\n * @format GUID\n */\n algorithmId?: string;\n}\n\nexport enum AlgorithmType {\n UNSPECIFIED = 'UNSPECIFIED',\n RELATED_ITEMS = 'RELATED_ITEMS',\n GLOBAL = 'GLOBAL',\n}\n\n/** @enumType */\nexport type AlgorithmTypeWithLiterals =\n | AlgorithmType\n | 'UNSPECIFIED'\n | 'RELATED_ITEMS'\n | 'GLOBAL';\n\nexport interface GetRecommendationRequest {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @minSize 1\n * @maxSize 10\n */\n algorithms: Algorithm[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n\nexport interface GetRecommendationResponse {\n /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */\n recommendation?: Recommendation;\n}\n\nexport interface ItemAppIdNotSupportedByProvider {\n /**\n * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.\n * @minSize 1\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * Algorithms that don't support the requested items.\n * @minSize 1\n * @maxSize 10\n */\n algorithms?: Algorithm[];\n}\n\nexport interface RecommendationAlgorithmNotSupported {\n /**\n * Algorithms not supported by the provider.\n * @minSize 1\n * @maxSize 10\n */\n unsupportedAlgorithms?: Algorithm[];\n}\n\n/** @docsIgnore */\nexport type GetRecommendationApplicationErrors =\n | {\n code?: 'ITEM_APP_ID_NOT_SUPPORTED';\n description?: string;\n data?: ItemAppIdNotSupportedByProvider;\n }\n | {\n code?: 'ALGORITHM_NOT_SUPPORTED';\n description?: string;\n data?: RecommendationAlgorithmNotSupported;\n }\n | {\n code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n * @public\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms\n */\nexport async function listAvailableAlgorithms(): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @public\n * @requiredField algorithms\n * @requiredField algorithms._id\n * @requiredField algorithms.appId\n * @requiredField options.items.appId\n * @requiredField options.items.catalogItemId\n * @param options - Get recommendation options.\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation\n */\nexport async function getRecommendation(\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n algorithms: algorithms,\n items: options?.items,\n minimumRecommendedItems: options?.minimumRecommendedItems,\n });\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n algorithms: '$[0]',\n items: '$[1].items',\n minimumRecommendedItems: '$[1].minimumRecommendedItems',\n },\n singleArgumentUnchanged: false,\n },\n ['algorithms', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRecommendationOptions {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n {\n srcPath: '/ecom/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n _: [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\nexport function listAvailableAlgorithms(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAvailableAlgorithms({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'GET' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/algorithms',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listAvailableAlgorithms;\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n */\nexport function getRecommendation(payload: object): RequestOptionsFactory<any> {\n function __getRecommendation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/get',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __getRecommendation;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Algorithm,\n GetRecommendationApplicationErrors,\n GetRecommendationOptions,\n GetRecommendationResponse,\n ListAvailableAlgorithmsResponse,\n getRecommendation as universalGetRecommendation,\n listAvailableAlgorithms as universalListAvailableAlgorithms,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function listAvailableAlgorithms(\n httpClient: HttpClient\n): ListAvailableAlgorithmsSignature {\n return () =>\n universalListAvailableAlgorithms(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAvailableAlgorithmsSignature {\n /**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\n (): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n >;\n}\n\nexport function getRecommendation(\n httpClient: HttpClient\n): GetRecommendationSignature {\n return (\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n ) =>\n universalGetRecommendation(\n algorithms,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRecommendationSignature {\n /**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @param - Get recommendation options.\n */\n (\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n ): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n >;\n}\n\nexport {\n Algorithm,\n AlgorithmConfig,\n AlgorithmInfo,\n AlgorithmType,\n CatalogReference,\n GetRecommendationOptions,\n GetRecommendationRequest,\n GetRecommendationResponse,\n ItemAppIdNotSupportedByProvider,\n ListAvailableAlgorithmsRequest,\n ListAvailableAlgorithmsResponse,\n Recommendation,\n RecommendationAlgorithmNotSupported,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n","import {\n listAvailableAlgorithms as publicListAvailableAlgorithms,\n getRecommendation as publicGetRecommendation,\n} from './ecom-recommendations-v1-recommendation-recommendations.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listAvailableAlgorithms: MaybeContext<\n BuildRESTFunction<typeof publicListAvailableAlgorithms> &\n typeof publicListAvailableAlgorithms\n> = /*#__PURE__*/ createRESTModule(publicListAvailableAlgorithms);\nexport const getRecommendation: MaybeContext<\n BuildRESTFunction<typeof publicGetRecommendation> &\n typeof publicGetRecommendation\n> = /*#__PURE__*/ createRESTModule(publicGetRecommendation);\n\nexport { AlgorithmType } from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\nexport {\n Recommendation,\n CatalogReference,\n Algorithm,\n ListAvailableAlgorithmsRequest,\n ListAvailableAlgorithmsResponse,\n AlgorithmInfo,\n AlgorithmConfig,\n GetRecommendationRequest,\n GetRecommendationResponse,\n ItemAppIdNotSupportedByProvider,\n RecommendationAlgorithmNotSupported,\n GetRecommendationOptions,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\nexport {\n AlgorithmTypeWithLiterals,\n GetRecommendationApplicationErrors,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAgBd,SAAS,wBACd,SAC4B;AAC5B,WAAS,0BAA0B,EAAE,KAAK,GAAQ;AAChD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,4DAA4D;AAAA,QAC/D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAsBO,SAAS,kBAAkB,SAA6C;AAC7E,WAAS,oBAAoB,EAAE,KAAK,GA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ACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,yBAAyB;AAAA,QAC3B;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEpWO,SAASE,yBACd,YACkC;AAClC,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AA+BO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CACL,YACA,YAMAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACjEA,IAAAC,uBAAiC;AAG1B,IAAMC,2BAGK,2DAAiBA,wBAA6B;AACzD,IAAMC,qBAGK,2DAAiBA,kBAAuB;","names":["getRecommendation","listAvailableAlgorithms","import_rest_modules","AlgorithmType","listAvailableAlgorithms","sdkTransformError","getRecommendation","listAvailableAlgorithms","getRecommendation","import_rest_modules","listAvailableAlgorithms","getRecommendation"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.universal.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.public.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.context.ts"],"sourcesContent":["export * from './src/ecom-recommendations-v1-recommendation-recommendations.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';\n\nexport interface Recommendation {\n /**\n * Recommended items.\n * @maxSize 100\n */\n items?: CatalogReference[];\n /** The algorithm used to provide the recommendation. */\n algorithm?: Algorithm;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * 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.\n *\n * 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)\n * 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).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface Algorithm {\n /**\n * Algorithm ID defined by the app providing the algorithm.\n * @format GUID\n */\n _id?: string;\n /**\n * App ID of the Wix or 3rd-party app providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n}\n\nexport interface ListAvailableAlgorithmsRequest {}\n\nexport interface ListAvailableAlgorithmsResponse {\n /**\n * Algorithms available for use on your Wix site or project. See the method description for more information.\n * @maxSize 500\n */\n availableAlgorithms?: AlgorithmInfo[];\n}\n\nexport interface AlgorithmInfo {\n /** How the algorithm is configured. */\n config?: AlgorithmConfig;\n /**\n * The app ID of the application providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n /**\n * App IDs of catalogs to which the algorithm can be applied.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minSize 1\n * @maxSize 100\n * @minLength 1\n * @maxLength 36\n */\n catalogAppIds?: string[];\n}\n\nexport interface AlgorithmConfig {\n /**\n * Algorithm name. This value is not translatable.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 500\n */\n description?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 300\n */\n additionalInfo?: string | null;\n /**\n * Algorithms may have the following types:\n * * `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.\n * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.\n */\n algorithmType?: AlgorithmTypeWithLiterals;\n /**\n * 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.\n * @format GUID\n */\n algorithmId?: string;\n}\n\nexport enum AlgorithmType {\n UNSPECIFIED = 'UNSPECIFIED',\n RELATED_ITEMS = 'RELATED_ITEMS',\n GLOBAL = 'GLOBAL',\n}\n\n/** @enumType */\nexport type AlgorithmTypeWithLiterals =\n | AlgorithmType\n | 'UNSPECIFIED'\n | 'RELATED_ITEMS'\n | 'GLOBAL';\n\nexport interface GetRecommendationRequest {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @minSize 1\n * @maxSize 10\n */\n algorithms: Algorithm[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n\nexport interface GetRecommendationResponse {\n /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */\n recommendation?: Recommendation;\n}\n\nexport interface ItemAppIdNotSupportedByProvider {\n /**\n * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.\n * @minSize 1\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * Algorithms that don't support the requested items.\n * @minSize 1\n * @maxSize 10\n */\n algorithms?: Algorithm[];\n}\n\nexport interface RecommendationAlgorithmNotSupported {\n /**\n * Algorithms not supported by the provider.\n * @minSize 1\n * @maxSize 10\n */\n unsupportedAlgorithms?: Algorithm[];\n}\n\n/** @docsIgnore */\nexport type GetRecommendationApplicationErrors =\n | {\n code?: 'ITEM_APP_ID_NOT_SUPPORTED';\n description?: string;\n data?: ItemAppIdNotSupportedByProvider;\n }\n | {\n code?: 'ALGORITHM_NOT_SUPPORTED';\n description?: string;\n data?: RecommendationAlgorithmNotSupported;\n }\n | {\n code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n * @public\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms\n */\nexport async function listAvailableAlgorithms(): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @public\n * @requiredField algorithms\n * @requiredField algorithms._id\n * @requiredField algorithms.appId\n * @requiredField options.items.appId\n * @requiredField options.items.catalogItemId\n * @param options - Get recommendation options.\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation\n */\nexport async function getRecommendation(\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n algorithms: algorithms,\n items: options?.items,\n minimumRecommendedItems: options?.minimumRecommendedItems,\n });\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n algorithms: '$[0]',\n items: '$[1].items',\n minimumRecommendedItems: '$[1].minimumRecommendedItems',\n },\n singleArgumentUnchanged: false,\n },\n ['algorithms', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRecommendationOptions {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n {\n srcPath: '/ecom/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n _: [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\nexport function listAvailableAlgorithms(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAvailableAlgorithms({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'GET' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/algorithms',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listAvailableAlgorithms;\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n */\nexport function getRecommendation(payload: object): RequestOptionsFactory<any> {\n function __getRecommendation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/get',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __getRecommendation;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Algorithm,\n GetRecommendationApplicationErrors,\n GetRecommendationOptions,\n GetRecommendationResponse,\n ListAvailableAlgorithmsResponse,\n getRecommendation as universalGetRecommendation,\n listAvailableAlgorithms as universalListAvailableAlgorithms,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function listAvailableAlgorithms(\n httpClient: HttpClient\n): ListAvailableAlgorithmsSignature {\n return () =>\n universalListAvailableAlgorithms(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAvailableAlgorithmsSignature {\n /**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\n (): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n >;\n}\n\nexport function getRecommendation(\n httpClient: HttpClient\n): GetRecommendationSignature {\n return (\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n ) =>\n universalGetRecommendation(\n algorithms,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRecommendationSignature {\n /**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @param - Get recommendation options.\n */\n (\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n ): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n >;\n}\n\nexport {\n Algorithm,\n AlgorithmConfig,\n AlgorithmInfo,\n AlgorithmType,\n CatalogReference,\n GetRecommendationOptions,\n GetRecommendationRequest,\n GetRecommendationResponse,\n ItemAppIdNotSupportedByProvider,\n ListAvailableAlgorithmsRequest,\n ListAvailableAlgorithmsResponse,\n Recommendation,\n RecommendationAlgorithmNotSupported,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n","import {\n listAvailableAlgorithms as publicListAvailableAlgorithms,\n getRecommendation as publicGetRecommendation,\n} from './ecom-recommendations-v1-recommendation-recommendations.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listAvailableAlgorithms: MaybeContext<\n BuildRESTFunction<typeof publicListAvailableAlgorithms> &\n typeof publicListAvailableAlgorithms\n> = /*#__PURE__*/ createRESTModule(publicListAvailableAlgorithms);\nexport const getRecommendation: MaybeContext<\n BuildRESTFunction<typeof publicGetRecommendation> &\n typeof publicGetRecommendation\n> = /*#__PURE__*/ createRESTModule(publicGetRecommendation);\n\nexport { AlgorithmType } from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\nexport {\n Recommendation,\n CatalogReference,\n Algorithm,\n ListAvailableAlgorithmsRequest,\n ListAvailableAlgorithmsResponse,\n AlgorithmInfo,\n AlgorithmConfig,\n GetRecommendationRequest,\n GetRecommendationResponse,\n ItemAppIdNotSupportedByProvider,\n RecommendationAlgorithmNotSupported,\n GetRecommendationOptions,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\nexport {\n AlgorithmTypeWithLiterals,\n GetRecommendationApplicationErrors,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA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AAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvWO,SAASE,yBACd,YACkC;AAClC,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AA+BO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CACL,YACA,YAMAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACjEA,IAAAC,uBAAiC;AAG1B,IAAMC,2BAGK,2DAAiBA,wBAA6B;AACzD,IAAMC,qBAGK,2DAAiBA,kBAAuB;","names":["getRecommendation","listAvailableAlgorithms","import_rest_modules","AlgorithmType","listAvailableAlgorithms","sdkTransformError","getRecommendation","listAvailableAlgorithms","getRecommendation","import_rest_modules","listAvailableAlgorithms","getRecommendation"]}
@@ -30,9 +30,12 @@ interface CatalogReference {
30
30
  */
31
31
  appId?: string;
32
32
  /**
33
- * 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.
33
+ * Additional item details in `key:value` pairs.
34
34
  *
35
- * 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).
35
+ * 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.
36
+ *
37
+ * 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)
38
+ * 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).
36
39
  */
37
40
  options?: Record<string, any> | null;
38
41
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.universal.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts"],"sourcesContent":["export * from './src/ecom-recommendations-v1-recommendation-recommendations.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';\n\nexport interface Recommendation {\n /**\n * Recommended items.\n * @maxSize 100\n */\n items?: CatalogReference[];\n /** The algorithm used to provide the recommendation. */\n algorithm?: Algorithm;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * 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.\n *\n * 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).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface Algorithm {\n /**\n * Algorithm ID defined by the app providing the algorithm.\n * @format GUID\n */\n _id?: string;\n /**\n * App ID of the Wix or 3rd-party app providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n}\n\nexport interface ListAvailableAlgorithmsRequest {}\n\nexport interface ListAvailableAlgorithmsResponse {\n /**\n * Algorithms available for use on your Wix site or project. See the method description for more information.\n * @maxSize 500\n */\n availableAlgorithms?: AlgorithmInfo[];\n}\n\nexport interface AlgorithmInfo {\n /** How the algorithm is configured. */\n config?: AlgorithmConfig;\n /**\n * The app ID of the application providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n /**\n * App IDs of catalogs to which the algorithm can be applied.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minSize 1\n * @maxSize 100\n * @minLength 1\n * @maxLength 36\n */\n catalogAppIds?: string[];\n}\n\nexport interface AlgorithmConfig {\n /**\n * Algorithm name. This value is not translatable.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 500\n */\n description?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 300\n */\n additionalInfo?: string | null;\n /**\n * Algorithms may have the following types:\n * * `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.\n * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.\n */\n algorithmType?: AlgorithmTypeWithLiterals;\n /**\n * 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.\n * @format GUID\n */\n algorithmId?: string;\n}\n\nexport enum AlgorithmType {\n UNSPECIFIED = 'UNSPECIFIED',\n RELATED_ITEMS = 'RELATED_ITEMS',\n GLOBAL = 'GLOBAL',\n}\n\n/** @enumType */\nexport type AlgorithmTypeWithLiterals =\n | AlgorithmType\n | 'UNSPECIFIED'\n | 'RELATED_ITEMS'\n | 'GLOBAL';\n\nexport interface GetRecommendationRequest {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @minSize 1\n * @maxSize 10\n */\n algorithms: Algorithm[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n\nexport interface GetRecommendationResponse {\n /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */\n recommendation?: Recommendation;\n}\n\nexport interface ItemAppIdNotSupportedByProvider {\n /**\n * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.\n * @minSize 1\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * Algorithms that don't support the requested items.\n * @minSize 1\n * @maxSize 10\n */\n algorithms?: Algorithm[];\n}\n\nexport interface RecommendationAlgorithmNotSupported {\n /**\n * Algorithms not supported by the provider.\n * @minSize 1\n * @maxSize 10\n */\n unsupportedAlgorithms?: Algorithm[];\n}\n\n/** @docsIgnore */\nexport type GetRecommendationApplicationErrors =\n | {\n code?: 'ITEM_APP_ID_NOT_SUPPORTED';\n description?: string;\n data?: ItemAppIdNotSupportedByProvider;\n }\n | {\n code?: 'ALGORITHM_NOT_SUPPORTED';\n description?: string;\n data?: RecommendationAlgorithmNotSupported;\n }\n | {\n code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n * @public\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms\n */\nexport async function listAvailableAlgorithms(): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @public\n * @requiredField algorithms\n * @requiredField algorithms._id\n * @requiredField algorithms.appId\n * @requiredField options.items.appId\n * @requiredField options.items.catalogItemId\n * @param options - Get recommendation options.\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation\n */\nexport async function getRecommendation(\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n algorithms: algorithms,\n items: options?.items,\n minimumRecommendedItems: options?.minimumRecommendedItems,\n });\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n algorithms: '$[0]',\n items: '$[1].items',\n minimumRecommendedItems: '$[1].minimumRecommendedItems',\n },\n singleArgumentUnchanged: false,\n },\n ['algorithms', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRecommendationOptions {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n {\n srcPath: '/ecom/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n _: [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\nexport function listAvailableAlgorithms(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAvailableAlgorithms({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'GET' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/algorithms',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listAvailableAlgorithms;\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n */\nexport function getRecommendation(payload: object): RequestOptionsFactory<any> {\n function __getRecommendation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/get',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __getRecommendation;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA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,UACP,yBAAyB;AAAA,QAC3B;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getRecommendation","listAvailableAlgorithms","import_rest_modules","AlgorithmType","listAvailableAlgorithms","sdkTransformError","getRecommendation"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.universal.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts"],"sourcesContent":["export * from './src/ecom-recommendations-v1-recommendation-recommendations.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';\n\nexport interface Recommendation {\n /**\n * Recommended items.\n * @maxSize 100\n */\n items?: CatalogReference[];\n /** The algorithm used to provide the recommendation. */\n algorithm?: Algorithm;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * 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.\n *\n * 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)\n * 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).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface Algorithm {\n /**\n * Algorithm ID defined by the app providing the algorithm.\n * @format GUID\n */\n _id?: string;\n /**\n * App ID of the Wix or 3rd-party app providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n}\n\nexport interface ListAvailableAlgorithmsRequest {}\n\nexport interface ListAvailableAlgorithmsResponse {\n /**\n * Algorithms available for use on your Wix site or project. See the method description for more information.\n * @maxSize 500\n */\n availableAlgorithms?: AlgorithmInfo[];\n}\n\nexport interface AlgorithmInfo {\n /** How the algorithm is configured. */\n config?: AlgorithmConfig;\n /**\n * The app ID of the application providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n /**\n * App IDs of catalogs to which the algorithm can be applied.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minSize 1\n * @maxSize 100\n * @minLength 1\n * @maxLength 36\n */\n catalogAppIds?: string[];\n}\n\nexport interface AlgorithmConfig {\n /**\n * Algorithm name. This value is not translatable.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 500\n */\n description?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 300\n */\n additionalInfo?: string | null;\n /**\n * Algorithms may have the following types:\n * * `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.\n * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.\n */\n algorithmType?: AlgorithmTypeWithLiterals;\n /**\n * 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.\n * @format GUID\n */\n algorithmId?: string;\n}\n\nexport enum AlgorithmType {\n UNSPECIFIED = 'UNSPECIFIED',\n RELATED_ITEMS = 'RELATED_ITEMS',\n GLOBAL = 'GLOBAL',\n}\n\n/** @enumType */\nexport type AlgorithmTypeWithLiterals =\n | AlgorithmType\n | 'UNSPECIFIED'\n | 'RELATED_ITEMS'\n | 'GLOBAL';\n\nexport interface GetRecommendationRequest {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @minSize 1\n * @maxSize 10\n */\n algorithms: Algorithm[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n\nexport interface GetRecommendationResponse {\n /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */\n recommendation?: Recommendation;\n}\n\nexport interface ItemAppIdNotSupportedByProvider {\n /**\n * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.\n * @minSize 1\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * Algorithms that don't support the requested items.\n * @minSize 1\n * @maxSize 10\n */\n algorithms?: Algorithm[];\n}\n\nexport interface RecommendationAlgorithmNotSupported {\n /**\n * Algorithms not supported by the provider.\n * @minSize 1\n * @maxSize 10\n */\n unsupportedAlgorithms?: Algorithm[];\n}\n\n/** @docsIgnore */\nexport type GetRecommendationApplicationErrors =\n | {\n code?: 'ITEM_APP_ID_NOT_SUPPORTED';\n description?: string;\n data?: ItemAppIdNotSupportedByProvider;\n }\n | {\n code?: 'ALGORITHM_NOT_SUPPORTED';\n description?: string;\n data?: RecommendationAlgorithmNotSupported;\n }\n | {\n code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n * @public\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms\n */\nexport async function listAvailableAlgorithms(): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @public\n * @requiredField algorithms\n * @requiredField algorithms._id\n * @requiredField algorithms.appId\n * @requiredField options.items.appId\n * @requiredField options.items.catalogItemId\n * @param options - Get recommendation options.\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation\n */\nexport async function getRecommendation(\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n algorithms: algorithms,\n items: options?.items,\n minimumRecommendedItems: options?.minimumRecommendedItems,\n });\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n algorithms: '$[0]',\n items: '$[1].items',\n minimumRecommendedItems: '$[1].minimumRecommendedItems',\n },\n singleArgumentUnchanged: false,\n },\n ['algorithms', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRecommendationOptions {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n {\n srcPath: '/ecom/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n _: [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\nexport function listAvailableAlgorithms(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAvailableAlgorithms({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'GET' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/algorithms',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listAvailableAlgorithms;\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n */\nexport function getRecommendation(payload: object): RequestOptionsFactory<any> {\n function __getRecommendation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/get',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __getRecommendation;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAgBd,SAAS,wBACd,SAC4B;AAC5B,WAAS,0BAA0B,EAAE,KAAK,GAAQ;AAChD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAA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A;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,OAAO,SAAS;AAAA,IAChB,yBAAyB,SAAS;AAAA,EACpC,CAAC;AAED,QAAM,UAC6C,kBAAkB,OAAO;AAE5E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,yBAAyB;AAAA,QAC3B;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getRecommendation","listAvailableAlgorithms","import_rest_modules","AlgorithmType","listAvailableAlgorithms","sdkTransformError","getRecommendation"]}
@@ -31,9 +31,12 @@ interface CatalogReference {
31
31
  */
32
32
  appId?: string;
33
33
  /**
34
- * 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.
34
+ * Additional item details in `key:value` pairs.
35
35
  *
36
- * 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).
36
+ * 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.
37
+ *
38
+ * 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)
39
+ * 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).
37
40
  */
38
41
  options?: Record<string, any> | null;
39
42
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../meta.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.types.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.meta.ts"],"sourcesContent":["export * from './src/ecom-recommendations-v1-recommendation-recommendations.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n {\n srcPath: '/ecom/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n _: [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\nexport function listAvailableAlgorithms(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAvailableAlgorithms({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'GET' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/algorithms',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listAvailableAlgorithms;\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n */\nexport function getRecommendation(payload: object): RequestOptionsFactory<any> {\n function __getRecommendation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/get',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __getRecommendation;\n}\n","export interface Recommendation {\n /**\n * Recommended items.\n * @maxSize 100\n */\n items?: CatalogReference[];\n /** The algorithm used to provide the recommendation. */\n algorithm?: Algorithm;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * 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.\n *\n * 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).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface Algorithm {\n /**\n * Algorithm ID defined by the app providing the algorithm.\n * @format GUID\n */\n id?: string;\n /**\n * App ID of the Wix or 3rd-party app providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n}\n\nexport interface ListAvailableAlgorithmsRequest {}\n\nexport interface ListAvailableAlgorithmsResponse {\n /**\n * Algorithms available for use on your Wix site or project. See the method description for more information.\n * @maxSize 500\n */\n availableAlgorithms?: AlgorithmInfo[];\n}\n\nexport interface AlgorithmInfo {\n /** How the algorithm is configured. */\n config?: AlgorithmConfig;\n /**\n * The app ID of the application providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n /**\n * App IDs of catalogs to which the algorithm can be applied.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minSize 1\n * @maxSize 100\n * @minLength 1\n * @maxLength 36\n */\n catalogAppIds?: string[];\n}\n\nexport interface AlgorithmConfig {\n /**\n * Algorithm name. This value is not translatable.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 500\n */\n description?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 300\n */\n additionalInfo?: string | null;\n /**\n * Algorithms may have the following types:\n * * `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.\n * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.\n */\n algorithmType?: AlgorithmTypeWithLiterals;\n /**\n * 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.\n * @format GUID\n */\n algorithmId?: string;\n}\n\nexport enum AlgorithmType {\n UNSPECIFIED = 'UNSPECIFIED',\n RELATED_ITEMS = 'RELATED_ITEMS',\n GLOBAL = 'GLOBAL',\n}\n\n/** @enumType */\nexport type AlgorithmTypeWithLiterals =\n | AlgorithmType\n | 'UNSPECIFIED'\n | 'RELATED_ITEMS'\n | 'GLOBAL';\n\nexport interface GetRecommendationRequest {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @minSize 1\n * @maxSize 10\n */\n algorithms: Algorithm[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n\nexport interface GetRecommendationResponse {\n /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */\n recommendation?: Recommendation;\n}\n\nexport interface ItemAppIdNotSupportedByProvider {\n /**\n * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.\n * @minSize 1\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * Algorithms that don't support the requested items.\n * @minSize 1\n * @maxSize 10\n */\n algorithms?: Algorithm[];\n}\n\nexport interface RecommendationAlgorithmNotSupported {\n /**\n * Algorithms not supported by the provider.\n * @minSize 1\n * @maxSize 10\n */\n unsupportedAlgorithms?: Algorithm[];\n}\n\n/** @docsIgnore */\nexport type GetRecommendationApplicationErrors =\n | {\n code?: 'ITEM_APP_ID_NOT_SUPPORTED';\n description?: string;\n data?: ItemAppIdNotSupportedByProvider;\n }\n | {\n code?: 'ALGORITHM_NOT_SUPPORTED';\n description?: string;\n data?: RecommendationAlgorithmNotSupported;\n }\n | {\n code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","import * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';\nimport * as ambassadorWixEcomRecommendationsV1RecommendationTypes from './ecom-recommendations-v1-recommendation-recommendations.types.js';\nimport * as ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function listAvailableAlgorithms(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsRequest,\n ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsRequest,\n ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsResponse,\n ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/recommendations/algorithms',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getRecommendation(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationRequest,\n ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationRequest,\n ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationResponse,\n ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/recommendations/get',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n Recommendation as RecommendationOriginal,\n CatalogReference as CatalogReferenceOriginal,\n Algorithm as AlgorithmOriginal,\n ListAvailableAlgorithmsRequest as ListAvailableAlgorithmsRequestOriginal,\n ListAvailableAlgorithmsResponse as ListAvailableAlgorithmsResponseOriginal,\n AlgorithmInfo as AlgorithmInfoOriginal,\n AlgorithmConfig as AlgorithmConfigOriginal,\n AlgorithmType as AlgorithmTypeOriginal,\n AlgorithmTypeWithLiterals as AlgorithmTypeWithLiteralsOriginal,\n GetRecommendationRequest as GetRecommendationRequestOriginal,\n GetRecommendationResponse as GetRecommendationResponseOriginal,\n ItemAppIdNotSupportedByProvider as ItemAppIdNotSupportedByProviderOriginal,\n RecommendationAlgorithmNotSupported as RecommendationAlgorithmNotSupportedOriginal,\n GetRecommendationApplicationErrors as GetRecommendationApplicationErrorsOriginal,\n} from './ecom-recommendations-v1-recommendation-recommendations.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAA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U,CAAC;AAEjB,QAAM,oBAC6C;AAAA,IAC/C;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,qBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6C,kBAAkB,OAAO;AAE5E,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["getRecommendation","listAvailableAlgorithms","import_rest_modules","AlgorithmType","listAvailableAlgorithms","getRecommendation"]}
1
+ {"version":3,"sources":["../../meta.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.types.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.meta.ts"],"sourcesContent":["export * from './src/ecom-recommendations-v1-recommendation-recommendations.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n {\n srcPath: '/ecom/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n _: [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\nexport function listAvailableAlgorithms(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAvailableAlgorithms({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'GET' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/algorithms',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listAvailableAlgorithms;\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n */\nexport function getRecommendation(payload: object): RequestOptionsFactory<any> {\n function __getRecommendation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/get',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __getRecommendation;\n}\n","export interface Recommendation {\n /**\n * Recommended items.\n * @maxSize 100\n */\n items?: CatalogReference[];\n /** The algorithm used to provide the recommendation. */\n algorithm?: Algorithm;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * 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.\n *\n * 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)\n * 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).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface Algorithm {\n /**\n * Algorithm ID defined by the app providing the algorithm.\n * @format GUID\n */\n id?: string;\n /**\n * App ID of the Wix or 3rd-party app providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n}\n\nexport interface ListAvailableAlgorithmsRequest {}\n\nexport interface ListAvailableAlgorithmsResponse {\n /**\n * Algorithms available for use on your Wix site or project. See the method description for more information.\n * @maxSize 500\n */\n availableAlgorithms?: AlgorithmInfo[];\n}\n\nexport interface AlgorithmInfo {\n /** How the algorithm is configured. */\n config?: AlgorithmConfig;\n /**\n * The app ID of the application providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n /**\n * App IDs of catalogs to which the algorithm can be applied.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minSize 1\n * @maxSize 100\n * @minLength 1\n * @maxLength 36\n */\n catalogAppIds?: string[];\n}\n\nexport interface AlgorithmConfig {\n /**\n * Algorithm name. This value is not translatable.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 500\n */\n description?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 300\n */\n additionalInfo?: string | null;\n /**\n * Algorithms may have the following types:\n * * `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.\n * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.\n */\n algorithmType?: AlgorithmTypeWithLiterals;\n /**\n * 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.\n * @format GUID\n */\n algorithmId?: string;\n}\n\nexport enum AlgorithmType {\n UNSPECIFIED = 'UNSPECIFIED',\n RELATED_ITEMS = 'RELATED_ITEMS',\n GLOBAL = 'GLOBAL',\n}\n\n/** @enumType */\nexport type AlgorithmTypeWithLiterals =\n | AlgorithmType\n | 'UNSPECIFIED'\n | 'RELATED_ITEMS'\n | 'GLOBAL';\n\nexport interface GetRecommendationRequest {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @minSize 1\n * @maxSize 10\n */\n algorithms: Algorithm[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n\nexport interface GetRecommendationResponse {\n /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */\n recommendation?: Recommendation;\n}\n\nexport interface ItemAppIdNotSupportedByProvider {\n /**\n * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.\n * @minSize 1\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * Algorithms that don't support the requested items.\n * @minSize 1\n * @maxSize 10\n */\n algorithms?: Algorithm[];\n}\n\nexport interface RecommendationAlgorithmNotSupported {\n /**\n * Algorithms not supported by the provider.\n * @minSize 1\n * @maxSize 10\n */\n unsupportedAlgorithms?: Algorithm[];\n}\n\n/** @docsIgnore */\nexport type GetRecommendationApplicationErrors =\n | {\n code?: 'ITEM_APP_ID_NOT_SUPPORTED';\n description?: string;\n data?: ItemAppIdNotSupportedByProvider;\n }\n | {\n code?: 'ALGORITHM_NOT_SUPPORTED';\n description?: string;\n data?: RecommendationAlgorithmNotSupported;\n }\n | {\n code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","import * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';\nimport * as ambassadorWixEcomRecommendationsV1RecommendationTypes from './ecom-recommendations-v1-recommendation-recommendations.types.js';\nimport * as ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function listAvailableAlgorithms(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsRequest,\n ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsRequest,\n ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsResponse,\n ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/recommendations/algorithms',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getRecommendation(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationRequest,\n ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationRequest,\n ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationResponse,\n ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/recommendations/get',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n Recommendation as RecommendationOriginal,\n CatalogReference as CatalogReferenceOriginal,\n Algorithm as AlgorithmOriginal,\n ListAvailableAlgorithmsRequest as ListAvailableAlgorithmsRequestOriginal,\n ListAvailableAlgorithmsResponse as ListAvailableAlgorithmsResponseOriginal,\n AlgorithmInfo as AlgorithmInfoOriginal,\n AlgorithmConfig as AlgorithmConfigOriginal,\n AlgorithmType as AlgorithmTypeOriginal,\n AlgorithmTypeWithLiterals as AlgorithmTypeWithLiteralsOriginal,\n GetRecommendationRequest as GetRecommendationRequestOriginal,\n GetRecommendationResponse as GetRecommendationResponseOriginal,\n ItemAppIdNotSupportedByProvider as ItemAppIdNotSupportedByProviderOriginal,\n RecommendationAlgorithmNotSupported as RecommendationAlgorithmNotSupportedOriginal,\n GetRecommendationApplicationErrors as GetRecommendationApplicationErrorsOriginal,\n} from './ecom-recommendations-v1-recommendation-recommendations.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,+BAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAgBd,SAAS,wBACd,SAC4B;AAC5B,WAAS,0BAA0B,EAAE,KAAK,GAAQ;AAChD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,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AS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["getRecommendation","listAvailableAlgorithms","import_rest_modules","AlgorithmType","listAvailableAlgorithms","getRecommendation"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ecom-recommendations-v1-recommendation-recommendations.universal.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.public.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';\n\nexport interface Recommendation {\n /**\n * Recommended items.\n * @maxSize 100\n */\n items?: CatalogReference[];\n /** The algorithm used to provide the recommendation. */\n algorithm?: Algorithm;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * 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.\n *\n * 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).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface Algorithm {\n /**\n * Algorithm ID defined by the app providing the algorithm.\n * @format GUID\n */\n _id?: string;\n /**\n * App ID of the Wix or 3rd-party app providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n}\n\nexport interface ListAvailableAlgorithmsRequest {}\n\nexport interface ListAvailableAlgorithmsResponse {\n /**\n * Algorithms available for use on your Wix site or project. See the method description for more information.\n * @maxSize 500\n */\n availableAlgorithms?: AlgorithmInfo[];\n}\n\nexport interface AlgorithmInfo {\n /** How the algorithm is configured. */\n config?: AlgorithmConfig;\n /**\n * The app ID of the application providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n /**\n * App IDs of catalogs to which the algorithm can be applied.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minSize 1\n * @maxSize 100\n * @minLength 1\n * @maxLength 36\n */\n catalogAppIds?: string[];\n}\n\nexport interface AlgorithmConfig {\n /**\n * Algorithm name. This value is not translatable.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 500\n */\n description?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 300\n */\n additionalInfo?: string | null;\n /**\n * Algorithms may have the following types:\n * * `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.\n * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.\n */\n algorithmType?: AlgorithmTypeWithLiterals;\n /**\n * 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.\n * @format GUID\n */\n algorithmId?: string;\n}\n\nexport enum AlgorithmType {\n UNSPECIFIED = 'UNSPECIFIED',\n RELATED_ITEMS = 'RELATED_ITEMS',\n GLOBAL = 'GLOBAL',\n}\n\n/** @enumType */\nexport type AlgorithmTypeWithLiterals =\n | AlgorithmType\n | 'UNSPECIFIED'\n | 'RELATED_ITEMS'\n | 'GLOBAL';\n\nexport interface GetRecommendationRequest {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @minSize 1\n * @maxSize 10\n */\n algorithms: Algorithm[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n\nexport interface GetRecommendationResponse {\n /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */\n recommendation?: Recommendation;\n}\n\nexport interface ItemAppIdNotSupportedByProvider {\n /**\n * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.\n * @minSize 1\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * Algorithms that don't support the requested items.\n * @minSize 1\n * @maxSize 10\n */\n algorithms?: Algorithm[];\n}\n\nexport interface RecommendationAlgorithmNotSupported {\n /**\n * Algorithms not supported by the provider.\n * @minSize 1\n * @maxSize 10\n */\n unsupportedAlgorithms?: Algorithm[];\n}\n\n/** @docsIgnore */\nexport type GetRecommendationApplicationErrors =\n | {\n code?: 'ITEM_APP_ID_NOT_SUPPORTED';\n description?: string;\n data?: ItemAppIdNotSupportedByProvider;\n }\n | {\n code?: 'ALGORITHM_NOT_SUPPORTED';\n description?: string;\n data?: RecommendationAlgorithmNotSupported;\n }\n | {\n code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n * @public\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms\n */\nexport async function listAvailableAlgorithms(): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @public\n * @requiredField algorithms\n * @requiredField algorithms._id\n * @requiredField algorithms.appId\n * @requiredField options.items.appId\n * @requiredField options.items.catalogItemId\n * @param options - Get recommendation options.\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation\n */\nexport async function getRecommendation(\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n algorithms: algorithms,\n items: options?.items,\n minimumRecommendedItems: options?.minimumRecommendedItems,\n });\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n algorithms: '$[0]',\n items: '$[1].items',\n minimumRecommendedItems: '$[1].minimumRecommendedItems',\n },\n singleArgumentUnchanged: false,\n },\n ['algorithms', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRecommendationOptions {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n {\n srcPath: '/ecom/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n _: [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\nexport function listAvailableAlgorithms(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAvailableAlgorithms({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'GET' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/algorithms',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listAvailableAlgorithms;\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n */\nexport function getRecommendation(payload: object): RequestOptionsFactory<any> {\n function __getRecommendation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/get',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __getRecommendation;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Algorithm,\n GetRecommendationApplicationErrors,\n GetRecommendationOptions,\n GetRecommendationResponse,\n ListAvailableAlgorithmsResponse,\n getRecommendation as universalGetRecommendation,\n listAvailableAlgorithms as universalListAvailableAlgorithms,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function listAvailableAlgorithms(\n httpClient: HttpClient\n): ListAvailableAlgorithmsSignature {\n return () =>\n universalListAvailableAlgorithms(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAvailableAlgorithmsSignature {\n /**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\n (): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n >;\n}\n\nexport function getRecommendation(\n httpClient: HttpClient\n): GetRecommendationSignature {\n return (\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n ) =>\n universalGetRecommendation(\n algorithms,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRecommendationSignature {\n /**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @param - Get recommendation options.\n */\n (\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n ): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n >;\n}\n\nexport {\n Algorithm,\n AlgorithmConfig,\n AlgorithmInfo,\n AlgorithmType,\n CatalogReference,\n GetRecommendationOptions,\n GetRecommendationRequest,\n GetRecommendationResponse,\n ItemAppIdNotSupportedByProvider,\n ListAvailableAlgorithmsRequest,\n ListAvailableAlgorithmsResponse,\n Recommendation,\n RecommendationAlgorithmNotSupported,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n","import {\n listAvailableAlgorithms as publicListAvailableAlgorithms,\n getRecommendation as publicGetRecommendation,\n} from './ecom-recommendations-v1-recommendation-recommendations.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listAvailableAlgorithms: MaybeContext<\n BuildRESTFunction<typeof publicListAvailableAlgorithms> &\n typeof publicListAvailableAlgorithms\n> = /*#__PURE__*/ createRESTModule(publicListAvailableAlgorithms);\nexport const getRecommendation: MaybeContext<\n BuildRESTFunction<typeof publicGetRecommendation> &\n typeof publicGetRecommendation\n> = /*#__PURE__*/ createRESTModule(publicGetRecommendation);\n\nexport { AlgorithmType } from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\nexport {\n Recommendation,\n CatalogReference,\n Algorithm,\n ListAvailableAlgorithmsRequest,\n ListAvailableAlgorithmsResponse,\n AlgorithmInfo,\n AlgorithmConfig,\n GetRecommendationRequest,\n GetRecommendationResponse,\n ItemAppIdNotSupportedByProvider,\n RecommendationAlgorithmNotSupported,\n GetRecommendationOptions,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\nexport {\n AlgorithmTypeWithLiterals,\n GetRecommendationApplicationErrors,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAgBd,SAAS,wBACd,SAC4B;AAC5B,WAAS,0BAA0B,EAAE,KAAK,GAAQ;AAChD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,4DAA4D;AAAA,QAC/D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAAkB,OAAO;AAAA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AChB,yBAAyB,SAAS;AAAA,EACpC,CAAC;AAED,QAAM,UAC6C,kBAAkB,OAAO;AAE5E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,yBAAyB;AAAA,QAC3B;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc,SAAS;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEpWO,SAASC,yBACd,YACkC;AAClC,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AA+BO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CACL,YACA,YAMAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACjEA,SAAS,wBAAwB;AAG1B,IAAMC,2BAGK,iCAAiBA,wBAA6B;AACzD,IAAMC,qBAGK,iCAAiBA,kBAAuB;","names":["AlgorithmType","listAvailableAlgorithms","getRecommendation","listAvailableAlgorithms","getRecommendation","listAvailableAlgorithms","getRecommendation"]}
1
+ {"version":3,"sources":["../../src/ecom-recommendations-v1-recommendation-recommendations.universal.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.public.ts","../../src/ecom-recommendations-v1-recommendation-recommendations.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';\n\nexport interface Recommendation {\n /**\n * Recommended items.\n * @maxSize 100\n */\n items?: CatalogReference[];\n /** The algorithm used to provide the recommendation. */\n algorithm?: Algorithm;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n /**\n * ID of the item within the catalog it belongs to.\n * @minLength 1\n * @maxLength 36\n */\n catalogItemId?: string;\n /**\n * ID of the app providing the catalog.\n *\n * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n *\n * For items from Wix catalogs, the following values always apply:\n * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n * @minLength 1\n */\n appId?: string;\n /**\n * Additional item details in `key:value` pairs.\n *\n * 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.\n *\n * 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)\n * 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).\n */\n options?: Record<string, any> | null;\n}\n\nexport interface Algorithm {\n /**\n * Algorithm ID defined by the app providing the algorithm.\n * @format GUID\n */\n _id?: string;\n /**\n * App ID of the Wix or 3rd-party app providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n}\n\nexport interface ListAvailableAlgorithmsRequest {}\n\nexport interface ListAvailableAlgorithmsResponse {\n /**\n * Algorithms available for use on your Wix site or project. See the method description for more information.\n * @maxSize 500\n */\n availableAlgorithms?: AlgorithmInfo[];\n}\n\nexport interface AlgorithmInfo {\n /** How the algorithm is configured. */\n config?: AlgorithmConfig;\n /**\n * The app ID of the application providing the algorithm.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minLength 1\n * @maxLength 36\n */\n appId?: string;\n /**\n * App IDs of catalogs to which the algorithm can be applied.\n *\n * Wix app IDs are <a href=\"https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions\" target=\"_blank\">listed here</a>.\n * @minSize 1\n * @maxSize 100\n * @minLength 1\n * @maxLength 36\n */\n catalogAppIds?: string[];\n}\n\nexport interface AlgorithmConfig {\n /**\n * Algorithm name. This value is not translatable.\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 500\n */\n description?: string;\n /**\n * 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.\n * @minLength 1\n * @maxLength 300\n */\n additionalInfo?: string | null;\n /**\n * Algorithms may have the following types:\n * * `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.\n * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.\n */\n algorithmType?: AlgorithmTypeWithLiterals;\n /**\n * 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.\n * @format GUID\n */\n algorithmId?: string;\n}\n\nexport enum AlgorithmType {\n UNSPECIFIED = 'UNSPECIFIED',\n RELATED_ITEMS = 'RELATED_ITEMS',\n GLOBAL = 'GLOBAL',\n}\n\n/** @enumType */\nexport type AlgorithmTypeWithLiterals =\n | AlgorithmType\n | 'UNSPECIFIED'\n | 'RELATED_ITEMS'\n | 'GLOBAL';\n\nexport interface GetRecommendationRequest {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @minSize 1\n * @maxSize 10\n */\n algorithms: Algorithm[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n\nexport interface GetRecommendationResponse {\n /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */\n recommendation?: Recommendation;\n}\n\nexport interface ItemAppIdNotSupportedByProvider {\n /**\n * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.\n * @minSize 1\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * Algorithms that don't support the requested items.\n * @minSize 1\n * @maxSize 10\n */\n algorithms?: Algorithm[];\n}\n\nexport interface RecommendationAlgorithmNotSupported {\n /**\n * Algorithms not supported by the provider.\n * @minSize 1\n * @maxSize 10\n */\n unsupportedAlgorithms?: Algorithm[];\n}\n\n/** @docsIgnore */\nexport type GetRecommendationApplicationErrors =\n | {\n code?: 'ITEM_APP_ID_NOT_SUPPORTED';\n description?: string;\n data?: ItemAppIdNotSupportedByProvider;\n }\n | {\n code?: 'ALGORITHM_NOT_SUPPORTED';\n description?: string;\n data?: RecommendationAlgorithmNotSupported;\n }\n | {\n code?: 'RECOMMENDATIONS_PROVIDER_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n * @public\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms\n */\nexport async function listAvailableAlgorithms(): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @public\n * @requiredField algorithms\n * @requiredField algorithms._id\n * @requiredField algorithms.appId\n * @requiredField options.items.appId\n * @requiredField options.items.catalogItemId\n * @param options - Get recommendation options.\n * @permissionId RECOMMENDATIONS.READ\n * @applicableIdentity APP\n * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation\n */\nexport async function getRecommendation(\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n algorithms: algorithms,\n items: options?.items,\n minimumRecommendedItems: options?.minimumRecommendedItems,\n });\n\n const reqOpts =\n ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n algorithms: '$[0]',\n items: '$[1].items',\n minimumRecommendedItems: '$[1].minimumRecommendedItems',\n },\n singleArgumentUnchanged: false,\n },\n ['algorithms', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRecommendationOptions {\n /**\n * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.\n * @maxSize 300\n */\n items?: CatalogReference[];\n /**\n * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.\n *\n * Max: `100`\n * @max 100\n */\n minimumRecommendedItems?: number;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n {\n srcPath: '/ecom/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n _: [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/v1/recommendations',\n destPath: '/v1/recommendations',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';\n\n/**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\nexport function listAvailableAlgorithms(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAvailableAlgorithms({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'GET' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/algorithms',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listAvailableAlgorithms;\n}\n\n/**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n */\nexport function getRecommendation(payload: object): RequestOptionsFactory<any> {\n function __getRecommendation({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ecom.recommendations.v1.recommendation',\n method: 'POST' as any,\n methodFqn:\n 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({\n protoPath: '/v1/recommendations/get',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __getRecommendation;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Algorithm,\n GetRecommendationApplicationErrors,\n GetRecommendationOptions,\n GetRecommendationResponse,\n ListAvailableAlgorithmsResponse,\n getRecommendation as universalGetRecommendation,\n listAvailableAlgorithms as universalListAvailableAlgorithms,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function listAvailableAlgorithms(\n httpClient: HttpClient\n): ListAvailableAlgorithmsSignature {\n return () =>\n universalListAvailableAlgorithms(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAvailableAlgorithmsSignature {\n /**\n * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.\n *\n * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.\n *\n * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.\n *\n *\n * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:\n * 1. The algorithm’s `appId` must match the ID of an installed Wix app.\n * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.\n *\n * Wix app IDs are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix).\n */\n (): Promise<\n NonNullablePaths<\n ListAvailableAlgorithmsResponse,\n | `availableAlgorithms`\n | `availableAlgorithms.${number}.config.name`\n | `availableAlgorithms.${number}.config.description`\n | `availableAlgorithms.${number}.config.algorithmType`\n | `availableAlgorithms.${number}.config.algorithmId`\n | `availableAlgorithms.${number}.appId`,\n 5\n >\n >;\n}\n\nexport function getRecommendation(\n httpClient: HttpClient\n): GetRecommendationSignature {\n return (\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n ) =>\n universalGetRecommendation(\n algorithms,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRecommendationSignature {\n /**\n * Returns a recommendation object containing a list of items to recommend to the customer.\n *\n * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.\n *\n * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.\n *\n * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.\n * For example, Wix Stores provides algorithms that can only be used on its own catalogs.\n * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.\n * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).\n *\n * `getRecommendation()` operates as follows:\n * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.\n * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.\n * 3. The app runs the algorithms.\n * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.\n * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.\n * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.\n * @param - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.\n * See the method description for more information.\n *\n * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.\n * @param - Get recommendation options.\n */\n (\n algorithms: NonNullablePaths<Algorithm, `_id` | `appId`, 2>[],\n options?: NonNullablePaths<\n GetRecommendationOptions,\n `items.${number}.appId` | `items.${number}.catalogItemId`,\n 4\n >\n ): Promise<\n NonNullablePaths<\n GetRecommendationResponse,\n | `recommendation.items`\n | `recommendation.items.${number}.catalogItemId`\n | `recommendation.items.${number}.appId`\n | `recommendation.algorithm._id`\n | `recommendation.algorithm.appId`,\n 5\n > & {\n __applicationErrorsType?: GetRecommendationApplicationErrors;\n }\n >;\n}\n\nexport {\n Algorithm,\n AlgorithmConfig,\n AlgorithmInfo,\n AlgorithmType,\n CatalogReference,\n GetRecommendationOptions,\n GetRecommendationRequest,\n GetRecommendationResponse,\n ItemAppIdNotSupportedByProvider,\n ListAvailableAlgorithmsRequest,\n ListAvailableAlgorithmsResponse,\n Recommendation,\n RecommendationAlgorithmNotSupported,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n","import {\n listAvailableAlgorithms as publicListAvailableAlgorithms,\n getRecommendation as publicGetRecommendation,\n} from './ecom-recommendations-v1-recommendation-recommendations.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listAvailableAlgorithms: MaybeContext<\n BuildRESTFunction<typeof publicListAvailableAlgorithms> &\n typeof publicListAvailableAlgorithms\n> = /*#__PURE__*/ createRESTModule(publicListAvailableAlgorithms);\nexport const getRecommendation: MaybeContext<\n BuildRESTFunction<typeof publicGetRecommendation> &\n typeof publicGetRecommendation\n> = /*#__PURE__*/ createRESTModule(publicGetRecommendation);\n\nexport { AlgorithmType } from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\nexport {\n Recommendation,\n CatalogReference,\n Algorithm,\n ListAvailableAlgorithmsRequest,\n ListAvailableAlgorithmsResponse,\n AlgorithmInfo,\n AlgorithmConfig,\n GetRecommendationRequest,\n GetRecommendationResponse,\n ItemAppIdNotSupportedByProvider,\n RecommendationAlgorithmNotSupported,\n GetRecommendationOptions,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\nexport {\n AlgorithmTypeWithLiterals,\n GetRecommendationApplicationErrors,\n} from './ecom-recommendations-v1-recommendation-recommendations.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;A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;AEvWO,SAASC,yBACd,YACkC;AAClC,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AA+BO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CACL,YACA,YAMAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACjEA,SAAS,wBAAwB;AAG1B,IAAMC,2BAGK,iCAAiBA,wBAA6B;AACzD,IAAMC,qBAGK,iCAAiBA,kBAAuB;","names":["AlgorithmType","listAvailableAlgorithms","getRecommendation","listAvailableAlgorithms","getRecommendation","listAvailableAlgorithms","getRecommendation"]}
@@ -30,9 +30,12 @@ interface CatalogReference {
30
30
  */
31
31
  appId?: string;
32
32
  /**
33
- * 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.
33
+ * Additional item details in `key:value` pairs.
34
34
  *
35
- * 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).
35
+ * 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.
36
+ *
37
+ * 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)
38
+ * 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).
36
39
  */
37
40
  options?: Record<string, any> | null;
38
41
  }