@algolia/composition 1.19.0 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/worker.d.ts CHANGED
@@ -1182,101 +1182,105 @@ type InsideBoundingBox = string | Array<Array<number>>;
1182
1182
 
1183
1183
  type Params = {
1184
1184
  /**
1185
- * Search query.
1185
+ * Whether this search will be included in Analytics.
1186
1186
  */
1187
- query?: string | undefined;
1187
+ analytics?: boolean | undefined;
1188
1188
  /**
1189
- * Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering).
1189
+ * Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments).
1190
1190
  */
1191
- filters?: string | undefined;
1191
+ analyticsTags?: Array<string> | undefined;
1192
1192
  /**
1193
- * Page of search results to retrieve.
1193
+ * Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
1194
1194
  */
1195
- page?: number | undefined;
1195
+ aroundLatLng?: string | undefined;
1196
1196
  /**
1197
- * Whether the run response should include detailed ranking information.
1197
+ * Whether to obtain the coordinates from the request\'s IP address.
1198
1198
  */
1199
- getRankingInfo?: boolean | undefined;
1199
+ aroundLatLngViaIP?: boolean | undefined;
1200
+ aroundRadius?: AroundRadius | undefined;
1201
+ aroundPrecision?: AroundPrecision | undefined;
1200
1202
  /**
1201
- * Relevancy threshold below which less relevant results aren\'t included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
1203
+ * Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).
1202
1204
  */
1203
- relevancyStrictness?: number | undefined;
1205
+ clickAnalytics?: boolean | undefined;
1206
+ /**
1207
+ * Whether to enable index level A/B testing for this run request. If the composition mixes multiple indices, the A/B test is ignored.
1208
+ */
1209
+ enableABTest?: boolean | undefined;
1210
+ /**
1211
+ * Whether to enable Personalization.
1212
+ */
1213
+ enablePersonalization?: boolean | undefined;
1214
+ /**
1215
+ * Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
1216
+ */
1217
+ enableReRanking?: boolean | undefined;
1218
+ /**
1219
+ * Whether to enable composition rules.
1220
+ */
1221
+ enableRules?: boolean | undefined;
1204
1222
  facetFilters?: FacetFilters | undefined;
1205
1223
  /**
1206
1224
  * Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. To retrieve disjunctive facets lists, annotate any facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts) and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
1207
1225
  */
1208
1226
  facets?: Array<string> | undefined;
1209
- optionalFilters?: OptionalFilters | undefined;
1210
- numericFilters?: NumericFilters | undefined;
1211
1227
  /**
1212
- * Number of hits per page.
1228
+ * Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering).
1213
1229
  */
1214
- hitsPerPage?: number | undefined;
1230
+ filters?: string | undefined;
1215
1231
  /**
1216
- * Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`.
1232
+ * Whether the run response should include detailed ranking information.
1217
1233
  */
1218
- aroundLatLng?: string | undefined;
1234
+ getRankingInfo?: boolean | undefined;
1219
1235
  /**
1220
- * Whether to obtain the coordinates from the request\'s IP address.
1236
+ * Number of hits per page.
1221
1237
  */
1222
- aroundLatLngViaIP?: boolean | undefined;
1223
- aroundRadius?: AroundRadius | undefined;
1224
- aroundPrecision?: AroundPrecision | undefined;
1238
+ hitsPerPage?: number | undefined;
1225
1239
  /**
1226
- * Minimum radius (in meters) for a search around a location when `aroundRadius` isn\'t set.
1240
+ * A list of extenrally injected objectID groups into from an external source.
1227
1241
  */
1228
- minimumAroundRadius?: number | undefined;
1242
+ injectedItems?: {
1243
+ [key: string]: ExternalInjectedItem;
1244
+ } | undefined;
1229
1245
  insideBoundingBox?: InsideBoundingBox | null | undefined;
1230
1246
  /**
1231
1247
  * Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
1232
1248
  */
1233
1249
  insidePolygon?: Array<Array<number>> | undefined;
1234
1250
  /**
1235
- * 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).
1251
+ * Minimum radius (in meters) for a search around a location when `aroundRadius` isn\'t set.
1236
1252
  */
1237
- queryLanguages?: Array<SupportedLanguage> | undefined;
1253
+ minimumAroundRadius?: number | undefined;
1238
1254
  /**
1239
1255
  * ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
1240
1256
  */
1241
1257
  naturalLanguages?: Array<SupportedLanguage> | undefined;
1258
+ numericFilters?: NumericFilters | undefined;
1259
+ optionalFilters?: OptionalFilters | undefined;
1242
1260
  /**
1243
- * Whether to enable composition rules.
1244
- */
1245
- enableRules?: boolean | undefined;
1246
- /**
1247
- * Assigns a rule context to the run query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
1248
- */
1249
- ruleContexts?: Array<string> | undefined;
1250
- /**
1251
- * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
1252
- */
1253
- userToken?: string | undefined;
1254
- /**
1255
- * Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).
1261
+ * Page of search results to retrieve.
1256
1262
  */
1257
- clickAnalytics?: boolean | undefined;
1263
+ page?: number | undefined;
1258
1264
  /**
1259
- * Whether this search will be included in Analytics.
1265
+ * Search query.
1260
1266
  */
1261
- analytics?: boolean | undefined;
1267
+ query?: string | undefined;
1262
1268
  /**
1263
- * Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments).
1269
+ * Relevancy threshold below which less relevant results aren\'t included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
1264
1270
  */
1265
- analyticsTags?: Array<string> | undefined;
1271
+ relevancyStrictness?: number | undefined;
1266
1272
  /**
1267
- * Whether to enable index level A/B testing for this run request. If the composition mixes multiple indices, the A/B test is ignored.
1273
+ * Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first** **You should always specify a query language.** If you don\'t specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations).
1268
1274
  */
1269
- enableABTest?: boolean | undefined;
1275
+ queryLanguages?: Array<SupportedLanguage> | undefined;
1270
1276
  /**
1271
- * Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
1277
+ * Assigns a rule context to the run query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules.
1272
1278
  */
1273
- enableReRanking?: boolean | undefined;
1279
+ ruleContexts?: Array<string> | undefined;
1274
1280
  /**
1275
- * A list of extenrally injected objectID groups into from an external source.
1281
+ * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
1276
1282
  */
1277
- injectedItems?: {
1278
- [key: string]: ExternalInjectedItem;
1279
- } | undefined;
1283
+ userToken?: string | undefined;
1280
1284
  };
