@algolia/composition 1.19.0 → 1.21.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.
- package/README.md +4 -4
- package/dist/browser.d.ts +56 -52
- package/dist/builds/browser.js +2 -2
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +1 -1
- package/dist/builds/fetch.js +2 -2
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +2 -2
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +2 -2
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +2 -2
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +56 -52
- package/dist/node.d.cts +56 -52
- package/dist/node.d.ts +56 -52
- package/dist/src/compositionClient.cjs +2 -2
- package/dist/src/compositionClient.cjs.map +1 -1
- package/dist/src/compositionClient.js +2 -2
- package/dist/src/compositionClient.js.map +1 -1
- package/dist/worker.d.ts +56 -52
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -40,11 +40,11 @@ All of our clients comes with type definition, and are available for both browse
|
|
|
40
40
|
### With a package manager
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
yarn add @algolia/composition@1.
|
|
43
|
+
yarn add @algolia/composition@1.21.0
|
|
44
44
|
# or
|
|
45
|
-
npm install @algolia/composition@1.
|
|
45
|
+
npm install @algolia/composition@1.21.0
|
|
46
46
|
# or
|
|
47
|
-
pnpm add @algolia/composition@1.
|
|
47
|
+
pnpm add @algolia/composition@1.21.0
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
### Without a package manager
|
|
@@ -52,7 +52,7 @@ pnpm add @algolia/composition@1.19.0
|
|
|
52
52
|
Add the following JavaScript snippet to the <head> of your website:
|
|
53
53
|
|
|
54
54
|
```html
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@algolia/composition@1.
|
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/@algolia/composition@1.21.0/dist/builds/browser.umd.js"></script>
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### Usage
|
package/dist/browser.d.ts
CHANGED
|
@@ -1182,101 +1182,105 @@ type InsideBoundingBox = string | Array<Array<number>>;
|
|
|
1182
1182
|
|
|
1183
1183
|
type Params = {
|
|
1184
1184
|
/**
|
|
1185
|
-
*
|
|
1185
|
+
* Whether this search will be included in Analytics.
|
|
1186
1186
|
*/
|
|
1187
|
-
|
|
1187
|
+
analytics?: boolean | undefined;
|
|
1188
1188
|
/**
|
|
1189
|
-
*
|
|
1189
|
+
* Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments).
|
|
1190
1190
|
*/
|
|
1191
|
-
|
|
1191
|
+
analyticsTags?: Array<string> | undefined;
|
|
1192
1192
|
/**
|
|
1193
|
-
*
|
|
1193
|
+
* Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
|
|
1194
1194
|
*/
|
|
1195
|
-
|
|
1195
|
+
aroundLatLng?: string | undefined;
|
|
1196
1196
|
/**
|
|
1197
|
-
* Whether the
|
|
1197
|
+
* Whether to obtain the coordinates from the request\'s IP address.
|
|
1198
1198
|
*/
|
|
1199
|
-
|
|
1199
|
+
aroundLatLngViaIP?: boolean | undefined;
|
|
1200
|
+
aroundRadius?: AroundRadius | undefined;
|
|
1201
|
+
aroundPrecision?: AroundPrecision | undefined;
|
|
1200
1202
|
/**
|
|
1201
|
-
*
|
|
1203
|
+
* Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).
|
|
1202
1204
|
*/
|
|
1203
|
-
|
|
1205
|
+
clickAnalytics?: boolean | undefined;
|
|
1206
|
+
/**
|
|
1207
|
+
* Whether to enable index level A/B testing for this run request. If the composition mixes multiple indices, the A/B test is ignored.
|
|
1208
|
+
*/
|
|
1209
|
+
enableABTest?: boolean | undefined;
|
|
1210
|
+
/**
|
|
1211
|
+
* Whether to enable Personalization.
|
|
1212
|
+
*/
|
|
1213
|
+
enablePersonalization?: boolean | undefined;
|
|
1214
|
+
/**
|
|
1215
|
+
* Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
|
|
1216
|
+
*/
|
|
1217
|
+
enableReRanking?: boolean | undefined;
|
|
1218
|
+
/**
|
|
1219
|
+
* Whether to enable composition rules.
|
|
1220
|
+
*/
|
|
1221
|
+
enableRules?: boolean | undefined;
|
|
1204
1222
|
facetFilters?: FacetFilters | undefined;
|
|
1205
1223
|
/**
|
|
1206
1224
|
* 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).
|
|
1207
1225
|
*/
|
|
1208
1226
|
facets?: Array<string> | undefined;
|
|
1209
|
-
optionalFilters?: OptionalFilters | undefined;
|
|
1210
|
-
numericFilters?: NumericFilters | undefined;
|
|
1211
1227
|
/**
|
|
1212
|
-
*
|
|
1228
|
+
* Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering).
|
|
1213
1229
|
*/
|
|
1214
|
-
|
|
1230
|
+
filters?: string | undefined;
|
|
1215
1231
|
/**
|
|
1216
|
-
*
|
|
1232
|
+
* Whether the run response should include detailed ranking information.
|
|
1217
1233
|
*/
|
|
1218
|
-
|
|
1234
|
+
getRankingInfo?: boolean | undefined;
|
|
1219
1235
|
/**
|
|
1220
|
-
*
|
|
1236
|
+
* Number of hits per page.
|
|
1221
1237
|
*/
|
|
1222
|
-
|
|
1223
|
-
aroundRadius?: AroundRadius | undefined;
|
|
1224
|
-
aroundPrecision?: AroundPrecision | undefined;
|
|
1238
|
+
hitsPerPage?: number | undefined;
|
|
1225
1239
|
/**
|
|
1226
|
-
*
|
|
1240
|
+
* A list of extenrally injected objectID groups into from an external source.
|
|
1227
1241
|
*/
|
|
1228
|
-
|
|
1242
|
+
injectedItems?: {
|
|
1243
|
+
[key: string]: ExternalInjectedItem;
|
|
1244
|
+
} | undefined;
|
|
1229
1245
|
insideBoundingBox?: InsideBoundingBox | null | undefined;
|
|
1230
1246
|
/**
|
|
1231
1247
|
* Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
|
|
1232
1248
|
*/
|
|
1233
1249
|
insidePolygon?: Array<Array<number>> | undefined;
|
|
1234
1250
|
/**
|
|
1235
|
-
*
|
|
1251
|
+
* Minimum radius (in meters) for a search around a location when `aroundRadius` isn\'t set.
|
|
1236
1252
|
*/
|
|
1237
|
-
|
|
1253
|
+
minimumAroundRadius?: number | undefined;
|
|
1238
1254
|
/**
|
|
1239
1255
|
* ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
|
|
1240
1256
|
*/
|
|
1241
1257
|
naturalLanguages?: Array<SupportedLanguage> | undefined;
|
|
1258
|
+
numericFilters?: NumericFilters | undefined;
|
|
1259
|
+
optionalFilters?: OptionalFilters | undefined;
|
|
1242
1260
|
/**
|
|
1243
|
-
*
|
|
1244
|
-
*/
|
|
1245
|
-
enableRules?: boolean | undefined;
|
|
1246
|
-
/**
|
|
1247
|
-
* Assigns a rule context to the run query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
|
|
1248
|
-
*/
|
|
1249
|
-
ruleContexts?: Array<string> | undefined;
|
|
1250
|
-
/**
|
|
1251
|
-
* Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
|
|
1252
|
-
*/
|
|
1253
|
-
userToken?: string | undefined;
|
|
1254
|
-
/**
|
|
1255
|
-
* Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).
|
|
1261
|
+
* Page of search results to retrieve.
|
|
1256
1262
|
*/
|
|
1257
|
-
|
|
1263
|
+
page?: number | undefined;
|
|
1258
1264
|
/**
|
|
1259
|
-
*
|
|
1265
|
+
* Search query.
|
|
1260
1266
|
*/
|
|
1261
|
-
|
|
1267
|
+
query?: string | undefined;
|
|
1262
1268
|
/**
|
|
1263
|
-
*
|
|
1269
|
+
* 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.
|
|
1264
1270
|
*/
|
|
1265
|
-
|
|
1271
|
+
relevancyStrictness?: number | undefined;
|
|
1266
1272
|
/**
|
|
1267
|
-
*
|
|
1273
|
+
* Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first** **You should always specify a query language.** If you don\'t specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations).
|
|
1268
1274
|
*/
|
|
1269
|
-
|
|
1275
|
+
queryLanguages?: Array<SupportedLanguage> | undefined;
|
|
1270
1276
|
/**
|
|
1271
|
-
*
|
|
1277
|
+
* Assigns a rule context to the run query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
|
|
1272
1278
|
*/
|
|
1273
|
-
|
|
1279
|
+
ruleContexts?: Array<string> | undefined;
|
|
1274
1280
|
/**
|
|
1275
|
-
*
|
|
1281
|
+
* Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
|
|
1276
1282
|
*/
|
|
1277
|
-
|
|
1278
|
-
[key: string]: ExternalInjectedItem;
|
|
1279
|
-
} | undefined;
|
|
1283
|
+
userToken?: string | undefined;
|
|
1280
1284
|
};
|
|
1281
1285
|
|
|
1282
1286
|
type RequestBody = {
|
|
@@ -1551,7 +1555,7 @@ type WaitForCompositionTaskOptions = {
|
|
|
1551
1555
|
compositionID: string;
|
|
1552
1556
|
};
|
|
1553
1557
|
|
|
1554
|
-
declare const apiClientVersion = "1.
|
|
1558
|
+
declare const apiClientVersion = "1.21.0";
|
|
1555
1559
|
declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
1556
1560
|
transporter: _algolia_client_common.Transporter;
|
|
1557
1561
|
/**
|
|
@@ -1713,7 +1717,7 @@ declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOpt
|
|
|
1713
1717
|
*/
|
|
1714
1718
|
multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse>;
|
|
1715
1719
|
/**
|
|
1716
|
-
*
|
|
1720
|
+
* Update and insert a composition in the current Algolia application.
|
|
1717
1721
|
*
|
|
1718
1722
|
* Required API Key ACLs:
|
|
1719
1723
|
* - editSettings
|
package/dist/builds/browser.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
// src/compositionClient.ts
|
|
11
11
|
import { createAuth, createIterablePromise, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
|
|
12
|
-
var apiClientVersion = "1.
|
|
12
|
+
var apiClientVersion = "1.21.0";
|
|
13
13
|
function getDefaultHosts(appId) {
|
|
14
14
|
return [
|
|
15
15
|
{
|
|
@@ -434,7 +434,7 @@ function createCompositionClient({
|
|
|
434
434
|
return transporter.request(request, requestOptions);
|
|
435
435
|
},
|
|
436
436
|
/**
|
|
437
|
-
*
|
|
437
|
+
* Update and insert a composition in the current Algolia application.
|
|
438
438
|
*
|
|
439
439
|
* Required API Key ACLs:
|
|
440
440
|
* - editSettings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../builds/browser.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\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, 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 createCompositionClient({\n appId,\n apiKey,\n timeouts: {\n connect: 1000,\n read: 2000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinHeaders',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n\nexport type CompositionClient = ReturnType<typeof createCompositionClient>;\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.19.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":";AAEA,SAAS,0BAA0B;AAEnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACCP,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,KAA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,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;;;ADtyBO,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,wBAAwB;AAAA,IAC7B;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,QAAQ,iBAAiB;AAAA,IACzB,WAAW,mBAAmB;AAAA,IAC9B,eAAe,CAAC,EAAE,SAAS,UAAU,CAAC;AAAA,IACtC,UAAU;AAAA,IACV,gBAAgB,kBAAkB;AAAA,IAClC,eAAe,kBAAkB,EAAE,cAAc,MAAM,CAAC;AAAA,IACxD,YAAY,wBAAwB;AAAA,MAClC,QAAQ,CAAC,+BAA+B,EAAE,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAAA,IACvG,CAAC;AAAA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../builds/browser.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\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, 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 createCompositionClient({\n appId,\n apiKey,\n timeouts: {\n connect: 1000,\n read: 2000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinHeaders',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n\nexport type CompositionClient = ReturnType<typeof createCompositionClient>;\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.21.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 * Update and insert 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":";AAEA,SAAS,0BAA0B;AAEnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACCP,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,IAClC,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBA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C,QAAQ,CAAC,+BAA+B,EAAE,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAAA,IACvG,CAAC;AAAA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _(){function r(e){return new Promise(a=>{let s=new XMLHttpRequest;s.open(e.method,e.url,!0),Object.keys(e.headers).forEach(t=>s.setRequestHeader(t,e.headers[t]));let c=(t,o)=>setTimeout(()=>{s.abort(),a({status:0,content:o,isTimedOut:!0})},t),d=c(e.connectTimeout,"Connection timeout"),m;s.onreadystatechange=()=>{s.readyState>s.OPENED&&m===void 0&&(clearTimeout(d),m=c(e.responseTimeout,"Socket timeout"))},s.onerror=()=>{s.status===0&&(clearTimeout(d),clearTimeout(m),a({content:s.responseText||"Network request failed",status:s.status,isTimedOut:!1}))},s.onload=()=>{clearTimeout(d),clearTimeout(m),a({content:s.responseText,status:s.status,isTimedOut:!1})},s.send(e.data)})}return{send:r}}function L(r){let e,a=`algolia-client-js-${r.key}`;function s(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function c(){return JSON.parse(s().getItem(a)||"{}")}function d(t){s().setItem(a,JSON.stringify(t))}function m(){let t=r.timeToLive?r.timeToLive*1e3:null,o=c(),n=Object.fromEntries(Object.entries(o).filter(([,l])=>l.timestamp!==void 0));if(d(n),!t)return;let u=Object.fromEntries(Object.entries(n).filter(([,l])=>{let p=new Date().getTime();return!(l.timestamp+t<p)}));d(u)}return{get(t,o,n={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(m(),c()[JSON.stringify(t)])).then(u=>Promise.all([u?u.value:o(),u!==void 0])).then(([u,l])=>Promise.all([u,l||n.miss(u)])).then(([u])=>u)},set(t,o){return Promise.resolve().then(()=>{let n=c();return n[JSON.stringify(t)]={timestamp:new Date().getTime(),value:o},s().setItem(a,JSON.stringify(n)),o})},delete(t){return Promise.resolve().then(()=>{let o=c();delete o[JSON.stringify(t)],s().setItem(a,JSON.stringify(o))})},clear(){return Promise.resolve().then(()=>{s().removeItem(a)})}}}function Y(){return{get(r,e,a={miss:()=>Promise.resolve()}){return e().then(c=>Promise.all([c,a.miss(c)])).then(([c])=>c)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function y(r){let e=[...r.caches],a=e.shift();return a===void 0?Y():{get(s,c,d={miss:()=>Promise.resolve()}){return a.get(s,c,d).catch(()=>y({caches:e}).get(s,c,d))},set(s,c){return a.set(s,c).catch(()=>y({caches:e}).set(s,c))},delete(s){return a.delete(s).catch(()=>y({caches:e}).delete(s))},clear(){return a.clear().catch(()=>y({caches:e}).clear())}}}function I(r={serializable:!0}){let e={};return{get(a,s,c={miss:()=>Promise.resolve()}){let d=JSON.stringify(a);if(d in e)return Promise.resolve(r.serializable?JSON.parse(e[d]):e[d]);let m=s();return m.then(t=>c.miss(t)).then(()=>m)},set(a,s){return e[JSON.stringify(a)]=r.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(a){return delete e[JSON.stringify(a)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}function Z(r){let e={value:`Algolia for JavaScript (${r})`,add(a){let s=`; ${a.segment}${a.version!==void 0?` (${a.version})`:""}`;return e.value.indexOf(s)===-1&&(e.value=`${e.value}${s}`),e}};return e}function $(r,e,a="WithinHeaders"){let s={"x-algolia-api-key":e,"x-algolia-application-id":r};return{headers(){return a==="WithinHeaders"?s:{}},queryParameters(){return a==="WithinQueryParameters"?s:{}}}}function Q({func:r,validate:e,aggregator:a,error:s,timeout:c=()=>0}){let d=m=>new Promise((t,o)=>{r(m).then(async n=>(a&&await a(n),await e(n)?t(n):s&&await s.validate(n)?o(new Error(await s.message(n))):setTimeout(()=>{d(n).then(t).catch(o)},await c()))).catch(n=>{o(n)})});return d()}function G({algoliaAgents:r,client:e,version:a}){let s=Z(a).add({segment:e,version:a});return r.forEach(c=>s.add(c)),s}function W(){return{debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var F=120*1e3;function j(r,e="up"){let a=Date.now();function s(){return e==="up"||Date.now()-a>F}function c(){return e==="timed out"&&Date.now()-a<=F}return{...r,status:e,lastUpdate:a,isUp:s,isTimedOut:c}}var M=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e)}};var B=class extends M{stackTrace;constructor(r,e,a){super(r,a),this.stackTrace=e}},ee=class extends B{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",r,"RetryError")}},S=class extends B{status;constructor(r,e,a,s="ApiError"){super(r,a,s),this.status=e}},re=class extends M{response;constructor(r,e){super(r,"DeserializationError"),this.response=e}},te=class extends S{error;constructor(r,e,a,s){super(r,e,s,"DetailedApiError"),this.error=a}};function J(r){let e=r;for(let a=r.length-1;a>0;a--){let s=Math.floor(Math.random()*(a+1)),c=r[a];e[a]=r[s],e[s]=c}return e}function oe(r,e,a){let s=se(a),c=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return s.length&&(c+=`?${s}`),c}function se(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replace(/\+/g,"%20")}`).join("&")}function ae(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let a=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(a)}function ne(r,e,a){let s={Accept:"application/json",...r,...e,...a},c={};return Object.keys(s).forEach(d=>{let m=s[d];c[d.toLowerCase()]=m}),c}function ie(r){try{return JSON.parse(r.content)}catch(e){throw new re(e.message,r)}}function ce({content:r,status:e},a){try{let s=JSON.parse(r);return"error"in s?new te(s.message,e,s.error,a):new S(s.message,e,a)}catch{}return new S(r,e,a)}function me({isTimedOut:r,status:e}){return!r&&~~e===0}function ue({isTimedOut:r,status:e}){return r||me({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function pe({status:r}){return~~(r/100)===2}function le(r){return r.map(e=>z(e))}function z(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function V({hosts:r,hostsCache:e,baseHeaders:a,logger:s,baseQueryParameters:c,algoliaAgent:d,timeouts:m,requester:t,requestsCache:o,responsesCache:n}){async function u(i){let h=await Promise.all(i.map(f=>e.get(f,()=>Promise.resolve(j(f))))),w=h.filter(f=>f.isUp()),g=h.filter(f=>f.isTimedOut()),C=[...w,...g];return{hosts:C.length>0?C:i,getTimeout(f,x){return(g.length===0&&f===0?1:g.length+3+f)*x}}}async function l(i,h,w=!0){let g=[],C=ae(i,h),q=ne(a,i.headers,h.headers),f=i.method==="GET"?{...i.data,...h.data}:{},x={...c,...i.queryParameters,...f};if(d.value&&(x["x-algolia-agent"]=d.value),h&&h.queryParameters)for(let P of Object.keys(h.queryParameters))!h.queryParameters[P]||Object.prototype.toString.call(h.queryParameters[P])==="[object Object]"?x[P]=h.queryParameters[P]:x[P]=h.queryParameters[P].toString();let T=0,A=async(P,D)=>{let E=P.pop();if(E===void 0)throw new ee(le(g));let O={...m,...h.timeouts},U={data:C,headers:q,method:i.method,url:oe(E,i.path,x),connectTimeout:D(T,O.connect),responseTimeout:D(T,w?O.read:O.write)},N=b=>{let H={request:U,response:b,host:E,triesLeft:P.length};return g.push(H),H},R=await t.send(U);if(ue(R)){let b=N(R);return R.isTimedOut&&T++,s.info("Retryable failure",z(b)),await e.set(E,j(E,R.isTimedOut?"timed out":"down")),A(P,D)}if(pe(R))return ie(R);throw N(R),ce(R,g)},K=r.filter(P=>P.accept==="readWrite"||(w?P.accept==="read":P.accept==="write")),k=await u(K);return A([...k.hosts].reverse(),k.getTimeout)}function p(i,h={}){let w=i.useReadTransporter||i.method==="GET";if(!w)return l(i,h,w);let g=()=>l(i,h);if((h.cacheable||i.cacheable)!==!0)return g();let q={request:i,requestOptions:h,transporter:{queryParameters:c,headers:a}};return n.get(q,()=>o.get(q,()=>o.set(q,g()).then(f=>Promise.all([o.delete(q),f]),f=>Promise.all([o.delete(q),Promise.reject(f)])).then(([f,x])=>x)),{miss:f=>n.set(q,f)})}return{hostsCache:e,requester:t,timeouts:m,logger:s,algoliaAgent:d,baseHeaders:a,baseQueryParameters:c,hosts:r,request:p,requestsCache:o,responsesCache:n}}var v="1.19.0";function he(r){return[{url:`${r}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${r}.algolia.net`,accept:"write",protocol:"https"}].concat(J([{url:`${r}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${r}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${r}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function X({appId:r,apiKey:e,authMode:a,algoliaAgents:s,...c}){let d=$(r,e,a),m=V({hosts:he(r),...c,algoliaAgent:G({algoliaAgents:s,client:"Composition",version:v}),baseHeaders:{"content-type":"text/plain",...d.headers(),...c.baseHeaders},baseQueryParameters:{...d.queryParameters(),...c.baseQueryParameters}});return{transporter:m,appId:r,apiKey:e,clearCache(){return Promise.all([m.requestsCache.clear(),m.responsesCache.clear()]).then(()=>{})},get _ua(){return m.algoliaAgent.value},addAlgoliaAgent(t,o){m.algoliaAgent.add({segment:t,version:o})},setClientApiKey({apiKey:t}){!a||a==="WithinHeaders"?m.baseHeaders["x-algolia-api-key"]=t:m.baseQueryParameters["x-algolia-api-key"]=t},waitForCompositionTask({compositionID:t,taskID:o,maxRetries:n=50,timeout:u=p=>Math.min(p*200,5e3)},l){let p=0;return Q({func:()=>this.getTask({compositionID:t,taskID:o},l),validate:i=>i.status==="published",aggregator:()=>p+=1,error:{validate:()=>p>=n,message:()=>`The maximum number of retries exceeded. (${p}/${n})`},timeout:()=>u(p)})},customDelete({path:t,parameters:o},n){if(!t)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",t),queryParameters:o||{},headers:{}};return m.request(i,n)},customGet({path:t,parameters:o},n){if(!t)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",t),queryParameters:o||{},headers:{}};return m.request(i,n)},customPost({path:t,parameters:o,body:n},u){if(!t)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",t),queryParameters:o||{},headers:{},data:n||{}};return m.request(h,u)},customPut({path:t,parameters:o,body:n},u){if(!t)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",t),queryParameters:o||{},headers:{},data:n||{}};return m.request(h,u)},deleteComposition({compositionID:t},o){if(!t)throw new Error("Parameter `compositionID` is required when calling `deleteComposition`.");let p={method:"DELETE",path:"/1/compositions/{compositionID}".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return m.request(p,o)},deleteCompositionRule({compositionID:t,objectID:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `deleteCompositionRule`.");if(!o)throw new Error("Parameter `objectID` is required when calling `deleteCompositionRule`.");let i={method:"DELETE",path:"/1/compositions/{compositionID}/rules/{objectID}".replace("{compositionID}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(o)),queryParameters:{},headers:{}};return m.request(i,n)},getComposition({compositionID:t},o){if(!t)throw new Error("Parameter `compositionID` is required when calling `getComposition`.");let p={method:"GET",path:"/1/compositions/{compositionID}".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return m.request(p,o)},getRule({compositionID:t,objectID:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `getRule`.");if(!o)throw new Error("Parameter `objectID` is required when calling `getRule`.");let i={method:"GET",path:"/1/compositions/{compositionID}/rules/{objectID}".replace("{compositionID}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(o)),queryParameters:{},headers:{}};return m.request(i,n)},getTask({compositionID:t,taskID:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `getTask`.");if(!o)throw new Error("Parameter `taskID` is required when calling `getTask`.");let i={method:"GET",path:"/1/compositions/{compositionID}/task/{taskID}".replace("{compositionID}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(o)),queryParameters:{},headers:{}};return m.request(i,n)},listCompositions({page:t,hitsPerPage:o}={},n=void 0){let u="/1/compositions",l={},p={};t!==void 0&&(p.page=t.toString()),o!==void 0&&(p.hitsPerPage=o.toString());let i={method:"GET",path:u,queryParameters:p,headers:l};return m.request(i,n)},multipleBatch(t,o){if(!t)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!t.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");let p={method:"POST",path:"/1/compositions/*/batch",queryParameters:{},headers:{},data:t};return m.request(p,o)},putComposition({compositionID:t,composition:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `putComposition`.");if(!o)throw new Error("Parameter `composition` is required when calling `putComposition`.");if(!o.objectID)throw new Error("Parameter `composition.objectID` is required when calling `putComposition`.");if(!o.name)throw new Error("Parameter `composition.name` is required when calling `putComposition`.");if(!o.behavior)throw new Error("Parameter `composition.behavior` is required when calling `putComposition`.");let i={method:"PUT",path:"/1/compositions/{compositionID}".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:o};return m.request(i,n)},putCompositionRule({compositionID:t,objectID:o,compositionRule:n},u){if(!t)throw new Error("Parameter `compositionID` is required when calling `putCompositionRule`.");if(!o)throw new Error("Parameter `objectID` is required when calling `putCompositionRule`.");if(!n)throw new Error("Parameter `compositionRule` is required when calling `putCompositionRule`.");if(!n.objectID)throw new Error("Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.");if(!n.conditions)throw new Error("Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.");if(!n.consequence)throw new Error("Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.");let h={method:"PUT",path:"/1/compositions/{compositionID}/rules/{objectID}".replace("{compositionID}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(o)),queryParameters:{},headers:{},data:n};return m.request(h,u)},saveRules({compositionID:t,rules:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `saveRules`.");if(!o)throw new Error("Parameter `rules` is required when calling `saveRules`.");let i={method:"POST",path:"/1/compositions/{compositionID}/rules/batch".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:o};return m.request(i,n)},search({compositionID:t,requestBody:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `search`.");if(!o)throw new Error("Parameter `requestBody` is required when calling `search`.");let i={method:"POST",path:"/1/compositions/{compositionID}/run".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:o,useReadTransporter:!0,cacheable:!0};return m.request(i,n)},searchCompositionRules({compositionID:t,searchCompositionRulesParams:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `searchCompositionRules`.");let i={method:"POST",path:"/1/compositions/{compositionID}/rules/search".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:o||{}};return m.request(i,n)},searchForFacetValues({compositionID:t,facetName:o,searchForFacetValuesRequest:n},u){if(!t)throw new Error("Parameter `compositionID` is required when calling `searchForFacetValues`.");if(!o)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");let h={method:"POST",path:"/1/compositions/{compositionID}/facets/{facetName}/query".replace("{compositionID}",encodeURIComponent(t)).replace("{facetName}",encodeURIComponent(o)),queryParameters:{},headers:{},data:n||{},useReadTransporter:!0,cacheable:!0};return m.request(h,u)}}}function Nt(r,e,a){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");return X({appId:r,apiKey:e,timeouts:{connect:1e3,read:2e3,write:3e4},logger:W(),requester:_(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinHeaders",responsesCache:I(),requestsCache:I({serializable:!1}),hostsCache:y({caches:[L({key:`${v}-${r}`}),I()]}),...a})}export{v as apiClientVersion,Nt as compositionClient};
|
|
1
|
+
function _(){function r(e){return new Promise(a=>{let s=new XMLHttpRequest;s.open(e.method,e.url,!0),Object.keys(e.headers).forEach(t=>s.setRequestHeader(t,e.headers[t]));let c=(t,o)=>setTimeout(()=>{s.abort(),a({status:0,content:o,isTimedOut:!0})},t),d=c(e.connectTimeout,"Connection timeout"),m;s.onreadystatechange=()=>{s.readyState>s.OPENED&&m===void 0&&(clearTimeout(d),m=c(e.responseTimeout,"Socket timeout"))},s.onerror=()=>{s.status===0&&(clearTimeout(d),clearTimeout(m),a({content:s.responseText||"Network request failed",status:s.status,isTimedOut:!1}))},s.onload=()=>{clearTimeout(d),clearTimeout(m),a({content:s.responseText,status:s.status,isTimedOut:!1})},s.send(e.data)})}return{send:r}}function L(r){let e,a=`algolia-client-js-${r.key}`;function s(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function c(){return JSON.parse(s().getItem(a)||"{}")}function d(t){s().setItem(a,JSON.stringify(t))}function m(){let t=r.timeToLive?r.timeToLive*1e3:null,o=c(),n=Object.fromEntries(Object.entries(o).filter(([,l])=>l.timestamp!==void 0));if(d(n),!t)return;let u=Object.fromEntries(Object.entries(n).filter(([,l])=>{let p=new Date().getTime();return!(l.timestamp+t<p)}));d(u)}return{get(t,o,n={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(m(),c()[JSON.stringify(t)])).then(u=>Promise.all([u?u.value:o(),u!==void 0])).then(([u,l])=>Promise.all([u,l||n.miss(u)])).then(([u])=>u)},set(t,o){return Promise.resolve().then(()=>{let n=c();return n[JSON.stringify(t)]={timestamp:new Date().getTime(),value:o},s().setItem(a,JSON.stringify(n)),o})},delete(t){return Promise.resolve().then(()=>{let o=c();delete o[JSON.stringify(t)],s().setItem(a,JSON.stringify(o))})},clear(){return Promise.resolve().then(()=>{s().removeItem(a)})}}}function Y(){return{get(r,e,a={miss:()=>Promise.resolve()}){return e().then(c=>Promise.all([c,a.miss(c)])).then(([c])=>c)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function y(r){let e=[...r.caches],a=e.shift();return a===void 0?Y():{get(s,c,d={miss:()=>Promise.resolve()}){return a.get(s,c,d).catch(()=>y({caches:e}).get(s,c,d))},set(s,c){return a.set(s,c).catch(()=>y({caches:e}).set(s,c))},delete(s){return a.delete(s).catch(()=>y({caches:e}).delete(s))},clear(){return a.clear().catch(()=>y({caches:e}).clear())}}}function I(r={serializable:!0}){let e={};return{get(a,s,c={miss:()=>Promise.resolve()}){let d=JSON.stringify(a);if(d in e)return Promise.resolve(r.serializable?JSON.parse(e[d]):e[d]);let m=s();return m.then(t=>c.miss(t)).then(()=>m)},set(a,s){return e[JSON.stringify(a)]=r.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(a){return delete e[JSON.stringify(a)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}function Z(r){let e={value:`Algolia for JavaScript (${r})`,add(a){let s=`; ${a.segment}${a.version!==void 0?` (${a.version})`:""}`;return e.value.indexOf(s)===-1&&(e.value=`${e.value}${s}`),e}};return e}function $(r,e,a="WithinHeaders"){let s={"x-algolia-api-key":e,"x-algolia-application-id":r};return{headers(){return a==="WithinHeaders"?s:{}},queryParameters(){return a==="WithinQueryParameters"?s:{}}}}function Q({func:r,validate:e,aggregator:a,error:s,timeout:c=()=>0}){let d=m=>new Promise((t,o)=>{r(m).then(async n=>(a&&await a(n),await e(n)?t(n):s&&await s.validate(n)?o(new Error(await s.message(n))):setTimeout(()=>{d(n).then(t).catch(o)},await c()))).catch(n=>{o(n)})});return d()}function G({algoliaAgents:r,client:e,version:a}){let s=Z(a).add({segment:e,version:a});return r.forEach(c=>s.add(c)),s}function W(){return{debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var F=120*1e3;function j(r,e="up"){let a=Date.now();function s(){return e==="up"||Date.now()-a>F}function c(){return e==="timed out"&&Date.now()-a<=F}return{...r,status:e,lastUpdate:a,isUp:s,isTimedOut:c}}var M=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e)}};var B=class extends M{stackTrace;constructor(r,e,a){super(r,a),this.stackTrace=e}},ee=class extends B{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",r,"RetryError")}},S=class extends B{status;constructor(r,e,a,s="ApiError"){super(r,a,s),this.status=e}},re=class extends M{response;constructor(r,e){super(r,"DeserializationError"),this.response=e}},te=class extends S{error;constructor(r,e,a,s){super(r,e,s,"DetailedApiError"),this.error=a}};function J(r){let e=r;for(let a=r.length-1;a>0;a--){let s=Math.floor(Math.random()*(a+1)),c=r[a];e[a]=r[s],e[s]=c}return e}function oe(r,e,a){let s=se(a),c=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return s.length&&(c+=`?${s}`),c}function se(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replace(/\+/g,"%20")}`).join("&")}function ae(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let a=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(a)}function ne(r,e,a){let s={Accept:"application/json",...r,...e,...a},c={};return Object.keys(s).forEach(d=>{let m=s[d];c[d.toLowerCase()]=m}),c}function ie(r){try{return JSON.parse(r.content)}catch(e){throw new re(e.message,r)}}function ce({content:r,status:e},a){try{let s=JSON.parse(r);return"error"in s?new te(s.message,e,s.error,a):new S(s.message,e,a)}catch{}return new S(r,e,a)}function me({isTimedOut:r,status:e}){return!r&&~~e===0}function ue({isTimedOut:r,status:e}){return r||me({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function pe({status:r}){return~~(r/100)===2}function le(r){return r.map(e=>z(e))}function z(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function V({hosts:r,hostsCache:e,baseHeaders:a,logger:s,baseQueryParameters:c,algoliaAgent:d,timeouts:m,requester:t,requestsCache:o,responsesCache:n}){async function u(i){let h=await Promise.all(i.map(f=>e.get(f,()=>Promise.resolve(j(f))))),w=h.filter(f=>f.isUp()),g=h.filter(f=>f.isTimedOut()),C=[...w,...g];return{hosts:C.length>0?C:i,getTimeout(f,x){return(g.length===0&&f===0?1:g.length+3+f)*x}}}async function l(i,h,w=!0){let g=[],C=ae(i,h),q=ne(a,i.headers,h.headers),f=i.method==="GET"?{...i.data,...h.data}:{},x={...c,...i.queryParameters,...f};if(d.value&&(x["x-algolia-agent"]=d.value),h&&h.queryParameters)for(let P of Object.keys(h.queryParameters))!h.queryParameters[P]||Object.prototype.toString.call(h.queryParameters[P])==="[object Object]"?x[P]=h.queryParameters[P]:x[P]=h.queryParameters[P].toString();let T=0,A=async(P,D)=>{let E=P.pop();if(E===void 0)throw new ee(le(g));let O={...m,...h.timeouts},U={data:C,headers:q,method:i.method,url:oe(E,i.path,x),connectTimeout:D(T,O.connect),responseTimeout:D(T,w?O.read:O.write)},N=b=>{let H={request:U,response:b,host:E,triesLeft:P.length};return g.push(H),H},R=await t.send(U);if(ue(R)){let b=N(R);return R.isTimedOut&&T++,s.info("Retryable failure",z(b)),await e.set(E,j(E,R.isTimedOut?"timed out":"down")),A(P,D)}if(pe(R))return ie(R);throw N(R),ce(R,g)},K=r.filter(P=>P.accept==="readWrite"||(w?P.accept==="read":P.accept==="write")),k=await u(K);return A([...k.hosts].reverse(),k.getTimeout)}function p(i,h={}){let w=i.useReadTransporter||i.method==="GET";if(!w)return l(i,h,w);let g=()=>l(i,h);if((h.cacheable||i.cacheable)!==!0)return g();let q={request:i,requestOptions:h,transporter:{queryParameters:c,headers:a}};return n.get(q,()=>o.get(q,()=>o.set(q,g()).then(f=>Promise.all([o.delete(q),f]),f=>Promise.all([o.delete(q),Promise.reject(f)])).then(([f,x])=>x)),{miss:f=>n.set(q,f)})}return{hostsCache:e,requester:t,timeouts:m,logger:s,algoliaAgent:d,baseHeaders:a,baseQueryParameters:c,hosts:r,request:p,requestsCache:o,responsesCache:n}}var v="1.21.0";function he(r){return[{url:`${r}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${r}.algolia.net`,accept:"write",protocol:"https"}].concat(J([{url:`${r}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${r}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${r}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function X({appId:r,apiKey:e,authMode:a,algoliaAgents:s,...c}){let d=$(r,e,a),m=V({hosts:he(r),...c,algoliaAgent:G({algoliaAgents:s,client:"Composition",version:v}),baseHeaders:{"content-type":"text/plain",...d.headers(),...c.baseHeaders},baseQueryParameters:{...d.queryParameters(),...c.baseQueryParameters}});return{transporter:m,appId:r,apiKey:e,clearCache(){return Promise.all([m.requestsCache.clear(),m.responsesCache.clear()]).then(()=>{})},get _ua(){return m.algoliaAgent.value},addAlgoliaAgent(t,o){m.algoliaAgent.add({segment:t,version:o})},setClientApiKey({apiKey:t}){!a||a==="WithinHeaders"?m.baseHeaders["x-algolia-api-key"]=t:m.baseQueryParameters["x-algolia-api-key"]=t},waitForCompositionTask({compositionID:t,taskID:o,maxRetries:n=50,timeout:u=p=>Math.min(p*200,5e3)},l){let p=0;return Q({func:()=>this.getTask({compositionID:t,taskID:o},l),validate:i=>i.status==="published",aggregator:()=>p+=1,error:{validate:()=>p>=n,message:()=>`The maximum number of retries exceeded. (${p}/${n})`},timeout:()=>u(p)})},customDelete({path:t,parameters:o},n){if(!t)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",t),queryParameters:o||{},headers:{}};return m.request(i,n)},customGet({path:t,parameters:o},n){if(!t)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",t),queryParameters:o||{},headers:{}};return m.request(i,n)},customPost({path:t,parameters:o,body:n},u){if(!t)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",t),queryParameters:o||{},headers:{},data:n||{}};return m.request(h,u)},customPut({path:t,parameters:o,body:n},u){if(!t)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",t),queryParameters:o||{},headers:{},data:n||{}};return m.request(h,u)},deleteComposition({compositionID:t},o){if(!t)throw new Error("Parameter `compositionID` is required when calling `deleteComposition`.");let p={method:"DELETE",path:"/1/compositions/{compositionID}".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return m.request(p,o)},deleteCompositionRule({compositionID:t,objectID:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `deleteCompositionRule`.");if(!o)throw new Error("Parameter `objectID` is required when calling `deleteCompositionRule`.");let i={method:"DELETE",path:"/1/compositions/{compositionID}/rules/{objectID}".replace("{compositionID}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(o)),queryParameters:{},headers:{}};return m.request(i,n)},getComposition({compositionID:t},o){if(!t)throw new Error("Parameter `compositionID` is required when calling `getComposition`.");let p={method:"GET",path:"/1/compositions/{compositionID}".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return m.request(p,o)},getRule({compositionID:t,objectID:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `getRule`.");if(!o)throw new Error("Parameter `objectID` is required when calling `getRule`.");let i={method:"GET",path:"/1/compositions/{compositionID}/rules/{objectID}".replace("{compositionID}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(o)),queryParameters:{},headers:{}};return m.request(i,n)},getTask({compositionID:t,taskID:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `getTask`.");if(!o)throw new Error("Parameter `taskID` is required when calling `getTask`.");let i={method:"GET",path:"/1/compositions/{compositionID}/task/{taskID}".replace("{compositionID}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(o)),queryParameters:{},headers:{}};return m.request(i,n)},listCompositions({page:t,hitsPerPage:o}={},n=void 0){let u="/1/compositions",l={},p={};t!==void 0&&(p.page=t.toString()),o!==void 0&&(p.hitsPerPage=o.toString());let i={method:"GET",path:u,queryParameters:p,headers:l};return m.request(i,n)},multipleBatch(t,o){if(!t)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!t.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");let p={method:"POST",path:"/1/compositions/*/batch",queryParameters:{},headers:{},data:t};return m.request(p,o)},putComposition({compositionID:t,composition:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `putComposition`.");if(!o)throw new Error("Parameter `composition` is required when calling `putComposition`.");if(!o.objectID)throw new Error("Parameter `composition.objectID` is required when calling `putComposition`.");if(!o.name)throw new Error("Parameter `composition.name` is required when calling `putComposition`.");if(!o.behavior)throw new Error("Parameter `composition.behavior` is required when calling `putComposition`.");let i={method:"PUT",path:"/1/compositions/{compositionID}".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:o};return m.request(i,n)},putCompositionRule({compositionID:t,objectID:o,compositionRule:n},u){if(!t)throw new Error("Parameter `compositionID` is required when calling `putCompositionRule`.");if(!o)throw new Error("Parameter `objectID` is required when calling `putCompositionRule`.");if(!n)throw new Error("Parameter `compositionRule` is required when calling `putCompositionRule`.");if(!n.objectID)throw new Error("Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.");if(!n.conditions)throw new Error("Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.");if(!n.consequence)throw new Error("Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.");let h={method:"PUT",path:"/1/compositions/{compositionID}/rules/{objectID}".replace("{compositionID}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(o)),queryParameters:{},headers:{},data:n};return m.request(h,u)},saveRules({compositionID:t,rules:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `saveRules`.");if(!o)throw new Error("Parameter `rules` is required when calling `saveRules`.");let i={method:"POST",path:"/1/compositions/{compositionID}/rules/batch".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:o};return m.request(i,n)},search({compositionID:t,requestBody:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `search`.");if(!o)throw new Error("Parameter `requestBody` is required when calling `search`.");let i={method:"POST",path:"/1/compositions/{compositionID}/run".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:o,useReadTransporter:!0,cacheable:!0};return m.request(i,n)},searchCompositionRules({compositionID:t,searchCompositionRulesParams:o},n){if(!t)throw new Error("Parameter `compositionID` is required when calling `searchCompositionRules`.");let i={method:"POST",path:"/1/compositions/{compositionID}/rules/search".replace("{compositionID}",encodeURIComponent(t)),queryParameters:{},headers:{},data:o||{}};return m.request(i,n)},searchForFacetValues({compositionID:t,facetName:o,searchForFacetValuesRequest:n},u){if(!t)throw new Error("Parameter `compositionID` is required when calling `searchForFacetValues`.");if(!o)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");let h={method:"POST",path:"/1/compositions/{compositionID}/facets/{facetName}/query".replace("{compositionID}",encodeURIComponent(t)).replace("{facetName}",encodeURIComponent(o)),queryParameters:{},headers:{},data:n||{},useReadTransporter:!0,cacheable:!0};return m.request(h,u)}}}function Nt(r,e,a){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");return X({appId:r,apiKey:e,timeouts:{connect:1e3,read:2e3,write:3e4},logger:W(),requester:_(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinHeaders",responsesCache:I(),requestsCache:I({serializable:!1}),hostsCache:y({caches:[L({key:`${v}-${r}`}),I()]}),...a})}export{v as apiClientVersion,Nt as compositionClient};
|
|
2
2
|
//# sourceMappingURL=browser.min.js.map
|