@algolia/advanced-personalization 0.0.1-alpha.16 → 0.0.1-alpha.17

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.
@@ -29,7 +29,7 @@ var import_client_common2 = require("@algolia/client-common");
29
29
 
30
30
  // src/advancedPersonalizationClient.ts
31
31
  var import_client_common = require("@algolia/client-common");
32
- var apiClientVersion = "0.0.1-alpha.16";
32
+ var apiClientVersion = "0.0.1-alpha.17";
33
33
  var REGIONS = ["eu", "us"];
34
34
  function getDefaultHosts(region) {
35
35
  const url = "ai-personalization.{region}.algolia.com".replace("{region}", region);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/node.ts","../../src/advancedPersonalizationClient.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\nexport type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;\n\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createAdvancedPersonalizationClient } from '../src/advancedPersonalizationClient';\n\nimport type { Region } from '../src/advancedPersonalizationClient';\nimport { REGIONS } from '../src/advancedPersonalizationClient';\n\nexport type { Region, RegionOptions } from '../src/advancedPersonalizationClient';\n\nexport { apiClientVersion } from '../src/advancedPersonalizationClient';\n\nexport * from '../model';\n\nexport function advancedPersonalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): AdvancedPersonalizationClient {\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 if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createAdvancedPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\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 type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { AcceptedResponse } from '../model/acceptedResponse';\nimport type { ConfigurationObject } from '../model/configurationObject';\nimport type { ConfigurationParameters } from '../model/configurationParameters';\n\nimport type { DeleteUserResponse } from '../model/deleteUserResponse';\n\nimport type { GetUsersResponse } from '../model/getUsersResponse';\nimport type { PutConfigResponse } from '../model/putConfigResponse';\nimport type { RealtimeUser } from '../model/realtimeUser';\n\nimport type { User } from '../model/user';\n\nimport type {\n ComputeRealtimeUserProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProps,\n GetRealtimeUserProps,\n GetUserProps,\n GetUsersProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '0.0.1-alpha.16';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'ai-personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAdvancedPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AdvancedPersonalization',\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 return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\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 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 | undefined): void {\n 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 if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Sends a request to compute the real-time user\\'s personalization profile.\n *\n * Required API Key ACLs:\n * - recommendation\n *\n * @deprecated\n * @param computeRealtimeUser - The computeRealtimeUser object.\n * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n computeRealtimeUser(\n { userToken }: ComputeRealtimeUserProps,\n requestOptions?: RequestOptions,\n ): Promise<AcceptedResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `computeRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}/compute'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param deleteUser - The deleteUser object.\n * @param deleteUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `deleteUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of configuration objects for each index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject> {\n const requestPath = '/2/config';\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the real-time user\\'s personalization profiles containing search filters.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getRealtimeUser - The getRealtimeUser object.\n * @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUser> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUser - The getUser object.\n * @param getUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUsers - The getUsers object.\n * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.\n * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.\n * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.\n * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.\n * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.\n * @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\\'t be used in the same request as `previousPageToken`.\n * @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\\'t be used in the same request as `nextPageToken`.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsers(\n { startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }: GetUsersProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetUsersResponse> {\n const requestPath = '/2/users';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (indices !== undefined) {\n queryParameters['indices'] = indices.toString();\n }\n\n if (affinity !== undefined) {\n queryParameters['affinity'] = affinity.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (nextPageToken !== undefined) {\n queryParameters['nextPageToken'] = nextPageToken.toString();\n }\n\n if (previousPageToken !== undefined) {\n queryParameters['previousPageToken'] = previousPageToken.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param configurationParameters - The configurationParameters object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putConfig(\n configurationParameters: ConfigurationParameters,\n requestOptions?: RequestOptions,\n ): Promise<PutConfigResponse> {\n if (!configurationParameters) {\n throw new Error('Parameter `configurationParameters` is required when calling `putConfig`.');\n }\n\n if (!configurationParameters.indices) {\n throw new Error('Parameter `configurationParameters.indices` is required when calling `putConfig`.');\n }\n if (!configurationParameters.personalizationReRanking) {\n throw new Error(\n 'Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`.',\n );\n }\n if (!configurationParameters.profileType) {\n throw new Error('Parameter `configurationParameters.profileType` is required when calling `putConfig`.');\n }\n if (!configurationParameters.features) {\n throw new Error('Parameter `configurationParameters.features` is required when calling `putConfig`.');\n }\n\n const requestPath = '/2/config';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationParameters,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,iCAAoC;AAEpC,IAAAA,wBAAqE;;;ACIrE,2BAA+D;AA0BxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,0CAA0C,QAAQ,YAAY,MAAM;AAEhF,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,oCAAoC;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AA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+ {"version":3,"sources":["../../builds/node.ts","../../src/advancedPersonalizationClient.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\nexport type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;\n\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createAdvancedPersonalizationClient } from '../src/advancedPersonalizationClient';\n\nimport type { Region } from '../src/advancedPersonalizationClient';\nimport { REGIONS } from '../src/advancedPersonalizationClient';\n\nexport type { Region, RegionOptions } from '../src/advancedPersonalizationClient';\n\nexport { apiClientVersion } from '../src/advancedPersonalizationClient';\n\nexport * from '../model';\n\nexport function advancedPersonalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): AdvancedPersonalizationClient {\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 if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createAdvancedPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\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 type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { AcceptedResponse } from '../model/acceptedResponse';\nimport type { ConfigurationObject } from '../model/configurationObject';\nimport type { ConfigurationParameters } from '../model/configurationParameters';\n\nimport type { DeleteUserResponse } from '../model/deleteUserResponse';\n\nimport type { GetUsersResponse } from '../model/getUsersResponse';\nimport type { PutConfigResponse } from '../model/putConfigResponse';\nimport type { RealtimeUser } from '../model/realtimeUser';\n\nimport type { User } from '../model/user';\n\nimport type {\n ComputeRealtimeUserProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProps,\n GetRealtimeUserProps,\n GetUserProps,\n GetUsersProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '0.0.1-alpha.17';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'ai-personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAdvancedPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AdvancedPersonalization',\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 return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\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 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 | undefined): void {\n 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 if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Sends a request to compute the real-time user\\'s personalization profile.\n *\n * Required API Key ACLs:\n * - recommendation\n *\n * @deprecated\n * @param computeRealtimeUser - The computeRealtimeUser object.\n * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n computeRealtimeUser(\n { userToken }: ComputeRealtimeUserProps,\n requestOptions?: RequestOptions,\n ): Promise<AcceptedResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `computeRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}/compute'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param deleteUser - The deleteUser object.\n * @param deleteUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `deleteUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of configuration objects for each index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject> {\n const requestPath = '/2/config';\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the real-time user\\'s personalization profiles containing search filters.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getRealtimeUser - The getRealtimeUser object.\n * @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUser> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUser - The getUser object.\n * @param getUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUsers - The getUsers object.\n * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.\n * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.\n * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.\n * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.\n * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.\n * @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\\'t be used in the same request as `previousPageToken`.\n * @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\\'t be used in the same request as `nextPageToken`.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsers(\n { startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }: GetUsersProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetUsersResponse> {\n const requestPath = '/2/users';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (indices !== undefined) {\n queryParameters['indices'] = indices.toString();\n }\n\n if (affinity !== undefined) {\n queryParameters['affinity'] = affinity.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (nextPageToken !== undefined) {\n queryParameters['nextPageToken'] = nextPageToken.toString();\n }\n\n if (previousPageToken !== undefined) {\n queryParameters['previousPageToken'] = previousPageToken.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param configurationParameters - The configurationParameters object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putConfig(\n configurationParameters: ConfigurationParameters,\n requestOptions?: RequestOptions,\n ): Promise<PutConfigResponse> {\n if (!configurationParameters) {\n throw new Error('Parameter `configurationParameters` is required when calling `putConfig`.');\n }\n\n if (!configurationParameters.indices) {\n throw new Error('Parameter `configurationParameters.indices` is required when calling `putConfig`.');\n }\n if (!configurationParameters.personalizationReRanking) {\n throw new Error(\n 'Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`.',\n );\n }\n if (!configurationParameters.profileType) {\n throw new Error('Parameter `configurationParameters.profileType` is required when calling `putConfig`.');\n }\n if (!configurationParameters.features) {\n throw new Error('Parameter `configurationParameters.features` is required when calling `putConfig`.');\n }\n\n const requestPath = '/2/config';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationParameters,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,iCAAoC;AAEpC,IAAAA,wBAAqE;;;ACIrE,2BAA+D;AA0BxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,0CAA0C,QAAQ,YAAY,MAAM;AAEhF,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,oCAAoC;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,kBAAc,wCAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,kBAAc,sCAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,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;AAAA,EACF;AACF;;;AD/dO,SAAS,8BACd,OACA,QACA,QACA,SAC+B;AAC/B,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,MAAI,CAAC,UAAW,WAAW,OAAO,WAAW,YAAY,CAAC,QAAQ,SAAS,MAAM,IAAK;AACpF,UAAM,IAAI,MAAM,4DAA4D,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EAClG;AAEA,SAAO;AAAA,IACL,GAAG,oCAAoC;AAAA,MACrC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,YAAQ,wCAAiB;AAAA,MACzB,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"]}
@@ -4,7 +4,7 @@ import { createMemoryCache, createNullCache, createNullLogger } from "@algolia/c
4
4
 
5
5
  // src/advancedPersonalizationClient.ts
6
6
  import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
7
- var apiClientVersion = "0.0.1-alpha.16";
7
+ var apiClientVersion = "0.0.1-alpha.17";
8
8
  var REGIONS = ["eu", "us"];
9
9
  function getDefaultHosts(region) {
10
10
  const url = "ai-personalization.{region}.algolia.com".replace("{region}", region);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/node.ts","../../src/advancedPersonalizationClient.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\nexport type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;\n\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createAdvancedPersonalizationClient } from '../src/advancedPersonalizationClient';\n\nimport type { Region } from '../src/advancedPersonalizationClient';\nimport { REGIONS } from '../src/advancedPersonalizationClient';\n\nexport type { Region, RegionOptions } from '../src/advancedPersonalizationClient';\n\nexport { apiClientVersion } from '../src/advancedPersonalizationClient';\n\nexport * from '../model';\n\nexport function advancedPersonalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): AdvancedPersonalizationClient {\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 if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createAdvancedPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\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 type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { AcceptedResponse } from '../model/acceptedResponse';\nimport type { ConfigurationObject } from '../model/configurationObject';\nimport type { ConfigurationParameters } from '../model/configurationParameters';\n\nimport type { DeleteUserResponse } from '../model/deleteUserResponse';\n\nimport type { GetUsersResponse } from '../model/getUsersResponse';\nimport type { PutConfigResponse } from '../model/putConfigResponse';\nimport type { RealtimeUser } from '../model/realtimeUser';\n\nimport type { User } from '../model/user';\n\nimport type {\n ComputeRealtimeUserProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProps,\n GetRealtimeUserProps,\n GetUserProps,\n GetUsersProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '0.0.1-alpha.16';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'ai-personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAdvancedPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AdvancedPersonalization',\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 return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\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 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 | undefined): void {\n 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 if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Sends a request to compute the real-time user\\'s personalization profile.\n *\n * Required API Key ACLs:\n * - recommendation\n *\n * @deprecated\n * @param computeRealtimeUser - The computeRealtimeUser object.\n * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n computeRealtimeUser(\n { userToken }: ComputeRealtimeUserProps,\n requestOptions?: RequestOptions,\n ): Promise<AcceptedResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `computeRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}/compute'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param deleteUser - The deleteUser object.\n * @param deleteUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `deleteUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of configuration objects for each index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject> {\n const requestPath = '/2/config';\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the real-time user\\'s personalization profiles containing search filters.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getRealtimeUser - The getRealtimeUser object.\n * @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUser> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUser - The getUser object.\n * @param getUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUsers - The getUsers object.\n * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.\n * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.\n * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.\n * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.\n * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.\n * @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\\'t be used in the same request as `previousPageToken`.\n * @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\\'t be used in the same request as `nextPageToken`.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsers(\n { startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }: GetUsersProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetUsersResponse> {\n const requestPath = '/2/users';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (indices !== undefined) {\n queryParameters['indices'] = indices.toString();\n }\n\n if (affinity !== undefined) {\n queryParameters['affinity'] = affinity.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (nextPageToken !== undefined) {\n queryParameters['nextPageToken'] = nextPageToken.toString();\n }\n\n if (previousPageToken !== undefined) {\n queryParameters['previousPageToken'] = previousPageToken.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param configurationParameters - The configurationParameters object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putConfig(\n configurationParameters: ConfigurationParameters,\n requestOptions?: RequestOptions,\n ): Promise<PutConfigResponse> {\n if (!configurationParameters) {\n throw new Error('Parameter `configurationParameters` is required when calling `putConfig`.');\n }\n\n if (!configurationParameters.indices) {\n throw new Error('Parameter `configurationParameters.indices` is required when calling `putConfig`.');\n }\n if (!configurationParameters.personalizationReRanking) {\n throw new Error(\n 'Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`.',\n );\n }\n if (!configurationParameters.profileType) {\n throw new Error('Parameter `configurationParameters.profileType` is required when calling `putConfig`.');\n }\n if (!configurationParameters.features) {\n throw new Error('Parameter `configurationParameters.features` is required when calling `putConfig`.');\n }\n\n const requestPath = '/2/config';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationParameters,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,2BAA2B;AAEpC,SAAS,mBAAmB,iBAAiB,wBAAwB;;;ACIrE,SAAS,YAAY,mBAAmB,uBAAuB;AA0BxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,0CAA0C,QAAQ,YAAY,MAAM;AAEhF,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,oCAAoC;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;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I,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,MAAI,CAAC,UAAW,WAAW,OAAO,WAAW,YAAY,CAAC,QAAQ,SAAS,MAAM,IAAK;AACpF,UAAM,IAAI,MAAM,4DAA4D,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EAClG;AAEA,SAAO;AAAA,IACL,GAAG,oCAAoC;AAAA,MACrC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,iBAAiB;AAAA,MACzB,WAAW,oBAAoB;AAAA,MAC/B,eAAe,CAAC,EAAE,SAAS,WAAW,SAAS,QAAQ,SAAS,KAAK,CAAC;AAAA,MACtE,gBAAgB,gBAAgB;AAAA,MAChC,eAAe,gBAAgB;AAAA,MAC/B,YAAY,kBAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../builds/node.ts","../../src/advancedPersonalizationClient.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\nexport type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;\n\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createAdvancedPersonalizationClient } from '../src/advancedPersonalizationClient';\n\nimport type { Region } from '../src/advancedPersonalizationClient';\nimport { REGIONS } from '../src/advancedPersonalizationClient';\n\nexport type { Region, RegionOptions } from '../src/advancedPersonalizationClient';\n\nexport { apiClientVersion } from '../src/advancedPersonalizationClient';\n\nexport * from '../model';\n\nexport function advancedPersonalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): AdvancedPersonalizationClient {\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 if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createAdvancedPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\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 type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { AcceptedResponse } from '../model/acceptedResponse';\nimport type { ConfigurationObject } from '../model/configurationObject';\nimport type { ConfigurationParameters } from '../model/configurationParameters';\n\nimport type { DeleteUserResponse } from '../model/deleteUserResponse';\n\nimport type { GetUsersResponse } from '../model/getUsersResponse';\nimport type { PutConfigResponse } from '../model/putConfigResponse';\nimport type { RealtimeUser } from '../model/realtimeUser';\n\nimport type { User } from '../model/user';\n\nimport type {\n ComputeRealtimeUserProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProps,\n GetRealtimeUserProps,\n GetUserProps,\n GetUsersProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '0.0.1-alpha.17';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'ai-personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAdvancedPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AdvancedPersonalization',\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 return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\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 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 | undefined): void {\n 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 if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Sends a request to compute the real-time user\\'s personalization profile.\n *\n * Required API Key ACLs:\n * - recommendation\n *\n * @deprecated\n * @param computeRealtimeUser - The computeRealtimeUser object.\n * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n computeRealtimeUser(\n { userToken }: ComputeRealtimeUserProps,\n requestOptions?: RequestOptions,\n ): Promise<AcceptedResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `computeRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}/compute'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param deleteUser - The deleteUser object.\n * @param deleteUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `deleteUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of configuration objects for each index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject> {\n const requestPath = '/2/config';\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the real-time user\\'s personalization profiles containing search filters.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getRealtimeUser - The getRealtimeUser object.\n * @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUser> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUser - The getUser object.\n * @param getUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUsers - The getUsers object.\n * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.\n * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.\n * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.\n * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.\n * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.\n * @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\\'t be used in the same request as `previousPageToken`.\n * @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\\'t be used in the same request as `nextPageToken`.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsers(\n { startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }: GetUsersProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetUsersResponse> {\n const requestPath = '/2/users';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (indices !== undefined) {\n queryParameters['indices'] = indices.toString();\n }\n\n if (affinity !== undefined) {\n queryParameters['affinity'] = affinity.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (nextPageToken !== undefined) {\n queryParameters['nextPageToken'] = nextPageToken.toString();\n }\n\n if (previousPageToken !== undefined) {\n queryParameters['previousPageToken'] = previousPageToken.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param configurationParameters - The configurationParameters object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putConfig(\n configurationParameters: ConfigurationParameters,\n requestOptions?: RequestOptions,\n ): Promise<PutConfigResponse> {\n if (!configurationParameters) {\n throw new Error('Parameter `configurationParameters` is required when calling `putConfig`.');\n }\n\n if (!configurationParameters.indices) {\n throw new Error('Parameter `configurationParameters.indices` is required when calling `putConfig`.');\n }\n if (!configurationParameters.personalizationReRanking) {\n throw new Error(\n 'Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`.',\n );\n }\n if (!configurationParameters.profileType) {\n throw new Error('Parameter `configurationParameters.profileType` is required when calling `putConfig`.');\n }\n if (!configurationParameters.features) {\n throw new Error('Parameter `configurationParameters.features` is required when calling `putConfig`.');\n }\n\n const requestPath = '/2/config';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationParameters,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,2BAA2B;AAEpC,SAAS,mBAAmB,iBAAiB,wBAAwB;;;ACIrE,SAAS,YAAY,mBAAmB,uBAAuB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AAiB;AAAA,MACzB,WAAW,oBAAoB;AAAA,MAC/B,eAAe,CAAC,EAAE,SAAS,WAAW,SAAS,QAAQ,SAAS,KAAK,CAAC;AAAA,MACtE,gBAAgB,gBAAgB;AAAA,MAChC,eAAe,gBAAgB;AAAA,MAC/B,YAAY,kBAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -4,7 +4,7 @@ import { createFetchRequester } from "@algolia/requester-fetch";
4
4
 
5
5
  // src/advancedPersonalizationClient.ts
6
6
  import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
7
- var apiClientVersion = "0.0.1-alpha.16";
7
+ var apiClientVersion = "0.0.1-alpha.17";
8
8
  var REGIONS = ["eu", "us"];
9
9
  function getDefaultHosts(region) {
10
10
  const url = "ai-personalization.{region}.algolia.com".replace("{region}", region);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/worker.ts","../../src/advancedPersonalizationClient.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\nexport type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\nimport { createFetchRequester } from '@algolia/requester-fetch';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createAdvancedPersonalizationClient } from '../src/advancedPersonalizationClient';\n\nimport type { Region } from '../src/advancedPersonalizationClient';\nimport { REGIONS } from '../src/advancedPersonalizationClient';\n\nexport type { Region, RegionOptions } from '../src/advancedPersonalizationClient';\n\nexport { apiClientVersion } from '../src/advancedPersonalizationClient';\n\nexport * from '../model';\n\nexport function advancedPersonalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): AdvancedPersonalizationClient {\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 if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createAdvancedPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createFetchRequester(),\n algoliaAgents: [{ segment: 'Worker' }],\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 type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { AcceptedResponse } from '../model/acceptedResponse';\nimport type { ConfigurationObject } from '../model/configurationObject';\nimport type { ConfigurationParameters } from '../model/configurationParameters';\n\nimport type { DeleteUserResponse } from '../model/deleteUserResponse';\n\nimport type { GetUsersResponse } from '../model/getUsersResponse';\nimport type { PutConfigResponse } from '../model/putConfigResponse';\nimport type { RealtimeUser } from '../model/realtimeUser';\n\nimport type { User } from '../model/user';\n\nimport type {\n ComputeRealtimeUserProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProps,\n GetRealtimeUserProps,\n GetUserProps,\n GetUsersProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '0.0.1-alpha.16';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'ai-personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAdvancedPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AdvancedPersonalization',\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 return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\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 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 | undefined): void {\n 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 if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Sends a request to compute the real-time user\\'s personalization profile.\n *\n * Required API Key ACLs:\n * - recommendation\n *\n * @deprecated\n * @param computeRealtimeUser - The computeRealtimeUser object.\n * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n computeRealtimeUser(\n { userToken }: ComputeRealtimeUserProps,\n requestOptions?: RequestOptions,\n ): Promise<AcceptedResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `computeRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}/compute'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param deleteUser - The deleteUser object.\n * @param deleteUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `deleteUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of configuration objects for each index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject> {\n const requestPath = '/2/config';\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the real-time user\\'s personalization profiles containing search filters.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getRealtimeUser - The getRealtimeUser object.\n * @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUser> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUser - The getUser object.\n * @param getUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUsers - The getUsers object.\n * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.\n * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.\n * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.\n * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.\n * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.\n * @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\\'t be used in the same request as `previousPageToken`.\n * @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\\'t be used in the same request as `nextPageToken`.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsers(\n { startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }: GetUsersProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetUsersResponse> {\n const requestPath = '/2/users';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (indices !== undefined) {\n queryParameters['indices'] = indices.toString();\n }\n\n if (affinity !== undefined) {\n queryParameters['affinity'] = affinity.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (nextPageToken !== undefined) {\n queryParameters['nextPageToken'] = nextPageToken.toString();\n }\n\n if (previousPageToken !== undefined) {\n queryParameters['previousPageToken'] = previousPageToken.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param configurationParameters - The configurationParameters object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putConfig(\n configurationParameters: ConfigurationParameters,\n requestOptions?: RequestOptions,\n ): Promise<PutConfigResponse> {\n if (!configurationParameters) {\n throw new Error('Parameter `configurationParameters` is required when calling `putConfig`.');\n }\n\n if (!configurationParameters.indices) {\n throw new Error('Parameter `configurationParameters.indices` is required when calling `putConfig`.');\n }\n if (!configurationParameters.personalizationReRanking) {\n throw new Error(\n 'Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`.',\n );\n }\n if (!configurationParameters.profileType) {\n throw new Error('Parameter `configurationParameters.profileType` is required when calling `putConfig`.');\n }\n if (!configurationParameters.features) {\n throw new Error('Parameter `configurationParameters.features` is required when calling `putConfig`.');\n }\n\n const requestPath = '/2/config';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationParameters,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,mBAAmB,iBAAiB,wBAAwB;AACrE,SAAS,4BAA4B;;;ACKrC,SAAS,YAAY,mBAAmB,uBAAuB;AA0BxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,0CAA0C,QAAQ,YAAY,MAAM;AAEhF,SAAO,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AY,kBAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../builds/worker.ts","../../src/advancedPersonalizationClient.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\nexport type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\nimport { createFetchRequester } from '@algolia/requester-fetch';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createAdvancedPersonalizationClient } from '../src/advancedPersonalizationClient';\n\nimport type { Region } from '../src/advancedPersonalizationClient';\nimport { REGIONS } from '../src/advancedPersonalizationClient';\n\nexport type { Region, RegionOptions } from '../src/advancedPersonalizationClient';\n\nexport { apiClientVersion } from '../src/advancedPersonalizationClient';\n\nexport * from '../model';\n\nexport function advancedPersonalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): AdvancedPersonalizationClient {\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 if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return {\n ...createAdvancedPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createFetchRequester(),\n algoliaAgents: [{ segment: 'Worker' }],\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 type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { AcceptedResponse } from '../model/acceptedResponse';\nimport type { ConfigurationObject } from '../model/configurationObject';\nimport type { ConfigurationParameters } from '../model/configurationParameters';\n\nimport type { DeleteUserResponse } from '../model/deleteUserResponse';\n\nimport type { GetUsersResponse } from '../model/getUsersResponse';\nimport type { PutConfigResponse } from '../model/putConfigResponse';\nimport type { RealtimeUser } from '../model/realtimeUser';\n\nimport type { User } from '../model/user';\n\nimport type {\n ComputeRealtimeUserProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProps,\n GetRealtimeUserProps,\n GetUserProps,\n GetUsersProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '0.0.1-alpha.17';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'ai-personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAdvancedPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AdvancedPersonalization',\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 return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\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 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 | undefined): void {\n 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 if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Sends a request to compute the real-time user\\'s personalization profile.\n *\n * Required API Key ACLs:\n * - recommendation\n *\n * @deprecated\n * @param computeRealtimeUser - The computeRealtimeUser object.\n * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n computeRealtimeUser(\n { userToken }: ComputeRealtimeUserProps,\n requestOptions?: RequestOptions,\n ): Promise<AcceptedResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `computeRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}/compute'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param deleteUser - The deleteUser object.\n * @param deleteUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `deleteUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of configuration objects for each index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject> {\n const requestPath = '/2/config';\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the real-time user\\'s personalization profiles containing search filters.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getRealtimeUser - The getRealtimeUser object.\n * @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUser> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUser - The getUser object.\n * @param getUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUsers - The getUsers object.\n * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.\n * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.\n * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.\n * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.\n * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.\n * @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\\'t be used in the same request as `previousPageToken`.\n * @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\\'t be used in the same request as `nextPageToken`.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsers(\n { startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }: GetUsersProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetUsersResponse> {\n const requestPath = '/2/users';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (indices !== undefined) {\n queryParameters['indices'] = indices.toString();\n }\n\n if (affinity !== undefined) {\n queryParameters['affinity'] = affinity.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (nextPageToken !== undefined) {\n queryParameters['nextPageToken'] = nextPageToken.toString();\n }\n\n if (previousPageToken !== undefined) {\n queryParameters['previousPageToken'] = previousPageToken.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param configurationParameters - The configurationParameters object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putConfig(\n configurationParameters: ConfigurationParameters,\n requestOptions?: RequestOptions,\n ): Promise<PutConfigResponse> {\n if (!configurationParameters) {\n throw new Error('Parameter `configurationParameters` is required when calling `putConfig`.');\n }\n\n if (!configurationParameters.indices) {\n throw new Error('Parameter `configurationParameters.indices` is required when calling `putConfig`.');\n }\n if (!configurationParameters.personalizationReRanking) {\n throw new Error(\n 'Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`.',\n );\n }\n if (!configurationParameters.profileType) {\n throw new Error('Parameter `configurationParameters.profileType` is required when calling `putConfig`.');\n }\n if (!configurationParameters.features) {\n throw new Error('Parameter `configurationParameters.features` is required when calling `putConfig`.');\n }\n\n const requestPath = '/2/config';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationParameters,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,mBAAmB,iBAAiB,wBAAwB;AACrE,SAAS,4BAA4B;;;ACKrC,SAAS,YAAY,mBAAmB,uBAAuB;AA0BxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,0CAA0C,QAAQ,YAAY,MAAM;AAEhF,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,oCAAoC;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QA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AAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;;;ADheO,SAAS,8BACd,OACA,QACA,QACA,SAC+B;AAC/B,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,MAAI,CAAC,UAAW,WAAW,OAAO,WAAW,YAAY,CAAC,QAAQ,SAAS,MAAM,IAAK;AACpF,UAAM,IAAI,MAAM,4DAA4D,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EAClG;AAEA,SAAO;AAAA,IACL,GAAG,oCAAoC;AAAA,MACrC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,iBAAiB;AAAA,MACzB,WAAW,qBAAqB;AAAA,MAChC,eAAe,CAAC,EAAE,SAAS,SAAS,CAAC;AAAA,MACrC,gBAAgB,gBAAgB;AAAA,MAChC,eAAe,gBAAgB;AAAA,MAC/B,YAAY,kBAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":[]}
package/dist/fetch.d.ts CHANGED
@@ -317,7 +317,7 @@ type GetUsersProps = {
317
317
  previousPageToken?: string | undefined;
318
318
  };
319
319
 
320
- declare const apiClientVersion = "0.0.1-alpha.16";
320
+ declare const apiClientVersion = "0.0.1-alpha.17";
321
321
  declare const REGIONS: readonly ["eu", "us"];
322
322
  type Region = (typeof REGIONS)[number];
323
323
  type RegionOptions = {
package/dist/node.d.cts CHANGED
@@ -317,7 +317,7 @@ type GetUsersProps = {
317
317
  previousPageToken?: string | undefined;
318
318
  };
319
319
 
320
- declare const apiClientVersion = "0.0.1-alpha.16";
320
+ declare const apiClientVersion = "0.0.1-alpha.17";
321
321
  declare const REGIONS: readonly ["eu", "us"];
322
322
  type Region = (typeof REGIONS)[number];
323
323
  type RegionOptions = {
package/dist/node.d.ts CHANGED
@@ -317,7 +317,7 @@ type GetUsersProps = {
317
317
  previousPageToken?: string | undefined;
318
318
  };
319
319
 
320
- declare const apiClientVersion = "0.0.1-alpha.16";
320
+ declare const apiClientVersion = "0.0.1-alpha.17";
321
321
  declare const REGIONS: readonly ["eu", "us"];
322
322
  type Region = (typeof REGIONS)[number];
323
323
  type RegionOptions = {
@@ -26,7 +26,7 @@ __export(advancedPersonalizationClient_exports, {
26
26
  });
27
27
  module.exports = __toCommonJS(advancedPersonalizationClient_exports);
28
28
  var import_client_common = require("@algolia/client-common");
29
- var apiClientVersion = "0.0.1-alpha.16";
29
+ var apiClientVersion = "0.0.1-alpha.17";
30
30
  var REGIONS = ["eu", "us"];
31
31
  function getDefaultHosts(region) {
32
32
  const url = "ai-personalization.{region}.algolia.com".replace("{region}", region);