1281
1285
 
1282
1286
  type RequestBody = {
@@ -1551,7 +1555,7 @@ type WaitForCompositionTaskOptions = {
1551
1555
  compositionID: string;
1552
1556
  };
1553
1557
 
1554
- declare const apiClientVersion = "1.19.0";
1558
+ declare const apiClientVersion = "1.21.0";
1555
1559
  declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1556
1560
  transporter: _algolia_client_common.Transporter;
1557
1561
  /**
@@ -1713,7 +1717,7 @@ declare function createCompositionClient({ appId: appIdOption, apiKey: apiKeyOpt
1713
1717
  */
1714
1718
  multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse>;
1715
1719
  /**
1716
- * Upsert a composition in the current Algolia application.
1720
+ * Update and insert a composition in the current Algolia application.
1717
1721
  *
1718
1722
  * Required API Key ACLs:
1719
1723
  * - editSettings
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.19.0",
2
+ "version": "1.21.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
@@ -49,17 +49,17 @@
49
49
  "index.d.ts"
50
50
  ],
51
51
  "dependencies": {
52
- "@algolia/client-common": "5.43.0",
53
- "@algolia/requester-browser-xhr": "5.43.0",
54
- "@algolia/requester-fetch": "5.43.0",
55
- "@algolia/requester-node-http": "5.43.0"
52
+ "@algolia/client-common": "5.45.0",
53
+ "@algolia/requester-browser-xhr": "5.45.0",
54
+ "@algolia/requester-fetch": "5.45.0",
55
+ "@algolia/requester-node-http": "5.45.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@arethetypeswrong/cli": "0.18.2",
59
- "@types/node": "24.10.0",
59
+ "@types/node": "24.10.1",
60
60
  "publint": "0.3.15",
61
- "rollup": "4.52.5",
62
- "tsup": "8.5.0",
61
+ "rollup": "4.53.2",
62
+ "tsup": "8.5.1",
63
63
  "typescript": "5.9.3"
64
64
  },
65
65
  "engines": {