@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/dist/fetch.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
- * Unique record identifier.
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
- * Unique record identifier.
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 = Record<string, any> & {
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
- * Unique record identifier.
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 = Record<string, any> & {
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 SearchHits<T = Record<string, unknown>> = Record<string, any> & {
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
- * Search query.
1066
- */
1067
- query: string;
1068
- /**
1069
- * URL-encoded string of all search parameters.
1078
+ * Number of hits returned per page.
1070
1079
  */
1071
- params: string;
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
- * Number of hits per page.
1090
+ * The current page of the results.
1089
1091
  */
1090
- hitsPerPage: number;
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 & SearchPagination & SearchHits<T> & ResultsCompositionsResponse;
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.21.0";
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 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 };
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 };
package/dist/node.d.cts 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
- * Unique record identifier.
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
- * Unique record identifier.
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 = Record<string, any> & {
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
- * Unique record identifier.
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 = Record<string, any> & {
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 SearchHits<T = Record<string, unknown>> = Record<string, any> & {
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
- * Search query.
1066
- */
1067
- query: string;
1068
- /**
1069
- * URL-encoded string of all search parameters.
1078
+ * Number of hits returned per page.
1070
1079
  */
1071
- params: string;
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
- * Number of hits per page.
1090
+ * The current page of the results.
1089
1091
  */
1090
- hitsPerPage: number;
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 & SearchPagination & SearchHits<T> & ResultsCompositionsResponse;
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.21.0";
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 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 };
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 };