@algolia/composition 1.16.0 → 1.17.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 +8 -9
- package/dist/browser.d.ts +13 -9
- package/dist/builds/browser.js +1 -1
- 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 +1 -1
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +1 -1
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +1 -1
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +1 -1
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +13 -9
- package/dist/node.d.cts +13 -9
- package/dist/node.d.ts +13 -9
- package/dist/src/compositionClient.cjs +1 -1
- package/dist/src/compositionClient.cjs.map +1 -1
- package/dist/src/compositionClient.js +1 -1
- package/dist/src/compositionClient.js.map +1 -1
- package/dist/worker.d.ts +13 -9
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your JavaScript project</h4>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="https://npmjs.
|
|
9
|
+
<a href="https://npmjs.com/package/@algolia/composition"><img src="https://img.shields.io/npm/v/@algolia/composition.svg?style=flat-square" alt="NPM version"></img></a>
|
|
10
10
|
<a href="http://npm-stat.com/charts.html?package=@algolia/composition"><img src="https://img.shields.io/npm/dm/@algolia/composition.svg?style=flat-square" alt="NPM downloads"></a>
|
|
11
11
|
<a href="https://www.jsdelivr.com/package/npm/@algolia/composition"><img src="https://data.jsdelivr.com/v1/package/npm/@algolia/composition/badge" alt="jsDelivr Downloads"></img></a>
|
|
12
12
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
|
-
<a href="https://www.algolia.com/doc/libraries/javascript
|
|
17
|
+
<a href="https://www.algolia.com/doc/libraries/sdk/install#javascript" target="_blank">Documentation</a> •
|
|
18
18
|
<a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> •
|
|
19
19
|
<a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
|
|
20
20
|
<a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
|
|
21
21
|
<a href="https://github.com/algolia/algoliasearch-client-javascript/issues" target="_blank">Report a bug</a> •
|
|
22
|
-
<a href="https://www.algolia.com/doc/libraries/javascript/v5/" target="_blank">FAQ</a> •
|
|
23
22
|
<a href="https://alg.li/support" target="_blank">Support</a>
|
|
24
23
|
</p>
|
|
25
24
|
|
|
@@ -41,11 +40,11 @@ All of our clients comes with type definition, and are available for both browse
|
|
|
41
40
|
### With a package manager
|
|
42
41
|
|
|
43
42
|
```bash
|
|
44
|
-
yarn add @algolia/composition@1.
|
|
43
|
+
yarn add @algolia/composition@1.17.0
|
|
45
44
|
# or
|
|
46
|
-
npm install @algolia/composition@1.
|
|
45
|
+
npm install @algolia/composition@1.17.0
|
|
47
46
|
# or
|
|
48
|
-
pnpm add @algolia/composition@1.
|
|
47
|
+
pnpm add @algolia/composition@1.17.0
|
|
49
48
|
```
|
|
50
49
|
|
|
51
50
|
### Without a package manager
|
|
@@ -53,7 +52,7 @@ pnpm add @algolia/composition@1.16.0
|
|
|
53
52
|
Add the following JavaScript snippet to the <head> of your website:
|
|
54
53
|
|
|
55
54
|
```html
|
|
56
|
-
<script src="https://cdn.jsdelivr.net/npm/@algolia/composition@1.
|
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/@algolia/composition@1.17.0/dist/builds/browser.umd.js"></script>
|
|
57
56
|
```
|
|
58
57
|
|
|
59
58
|
### Usage
|
|
@@ -66,11 +65,11 @@ import { compositionClient } from '@algolia/composition';
|
|
|
66
65
|
const client = compositionClient('YOUR_APP_ID', 'YOUR_API_KEY');
|
|
67
66
|
```
|
|
68
67
|
|
|
69
|
-
For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/
|
|
68
|
+
For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/sdk/methods/composition/)**.
|
|
70
69
|
|
|
71
70
|
## ❓ Troubleshooting
|
|
72
71
|
|
|
73
|
-
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://
|
|
72
|
+
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://support.algolia.com/hc/en-us/sections/15061037630609-API-Client-FAQs) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md)
|
|
74
73
|
|
|
75
74
|
## 📄 License
|
|
76
75
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -150,7 +150,7 @@ type BaseInjectionQueryParameters = {
|
|
|
150
150
|
*/
|
|
151
151
|
attributesToSnippet?: Array<string> | undefined;
|
|
152
152
|
/**
|
|
153
|
-
* 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/guides/sending-events/getting-started).
|
|
153
|
+
* 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).
|
|
154
154
|
*/
|
|
155
155
|
clickAnalytics?: boolean | undefined;
|
|
156
156
|
/**
|
|
@@ -531,7 +531,7 @@ type FacetHits = {
|
|
|
531
531
|
*/
|
|
532
532
|
highlighted: string;
|
|
533
533
|
/**
|
|
534
|
-
* Number of records with this facet value. [The count may be approximated](https://support.algolia.com/hc/
|
|
534
|
+
* Number of records with this facet value. [The count may be approximated](https://support.algolia.com/hc/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate).
|
|
535
535
|
*/
|
|
536
536
|
count: number;
|
|
537
537
|
};
|
|
@@ -543,7 +543,7 @@ type SearchForFacetValuesResults = {
|
|
|
543
543
|
*/
|
|
544
544
|
facetHits: Array<FacetHits>;
|
|
545
545
|
/**
|
|
546
|
-
* Whether the facet count is exhaustive (true) or approximate (false). For more information, see [Why are my facet and hit counts not accurate](https://support.algolia.com/hc/
|
|
546
|
+
* Whether the facet count is exhaustive (true) or approximate (false). For more information, see [Why are my facet and hit counts not accurate](https://support.algolia.com/hc/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate).
|
|
547
547
|
*/
|
|
548
548
|
exhaustiveFacetsCount: boolean;
|
|
549
549
|
/**
|
|
@@ -587,7 +587,7 @@ type CompositionBaseSearchResponse = Record<string, any> & {
|
|
|
587
587
|
*/
|
|
588
588
|
type Exhaustive = {
|
|
589
589
|
/**
|
|
590
|
-
* Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/
|
|
590
|
+
* Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate).
|
|
591
591
|
*/
|
|
592
592
|
facetsCount?: boolean | undefined;
|
|
593
593
|
/**
|
|
@@ -664,7 +664,7 @@ type Redirect = {
|
|
|
664
664
|
/**
|
|
665
665
|
* Order of facet names.
|
|
666
666
|
*/
|
|
667
|
-
type
|
|
667
|
+
type IndexSettingsFacets = {
|
|
668
668
|
/**
|
|
669
669
|
* Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
|
|
670
670
|
*/
|
|
@@ -692,7 +692,7 @@ type Value = {
|
|
|
692
692
|
* Order of facet names and facet values in your UI.
|
|
693
693
|
*/
|
|
694
694
|
type FacetOrdering = {
|
|
695
|
-
facets?:
|
|
695
|
+
facets?: IndexSettingsFacets | undefined;
|
|
696
696
|
/**
|
|
697
697
|
* Order of facet values. One object for each facet.
|
|
698
698
|
*/
|
|
@@ -1201,6 +1201,10 @@ type Params = {
|
|
|
1201
1201
|
* Relevancy threshold below which less relevant results aren\'t included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
|
|
1202
1202
|
*/
|
|
1203
1203
|
relevancyStrictness?: number | undefined;
|
|
1204
|
+
/**
|
|
1205
|
+
* Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
|
|
1206
|
+
*/
|
|
1207
|
+
facets?: Array<string> | undefined;
|
|
1204
1208
|
facetFilters?: FacetFilters | undefined;
|
|
1205
1209
|
optionalFilters?: OptionalFilters | undefined;
|
|
1206
1210
|
numericFilters?: NumericFilters | undefined;
|
|
@@ -1248,7 +1252,7 @@ type Params = {
|
|
|
1248
1252
|
*/
|
|
1249
1253
|
userToken?: string | undefined;
|
|
1250
1254
|
/**
|
|
1251
|
-
* 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/guides/sending-events/getting-started).
|
|
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).
|
|
1252
1256
|
*/
|
|
1253
1257
|
clickAnalytics?: boolean | undefined;
|
|
1254
1258
|
/**
|
|
@@ -1547,7 +1551,7 @@ type WaitForCompositionTaskOptions = {
|
|
|
1547
1551
|
compositionID: string;
|
|
1548
1552
|
};
|
|
1549
1553
|
|
|
1550
|
-
declare const apiClientVersion = "1.
|
|
1554
|
+
declare const apiClientVersion = "1.17.0";
|
|
1551
1555
|
declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
1552
1556
|
transporter: _algolia_client_common.Transporter;
|
|
1553
1557
|
/**
|
|
@@ -1788,4 +1792,4 @@ type ErrorBase = Record<string, any> & {
|
|
|
1788
1792
|
declare function compositionClient(appId: string, apiKey: string, options?: ClientOptions | undefined): CompositionClient;
|
|
1789
1793
|
type CompositionClient = ReturnType<typeof createCompositionClient>;
|
|
1790
1794
|
|
|
1791
|
-
export { type Action, type AdvancedSyntaxFeatures, type AlternativesAsExact, type Anchoring, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseInjectionQueryParameters, type BaseSearchResponse, type BatchCompositionAction, type BatchParams, type BooleanString, type Composition, type CompositionBaseSearchResponse, type CompositionBehavior, type CompositionClient, type CompositionIdRankingInfo, type CompositionRankingInfo, type CompositionRule, type CompositionRuleConsequence, type CompositionRulesBatchParams, type CompositionRunAppliedRules, type CompositionRunSearchResponse, type CompositionSource, type CompositionSourceSearch, type CompositionsSearchResponse, type Condition, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DedupPositioning, type Deduplication, type DeleteCompositionAction, type DeleteCompositionProps, type DeleteCompositionRuleAction, type DeleteCompositionRuleProps, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type External, type ExternalInjectedItem, type ExternalInjection, type ExternalOrdering, type ExternalSource, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type
|
|
1795
|
+
export { type Action, type AdvancedSyntaxFeatures, type AlternativesAsExact, type Anchoring, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseInjectionQueryParameters, type BaseSearchResponse, type BatchCompositionAction, type BatchParams, type BooleanString, type Composition, type CompositionBaseSearchResponse, type CompositionBehavior, type CompositionClient, type CompositionIdRankingInfo, type CompositionRankingInfo, type CompositionRule, type CompositionRuleConsequence, type CompositionRulesBatchParams, type CompositionRunAppliedRules, type CompositionRunSearchResponse, type CompositionSource, type CompositionSourceSearch, type CompositionsSearchResponse, type Condition, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DedupPositioning, type Deduplication, type DeleteCompositionAction, type DeleteCompositionProps, type DeleteCompositionRuleAction, type DeleteCompositionRuleProps, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type External, type ExternalInjectedItem, type ExternalInjection, type ExternalOrdering, type ExternalSource, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type GetCompositionProps, type GetRuleProps, type GetTaskProps, type GetTaskResponse, type HighlightResult, type HighlightResultOption, type Hit, type HitMetadata, type HitRankingInfo, type IgnorePlurals, type IndexSettingsFacets, type InjectedItem, type InjectedItemHitsMetadata, type InjectedItemMetadata, type InjectedItemSource, type Injection, type InsideBoundingBox, type ListCompositionsProps, type ListCompositionsResponse, type Main, type MainInjectionQueryParameters, type MatchLevel, type MatchedGeoLocation, type MultipleBatchRequest, type MultipleBatchResponse, type NumericFilters, type OptionalFilters, type OptionalWords, type Params, type Personalization, type PutCompositionProps, type PutCompositionRuleProps, type QueryType, type Range, type RankingInfo, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RemoveStopWords, type RemoveWordsIfNoResults, type RenderingContent, type RequestBody, type ResultsCompositionInfoResponse, type ResultsCompositionsResponse, type ResultsInjectedItemAppliedRulesInfoResponse, type ResultsInjectedItemInfoResponse, type RulesBatchCompositionAction, type RulesMultipleBatchRequest, type RulesMultipleBatchResponse, type SaveRulesProps, type Search, type SearchCompositionRulesParams, type SearchCompositionRulesProps, type SearchCompositionRulesResponse, type SearchForFacetValuesParams, type SearchForFacetValuesProps, type SearchForFacetValuesRequest, type SearchForFacetValuesResponse, type SearchForFacetValuesResults, type SearchHits, type SearchPagination, type SearchProps, type SearchResponse, type SearchResults, type SearchResultsItem, type SearchSource, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TaskIDResponse, type TaskStatus, type TimeRange, type TypoTolerance, type TypoToleranceEnum, type Value, type WaitForCompositionTaskOptions, type Widgets, apiClientVersion, compositionClient };
|
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.17.0";
|
|
13
13
|
function getDefaultHosts(appId) {
|
|
14
14
|
return [
|
|
15
15
|
{
|
|
@@ -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.16.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,gB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mBAAmB,SAAS,CAAC;AACvD,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM,8BAA8B,8BAA8B,CAAC;AAAA,QACnE,oBAAoB;AAAA,QACpB,WAAW;AAAA,MACb;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;;;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.17.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createCompositionClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Composition',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Helper: Wait for a composition-level task to be published (completed) for a given `compositionID` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param WaitForCompositionTaskOptions - The `WaitForCompositionTaskOptions` object.\n * @param WaitForCompositionTaskOptions.compositionID - The `compositionID` where the operation was performed.\n * @param WaitForCompositionTaskOptions.taskID - The `taskID` returned in the method response.\n * @param WaitForCompositionTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param WaitForCompositionTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForCompositionTask(\n {\n compositionID,\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForCompositionTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getTask({ compositionID, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n });\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Delete a composition from the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteComposition - The deleteComposition object.\n * @param deleteComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteComposition(\n { compositionID }: DeleteCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Delete a Composition Rule from the specified Composition ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteCompositionRule - The deleteCompositionRule object.\n * @param deleteCompositionRule.compositionID - Unique Composition ObjectID.\n * @param deleteCompositionRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteCompositionRule(\n { compositionID, objectID }: DeleteCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieve a single composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getComposition - The getComposition object.\n * @param getComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getComposition({ compositionID }: GetCompositionProps, requestOptions?: RequestOptions): Promise<Composition> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a rule by its ID. To find the object ID of a rule, use the [`search` operation](https://www.algolia.com/doc/rest-api/composition/search-composition-rules).\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getRule - The getRule object.\n * @param getRule.compositionID - Unique Composition ObjectID.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ compositionID, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<CompositionRule> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * - addObject\n * - deleteObject\n * - deleteIndex\n * @param getTask - The getTask object.\n * @param getTask.compositionID - Unique Composition ObjectID.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ compositionID, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getTask`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/task/{taskID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Lists all compositions in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param listCompositions - The listCompositions object.\n * @param listCompositions.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listCompositions.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listCompositions(\n { page, hitsPerPage }: ListCompositionsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListCompositionsResponse> {\n const requestPath = '/1/compositions';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (hitsPerPage !== undefined) {\n queryParameters['hitsPerPage'] = hitsPerPage.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Adds, updates, or deletes compositions with a single API request.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse> {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n\n const requestPath = '/1/compositions/*/batch';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Upsert a composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putComposition - The putComposition object.\n * @param putComposition.compositionID - Unique Composition ObjectID.\n * @param putComposition.composition - The composition object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putComposition(\n { compositionID, composition }: PutCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putComposition`.');\n }\n\n if (!composition) {\n throw new Error('Parameter `composition` is required when calling `putComposition`.');\n }\n\n if (!composition.objectID) {\n throw new Error('Parameter `composition.objectID` is required when calling `putComposition`.');\n }\n if (!composition.name) {\n throw new Error('Parameter `composition.name` is required when calling `putComposition`.');\n }\n if (!composition.behavior) {\n throw new Error('Parameter `composition.behavior` is required when calling `putComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: composition,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a composition rule with the provided ID already exists, it\\'s replaced. Otherwise, a new one is added.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putCompositionRule - The putCompositionRule object.\n * @param putCompositionRule.compositionID - Unique Composition ObjectID.\n * @param putCompositionRule.objectID - Unique identifier of a rule object.\n * @param putCompositionRule.compositionRule - The compositionRule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putCompositionRule(\n { compositionID, objectID, compositionRule }: PutCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule) {\n throw new Error('Parameter `compositionRule` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule.objectID) {\n throw new Error('Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.conditions) {\n throw new Error('Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.consequence) {\n throw new Error('Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: compositionRule,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Create or update or delete multiple composition rules.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param saveRules - The saveRules object.\n * @param saveRules.compositionID - Unique Composition ObjectID.\n * @param saveRules.rules - The rules object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules(\n { compositionID, rules }: SaveRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<RulesMultipleBatchResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `saveRules`.');\n }\n\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/batch'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs a query on a single composition and returns matching results.\n *\n * Required API Key ACLs:\n * - search\n * @param search - The search object.\n * @param search.compositionID - Unique Composition ObjectID.\n * @param search.requestBody - The requestBody object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n { compositionID, requestBody }: SearchProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponse<T>> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `search`.');\n }\n\n if (!requestBody) {\n throw new Error('Parameter `requestBody` is required when calling `search`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/run'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: requestBody,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for composition rules in your index.\n *\n * Required API Key ACLs:\n * - settings\n * @param searchCompositionRules - The searchCompositionRules object.\n * @param searchCompositionRules.compositionID - Unique Composition ObjectID.\n * @param searchCompositionRules.searchCompositionRulesParams - The searchCompositionRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchCompositionRules(\n { compositionID, searchCompositionRulesParams }: SearchCompositionRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchCompositionRulesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchCompositionRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/search'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchCompositionRulesParams ? searchCompositionRulesParams : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for values of a specified facet attribute on the composition\\'s main source\\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.compositionID - Unique Composition ObjectID.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues(\n { compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchForFacetValuesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchForFacetValues`.');\n }\n\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/facets/{facetName}/query'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{facetName}', encodeURIComponent(facetName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";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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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,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.16.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.17.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
|