@algolia/recommend 5.2.4 → 5.3.0

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.
Files changed (219) hide show
  1. package/dist/browser.d.ts +1414 -0
  2. package/dist/builds/browser.js +408 -0
  3. package/dist/builds/browser.js.map +1 -0
  4. package/dist/builds/browser.min.js +2 -0
  5. package/dist/builds/browser.min.js.map +1 -0
  6. package/dist/builds/browser.umd.js +12 -0
  7. package/dist/builds/node.cjs +426 -0
  8. package/dist/builds/node.cjs.map +1 -0
  9. package/dist/builds/node.js +406 -0
  10. package/dist/builds/node.js.map +1 -0
  11. package/dist/node.d.cts +1414 -0
  12. package/dist/node.d.ts +1414 -0
  13. package/dist/src/recommendClient.cjs +395 -0
  14. package/dist/src/recommendClient.cjs.map +1 -0
  15. package/dist/src/recommendClient.js +369 -0
  16. package/dist/src/recommendClient.js.map +1 -0
  17. package/index.d.ts +1 -1
  18. package/index.js +1 -1
  19. package/package.json +28 -25
  20. package/dist/builds/browser.d.ts +0 -24
  21. package/dist/builds/browser.d.ts.map +0 -1
  22. package/dist/builds/node.d.ts +0 -24
  23. package/dist/builds/node.d.ts.map +0 -1
  24. package/dist/model/advancedSyntaxFeatures.d.ts +0 -2
  25. package/dist/model/advancedSyntaxFeatures.d.ts.map +0 -1
  26. package/dist/model/alternativesAsExact.d.ts +0 -2
  27. package/dist/model/alternativesAsExact.d.ts.map +0 -1
  28. package/dist/model/aroundPrecision.d.ts +0 -6
  29. package/dist/model/aroundPrecision.d.ts.map +0 -1
  30. package/dist/model/aroundRadius.d.ts +0 -6
  31. package/dist/model/aroundRadius.d.ts.map +0 -1
  32. package/dist/model/aroundRadiusAll.d.ts +0 -5
  33. package/dist/model/aroundRadiusAll.d.ts.map +0 -1
  34. package/dist/model/autoFacetFilter.d.ts +0 -14
  35. package/dist/model/autoFacetFilter.d.ts.map +0 -1
  36. package/dist/model/baseRecommendRequest.d.ts +0 -17
  37. package/dist/model/baseRecommendRequest.d.ts.map +0 -1
  38. package/dist/model/baseSearchParams.d.ts +0 -4
  39. package/dist/model/baseSearchParams.d.ts.map +0 -1
  40. package/dist/model/baseSearchParamsWithoutQuery.d.ts +0 -116
  41. package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +0 -1
  42. package/dist/model/baseSearchResponse.d.ts +0 -94
  43. package/dist/model/baseSearchResponse.d.ts.map +0 -1
  44. package/dist/model/booleanString.d.ts +0 -2
  45. package/dist/model/booleanString.d.ts.map +0 -1
  46. package/dist/model/boughtTogetherQuery.d.ts +0 -4
  47. package/dist/model/boughtTogetherQuery.d.ts.map +0 -1
  48. package/dist/model/clientMethodProps.d.ts +0 -135
  49. package/dist/model/clientMethodProps.d.ts.map +0 -1
  50. package/dist/model/condition.d.ts +0 -14
  51. package/dist/model/condition.d.ts.map +0 -1
  52. package/dist/model/consequence.d.ts +0 -18
  53. package/dist/model/consequence.d.ts.map +0 -1
  54. package/dist/model/deletedAtResponse.d.ts +0 -14
  55. package/dist/model/deletedAtResponse.d.ts.map +0 -1
  56. package/dist/model/distinct.d.ts +0 -5
  57. package/dist/model/distinct.d.ts.map +0 -1
  58. package/dist/model/errorBase.d.ts +0 -7
  59. package/dist/model/errorBase.d.ts.map +0 -1
  60. package/dist/model/exactOnSingleWordQuery.d.ts +0 -5
  61. package/dist/model/exactOnSingleWordQuery.d.ts.map +0 -1
  62. package/dist/model/exhaustive.d.ts +0 -26
  63. package/dist/model/exhaustive.d.ts.map +0 -1
  64. package/dist/model/facetFilters.d.ts +0 -5
  65. package/dist/model/facetFilters.d.ts.map +0 -1
  66. package/dist/model/facetOrdering.d.ts +0 -13
  67. package/dist/model/facetOrdering.d.ts.map +0 -1
  68. package/dist/model/facetStats.d.ts +0 -19
  69. package/dist/model/facetStats.d.ts.map +0 -1
  70. package/dist/model/facets.d.ts +0 -10
  71. package/dist/model/facets.d.ts.map +0 -1
  72. package/dist/model/fallbackParams.d.ts +0 -3
  73. package/dist/model/fallbackParams.d.ts.map +0 -1
  74. package/dist/model/fbtModel.d.ts +0 -5
  75. package/dist/model/fbtModel.d.ts.map +0 -1
  76. package/dist/model/frequentlyBoughtTogether.d.ts +0 -9
  77. package/dist/model/frequentlyBoughtTogether.d.ts.map +0 -1
  78. package/dist/model/getRecommendTaskResponse.d.ts +0 -5
  79. package/dist/model/getRecommendTaskResponse.d.ts.map +0 -1
  80. package/dist/model/getRecommendationsParams.d.ts +0 -11
  81. package/dist/model/getRecommendationsParams.d.ts.map +0 -1
  82. package/dist/model/getRecommendationsResponse.d.ts +0 -5
  83. package/dist/model/getRecommendationsResponse.d.ts.map +0 -1
  84. package/dist/model/hideConsequenceObject.d.ts +0 -10
  85. package/dist/model/hideConsequenceObject.d.ts.map +0 -1
  86. package/dist/model/highlightResult.d.ts +0 -5
  87. package/dist/model/highlightResult.d.ts.map +0 -1
  88. package/dist/model/highlightResultOption.d.ts +0 -20
  89. package/dist/model/highlightResultOption.d.ts.map +0 -1
  90. package/dist/model/ignorePlurals.d.ts +0 -7
  91. package/dist/model/ignorePlurals.d.ts.map +0 -1
  92. package/dist/model/index.d.ts +0 -95
  93. package/dist/model/index.d.ts.map +0 -1
  94. package/dist/model/indexSettingsAsSearchParams.d.ts +0 -160
  95. package/dist/model/indexSettingsAsSearchParams.d.ts.map +0 -1
  96. package/dist/model/lookingSimilar.d.ts +0 -11
  97. package/dist/model/lookingSimilar.d.ts.map +0 -1
  98. package/dist/model/lookingSimilarModel.d.ts +0 -5
  99. package/dist/model/lookingSimilarModel.d.ts.map +0 -1
  100. package/dist/model/lookingSimilarQuery.d.ts +0 -4
  101. package/dist/model/lookingSimilarQuery.d.ts.map +0 -1
  102. package/dist/model/matchLevel.d.ts +0 -5
  103. package/dist/model/matchLevel.d.ts.map +0 -1
  104. package/dist/model/matchedGeoLocation.d.ts +0 -15
  105. package/dist/model/matchedGeoLocation.d.ts.map +0 -1
  106. package/dist/model/mode.d.ts +0 -5
  107. package/dist/model/mode.d.ts.map +0 -1
  108. package/dist/model/numericFilters.d.ts +0 -5
  109. package/dist/model/numericFilters.d.ts.map +0 -1
  110. package/dist/model/optionalFilters.d.ts +0 -5
  111. package/dist/model/optionalFilters.d.ts.map +0 -1
  112. package/dist/model/paramsConsequence.d.ts +0 -19
  113. package/dist/model/paramsConsequence.d.ts.map +0 -1
  114. package/dist/model/personalization.d.ts +0 -15
  115. package/dist/model/personalization.d.ts.map +0 -1
  116. package/dist/model/promoteConsequenceObject.d.ts +0 -14
  117. package/dist/model/promoteConsequenceObject.d.ts.map +0 -1
  118. package/dist/model/queryType.d.ts +0 -5
  119. package/dist/model/queryType.d.ts.map +0 -1
  120. package/dist/model/range.d.ts +0 -14
  121. package/dist/model/range.d.ts.map +0 -1
  122. package/dist/model/rankingInfo.d.ts +0 -54
  123. package/dist/model/rankingInfo.d.ts.map +0 -1
  124. package/dist/model/reRankingApplyFilter.d.ts +0 -5
  125. package/dist/model/reRankingApplyFilter.d.ts.map +0 -1
  126. package/dist/model/recommendHit.d.ts +0 -27
  127. package/dist/model/recommendHit.d.ts.map +0 -1
  128. package/dist/model/recommendModels.d.ts +0 -2
  129. package/dist/model/recommendModels.d.ts.map +0 -1
  130. package/dist/model/recommendRule.d.ts +0 -24
  131. package/dist/model/recommendRule.d.ts.map +0 -1
  132. package/dist/model/recommendationsHit.d.ts +0 -4
  133. package/dist/model/recommendationsHit.d.ts.map +0 -1
  134. package/dist/model/recommendationsHits.d.ts +0 -5
  135. package/dist/model/recommendationsHits.d.ts.map +0 -1
  136. package/dist/model/recommendationsRequest.d.ts +0 -8
  137. package/dist/model/recommendationsRequest.d.ts.map +0 -1
  138. package/dist/model/recommendationsResults.d.ts +0 -5
  139. package/dist/model/recommendationsResults.d.ts.map +0 -1
  140. package/dist/model/recommendedForYou.d.ts +0 -7
  141. package/dist/model/recommendedForYou.d.ts.map +0 -1
  142. package/dist/model/recommendedForYouModel.d.ts +0 -5
  143. package/dist/model/recommendedForYouModel.d.ts.map +0 -1
  144. package/dist/model/recommendedForYouQuery.d.ts +0 -4
  145. package/dist/model/recommendedForYouQuery.d.ts.map +0 -1
  146. package/dist/model/redirect.d.ts +0 -8
  147. package/dist/model/redirect.d.ts.map +0 -1
  148. package/dist/model/redirectRuleIndexData.d.ts +0 -7
  149. package/dist/model/redirectRuleIndexData.d.ts.map +0 -1
  150. package/dist/model/redirectRuleIndexMetadata.d.ts +0 -21
  151. package/dist/model/redirectRuleIndexMetadata.d.ts.map +0 -1
  152. package/dist/model/redirectURL.d.ts +0 -7
  153. package/dist/model/redirectURL.d.ts.map +0 -1
  154. package/dist/model/relatedModel.d.ts +0 -5
  155. package/dist/model/relatedModel.d.ts.map +0 -1
  156. package/dist/model/relatedProducts.d.ts +0 -11
  157. package/dist/model/relatedProducts.d.ts.map +0 -1
  158. package/dist/model/relatedQuery.d.ts +0 -4
  159. package/dist/model/relatedQuery.d.ts.map +0 -1
  160. package/dist/model/removeStopWords.d.ts +0 -6
  161. package/dist/model/removeStopWords.d.ts.map +0 -1
  162. package/dist/model/removeWordsIfNoResults.d.ts +0 -5
  163. package/dist/model/removeWordsIfNoResults.d.ts.map +0 -1
  164. package/dist/model/renderingContent.d.ts +0 -10
  165. package/dist/model/renderingContent.d.ts.map +0 -1
  166. package/dist/model/ruleMetadata.d.ts +0 -10
  167. package/dist/model/ruleMetadata.d.ts.map +0 -1
  168. package/dist/model/searchPagination.d.ts +0 -19
  169. package/dist/model/searchPagination.d.ts.map +0 -1
  170. package/dist/model/searchParams.d.ts +0 -3
  171. package/dist/model/searchParams.d.ts.map +0 -1
  172. package/dist/model/searchParamsObject.d.ts +0 -7
  173. package/dist/model/searchParamsObject.d.ts.map +0 -1
  174. package/dist/model/searchParamsQuery.d.ts +0 -7
  175. package/dist/model/searchParamsQuery.d.ts.map +0 -1
  176. package/dist/model/searchRecommendRulesParams.d.ts +0 -38
  177. package/dist/model/searchRecommendRulesParams.d.ts.map +0 -1
  178. package/dist/model/searchRecommendRulesResponse.d.ts +0 -20
  179. package/dist/model/searchRecommendRulesResponse.d.ts.map +0 -1
  180. package/dist/model/semanticSearch.d.ts +0 -10
  181. package/dist/model/semanticSearch.d.ts.map +0 -1
  182. package/dist/model/snippetResult.d.ts +0 -5
  183. package/dist/model/snippetResult.d.ts.map +0 -1
  184. package/dist/model/snippetResultOption.d.ts +0 -12
  185. package/dist/model/snippetResultOption.d.ts.map +0 -1
  186. package/dist/model/sortRemainingBy.d.ts +0 -5
  187. package/dist/model/sortRemainingBy.d.ts.map +0 -1
  188. package/dist/model/supportedLanguage.d.ts +0 -5
  189. package/dist/model/supportedLanguage.d.ts.map +0 -1
  190. package/dist/model/tagFilters.d.ts +0 -5
  191. package/dist/model/tagFilters.d.ts.map +0 -1
  192. package/dist/model/taskStatus.d.ts +0 -5
  193. package/dist/model/taskStatus.d.ts.map +0 -1
  194. package/dist/model/trendingFacetHit.d.ts +0 -18
  195. package/dist/model/trendingFacetHit.d.ts.map +0 -1
  196. package/dist/model/trendingFacets.d.ts +0 -11
  197. package/dist/model/trendingFacets.d.ts.map +0 -1
  198. package/dist/model/trendingFacetsModel.d.ts +0 -5
  199. package/dist/model/trendingFacetsModel.d.ts.map +0 -1
  200. package/dist/model/trendingFacetsQuery.d.ts +0 -4
  201. package/dist/model/trendingFacetsQuery.d.ts.map +0 -1
  202. package/dist/model/trendingItems.d.ts +0 -15
  203. package/dist/model/trendingItems.d.ts.map +0 -1
  204. package/dist/model/trendingItemsModel.d.ts +0 -5
  205. package/dist/model/trendingItemsModel.d.ts.map +0 -1
  206. package/dist/model/trendingItemsQuery.d.ts +0 -4
  207. package/dist/model/trendingItemsQuery.d.ts.map +0 -1
  208. package/dist/model/typoTolerance.d.ts +0 -6
  209. package/dist/model/typoTolerance.d.ts.map +0 -1
  210. package/dist/model/typoToleranceEnum.d.ts +0 -5
  211. package/dist/model/typoToleranceEnum.d.ts.map +0 -1
  212. package/dist/model/value.d.ts +0 -13
  213. package/dist/model/value.d.ts.map +0 -1
  214. package/dist/recommend.cjs +0 -394
  215. package/dist/recommend.esm.browser.js +0 -1079
  216. package/dist/recommend.esm.node.js +0 -391
  217. package/dist/recommend.umd.js +0 -2
  218. package/dist/src/recommendClient.d.ts +0 -132
  219. package/dist/src/recommendClient.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../builds/node.ts","../../src/recommendClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createNullCache,\n DEFAULT_CONNECT_TIMEOUT_NODE,\n DEFAULT_READ_TIMEOUT_NODE,\n DEFAULT_WRITE_TIMEOUT_NODE,\n} from '@algolia/client-common';\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createRecommendClient } from '../src/recommendClient';\n\nexport type RecommendClient = ReturnType<typeof createRecommendClient>;\n\nexport { apiClientVersion } from '../src/recommendClient';\nexport * from '../model';\n\nexport function recommendClient(appId: string, apiKey: string, options?: ClientOptions): RecommendClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createRecommendClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n read: DEFAULT_READ_TIMEOUT_NODE,\n write: DEFAULT_WRITE_TIMEOUT_NODE,\n },\n requester: createHttpRequester(),\n algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteRecommendRuleProps,\n GetRecommendRuleProps,\n GetRecommendStatusProps,\n LegacyGetRecommendationsParams,\n SearchRecommendRulesProps,\n} from '../model/clientMethodProps';\nimport type { DeletedAtResponse } from '../model/deletedAtResponse';\nimport type { GetRecommendTaskResponse } from '../model/getRecommendTaskResponse';\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { RecommendRule } from '../model/recommendRule';\nimport type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';\n\nexport const apiClientVersion = '5.3.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createRecommendClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n\n return {\n transporter: createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Recommend',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n }),\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(\n () => undefined,\n );\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return this.transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n this.transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n this.transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a Recommend rule from a recommendation scenario.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteRecommendRule - The deleteRecommendRule object.\n * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param deleteRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteRecommendRule(\n { indexName, model, objectID }: DeleteRecommendRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<DeletedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a Recommend rule that you previously created in the Algolia dashboard.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getRecommendRule - The getRecommendRule object.\n * @param getRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendRule(\n { indexName, model, objectID }: GetRecommendRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<RecommendRule> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param getRecommendStatus - The getRecommendStatus object.\n * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.\n * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendStatus.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendStatus(\n { indexName, model, taskID }: GetRecommendStatusProps,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendTaskResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n // eslint-disable-next-line no-param-reassign\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchRecommendRules - The searchRecommendRules object.\n * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.\n * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchRecommendRules(\n { indexName, model, searchRecommendRulesParams }: SearchRecommendRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchRecommendRulesResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchRecommendRulesParams ? searchRecommendRulesParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,IAAAA,wBAMO;AACP,iCAAoC;;;ACRpC,2BAAwE;AA4BjE,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF,EACA;AAAA,QACA,8BAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAGO,SAAS,sBAAsB;AAAA,EACpC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAE3D,S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CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,GAAG,sBAAsB;AAAA,MACvB;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,eAAW,gDAAoB;AAAA,MAC/B,eAAe,CAAC,EAAE,SAAS,WAAW,SAAS,QAAQ,SAAS,KAAK,CAAC;AAAA,MACtE,oBAAgB,uCAAgB;AAAA,MAChC,mBAAe,uCAAgB;AAAA,MAC/B,gBAAY,yCAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":["import_client_common"]}
@@ -0,0 +1,406 @@
1
+ // builds/node.ts
2
+ import {
3
+ createMemoryCache,
4
+ createNullCache,
5
+ DEFAULT_CONNECT_TIMEOUT_NODE,
6
+ DEFAULT_READ_TIMEOUT_NODE,
7
+ DEFAULT_WRITE_TIMEOUT_NODE
8
+ } from "@algolia/client-common";
9
+ import { createHttpRequester } from "@algolia/requester-node-http";
10
+
11
+ // src/recommendClient.ts
12
+ import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
13
+ var apiClientVersion = "5.3.0";
14
+ function getDefaultHosts(appId) {
15
+ return [
16
+ {
17
+ url: `${appId}-dsn.algolia.net`,
18
+ accept: "read",
19
+ protocol: "https"
20
+ },
21
+ {
22
+ url: `${appId}.algolia.net`,
23
+ accept: "write",
24
+ protocol: "https"
25
+ }
26
+ ].concat(
27
+ shuffle([
28
+ {
29
+ url: `${appId}-1.algolianet.com`,
30
+ accept: "readWrite",
31
+ protocol: "https"
32
+ },
33
+ {
34
+ url: `${appId}-2.algolianet.com`,
35
+ accept: "readWrite",
36
+ protocol: "https"
37
+ },
38
+ {
39
+ url: `${appId}-3.algolianet.com`,
40
+ accept: "readWrite",
41
+ protocol: "https"
42
+ }
43
+ ])
44
+ );
45
+ }
46
+ function createRecommendClient({
47
+ appId: appIdOption,
48
+ apiKey: apiKeyOption,
49
+ authMode,
50
+ algoliaAgents,
51
+ ...options
52
+ }) {
53
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
54
+ return {
55
+ transporter: createTransporter({
56
+ hosts: getDefaultHosts(appIdOption),
57
+ ...options,
58
+ algoliaAgent: getAlgoliaAgent({
59
+ algoliaAgents,
60
+ client: "Recommend",
61
+ version: apiClientVersion
62
+ }),
63
+ baseHeaders: {
64
+ "content-type": "text/plain",
65
+ ...auth.headers(),
66
+ ...options.baseHeaders
67
+ },
68
+ baseQueryParameters: {
69
+ ...auth.queryParameters(),
70
+ ...options.baseQueryParameters
71
+ }
72
+ }),
73
+ /**
74
+ * The `appId` currently in use.
75
+ */
76
+ appId: appIdOption,
77
+ /**
78
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
79
+ */
80
+ clearCache() {
81
+ return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
82
+ () => void 0
83
+ );
84
+ },
85
+ /**
86
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
87
+ */
88
+ get _ua() {
89
+ return this.transporter.algoliaAgent.value;
90
+ },
91
+ /**
92
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
93
+ *
94
+ * @param segment - The algolia agent (user-agent) segment to add.
95
+ * @param version - The version of the agent.
96
+ */
97
+ addAlgoliaAgent(segment, version) {
98
+ this.transporter.algoliaAgent.add({ segment, version });
99
+ },
100
+ /**
101
+ * Helper method to switch the API key used to authenticate the requests.
102
+ *
103
+ * @param params - Method params.
104
+ * @param params.apiKey - The new API Key to use.
105
+ */
106
+ setClientApiKey({ apiKey }) {
107
+ this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
108
+ },
109
+ /**
110
+ * This method allow you to send requests to the Algolia REST API.
111
+ *
112
+ * @param customDelete - The customDelete object.
113
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
114
+ * @param customDelete.parameters - Query parameters to apply to the current query.
115
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
116
+ */
117
+ customDelete({ path, parameters }, requestOptions) {
118
+ if (!path) {
119
+ throw new Error("Parameter `path` is required when calling `customDelete`.");
120
+ }
121
+ const requestPath = "/{path}".replace("{path}", path);
122
+ const headers = {};
123
+ const queryParameters = parameters ? parameters : {};
124
+ const request = {
125
+ method: "DELETE",
126
+ path: requestPath,
127
+ queryParameters,
128
+ headers
129
+ };
130
+ return this.transporter.request(request, requestOptions);
131
+ },
132
+ /**
133
+ * This method allow you to send requests to the Algolia REST API.
134
+ *
135
+ * @param customGet - The customGet object.
136
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
137
+ * @param customGet.parameters - Query parameters to apply to the current query.
138
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
139
+ */
140
+ customGet({ path, parameters }, requestOptions) {
141
+ if (!path) {
142
+ throw new Error("Parameter `path` is required when calling `customGet`.");
143
+ }
144
+ const requestPath = "/{path}".replace("{path}", path);
145
+ const headers = {};
146
+ const queryParameters = parameters ? parameters : {};
147
+ const request = {
148
+ method: "GET",
149
+ path: requestPath,
150
+ queryParameters,
151
+ headers
152
+ };
153
+ return this.transporter.request(request, requestOptions);
154
+ },
155
+ /**
156
+ * This method allow you to send requests to the Algolia REST API.
157
+ *
158
+ * @param customPost - The customPost object.
159
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
160
+ * @param customPost.parameters - Query parameters to apply to the current query.
161
+ * @param customPost.body - Parameters to send with the custom request.
162
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
163
+ */
164
+ customPost({ path, parameters, body }, requestOptions) {
165
+ if (!path) {
166
+ throw new Error("Parameter `path` is required when calling `customPost`.");
167
+ }
168
+ const requestPath = "/{path}".replace("{path}", path);
169
+ const headers = {};
170
+ const queryParameters = parameters ? parameters : {};
171
+ const request = {
172
+ method: "POST",
173
+ path: requestPath,
174
+ queryParameters,
175
+ headers,
176
+ data: body ? body : {}
177
+ };
178
+ return this.transporter.request(request, requestOptions);
179
+ },
180
+ /**
181
+ * This method allow you to send requests to the Algolia REST API.
182
+ *
183
+ * @param customPut - The customPut object.
184
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
185
+ * @param customPut.parameters - Query parameters to apply to the current query.
186
+ * @param customPut.body - Parameters to send with the custom request.
187
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
188
+ */
189
+ customPut({ path, parameters, body }, requestOptions) {
190
+ if (!path) {
191
+ throw new Error("Parameter `path` is required when calling `customPut`.");
192
+ }
193
+ const requestPath = "/{path}".replace("{path}", path);
194
+ const headers = {};
195
+ const queryParameters = parameters ? parameters : {};
196
+ const request = {
197
+ method: "PUT",
198
+ path: requestPath,
199
+ queryParameters,
200
+ headers,
201
+ data: body ? body : {}
202
+ };
203
+ return this.transporter.request(request, requestOptions);
204
+ },
205
+ /**
206
+ * Deletes a Recommend rule from a recommendation scenario.
207
+ *
208
+ * Required API Key ACLs:
209
+ * - editSettings.
210
+ *
211
+ * @param deleteRecommendRule - The deleteRecommendRule object.
212
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
213
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
214
+ * @param deleteRecommendRule.objectID - Unique record identifier.
215
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
216
+ */
217
+ deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
218
+ if (!indexName) {
219
+ throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");
220
+ }
221
+ if (!model) {
222
+ throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");
223
+ }
224
+ if (!objectID) {
225
+ throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");
226
+ }
227
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{objectID}", encodeURIComponent(objectID));
228
+ const headers = {};
229
+ const queryParameters = {};
230
+ const request = {
231
+ method: "DELETE",
232
+ path: requestPath,
233
+ queryParameters,
234
+ headers
235
+ };
236
+ return this.transporter.request(request, requestOptions);
237
+ },
238
+ /**
239
+ * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
240
+ *
241
+ * Required API Key ACLs:
242
+ * - settings.
243
+ *
244
+ * @param getRecommendRule - The getRecommendRule object.
245
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
246
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
247
+ * @param getRecommendRule.objectID - Unique record identifier.
248
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
249
+ */
250
+ getRecommendRule({ indexName, model, objectID }, requestOptions) {
251
+ if (!indexName) {
252
+ throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");
253
+ }
254
+ if (!model) {
255
+ throw new Error("Parameter `model` is required when calling `getRecommendRule`.");
256
+ }
257
+ if (!objectID) {
258
+ throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");
259
+ }
260
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{objectID}", encodeURIComponent(objectID));
261
+ const headers = {};
262
+ const queryParameters = {};
263
+ const request = {
264
+ method: "GET",
265
+ path: requestPath,
266
+ queryParameters,
267
+ headers
268
+ };
269
+ return this.transporter.request(request, requestOptions);
270
+ },
271
+ /**
272
+ * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
273
+ *
274
+ * Required API Key ACLs:
275
+ * - editSettings.
276
+ *
277
+ * @param getRecommendStatus - The getRecommendStatus object.
278
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
279
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
280
+ * @param getRecommendStatus.taskID - Unique task identifier.
281
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
282
+ */
283
+ getRecommendStatus({ indexName, model, taskID }, requestOptions) {
284
+ if (!indexName) {
285
+ throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");
286
+ }
287
+ if (!model) {
288
+ throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");
289
+ }
290
+ if (!taskID) {
291
+ throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");
292
+ }
293
+ const requestPath = "/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{taskID}", encodeURIComponent(taskID));
294
+ const headers = {};
295
+ const queryParameters = {};
296
+ const request = {
297
+ method: "GET",
298
+ path: requestPath,
299
+ queryParameters,
300
+ headers
301
+ };
302
+ return this.transporter.request(request, requestOptions);
303
+ },
304
+ /**
305
+ * Retrieves recommendations from selected AI models.
306
+ *
307
+ * Required API Key ACLs:
308
+ * - search.
309
+ *
310
+ * @param getRecommendationsParams - The getRecommendationsParams object.
311
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
312
+ */
313
+ getRecommendations(getRecommendationsParams, requestOptions) {
314
+ if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
315
+ const newSignatureRequest = {
316
+ requests: getRecommendationsParams
317
+ };
318
+ getRecommendationsParams = newSignatureRequest;
319
+ }
320
+ if (!getRecommendationsParams) {
321
+ throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
322
+ }
323
+ if (!getRecommendationsParams.requests) {
324
+ throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
325
+ }
326
+ const requestPath = "/1/indexes/*/recommendations";
327
+ const headers = {};
328
+ const queryParameters = {};
329
+ const request = {
330
+ method: "POST",
331
+ path: requestPath,
332
+ queryParameters,
333
+ headers,
334
+ data: getRecommendationsParams,
335
+ useReadTransporter: true,
336
+ cacheable: true
337
+ };
338
+ return this.transporter.request(request, requestOptions);
339
+ },
340
+ /**
341
+ * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
342
+ *
343
+ * Required API Key ACLs:
344
+ * - settings.
345
+ *
346
+ * @param searchRecommendRules - The searchRecommendRules object.
347
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
348
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
349
+ * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
350
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
351
+ */
352
+ searchRecommendRules({ indexName, model, searchRecommendRulesParams }, requestOptions) {
353
+ if (!indexName) {
354
+ throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");
355
+ }
356
+ if (!model) {
357
+ throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");
358
+ }
359
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model));
360
+ const headers = {};
361
+ const queryParameters = {};
362
+ const request = {
363
+ method: "POST",
364
+ path: requestPath,
365
+ queryParameters,
366
+ headers,
367
+ data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
368
+ useReadTransporter: true,
369
+ cacheable: true
370
+ };
371
+ return this.transporter.request(request, requestOptions);
372
+ }
373
+ };
374
+ }
375
+
376
+ // builds/node.ts
377
+ function recommendClient(appId, apiKey, options) {
378
+ if (!appId || typeof appId !== "string") {
379
+ throw new Error("`appId` is missing.");
380
+ }
381
+ if (!apiKey || typeof apiKey !== "string") {
382
+ throw new Error("`apiKey` is missing.");
383
+ }
384
+ return {
385
+ ...createRecommendClient({
386
+ appId,
387
+ apiKey,
388
+ timeouts: {
389
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
390
+ read: DEFAULT_READ_TIMEOUT_NODE,
391
+ write: DEFAULT_WRITE_TIMEOUT_NODE
392
+ },
393
+ requester: createHttpRequester(),
394
+ algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
395
+ responsesCache: createNullCache(),
396
+ requestsCache: createNullCache(),
397
+ hostsCache: createMemoryCache(),
398
+ ...options
399
+ })
400
+ };
401
+ }
402
+ export {
403
+ apiClientVersion,
404
+ recommendClient
405
+ };
406
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../builds/node.ts","../../src/recommendClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createNullCache,\n DEFAULT_CONNECT_TIMEOUT_NODE,\n DEFAULT_READ_TIMEOUT_NODE,\n DEFAULT_WRITE_TIMEOUT_NODE,\n} from '@algolia/client-common';\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createRecommendClient } from '../src/recommendClient';\n\nexport type RecommendClient = ReturnType<typeof createRecommendClient>;\n\nexport { apiClientVersion } from '../src/recommendClient';\nexport * from '../model';\n\nexport function recommendClient(appId: string, apiKey: string, options?: ClientOptions): RecommendClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createRecommendClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n read: DEFAULT_READ_TIMEOUT_NODE,\n write: DEFAULT_WRITE_TIMEOUT_NODE,\n },\n requester: createHttpRequester(),\n algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteRecommendRuleProps,\n GetRecommendRuleProps,\n GetRecommendStatusProps,\n LegacyGetRecommendationsParams,\n SearchRecommendRulesProps,\n} from '../model/clientMethodProps';\nimport type { DeletedAtResponse } from '../model/deletedAtResponse';\nimport type { GetRecommendTaskResponse } from '../model/getRecommendTaskResponse';\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\nimport type { RecommendRule } from '../model/recommendRule';\nimport type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';\n\nexport const apiClientVersion = '5.3.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createRecommendClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n\n return {\n transporter: createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Recommend',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n }),\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(\n () => undefined,\n );\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return this.transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n this.transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n this.transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a Recommend rule from a recommendation scenario.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteRecommendRule - The deleteRecommendRule object.\n * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param deleteRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteRecommendRule(\n { indexName, model, objectID }: DeleteRecommendRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<DeletedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a Recommend rule that you previously created in the Algolia dashboard.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param getRecommendRule - The getRecommendRule object.\n * @param getRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendRule(\n { indexName, model, objectID }: GetRecommendRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<RecommendRule> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param getRecommendStatus - The getRecommendStatus object.\n * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.\n * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendStatus.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendStatus(\n { indexName, model, taskID }: GetRecommendStatusProps,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendTaskResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search.\n *\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n // eslint-disable-next-line no-param-reassign\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.\n *\n * Required API Key ACLs:\n * - settings.\n *\n * @param searchRecommendRules - The searchRecommendRules object.\n * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.\n * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchRecommendRules(\n { indexName, model, searchRecommendRulesParams }: SearchRecommendRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchRecommendRulesResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchRecommendRulesParams ? searchRecommendRulesParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;;;ACRpC,SAAS,YAAY,mBAAmB,iBAAiB,eAAe;AA4BjE,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF,EACA;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,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