@algolia/composition 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/node.ts","../../src/compositionClient.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 CompositionClient = ReturnType<typeof createCompositionClient>;\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 { createCompositionClient } from '../src/compositionClient';\n\nexport { apiClientVersion } from '../src/compositionClient';\n\nexport * from '../model';\n\nexport function compositionClient(\n appId: string,\n apiKey: string,\n options?: ClientOptions | undefined,\n): CompositionClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createCompositionClient({\n appId,\n apiKey,\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, createIterablePromise, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { BatchParams } from '../model/batchParams';\nimport type { Composition } from '../model/composition';\nimport type { CompositionRule } from '../model/compositionRule';\n\nimport type { GetTaskResponse } from '../model/getTaskResponse';\nimport type { ListCompositionsResponse } from '../model/listCompositionsResponse';\nimport type { MultipleBatchResponse } from '../model/multipleBatchResponse';\n\nimport type { RulesMultipleBatchResponse } from '../model/rulesMultipleBatchResponse';\n\nimport type { SearchCompositionRulesResponse } from '../model/searchCompositionRulesResponse';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { TaskIDResponse } from '../model/taskIDResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteCompositionProps,\n DeleteCompositionRuleProps,\n GetCompositionProps,\n GetRuleProps,\n GetTaskProps,\n ListCompositionsProps,\n PutCompositionProps,\n PutCompositionRuleProps,\n SaveRulesProps,\n SearchCompositionRulesProps,\n SearchForFacetValuesProps,\n SearchProps,\n WaitForCompositionTaskOptions,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.17.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createCompositionClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Composition',\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 * Helper: Wait for a composition-level task to be published (completed) for a given `compositionID` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param WaitForCompositionTaskOptions - The `WaitForCompositionTaskOptions` object.\n * @param WaitForCompositionTaskOptions.compositionID - The `compositionID` where the operation was performed.\n * @param WaitForCompositionTaskOptions.taskID - The `taskID` returned in the method response.\n * @param WaitForCompositionTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param WaitForCompositionTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForCompositionTask(\n {\n compositionID,\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForCompositionTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getTask({ compositionID, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\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 * Delete a composition from the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteComposition - The deleteComposition object.\n * @param deleteComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteComposition(\n { compositionID }: DeleteCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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 * Delete a Composition Rule from the specified Composition ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteCompositionRule - The deleteCompositionRule object.\n * @param deleteCompositionRule.compositionID - Unique Composition ObjectID.\n * @param deleteCompositionRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteCompositionRule(\n { compositionID, objectID }: DeleteCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieve a single composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getComposition - The getComposition object.\n * @param getComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getComposition({ compositionID }: GetCompositionProps, requestOptions?: RequestOptions): Promise<Composition> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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 rule by its ID. To find the object ID of a rule, use the [`search` operation](https://www.algolia.com/doc/rest-api/composition/search-composition-rules).\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getRule - The getRule object.\n * @param getRule.compositionID - Unique Composition ObjectID.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ compositionID, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<CompositionRule> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * - addObject\n * - deleteObject\n * - deleteIndex\n * @param getTask - The getTask object.\n * @param getTask.compositionID - Unique Composition ObjectID.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ compositionID, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getTask`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/task/{taskID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Lists all compositions in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param listCompositions - The listCompositions object.\n * @param listCompositions.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listCompositions.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listCompositions(\n { page, hitsPerPage }: ListCompositionsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListCompositionsResponse> {\n const requestPath = '/1/compositions';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (hitsPerPage !== undefined) {\n queryParameters['hitsPerPage'] = hitsPerPage.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 * Adds, updates, or deletes compositions with a single API request.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse> {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n\n const requestPath = '/1/compositions/*/batch';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Upsert a composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putComposition - The putComposition object.\n * @param putComposition.compositionID - Unique Composition ObjectID.\n * @param putComposition.composition - The composition object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putComposition(\n { compositionID, composition }: PutCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putComposition`.');\n }\n\n if (!composition) {\n throw new Error('Parameter `composition` is required when calling `putComposition`.');\n }\n\n if (!composition.objectID) {\n throw new Error('Parameter `composition.objectID` is required when calling `putComposition`.');\n }\n if (!composition.name) {\n throw new Error('Parameter `composition.name` is required when calling `putComposition`.');\n }\n if (!composition.behavior) {\n throw new Error('Parameter `composition.behavior` is required when calling `putComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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: composition,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a composition rule with the provided ID already exists, it\\'s replaced. Otherwise, a new one is added.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putCompositionRule - The putCompositionRule object.\n * @param putCompositionRule.compositionID - Unique Composition ObjectID.\n * @param putCompositionRule.objectID - Unique identifier of a rule object.\n * @param putCompositionRule.compositionRule - The compositionRule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putCompositionRule(\n { compositionID, objectID, compositionRule }: PutCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule) {\n throw new Error('Parameter `compositionRule` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule.objectID) {\n throw new Error('Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.conditions) {\n throw new Error('Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.consequence) {\n throw new Error('Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\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: compositionRule,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Create or update or delete multiple composition rules.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param saveRules - The saveRules object.\n * @param saveRules.compositionID - Unique Composition ObjectID.\n * @param saveRules.rules - The rules object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules(\n { compositionID, rules }: SaveRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<RulesMultipleBatchResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `saveRules`.');\n }\n\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/batch'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs a query on a single composition and returns matching results.\n *\n * Required API Key ACLs:\n * - search\n * @param search - The search object.\n * @param search.compositionID - Unique Composition ObjectID.\n * @param search.requestBody - The requestBody object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n { compositionID, requestBody }: SearchProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponse<T>> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `search`.');\n }\n\n if (!requestBody) {\n throw new Error('Parameter `requestBody` is required when calling `search`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/run'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: requestBody,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for composition rules in your index.\n *\n * Required API Key ACLs:\n * - settings\n * @param searchCompositionRules - The searchCompositionRules object.\n * @param searchCompositionRules.compositionID - Unique Composition ObjectID.\n * @param searchCompositionRules.searchCompositionRulesParams - The searchCompositionRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchCompositionRules(\n { compositionID, searchCompositionRulesParams }: SearchCompositionRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchCompositionRulesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchCompositionRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/search'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchCompositionRulesParams ? searchCompositionRulesParams : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for values of a specified facet attribute on the composition\\'s main source\\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.compositionID - Unique Composition ObjectID.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues(\n { compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchForFacetValuesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchForFacetValues`.');\n }\n\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/facets/{facetName}/query'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{facetName}', encodeURIComponent(facetName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,2BAA2B;AAEpC,SAAS,mBAAmB,iBAAiB,wBAAwB;;;ACIrE,SAAS,YAAY,uBAAuB,mBAAmB,iBAAiB,eAAe;AAsCxF,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF,EACA;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,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AU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,GAAG,wBAAwB;AAAA,MACzB;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/compositionClient.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 CompositionClient = ReturnType<typeof createCompositionClient>;\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 { createCompositionClient } from '../src/compositionClient';\n\nexport { apiClientVersion } from '../src/compositionClient';\n\nexport * from '../model';\n\nexport function compositionClient(\n appId: string,\n apiKey: string,\n options?: ClientOptions | undefined,\n): CompositionClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createCompositionClient({\n appId,\n apiKey,\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, createIterablePromise, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { BatchParams } from '../model/batchParams';\nimport type { Composition } from '../model/composition';\nimport type { CompositionRule } from '../model/compositionRule';\n\nimport type { GetTaskResponse } from '../model/getTaskResponse';\nimport type { ListCompositionsResponse } from '../model/listCompositionsResponse';\nimport type { MultipleBatchResponse } from '../model/multipleBatchResponse';\n\nimport type { RulesMultipleBatchResponse } from '../model/rulesMultipleBatchResponse';\n\nimport type { SearchCompositionRulesResponse } from '../model/searchCompositionRulesResponse';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { TaskIDResponse } from '../model/taskIDResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteCompositionProps,\n DeleteCompositionRuleProps,\n GetCompositionProps,\n GetRuleProps,\n GetTaskProps,\n ListCompositionsProps,\n PutCompositionProps,\n PutCompositionRuleProps,\n SaveRulesProps,\n SearchCompositionRulesProps,\n SearchForFacetValuesProps,\n SearchProps,\n WaitForCompositionTaskOptions,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.18.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createCompositionClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Composition',\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 * Helper: Wait for a composition-level task to be published (completed) for a given `compositionID` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param WaitForCompositionTaskOptions - The `WaitForCompositionTaskOptions` object.\n * @param WaitForCompositionTaskOptions.compositionID - The `compositionID` where the operation was performed.\n * @param WaitForCompositionTaskOptions.taskID - The `taskID` returned in the method response.\n * @param WaitForCompositionTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param WaitForCompositionTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForCompositionTask(\n {\n compositionID,\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForCompositionTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getTask({ compositionID, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\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 * Delete a composition from the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteComposition - The deleteComposition object.\n * @param deleteComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteComposition(\n { compositionID }: DeleteCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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 * Delete a Composition Rule from the specified Composition ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteCompositionRule - The deleteCompositionRule object.\n * @param deleteCompositionRule.compositionID - Unique Composition ObjectID.\n * @param deleteCompositionRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteCompositionRule(\n { compositionID, objectID }: DeleteCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieve a single composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getComposition - The getComposition object.\n * @param getComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getComposition({ compositionID }: GetCompositionProps, requestOptions?: RequestOptions): Promise<Composition> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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 rule by its ID. To find the object ID of a rule, use the [`search` operation](https://www.algolia.com/doc/rest-api/composition/search-composition-rules).\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getRule - The getRule object.\n * @param getRule.compositionID - Unique Composition ObjectID.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ compositionID, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<CompositionRule> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * - addObject\n * - deleteObject\n * - deleteIndex\n * @param getTask - The getTask object.\n * @param getTask.compositionID - Unique Composition ObjectID.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ compositionID, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getTask`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/task/{taskID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Lists all compositions in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param listCompositions - The listCompositions object.\n * @param listCompositions.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listCompositions.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listCompositions(\n { page, hitsPerPage }: ListCompositionsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListCompositionsResponse> {\n const requestPath = '/1/compositions';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (hitsPerPage !== undefined) {\n queryParameters['hitsPerPage'] = hitsPerPage.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 * Adds, updates, or deletes compositions with a single API request.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse> {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n\n const requestPath = '/1/compositions/*/batch';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Upsert a composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putComposition - The putComposition object.\n * @param putComposition.compositionID - Unique Composition ObjectID.\n * @param putComposition.composition - The composition object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putComposition(\n { compositionID, composition }: PutCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putComposition`.');\n }\n\n if (!composition) {\n throw new Error('Parameter `composition` is required when calling `putComposition`.');\n }\n\n if (!composition.objectID) {\n throw new Error('Parameter `composition.objectID` is required when calling `putComposition`.');\n }\n if (!composition.name) {\n throw new Error('Parameter `composition.name` is required when calling `putComposition`.');\n }\n if (!composition.behavior) {\n throw new Error('Parameter `composition.behavior` is required when calling `putComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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: composition,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a composition rule with the provided ID already exists, it\\'s replaced. Otherwise, a new one is added.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putCompositionRule - The putCompositionRule object.\n * @param putCompositionRule.compositionID - Unique Composition ObjectID.\n * @param putCompositionRule.objectID - Unique identifier of a rule object.\n * @param putCompositionRule.compositionRule - The compositionRule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putCompositionRule(\n { compositionID, objectID, compositionRule }: PutCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule) {\n throw new Error('Parameter `compositionRule` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule.objectID) {\n throw new Error('Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.conditions) {\n throw new Error('Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.consequence) {\n throw new Error('Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\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: compositionRule,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Create or update or delete multiple composition rules.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param saveRules - The saveRules object.\n * @param saveRules.compositionID - Unique Composition ObjectID.\n * @param saveRules.rules - The rules object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules(\n { compositionID, rules }: SaveRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<RulesMultipleBatchResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `saveRules`.');\n }\n\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/batch'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs a query on a single composition and returns matching results.\n *\n * Required API Key ACLs:\n * - search\n * @param search - The search object.\n * @param search.compositionID - Unique Composition ObjectID.\n * @param search.requestBody - The requestBody object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n { compositionID, requestBody }: SearchProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponse<T>> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `search`.');\n }\n\n if (!requestBody) {\n throw new Error('Parameter `requestBody` is required when calling `search`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/run'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: requestBody,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for composition rules in your index.\n *\n * Required API Key ACLs:\n * - settings\n * @param searchCompositionRules - The searchCompositionRules object.\n * @param searchCompositionRules.compositionID - Unique Composition ObjectID.\n * @param searchCompositionRules.searchCompositionRulesParams - The searchCompositionRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchCompositionRules(\n { compositionID, searchCompositionRulesParams }: SearchCompositionRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchCompositionRulesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchCompositionRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/search'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchCompositionRulesParams ? searchCompositionRulesParams : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for values of a specified facet attribute on the composition\\'s main source\\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.compositionID - Unique Composition ObjectID.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues(\n { compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchForFacetValuesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchForFacetValues`.');\n }\n\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/facets/{facetName}/query'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{facetName}', encodeURIComponent(facetName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,2BAA2B;AAEpC,SAAS,mBAAmB,iBAAiB,wBAAwB;;;ACIrE,SAAS,YAAY,uBAAuB,mBAAmB,iBAAiB,eAAe;AAsCxF,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU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,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM,8BAA8B,8BAA8B,CAAC;AAAA,QACnE,oBAAoB;AAAA,QACpB,WAAW;AAAA,MACb;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;;;ADzyBO,SAAS,kBACd,OACA,QACA,SACmB;AACnB,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,SAAO;AAAA,IACL,GAAG,wBAAwB;AAAA,MACzB;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":[]}
@@ -4,7 +4,7 @@ import { createFetchRequester } from "@algolia/requester-fetch";
4
4
 
5
5
  // src/compositionClient.ts
6
6
  import { createAuth, createIterablePromise, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
7
- var apiClientVersion = "1.17.0";
7
+ var apiClientVersion = "1.18.0";
8
8
  function getDefaultHosts(appId) {
9
9
  return [
10
10
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/worker.ts","../../src/compositionClient.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 CompositionClient = ReturnType<typeof createCompositionClient>;\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 { createCompositionClient } from '../src/compositionClient';\n\nexport { apiClientVersion } from '../src/compositionClient';\n\nexport * from '../model';\n\nexport function compositionClient(\n appId: string,\n apiKey: string,\n options?: ClientOptions | undefined,\n): CompositionClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createCompositionClient({\n appId,\n apiKey,\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, createIterablePromise, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { BatchParams } from '../model/batchParams';\nimport type { Composition } from '../model/composition';\nimport type { CompositionRule } from '../model/compositionRule';\n\nimport type { GetTaskResponse } from '../model/getTaskResponse';\nimport type { ListCompositionsResponse } from '../model/listCompositionsResponse';\nimport type { MultipleBatchResponse } from '../model/multipleBatchResponse';\n\nimport type { RulesMultipleBatchResponse } from '../model/rulesMultipleBatchResponse';\n\nimport type { SearchCompositionRulesResponse } from '../model/searchCompositionRulesResponse';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { TaskIDResponse } from '../model/taskIDResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteCompositionProps,\n DeleteCompositionRuleProps,\n GetCompositionProps,\n GetRuleProps,\n GetTaskProps,\n ListCompositionsProps,\n PutCompositionProps,\n PutCompositionRuleProps,\n SaveRulesProps,\n SearchCompositionRulesProps,\n SearchForFacetValuesProps,\n SearchProps,\n WaitForCompositionTaskOptions,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.17.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createCompositionClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Composition',\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 * Helper: Wait for a composition-level task to be published (completed) for a given `compositionID` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param WaitForCompositionTaskOptions - The `WaitForCompositionTaskOptions` object.\n * @param WaitForCompositionTaskOptions.compositionID - The `compositionID` where the operation was performed.\n * @param WaitForCompositionTaskOptions.taskID - The `taskID` returned in the method response.\n * @param WaitForCompositionTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param WaitForCompositionTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForCompositionTask(\n {\n compositionID,\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForCompositionTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getTask({ compositionID, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\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 * Delete a composition from the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteComposition - The deleteComposition object.\n * @param deleteComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteComposition(\n { compositionID }: DeleteCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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 * Delete a Composition Rule from the specified Composition ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteCompositionRule - The deleteCompositionRule object.\n * @param deleteCompositionRule.compositionID - Unique Composition ObjectID.\n * @param deleteCompositionRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteCompositionRule(\n { compositionID, objectID }: DeleteCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieve a single composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getComposition - The getComposition object.\n * @param getComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getComposition({ compositionID }: GetCompositionProps, requestOptions?: RequestOptions): Promise<Composition> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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 rule by its ID. To find the object ID of a rule, use the [`search` operation](https://www.algolia.com/doc/rest-api/composition/search-composition-rules).\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getRule - The getRule object.\n * @param getRule.compositionID - Unique Composition ObjectID.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ compositionID, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<CompositionRule> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * - addObject\n * - deleteObject\n * - deleteIndex\n * @param getTask - The getTask object.\n * @param getTask.compositionID - Unique Composition ObjectID.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ compositionID, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getTask`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/task/{taskID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Lists all compositions in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param listCompositions - The listCompositions object.\n * @param listCompositions.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listCompositions.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listCompositions(\n { page, hitsPerPage }: ListCompositionsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListCompositionsResponse> {\n const requestPath = '/1/compositions';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (hitsPerPage !== undefined) {\n queryParameters['hitsPerPage'] = hitsPerPage.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 * Adds, updates, or deletes compositions with a single API request.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse> {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n\n const requestPath = '/1/compositions/*/batch';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Upsert a composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putComposition - The putComposition object.\n * @param putComposition.compositionID - Unique Composition ObjectID.\n * @param putComposition.composition - The composition object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putComposition(\n { compositionID, composition }: PutCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putComposition`.');\n }\n\n if (!composition) {\n throw new Error('Parameter `composition` is required when calling `putComposition`.');\n }\n\n if (!composition.objectID) {\n throw new Error('Parameter `composition.objectID` is required when calling `putComposition`.');\n }\n if (!composition.name) {\n throw new Error('Parameter `composition.name` is required when calling `putComposition`.');\n }\n if (!composition.behavior) {\n throw new Error('Parameter `composition.behavior` is required when calling `putComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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: composition,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a composition rule with the provided ID already exists, it\\'s replaced. Otherwise, a new one is added.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putCompositionRule - The putCompositionRule object.\n * @param putCompositionRule.compositionID - Unique Composition ObjectID.\n * @param putCompositionRule.objectID - Unique identifier of a rule object.\n * @param putCompositionRule.compositionRule - The compositionRule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putCompositionRule(\n { compositionID, objectID, compositionRule }: PutCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule) {\n throw new Error('Parameter `compositionRule` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule.objectID) {\n throw new Error('Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.conditions) {\n throw new Error('Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.consequence) {\n throw new Error('Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\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: compositionRule,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Create or update or delete multiple composition rules.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param saveRules - The saveRules object.\n * @param saveRules.compositionID - Unique Composition ObjectID.\n * @param saveRules.rules - The rules object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules(\n { compositionID, rules }: SaveRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<RulesMultipleBatchResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `saveRules`.');\n }\n\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/batch'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs a query on a single composition and returns matching results.\n *\n * Required API Key ACLs:\n * - search\n * @param search - The search object.\n * @param search.compositionID - Unique Composition ObjectID.\n * @param search.requestBody - The requestBody object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n { compositionID, requestBody }: SearchProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponse<T>> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `search`.');\n }\n\n if (!requestBody) {\n throw new Error('Parameter `requestBody` is required when calling `search`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/run'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: requestBody,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for composition rules in your index.\n *\n * Required API Key ACLs:\n * - settings\n * @param searchCompositionRules - The searchCompositionRules object.\n * @param searchCompositionRules.compositionID - Unique Composition ObjectID.\n * @param searchCompositionRules.searchCompositionRulesParams - The searchCompositionRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchCompositionRules(\n { compositionID, searchCompositionRulesParams }: SearchCompositionRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchCompositionRulesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchCompositionRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/search'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchCompositionRulesParams ? searchCompositionRulesParams : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for values of a specified facet attribute on the composition\\'s main source\\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.compositionID - Unique Composition ObjectID.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues(\n { compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchForFacetValuesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchForFacetValues`.');\n }\n\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/facets/{facetName}/query'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{facetName}', encodeURIComponent(facetName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,mBAAmB,iBAAiB,wBAAwB;AACrE,SAAS,4BAA4B;;;ACKrC,SAAS,YAAY,uBAAuB,mBAAmB,iBAAiB,eAAe;AAsCxF,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF,EACA;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEO,SAAS,wBAAwB;AAAA,EACtC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,WAAW;AAAA,IACl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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":[]}
1
+ {"version":3,"sources":["../../builds/worker.ts","../../src/compositionClient.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 CompositionClient = ReturnType<typeof createCompositionClient>;\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 { createCompositionClient } from '../src/compositionClient';\n\nexport { apiClientVersion } from '../src/compositionClient';\n\nexport * from '../model';\n\nexport function compositionClient(\n appId: string,\n apiKey: string,\n options?: ClientOptions | undefined,\n): CompositionClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createCompositionClient({\n appId,\n apiKey,\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, createIterablePromise, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { BatchParams } from '../model/batchParams';\nimport type { Composition } from '../model/composition';\nimport type { CompositionRule } from '../model/compositionRule';\n\nimport type { GetTaskResponse } from '../model/getTaskResponse';\nimport type { ListCompositionsResponse } from '../model/listCompositionsResponse';\nimport type { MultipleBatchResponse } from '../model/multipleBatchResponse';\n\nimport type { RulesMultipleBatchResponse } from '../model/rulesMultipleBatchResponse';\n\nimport type { SearchCompositionRulesResponse } from '../model/searchCompositionRulesResponse';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { TaskIDResponse } from '../model/taskIDResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteCompositionProps,\n DeleteCompositionRuleProps,\n GetCompositionProps,\n GetRuleProps,\n GetTaskProps,\n ListCompositionsProps,\n PutCompositionProps,\n PutCompositionRuleProps,\n SaveRulesProps,\n SearchCompositionRulesProps,\n SearchForFacetValuesProps,\n SearchProps,\n WaitForCompositionTaskOptions,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.18.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createCompositionClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Composition',\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 * Helper: Wait for a composition-level task to be published (completed) for a given `compositionID` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param WaitForCompositionTaskOptions - The `WaitForCompositionTaskOptions` object.\n * @param WaitForCompositionTaskOptions.compositionID - The `compositionID` where the operation was performed.\n * @param WaitForCompositionTaskOptions.taskID - The `taskID` returned in the method response.\n * @param WaitForCompositionTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param WaitForCompositionTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForCompositionTask(\n {\n compositionID,\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForCompositionTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getTask({ compositionID, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\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 * Delete a composition from the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteComposition - The deleteComposition object.\n * @param deleteComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteComposition(\n { compositionID }: DeleteCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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 * Delete a Composition Rule from the specified Composition ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteCompositionRule - The deleteCompositionRule object.\n * @param deleteCompositionRule.compositionID - Unique Composition ObjectID.\n * @param deleteCompositionRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteCompositionRule(\n { compositionID, objectID }: DeleteCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieve a single composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getComposition - The getComposition object.\n * @param getComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getComposition({ compositionID }: GetCompositionProps, requestOptions?: RequestOptions): Promise<Composition> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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 rule by its ID. To find the object ID of a rule, use the [`search` operation](https://www.algolia.com/doc/rest-api/composition/search-composition-rules).\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getRule - The getRule object.\n * @param getRule.compositionID - Unique Composition ObjectID.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ compositionID, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<CompositionRule> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * - addObject\n * - deleteObject\n * - deleteIndex\n * @param getTask - The getTask object.\n * @param getTask.compositionID - Unique Composition ObjectID.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ compositionID, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getTask`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/task/{taskID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Lists all compositions in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param listCompositions - The listCompositions object.\n * @param listCompositions.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listCompositions.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listCompositions(\n { page, hitsPerPage }: ListCompositionsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListCompositionsResponse> {\n const requestPath = '/1/compositions';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (hitsPerPage !== undefined) {\n queryParameters['hitsPerPage'] = hitsPerPage.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 * Adds, updates, or deletes compositions with a single API request.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse> {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n\n const requestPath = '/1/compositions/*/batch';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Upsert a composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putComposition - The putComposition object.\n * @param putComposition.compositionID - Unique Composition ObjectID.\n * @param putComposition.composition - The composition object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putComposition(\n { compositionID, composition }: PutCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putComposition`.');\n }\n\n if (!composition) {\n throw new Error('Parameter `composition` is required when calling `putComposition`.');\n }\n\n if (!composition.objectID) {\n throw new Error('Parameter `composition.objectID` is required when calling `putComposition`.');\n }\n if (!composition.name) {\n throw new Error('Parameter `composition.name` is required when calling `putComposition`.');\n }\n if (!composition.behavior) {\n throw new Error('Parameter `composition.behavior` is required when calling `putComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\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: composition,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a composition rule with the provided ID already exists, it\\'s replaced. Otherwise, a new one is added.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putCompositionRule - The putCompositionRule object.\n * @param putCompositionRule.compositionID - Unique Composition ObjectID.\n * @param putCompositionRule.objectID - Unique identifier of a rule object.\n * @param putCompositionRule.compositionRule - The compositionRule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putCompositionRule(\n { compositionID, objectID, compositionRule }: PutCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule) {\n throw new Error('Parameter `compositionRule` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule.objectID) {\n throw new Error('Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.conditions) {\n throw new Error('Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.consequence) {\n throw new Error('Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\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: compositionRule,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Create or update or delete multiple composition rules.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param saveRules - The saveRules object.\n * @param saveRules.compositionID - Unique Composition ObjectID.\n * @param saveRules.rules - The rules object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules(\n { compositionID, rules }: SaveRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<RulesMultipleBatchResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `saveRules`.');\n }\n\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/batch'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs a query on a single composition and returns matching results.\n *\n * Required API Key ACLs:\n * - search\n * @param search - The search object.\n * @param search.compositionID - Unique Composition ObjectID.\n * @param search.requestBody - The requestBody object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n { compositionID, requestBody }: SearchProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponse<T>> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `search`.');\n }\n\n if (!requestBody) {\n throw new Error('Parameter `requestBody` is required when calling `search`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/run'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: requestBody,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for composition rules in your index.\n *\n * Required API Key ACLs:\n * - settings\n * @param searchCompositionRules - The searchCompositionRules object.\n * @param searchCompositionRules.compositionID - Unique Composition ObjectID.\n * @param searchCompositionRules.searchCompositionRulesParams - The searchCompositionRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchCompositionRules(\n { compositionID, searchCompositionRulesParams }: SearchCompositionRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchCompositionRulesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchCompositionRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/search'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchCompositionRulesParams ? searchCompositionRulesParams : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for values of a specified facet attribute on the composition\\'s main source\\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.compositionID - Unique Composition ObjectID.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues(\n { compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchForFacetValuesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchForFacetValues`.');\n }\n\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/facets/{facetName}/query'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{facetName}', encodeURIComponent(facetName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,mBAAmB,iBAAiB,wBAAwB;AACrE,SAAS,4BAA4B;;;ACKrC,SAAS,YAAY,uBAAuB,mBAAmB,iBAAiB,eAAe;AAsCxF,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF,EACA;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK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AEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,GAAG,wBAAwB;AAAA,MACzB;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
@@ -1201,11 +1201,11 @@ type Params = {
1201
1201
  * Relevancy threshold below which less relevant results aren\'t included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
1202
1202
  */
1203
1203
  relevancyStrictness?: number | undefined;
1204
+ facetFilters?: FacetFilters | undefined;
1204
1205
  /**
1205
- * Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
1206
+ * Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. To retrieve disjunctive facets lists, annotate any facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts) and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
1206
1207
  */
1207
1208
  facets?: Array<string> | undefined;
1208
- facetFilters?: FacetFilters | undefined;
1209
1209
  optionalFilters?: OptionalFilters | undefined;
1210
1210
  numericFilters?: NumericFilters | undefined;
1211
1211
  /**
@@ -1551,7 +1551,7 @@ type WaitForCompositionTaskOptions = {
1551
1551
  compositionID: string;
1552
1552
  };
1553
1553
 
1554
- declare const apiClientVersion = "1.17.0";
1554
+ declare const apiClientVersion = "1.18.0";
1555
1555
  declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1556
1556
  transporter: _algolia_client_common.Transporter;
1557
1557
  /**
package/dist/node.d.cts CHANGED
@@ -1201,11 +1201,11 @@ type Params = {
1201
1201
  * Relevancy threshold below which less relevant results aren\'t included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
1202
1202
  */
1203
1203
  relevancyStrictness?: number | undefined;
1204
+ facetFilters?: FacetFilters | undefined;
1204
1205
  /**
1205
- * Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
1206
+ * Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. To retrieve disjunctive facets lists, annotate any facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts) and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
1206
1207
  */
1207
1208
  facets?: Array<string> | undefined;
1208
- facetFilters?: FacetFilters | undefined;
1209
1209
  optionalFilters?: OptionalFilters | undefined;
1210
1210
  numericFilters?: NumericFilters | undefined;
1211
1211
  /**
@@ -1551,7 +1551,7 @@ type WaitForCompositionTaskOptions = {
1551
1551
  compositionID: string;
1552
1552
  };
1553
1553
 
1554
- declare const apiClientVersion = "1.17.0";
1554
+ declare const apiClientVersion = "1.18.0";
1555
1555
  declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1556
1556
  transporter: _algolia_client_common.Transporter;
1557
1557
  /**
package/dist/node.d.ts CHANGED
@@ -1201,11 +1201,11 @@ type Params = {
1201
1201
  * Relevancy threshold below which less relevant results aren\'t included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
1202
1202
  */
1203
1203
  relevancyStrictness?: number | undefined;
1204
+ facetFilters?: FacetFilters | undefined;
1204
1205
  /**
1205
- * Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
1206
+ * Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. To retrieve disjunctive facets lists, annotate any facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts) and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
1206
1207
  */
1207
1208
  facets?: Array<string> | undefined;
1208
- facetFilters?: FacetFilters | undefined;
1209
1209
  optionalFilters?: OptionalFilters | undefined;
1210
1210
  numericFilters?: NumericFilters | undefined;
1211
1211
  /**
@@ -1551,7 +1551,7 @@ type WaitForCompositionTaskOptions = {
1551
1551
  compositionID: string;
1552
1552
  };
1553
1553
 
1554
- declare const apiClientVersion = "1.17.0";
1554
+ declare const apiClientVersion = "1.18.0";
1555
1555
  declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1556
1556
  transporter: _algolia_client_common.Transporter;
1557
1557
  /**
@@ -25,7 +25,7 @@ __export(compositionClient_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(compositionClient_exports);
27
27
  var import_client_common = require("@algolia/client-common");
28
- var apiClientVersion = "1.17.0";
28
+ var apiClientVersion = "1.18.0";
29
29
  function getDefaultHosts(appId) {
30
30
  return [
31
31
  {