@algolia/composition 1.21.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser.d.ts +65 -28
- package/dist/builds/browser.js +33 -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 +3 -3
- package/dist/builds/fetch.js +33 -1
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +33 -1
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +33 -1
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +33 -1
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +65 -28
- package/dist/node.d.cts +65 -28
- package/dist/node.d.ts +65 -28
- package/dist/src/compositionClient.cjs +33 -1
- package/dist/src/compositionClient.cjs.map +1 -1
- package/dist/src/compositionClient.js +33 -1
- package/dist/src/compositionClient.js.map +1 -1
- package/dist/worker.d.ts +65 -28
- package/package.json +8 -8
package/dist/node.d.ts
CHANGED
|
@@ -361,6 +361,12 @@ type Composition = {
|
|
|
361
361
|
*/
|
|
362
362
|
description?: string | undefined;
|
|
363
363
|
behavior: CompositionBehavior;
|
|
364
|
+
/**
|
|
365
|
+
* A mapping of sorting labels to the indices (or replicas) that implement those sorting rules. The sorting indices MUST be related to the associated main targeted index in the composition. Each key is the label your frontend sends at runtime (for example, \"Price (asc)\"), and each value is the name of the index that should be queried when that label is selected. When a request includes a \"sortBy\" parameter, the platform looks up the corresponding index in this mapping and uses it to execute the query. The main targeted index is replaced with the sorting strategy index it is mapped to. Up to 20 sorting strategies can be defined.
|
|
366
|
+
*/
|
|
367
|
+
sortingStrategy?: {
|
|
368
|
+
[key: string]: string;
|
|
369
|
+
} | undefined;
|
|
364
370
|
};
|
|
365
371
|
|
|
366
372
|
/**
|
|
@@ -413,6 +419,10 @@ type Condition = {
|
|
|
413
419
|
* Filters that trigger the rule. You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter.
|
|
414
420
|
*/
|
|
415
421
|
filters?: string | undefined;
|
|
422
|
+
/**
|
|
423
|
+
* Sort criteria that trigger the rule. You can trigger composition rules based on the selected sorting strategy set by the parameter `sortBy`. The rule will trigger if the value passed to `sortBy` matches the one defined in the condition.
|
|
424
|
+
*/
|
|
425
|
+
sortBy?: string | undefined;
|
|
416
426
|
};
|
|
417
427
|
|
|
418
428
|
type TimeRange = {
|
|
@@ -561,14 +571,14 @@ type SearchForFacetValuesResponse = {
|
|
|
561
571
|
|
|
562
572
|
type CompositionRunAppliedRules = {
|
|
563
573
|
/**
|
|
564
|
-
*
|
|
574
|
+
* The objectID of the applied composition rule on this query.
|
|
565
575
|
*/
|
|
566
576
|
objectID: string;
|
|
567
577
|
};
|
|
568
578
|
|
|
569
579
|
type CompositionRunSearchResponse = Record<string, any> & {
|
|
570
580
|
/**
|
|
571
|
-
*
|
|
581
|
+
* The objectID of the composition which generated this result set.
|
|
572
582
|
*/
|
|
573
583
|
objectID: string;
|
|
574
584
|
appliedRules?: Array<CompositionRunAppliedRules> | undefined;
|
|
@@ -578,7 +588,7 @@ type CompositionsSearchResponse = Record<string, any> & {
|
|
|
578
588
|
run: Array<CompositionRunSearchResponse>;
|
|
579
589
|
};
|
|
580
590
|
|
|
581
|
-
type CompositionBaseSearchResponse =
|
|
591
|
+
type CompositionBaseSearchResponse = {
|
|
582
592
|
compositions?: CompositionsSearchResponse | undefined;
|
|
583
593
|
};
|
|
584
594
|
|
|
@@ -863,12 +873,15 @@ type BaseSearchResponse = Record<string, any> & {
|
|
|
863
873
|
|
|
864
874
|
type ResultsInjectedItemAppliedRulesInfoResponse = {
|
|
865
875
|
/**
|
|
866
|
-
*
|
|
876
|
+
* The objectID of the applied index level rule on this injected group.
|
|
867
877
|
*/
|
|
868
878
|
objectID: string;
|
|
869
879
|
};
|
|
870
880
|
|
|
871
881
|
type ResultsInjectedItemInfoResponse = Record<string, any> & {
|
|
882
|
+
/**
|
|
883
|
+
* The key of the injected group.
|
|
884
|
+
*/
|
|
872
885
|
key: string;
|
|
873
886
|
appliedRules?: Array<ResultsInjectedItemAppliedRulesInfoResponse> | undefined;
|
|
874
887
|
};
|
|
@@ -877,7 +890,7 @@ type ResultsCompositionInfoResponse = {
|
|
|
877
890
|
injectedItems: Array<ResultsInjectedItemInfoResponse>;
|
|
878
891
|
};
|
|
879
892
|
|
|
880
|
-
type ResultsCompositionsResponse =
|
|
893
|
+
type ResultsCompositionsResponse = {
|
|
881
894
|
compositions: {
|
|
882
895
|
[key: string]: ResultsCompositionInfoResponse;
|
|
883
896
|
};
|
|
@@ -1056,26 +1069,15 @@ type Hit<T = Record<string, unknown>> = T & {
|
|
|
1056
1069
|
_extra?: HitMetadata | undefined;
|
|
1057
1070
|
};
|
|
1058
1071
|
|
|
1059
|
-
type
|
|
1072
|
+
type SearchFields<T = Record<string, unknown>> = {
|
|
1060
1073
|
/**
|
|
1061
1074
|
* Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
|
|
1062
1075
|
*/
|
|
1063
1076
|
hits: Hit<T>[];
|
|
1064
1077
|
/**
|
|
1065
|
-
*
|
|
1066
|
-
*/
|
|
1067
|
-
query: string;
|
|
1068
|
-
/**
|
|
1069
|
-
* URL-encoded string of all search parameters.
|
|
1078
|
+
* Number of hits returned per page.
|
|
1070
1079
|
*/
|
|
1071
|
-
|
|
1072
|
-
};
|
|
1073
|
-
|
|
1074
|
-
type SearchPagination = {
|
|
1075
|
-
/**
|
|
1076
|
-
* Page of search results to retrieve.
|
|
1077
|
-
*/
|
|
1078
|
-
page: number;
|
|
1080
|
+
hitsPerPage: number;
|
|
1079
1081
|
/**
|
|
1080
1082
|
* Number of results (hits).
|
|
1081
1083
|
*/
|
|
@@ -1085,12 +1087,20 @@ type SearchPagination = {
|
|
|
1085
1087
|
*/
|
|
1086
1088
|
nbPages: number;
|
|
1087
1089
|
/**
|
|
1088
|
-
*
|
|
1090
|
+
* The current page of the results.
|
|
1089
1091
|
*/
|
|
1090
|
-
|
|
1092
|
+
page: number;
|
|
1093
|
+
/**
|
|
1094
|
+
* URL-encoded string of all search parameters.
|
|
1095
|
+
*/
|
|
1096
|
+
params: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* The search query string.
|
|
1099
|
+
*/
|
|
1100
|
+
query: string;
|
|
1091
1101
|
};
|
|
1092
1102
|
|
|
1093
|
-
type SearchResultsItem<T = Record<string, unknown>> = BaseSearchResponse &
|
|
1103
|
+
type SearchResultsItem<T = Record<string, unknown>> = BaseSearchResponse & SearchFields<T> & ResultsCompositionsResponse;
|
|
1094
1104
|
|
|
1095
1105
|
type SearchResults<T = Record<string, unknown>> = {
|
|
1096
1106
|
/**
|
|
@@ -1265,18 +1275,22 @@ type Params = {
|
|
|
1265
1275
|
* Search query.
|
|
1266
1276
|
*/
|
|
1267
1277
|
query?: string | undefined;
|
|
1268
|
-
/**
|
|
1269
|
-
* Relevancy threshold below which less relevant results aren\'t included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
|
|
1270
|
-
*/
|
|
1271
|
-
relevancyStrictness?: number | undefined;
|
|
1272
1278
|
/**
|
|
1273
1279
|
* Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first** **You should always specify a query language.** If you don\'t specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations).
|
|
1274
1280
|
*/
|
|
1275
1281
|
queryLanguages?: Array<SupportedLanguage> | undefined;
|
|
1282
|
+
/**
|
|
1283
|
+
* 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.
|
|
1284
|
+
*/
|
|
1285
|
+
relevancyStrictness?: number | undefined;
|
|
1276
1286
|
/**
|
|
1277
1287
|
* Assigns a rule context to the run query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
|
|
1278
1288
|
*/
|
|
1279
1289
|
ruleContexts?: Array<string> | undefined;
|
|
1290
|
+
/**
|
|
1291
|
+
* Indicates which sorting strategy to apply for the request. The value must match one of the labels defined in the \"sortingStrategy\" mapping. For example, \"Price (asc)\", see Upsert Composition. At runtime, this label is used to look up the corresponding index or replica configured in \"sortingStrategy\", and the query is executed using that index instead of main\'s. In addition to \"sortingStrategy\", this parameter is also used to apply a matching Composition Rule that contains a condition defined to trigger on \"sortBy\", see Composition Rules. If no value is provided or an invalid value, no sorting strategy is applied.
|
|
1292
|
+
*/
|
|
1293
|
+
sortBy?: string | undefined;
|
|
1280
1294
|
/**
|
|
1281
1295
|
* Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
|
|
1282
1296
|
*/
|
|
@@ -1536,6 +1550,18 @@ type SearchForFacetValuesProps = {
|
|
|
1536
1550
|
facetName: string;
|
|
1537
1551
|
searchForFacetValuesRequest?: SearchForFacetValuesRequest | undefined;
|
|
1538
1552
|
};
|
|
1553
|
+
/**
|
|
1554
|
+
* Properties for the `updateSortingStrategyComposition` method.
|
|
1555
|
+
*/
|
|
1556
|
+
type UpdateSortingStrategyCompositionProps = {
|
|
1557
|
+
/**
|
|
1558
|
+
* Unique Composition ObjectID.
|
|
1559
|
+
*/
|
|
1560
|
+
compositionID: string;
|
|
1561
|
+
requestBody: {
|
|
1562
|
+
[key: string]: string;
|
|
1563
|
+
};
|
|
1564
|
+
};
|
|
1539
1565
|
type WaitForCompositionTaskOptions = {
|
|
1540
1566
|
/**
|
|
1541
1567
|
* The maximum number of retries. 50 by default.
|
|
@@ -1555,7 +1581,7 @@ type WaitForCompositionTaskOptions = {
|
|
|
1555
1581
|
compositionID: string;
|
|
1556
1582
|
};
|
|
1557
1583
|
|
|
1558
|
-
declare const apiClientVersion = "1.
|
|
1584
|
+
declare const apiClientVersion = "1.22.1";
|
|
1559
1585
|
declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
1560
1586
|
transporter: _algolia_client_common.Transporter;
|
|
1561
1587
|
/**
|
|
@@ -1784,6 +1810,17 @@ declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOpt
|
|
|
1784
1810
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1785
1811
|
*/
|
|
1786
1812
|
searchForFacetValues({ compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps, requestOptions?: RequestOptions): Promise<SearchForFacetValuesResponse>;
|
|
1813
|
+
/**
|
|
1814
|
+
* Updates the \"sortingStrategy\" field of an existing composition. This endpoint allows you to create a new sorting strategy mapping or replace the currently configured one. The provided sorting indices MUST be associated indices or replicas of the main targeted index. WARNING: This endpoint cannot validate if the sort index is related to the composition\'s main index. Validation will fail at runtime if the index you updated is not related! The update is applied to the specified composition within the current Algolia application and returns a taskID that can be used to track the operation’s completion.
|
|
1815
|
+
*
|
|
1816
|
+
* Required API Key ACLs:
|
|
1817
|
+
* - editSettings
|
|
1818
|
+
* @param updateSortingStrategyComposition - The updateSortingStrategyComposition object.
|
|
1819
|
+
* @param updateSortingStrategyComposition.compositionID - Unique Composition ObjectID.
|
|
1820
|
+
* @param updateSortingStrategyComposition.requestBody - The requestBody object.
|
|
1821
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1822
|
+
*/
|
|
1823
|
+
updateSortingStrategyComposition({ compositionID, requestBody }: UpdateSortingStrategyCompositionProps, requestOptions?: RequestOptions): Promise<TaskIDResponse>;
|
|
1787
1824
|
};
|
|
1788
1825
|
|
|
1789
1826
|
/**
|
|
@@ -1797,4 +1834,4 @@ type CompositionClient = ReturnType<typeof createCompositionClient>;
|
|
|
1797
1834
|
|
|
1798
1835
|
declare function compositionClient(appId: string, apiKey: string, options?: ClientOptions | undefined): CompositionClient;
|
|
1799
1836
|
|
|
1800
|
-
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
|
|
1837
|
+
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 SearchFields, type SearchForFacetValuesParams, type SearchForFacetValuesProps, type SearchForFacetValuesRequest, type SearchForFacetValuesResponse, type SearchForFacetValuesResults, 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 UpdateSortingStrategyCompositionProps, type Value, type WaitForCompositionTaskOptions, type Widgets, apiClientVersion, compositionClient };
|
|
@@ -25,7 +25,7 @@ __export(compositionClient_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(compositionClient_exports);
|
|
27
27
|
var import_client_common = require("@algolia/client-common");
|
|
28
|
-
var apiClientVersion = "1.
|
|
28
|
+
var apiClientVersion = "1.22.1";
|
|
29
29
|
function getDefaultHosts(appId) {
|
|
30
30
|
return [
|
|
31
31
|
{
|
|
@@ -658,6 +658,38 @@ function createCompositionClient({
|
|
|
658
658
|
cacheable: true
|
|
659
659
|
};
|
|
660
660
|
return transporter.request(request, requestOptions);
|
|
661
|
+
},
|
|
662
|
+
/**
|
|
663
|
+
* Updates the \"sortingStrategy\" field of an existing composition. This endpoint allows you to create a new sorting strategy mapping or replace the currently configured one. The provided sorting indices MUST be associated indices or replicas of the main targeted index. WARNING: This endpoint cannot validate if the sort index is related to the composition\'s main index. Validation will fail at runtime if the index you updated is not related! The update is applied to the specified composition within the current Algolia application and returns a taskID that can be used to track the operation’s completion.
|
|
664
|
+
*
|
|
665
|
+
* Required API Key ACLs:
|
|
666
|
+
* - editSettings
|
|
667
|
+
* @param updateSortingStrategyComposition - The updateSortingStrategyComposition object.
|
|
668
|
+
* @param updateSortingStrategyComposition.compositionID - Unique Composition ObjectID.
|
|
669
|
+
* @param updateSortingStrategyComposition.requestBody - The requestBody object.
|
|
670
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
671
|
+
*/
|
|
672
|
+
updateSortingStrategyComposition({ compositionID, requestBody }, requestOptions) {
|
|
673
|
+
if (!compositionID) {
|
|
674
|
+
throw new Error("Parameter `compositionID` is required when calling `updateSortingStrategyComposition`.");
|
|
675
|
+
}
|
|
676
|
+
if (!requestBody) {
|
|
677
|
+
throw new Error("Parameter `requestBody` is required when calling `updateSortingStrategyComposition`.");
|
|
678
|
+
}
|
|
679
|
+
const requestPath = "/1/compositions/{compositionID}/sortingStrategy".replace(
|
|
680
|
+
"{compositionID}",
|
|
681
|
+
encodeURIComponent(compositionID)
|
|
682
|
+
);
|
|
683
|
+
const headers = {};
|
|
684
|
+
const queryParameters = {};
|
|
685
|
+
const request = {
|
|
686
|
+
method: "POST",
|
|
687
|
+
path: requestPath,
|
|
688
|
+
queryParameters,
|
|
689
|
+
headers,
|
|
690
|
+
data: requestBody
|
|
691
|
+
};
|
|
692
|
+
return transporter.request(request, requestOptions);
|
|
661
693
|
}
|
|
662
694
|
};
|
|
663
695
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../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 type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createIterablePromise, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { BatchParams } from '../model/batchParams';\nimport type { Composition } from '../model/composition';\nimport type { CompositionRule } from '../model/compositionRule';\n\nimport type { GetTaskResponse } from '../model/getTaskResponse';\nimport type { ListCompositionsResponse } from '../model/listCompositionsResponse';\nimport type { MultipleBatchResponse } from '../model/multipleBatchResponse';\n\nimport type { RulesMultipleBatchResponse } from '../model/rulesMultipleBatchResponse';\n\nimport type { SearchCompositionRulesResponse } from '../model/searchCompositionRulesResponse';\n\nimport type { SearchForFacetValuesResponse } from '../model/searchForFacetValuesResponse';\nimport type { SearchResponse } from '../model/searchResponse';\nimport type { TaskIDResponse } from '../model/taskIDResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteCompositionProps,\n DeleteCompositionRuleProps,\n GetCompositionProps,\n GetRuleProps,\n GetTaskProps,\n ListCompositionsProps,\n PutCompositionProps,\n PutCompositionRuleProps,\n SaveRulesProps,\n SearchCompositionRulesProps,\n SearchForFacetValuesProps,\n SearchProps,\n WaitForCompositionTaskOptions,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.21.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createCompositionClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Composition',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Helper: Wait for a composition-level task to be published (completed) for a given `compositionID` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param WaitForCompositionTaskOptions - The `WaitForCompositionTaskOptions` object.\n * @param WaitForCompositionTaskOptions.compositionID - The `compositionID` where the operation was performed.\n * @param WaitForCompositionTaskOptions.taskID - The `taskID` returned in the method response.\n * @param WaitForCompositionTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param WaitForCompositionTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForCompositionTask(\n {\n compositionID,\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForCompositionTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getTask({ compositionID, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n });\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Delete a composition from the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteComposition - The deleteComposition object.\n * @param deleteComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteComposition(\n { compositionID }: DeleteCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Delete a Composition Rule from the specified Composition ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteCompositionRule - The deleteCompositionRule object.\n * @param deleteCompositionRule.compositionID - Unique Composition ObjectID.\n * @param deleteCompositionRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteCompositionRule(\n { compositionID, objectID }: DeleteCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieve a single composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getComposition - The getComposition object.\n * @param getComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getComposition({ compositionID }: GetCompositionProps, requestOptions?: RequestOptions): Promise<Composition> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a rule by its ID. To find the object ID of a rule, use the [`search` operation](https://www.algolia.com/doc/rest-api/composition/search-composition-rules).\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getRule - The getRule object.\n * @param getRule.compositionID - Unique Composition ObjectID.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ compositionID, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<CompositionRule> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * - addObject\n * - deleteObject\n * - deleteIndex\n * @param getTask - The getTask object.\n * @param getTask.compositionID - Unique Composition ObjectID.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ compositionID, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getTask`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/task/{taskID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Lists all compositions in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param listCompositions - The listCompositions object.\n * @param listCompositions.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listCompositions.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listCompositions(\n { page, hitsPerPage }: ListCompositionsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListCompositionsResponse> {\n const requestPath = '/1/compositions';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (hitsPerPage !== undefined) {\n queryParameters['hitsPerPage'] = hitsPerPage.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Adds, updates, or deletes compositions with a single API request.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse> {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n\n const requestPath = '/1/compositions/*/batch';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Update and insert a composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putComposition - The putComposition object.\n * @param putComposition.compositionID - Unique Composition ObjectID.\n * @param putComposition.composition - The composition object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putComposition(\n { compositionID, composition }: PutCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putComposition`.');\n }\n\n if (!composition) {\n throw new Error('Parameter `composition` is required when calling `putComposition`.');\n }\n\n if (!composition.objectID) {\n throw new Error('Parameter `composition.objectID` is required when calling `putComposition`.');\n }\n if (!composition.name) {\n throw new Error('Parameter `composition.name` is required when calling `putComposition`.');\n }\n if (!composition.behavior) {\n throw new Error('Parameter `composition.behavior` is required when calling `putComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: composition,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a composition rule with the provided ID already exists, it\\'s replaced. Otherwise, a new one is added.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putCompositionRule - The putCompositionRule object.\n * @param putCompositionRule.compositionID - Unique Composition ObjectID.\n * @param putCompositionRule.objectID - Unique identifier of a rule object.\n * @param putCompositionRule.compositionRule - The compositionRule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putCompositionRule(\n { compositionID, objectID, compositionRule }: PutCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule) {\n throw new Error('Parameter `compositionRule` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule.objectID) {\n throw new Error('Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.conditions) {\n throw new Error('Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.consequence) {\n throw new Error('Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: compositionRule,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Create or update or delete multiple composition rules.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param saveRules - The saveRules object.\n * @param saveRules.compositionID - Unique Composition ObjectID.\n * @param saveRules.rules - The rules object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules(\n { compositionID, rules }: SaveRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<RulesMultipleBatchResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `saveRules`.');\n }\n\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/batch'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs a query on a single composition and returns matching results.\n *\n * Required API Key ACLs:\n * - search\n * @param search - The search object.\n * @param search.compositionID - Unique Composition ObjectID.\n * @param search.requestBody - The requestBody object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n { compositionID, requestBody }: SearchProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponse<T>> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `search`.');\n }\n\n if (!requestBody) {\n throw new Error('Parameter `requestBody` is required when calling `search`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/run'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: requestBody,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for composition rules in your index.\n *\n * Required API Key ACLs:\n * - settings\n * @param searchCompositionRules - The searchCompositionRules object.\n * @param searchCompositionRules.compositionID - Unique Composition ObjectID.\n * @param searchCompositionRules.searchCompositionRulesParams - The searchCompositionRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchCompositionRules(\n { compositionID, searchCompositionRulesParams }: SearchCompositionRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchCompositionRulesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchCompositionRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/search'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchCompositionRulesParams ? searchCompositionRulesParams : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for values of a specified facet attribute on the composition\\'s main source\\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.compositionID - Unique Composition ObjectID.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues(\n { compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchForFacetValuesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchForFacetValues`.');\n }\n\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/facets/{facetName}/query'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{facetName}', encodeURIComponent(facetName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,2BAA+F;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,QACA,8BAAQ;AAAA,MACN;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,KAAK,GAAG,KAAK;AAAA,QACb,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEO,SAAS,wBAAwB;AAAA,EACtC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,kBAAc,wCAAkB;AAAA,IACpC,OAAO,gBAAgB,WAAW;AAAA,IAClC,GAAG;AAAA,IACH,kBAAc,sCAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CA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,IAAI,MAAM,4EAA4E;AAAA,MAC9F;AAEA,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,wEAAwE;AAAA,MAC1F;AAEA,YAAM,cAAc,2DACjB,QAAQ,mBAAmB,mBAAmB,aAAa,CAAC,EAC5D,QAAQ,eAAe,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;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../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 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 UpdateSortingStrategyCompositionProps,\n WaitForCompositionTaskOptions,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.22.1';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createCompositionClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Composition',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Helper: Wait for a composition-level task to be published (completed) for a given `compositionID` and `taskID`.\n *\n * @summary Helper method that waits for a task to be published (completed).\n * @param WaitForCompositionTaskOptions - The `WaitForCompositionTaskOptions` object.\n * @param WaitForCompositionTaskOptions.compositionID - The `compositionID` where the operation was performed.\n * @param WaitForCompositionTaskOptions.taskID - The `taskID` returned in the method response.\n * @param WaitForCompositionTaskOptions.maxRetries - The maximum number of retries. 50 by default.\n * @param WaitForCompositionTaskOptions.timeout - The function to decide how long to wait between retries.\n * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.\n */\n waitForCompositionTask(\n {\n compositionID,\n taskID,\n maxRetries = 50,\n timeout = (retryCount: number): number => Math.min(retryCount * 200, 5000),\n }: WaitForCompositionTaskOptions,\n requestOptions?: RequestOptions,\n ): Promise<GetTaskResponse> {\n let retryCount = 0;\n\n return createIterablePromise({\n func: () => this.getTask({ compositionID, taskID }, requestOptions),\n validate: (response) => response.status === 'published',\n aggregator: () => (retryCount += 1),\n error: {\n validate: () => retryCount >= maxRetries,\n message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,\n },\n timeout: () => timeout(retryCount),\n });\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Delete a composition from the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteComposition - The deleteComposition object.\n * @param deleteComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteComposition(\n { compositionID }: DeleteCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Delete a Composition Rule from the specified Composition ID.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteCompositionRule - The deleteCompositionRule object.\n * @param deleteCompositionRule.compositionID - Unique Composition ObjectID.\n * @param deleteCompositionRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteCompositionRule(\n { compositionID, objectID }: DeleteCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `deleteCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieve a single composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getComposition - The getComposition object.\n * @param getComposition.compositionID - Unique Composition ObjectID.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getComposition({ compositionID }: GetCompositionProps, requestOptions?: RequestOptions): Promise<Composition> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a rule by its ID. To find the object ID of a rule, use the [`search` operation](https://www.algolia.com/doc/rest-api/composition/search-composition-rules).\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param getRule - The getRule object.\n * @param getRule.compositionID - Unique Composition ObjectID.\n * @param getRule.objectID - Unique identifier of a rule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRule({ compositionID, objectID }: GetRuleProps, requestOptions?: RequestOptions): Promise<CompositionRule> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * - addObject\n * - deleteObject\n * - deleteIndex\n * @param getTask - The getTask object.\n * @param getTask.compositionID - Unique Composition ObjectID.\n * @param getTask.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getTask({ compositionID, taskID }: GetTaskProps, requestOptions?: RequestOptions): Promise<GetTaskResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `getTask`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getTask`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/task/{taskID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Lists all compositions in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * - settings\n * @param listCompositions - The listCompositions object.\n * @param listCompositions.page - Requested page of the API response. If `null`, the API response is not paginated.\n * @param listCompositions.hitsPerPage - Number of hits per page.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listCompositions(\n { page, hitsPerPage }: ListCompositionsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListCompositionsResponse> {\n const requestPath = '/1/compositions';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (page !== undefined) {\n queryParameters['page'] = page.toString();\n }\n\n if (hitsPerPage !== undefined) {\n queryParameters['hitsPerPage'] = hitsPerPage.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Adds, updates, or deletes compositions with a single API request.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param batchParams - The batchParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse> {\n if (!batchParams) {\n throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');\n }\n\n if (!batchParams.requests) {\n throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');\n }\n\n const requestPath = '/1/compositions/*/batch';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: batchParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Update and insert a composition in the current Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putComposition - The putComposition object.\n * @param putComposition.compositionID - Unique Composition ObjectID.\n * @param putComposition.composition - The composition object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putComposition(\n { compositionID, composition }: PutCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putComposition`.');\n }\n\n if (!composition) {\n throw new Error('Parameter `composition` is required when calling `putComposition`.');\n }\n\n if (!composition.objectID) {\n throw new Error('Parameter `composition.objectID` is required when calling `putComposition`.');\n }\n if (!composition.name) {\n throw new Error('Parameter `composition.name` is required when calling `putComposition`.');\n }\n if (!composition.behavior) {\n throw new Error('Parameter `composition.behavior` is required when calling `putComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: composition,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * If a composition rule with the provided ID already exists, it\\'s replaced. Otherwise, a new one is added.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param putCompositionRule - The putCompositionRule object.\n * @param putCompositionRule.compositionID - Unique Composition ObjectID.\n * @param putCompositionRule.objectID - Unique identifier of a rule object.\n * @param putCompositionRule.compositionRule - The compositionRule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putCompositionRule(\n { compositionID, objectID, compositionRule }: PutCompositionRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `putCompositionRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule) {\n throw new Error('Parameter `compositionRule` is required when calling `putCompositionRule`.');\n }\n\n if (!compositionRule.objectID) {\n throw new Error('Parameter `compositionRule.objectID` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.conditions) {\n throw new Error('Parameter `compositionRule.conditions` is required when calling `putCompositionRule`.');\n }\n if (!compositionRule.consequence) {\n throw new Error('Parameter `compositionRule.consequence` is required when calling `putCompositionRule`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/{objectID}'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: compositionRule,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Create or update or delete multiple composition rules.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param saveRules - The saveRules object.\n * @param saveRules.compositionID - Unique Composition ObjectID.\n * @param saveRules.rules - The rules object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n saveRules(\n { compositionID, rules }: SaveRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<RulesMultipleBatchResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `saveRules`.');\n }\n\n if (!rules) {\n throw new Error('Parameter `rules` is required when calling `saveRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/batch'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: rules,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Runs a query on a single composition and returns matching results.\n *\n * Required API Key ACLs:\n * - search\n * @param search - The search object.\n * @param search.compositionID - Unique Composition ObjectID.\n * @param search.requestBody - The requestBody object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search<T>(\n { compositionID, requestBody }: SearchProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchResponse<T>> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `search`.');\n }\n\n if (!requestBody) {\n throw new Error('Parameter `requestBody` is required when calling `search`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/run'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: requestBody,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for composition rules in your index.\n *\n * Required API Key ACLs:\n * - settings\n * @param searchCompositionRules - The searchCompositionRules object.\n * @param searchCompositionRules.compositionID - Unique Composition ObjectID.\n * @param searchCompositionRules.searchCompositionRulesParams - The searchCompositionRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchCompositionRules(\n { compositionID, searchCompositionRulesParams }: SearchCompositionRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchCompositionRulesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchCompositionRules`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/rules/search'.replace(\n '{compositionID}',\n encodeURIComponent(compositionID),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchCompositionRulesParams ? searchCompositionRulesParams : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for values of a specified facet attribute on the composition\\'s main source\\'s index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\\'t work if you have **more than 65 searchable facets and searchable attributes combined**.\n *\n * Required API Key ACLs:\n * - search\n * @param searchForFacetValues - The searchForFacetValues object.\n * @param searchForFacetValues.compositionID - Unique Composition ObjectID.\n * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.\n * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacetValues(\n { compositionID, facetName, searchForFacetValuesRequest }: SearchForFacetValuesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchForFacetValuesResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `searchForFacetValues`.');\n }\n\n if (!facetName) {\n throw new Error('Parameter `facetName` is required when calling `searchForFacetValues`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/facets/{facetName}/query'\n .replace('{compositionID}', encodeURIComponent(compositionID))\n .replace('{facetName}', encodeURIComponent(facetName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchForFacetValuesRequest ? searchForFacetValuesRequest : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates the \\\"sortingStrategy\\\" field of an existing composition. This endpoint allows you to create a new sorting strategy mapping or replace the currently configured one. The provided sorting indices MUST be associated indices or replicas of the main targeted index. WARNING: This endpoint cannot validate if the sort index is related to the composition\\'s main index. Validation will fail at runtime if the index you updated is not related! The update is applied to the specified composition within the current Algolia application and returns a taskID that can be used to track the operation’s completion.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param updateSortingStrategyComposition - The updateSortingStrategyComposition object.\n * @param updateSortingStrategyComposition.compositionID - Unique Composition ObjectID.\n * @param updateSortingStrategyComposition.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 updateSortingStrategyComposition(\n { compositionID, requestBody }: UpdateSortingStrategyCompositionProps,\n requestOptions?: RequestOptions,\n ): Promise<TaskIDResponse> {\n if (!compositionID) {\n throw new Error('Parameter `compositionID` is required when calling `updateSortingStrategyComposition`.');\n }\n\n if (!requestBody) {\n throw new Error('Parameter `requestBody` is required when calling `updateSortingStrategyComposition`.');\n }\n\n const requestPath = '/1/compositions/{compositionID}/sortingStrategy'.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 };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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B,QAAQ,mBAAmB,mBAAmB,aAAa,CAAC,EAC5D,QAAQ,eAAe,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYA,iCACE,EAAE,eAAe,YAAY,GAC7B,gBACyB;AACzB,UAAI,CAAC,eAAe;AAClB,cAAM,IAAI,MAAM,wFAAwF;AAAA,MAC1G;AAEA,UAAI,CAAC,aAAa;AAChB,cAAM,IAAI,MAAM,sFAAsF;AAAA,MACxG;AAEA,YAAM,cAAc,kDAAkD;AAAA,QACpE;AAAA,QACA,mBAAmB,aAAa;AAAA,MAClC;AACA,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MACR;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/compositionClient.ts
|
|
2
2
|
import { createAuth, createIterablePromise, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
|
|
3
|
-
var apiClientVersion = "1.
|
|
3
|
+
var apiClientVersion = "1.22.1";
|
|
4
4
|
function getDefaultHosts(appId) {
|
|
5
5
|
return [
|
|
6
6
|
{
|
|
@@ -633,6 +633,38 @@ function createCompositionClient({
|
|
|
633
633
|
cacheable: true
|
|
634
634
|
};
|
|
635
635
|
return transporter.request(request, requestOptions);
|
|
636
|
+
},
|
|
637
|
+
/**
|
|
638
|
+
* Updates the \"sortingStrategy\" field of an existing composition. This endpoint allows you to create a new sorting strategy mapping or replace the currently configured one. The provided sorting indices MUST be associated indices or replicas of the main targeted index. WARNING: This endpoint cannot validate if the sort index is related to the composition\'s main index. Validation will fail at runtime if the index you updated is not related! The update is applied to the specified composition within the current Algolia application and returns a taskID that can be used to track the operation’s completion.
|
|
639
|
+
*
|
|
640
|
+
* Required API Key ACLs:
|
|
641
|
+
* - editSettings
|
|
642
|
+
* @param updateSortingStrategyComposition - The updateSortingStrategyComposition object.
|
|
643
|
+
* @param updateSortingStrategyComposition.compositionID - Unique Composition ObjectID.
|
|
644
|
+
* @param updateSortingStrategyComposition.requestBody - The requestBody object.
|
|
645
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
646
|
+
*/
|
|
647
|
+
updateSortingStrategyComposition({ compositionID, requestBody }, requestOptions) {
|
|
648
|
+
if (!compositionID) {
|
|
649
|
+
throw new Error("Parameter `compositionID` is required when calling `updateSortingStrategyComposition`.");
|
|
650
|
+
}
|
|
651
|
+
if (!requestBody) {
|
|
652
|
+
throw new Error("Parameter `requestBody` is required when calling `updateSortingStrategyComposition`.");
|
|
653
|
+
}
|
|
654
|
+
const requestPath = "/1/compositions/{compositionID}/sortingStrategy".replace(
|
|
655
|
+
"{compositionID}",
|
|
656
|
+
encodeURIComponent(compositionID)
|
|
657
|
+
);
|
|
658
|
+
const headers = {};
|
|
659
|
+
const queryParameters = {};
|
|
660
|
+
const request = {
|
|
661
|
+
method: "POST",
|
|
662
|
+
path: requestPath,
|
|
663
|
+
queryParameters,
|
|
664
|
+
headers,
|
|
665
|
+
data: requestBody
|
|
666
|
+
};
|
|
667
|
+
return transporter.request(request, requestOptions);
|
|
636
668
|
}
|
|
637
669
|
};
|
|
638
670
|
}
|