@algolia/client-search 4.10.4 → 4.12.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.
@@ -216,6 +216,15 @@ const copySynonyms = (base) => {
216
216
  };
217
217
  };
218
218
 
219
+ const customRequest = (base) => {
220
+ return (request, requestOptions) => {
221
+ if (request.method === requesterCommon.MethodEnum.Get) {
222
+ return base.transporter.read(request, requestOptions);
223
+ }
224
+ return base.transporter.write(request, requestOptions);
225
+ };
226
+ };
227
+
219
228
  const deleteApiKey = (base) => {
220
229
  return (apiKey, requestOptions) => {
221
230
  const wait = (_, waitRequestOptions) => {
@@ -269,6 +278,15 @@ const getApiKey = (base) => {
269
278
  };
270
279
  };
271
280
 
281
+ const getAppTask = (base) => {
282
+ return (taskID, requestOptions) => {
283
+ return base.transporter.read({
284
+ method: requesterCommon.MethodEnum.Get,
285
+ path: clientCommon.encode('1/task/%s', taskID.toString()),
286
+ }, requestOptions);
287
+ };
288
+ };
289
+
272
290
  const getDictionarySettings = (base) => {
273
291
  return (requestOptions) => {
274
292
  return base.transporter.read({
@@ -308,15 +326,6 @@ const getTopUserIDs = (base) => {
308
326
  };
309
327
  };
310
328
 
311
- const getAppTask = (base) => {
312
- return (taskID, requestOptions) => {
313
- return base.transporter.read({
314
- method: requesterCommon.MethodEnum.Get,
315
- path: clientCommon.encode('1/task/%s', taskID.toString()),
316
- }, requestOptions);
317
- };
318
- };
319
-
320
329
  const getUserID = (base) => {
321
330
  return (userID, requestOptions) => {
322
331
  return base.transporter.read({
@@ -1294,6 +1303,7 @@ exports.createMissingObjectIDError = createMissingObjectIDError;
1294
1303
  exports.createObjectNotFoundError = createObjectNotFoundError;
1295
1304
  exports.createSearchClient = createSearchClient;
1296
1305
  exports.createValidUntilNotFoundError = createValidUntilNotFoundError;
1306
+ exports.customRequest = customRequest;
1297
1307
  exports.deleteApiKey = deleteApiKey;
1298
1308
  exports.deleteBy = deleteBy;
1299
1309
  exports.deleteDictionaryEntries = deleteDictionaryEntries;
@@ -1,6 +1,7 @@
1
1
  import { AuthModeType } from '@algolia/client-common';
2
2
  import { ClientTransporterOptions } from '@algolia/client-common';
3
3
  import { CreateClient } from '@algolia/client-common';
4
+ import { Request } from '@algolia/transporter';
4
5
  import { RequestOptions } from '@algolia/transporter';
5
6
  import { Transporter } from '@algolia/transporter';
6
7
  import { WaitablePromise } from '@algolia/client-common';
@@ -367,6 +368,8 @@ export declare const createSearchClient: CreateClient<SearchClient, SearchClient
367
368
 
368
369
  export declare function createValidUntilNotFoundError(): Error;
369
370
 
371
+ export declare const customRequest: <TResponse = any>(base: SearchClient) => (request: Request, requestOptions?: RequestOptions | undefined) => Readonly<Promise<TResponse>>;
372
+
370
373
  export declare const deleteApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: RequestOptions | undefined) => Readonly<WaitablePromise<DeleteApiKeyResponse>>;
371
374
 
372
375
  export declare type DeleteApiKeyResponse = {
@@ -386,7 +389,7 @@ export declare type DeleteByFiltersOptions = {
386
389
  /**
387
390
  * Filter hits by facet value.
388
391
  */
389
- readonly facetFilters?: string | readonly string[] | ReadonlyArray<readonly string[]>;
392
+ readonly facetFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
390
393
  /**
391
394
  * Filter on numeric attributes.
392
395
  */
@@ -408,7 +411,7 @@ export declare type DeleteByFiltersOptions = {
408
411
  /**
409
412
  * Search inside a rectangular area (in geo coordinates).
410
413
  */
411
- readonly insideBoundingBox?: ReadonlyArray<readonly number[]>;
414
+ readonly insideBoundingBox?: ReadonlyArray<readonly number[]> | string;
412
415
  /**
413
416
  * Search inside a polygon (in geo coordinates).
414
417
  */
@@ -1124,7 +1127,7 @@ export declare const replaceAllSynonyms: (base: SearchIndex) => (synonyms: reado
1124
1127
 
1125
1128
  export declare const replaceDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, entries: readonly DictionaryEntry[], requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly<WaitablePromise<DictionaryEntriesResponse>>;
1126
1129
 
1127
- declare type RequireAtLeastOne<TType> = {
1130
+ export declare type RequireAtLeastOne<TType> = {
1128
1131
  [TKey in keyof TType]-?: Required<Pick<TType, TKey>> & Partial<Pick<TType, Exclude<keyof TType, TKey>>>;
1129
1132
  }[keyof TType];
1130
1133
 
@@ -1396,7 +1399,7 @@ export declare type SearchOptions = {
1396
1399
  /**
1397
1400
  * Filter hits by facet value.
1398
1401
  */
1399
- readonly facetFilters?: string | readonly string[] | ReadonlyArray<readonly string[]>;
1402
+ readonly facetFilters?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
1400
1403
  /**
1401
1404
  * Create filters for ranking purposes, where records that match the filter are ranked highest.
1402
1405
  */
@@ -1619,7 +1622,7 @@ export declare type SearchOptions = {
1619
1622
  /**
1620
1623
  * Search inside a rectangular area (in geo coordinates).
1621
1624
  */
1622
- readonly insideBoundingBox?: ReadonlyArray<readonly number[]>;
1625
+ readonly insideBoundingBox?: ReadonlyArray<readonly number[]> | string;
1623
1626
  /**
1624
1627
  * Search inside a polygon (in geo coordinates).
1625
1628
  */
@@ -1667,6 +1670,19 @@ export declare type SearchOptions = {
1667
1670
  * less relevant results.
1668
1671
  */
1669
1672
  readonly relevancyStrictness?: number;
1673
+ /**
1674
+ * Whether this search should use Dynamic Re-Ranking.
1675
+ * @link https://www.algolia.com/doc/guides/algolia-ai/re-ranking/
1676
+ *
1677
+ * Note: You need to turn on Dynamic Re-Ranking on your index for it to have an effect on
1678
+ * your search results. You can do this through the Re-Ranking page on the dashboard.
1679
+ * This parameter is only used to turn off Dynamic Re-Ranking (with false) at search time.
1680
+ */
1681
+ readonly enableReRanking?: boolean;
1682
+ /**
1683
+ * When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking.
1684
+ */
1685
+ readonly reRankingApplyFilter?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
1670
1686
  };
1671
1687
 
1672
1688
  export declare type SearchResponse<TObject = {}> = {
@@ -2280,6 +2296,18 @@ export declare type Settings = {
2280
2296
  };
2281
2297
  };
2282
2298
  };
2299
+ /**
2300
+ * Whether this index should use Dynamic Re-Ranking.
2301
+ * @link https://www.algolia.com/doc/guides/algolia-ai/re-ranking/
2302
+ *
2303
+ * Note: You need to turn on Dynamic Re-Ranking on your index for it to have an effect on
2304
+ * your search results. You can do this through the Re-Ranking page on the dashboard.
2305
+ */
2306
+ readonly enableReRanking?: boolean;
2307
+ /**
2308
+ * When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking.
2309
+ */
2310
+ readonly reRankingApplyFilter?: string | readonly string[] | ReadonlyArray<readonly string[] | string>;
2283
2311
  };
2284
2312
 
2285
2313
  declare type SharedMultipleQueriesQuery = {
@@ -212,6 +212,15 @@ const copySynonyms = (base) => {
212
212
  };
213
213
  };
214
214
 
215
+ const customRequest = (base) => {
216
+ return (request, requestOptions) => {
217
+ if (request.method === MethodEnum.Get) {
218
+ return base.transporter.read(request, requestOptions);
219
+ }
220
+ return base.transporter.write(request, requestOptions);
221
+ };
222
+ };
223
+
215
224
  const deleteApiKey = (base) => {
216
225
  return (apiKey, requestOptions) => {
217
226
  const wait = (_, waitRequestOptions) => {
@@ -265,6 +274,15 @@ const getApiKey = (base) => {
265
274
  };
266
275
  };
267
276
 
277
+ const getAppTask = (base) => {
278
+ return (taskID, requestOptions) => {
279
+ return base.transporter.read({
280
+ method: MethodEnum.Get,
281
+ path: encode('1/task/%s', taskID.toString()),
282
+ }, requestOptions);
283
+ };
284
+ };
285
+
268
286
  const getDictionarySettings = (base) => {
269
287
  return (requestOptions) => {
270
288
  return base.transporter.read({
@@ -304,15 +322,6 @@ const getTopUserIDs = (base) => {
304
322
  };
305
323
  };
306
324
 
307
- const getAppTask = (base) => {
308
- return (taskID, requestOptions) => {
309
- return base.transporter.read({
310
- method: MethodEnum.Get,
311
- path: encode('1/task/%s', taskID.toString()),
312
- }, requestOptions);
313
- };
314
- };
315
-
316
325
  const getUserID = (base) => {
317
326
  return (userID, requestOptions) => {
318
327
  return base.transporter.read({
@@ -1264,4 +1273,4 @@ const SynonymEnum = {
1264
1273
  Placeholder: 'placeholder',
1265
1274
  };
1266
1275
 
1267
- export { ApiKeyACLEnum, BatchActionEnum, ScopeEnum, StrategyEnum, SynonymEnum, addApiKey, assignUserID, assignUserIDs, batch, browseObjects, browseRules, browseSynonyms, chunkedBatch, clearDictionaryEntries, clearObjects, clearRules, clearSynonyms, copyIndex, copyRules, copySettings, copySynonyms, createBrowsablePromise, createMissingObjectIDError, createObjectNotFoundError, createSearchClient, createValidUntilNotFoundError, deleteApiKey, deleteBy, deleteDictionaryEntries, deleteIndex, deleteObject, deleteObjects, deleteRule, deleteSynonym, exists, findAnswers, findObject, generateSecuredApiKey, getApiKey, getAppTask, getDictionarySettings, getLogs, getObject, getObjectPosition, getObjects, getRule, getSecuredApiKeyRemainingValidity, getSettings, getSynonym, getTask, getTopUserIDs, getUserID, hasPendingMappings, initIndex, listApiKeys, listClusters, listIndices, listUserIDs, moveIndex, multipleBatch, multipleGetObjects, multipleQueries, multipleSearchForFacetValues, partialUpdateObject, partialUpdateObjects, removeUserID, replaceAllObjects, replaceAllRules, replaceAllSynonyms, replaceDictionaryEntries, restoreApiKey, saveDictionaryEntries, saveObject, saveObjects, saveRule, saveRules, saveSynonym, saveSynonyms, search, searchDictionaryEntries, searchForFacetValues, searchRules, searchSynonyms, searchUserIDs, setDictionarySettings, setSettings, updateApiKey, waitAppTask, waitTask };
1276
+ export { ApiKeyACLEnum, BatchActionEnum, ScopeEnum, StrategyEnum, SynonymEnum, addApiKey, assignUserID, assignUserIDs, batch, browseObjects, browseRules, browseSynonyms, chunkedBatch, clearDictionaryEntries, clearObjects, clearRules, clearSynonyms, copyIndex, copyRules, copySettings, copySynonyms, createBrowsablePromise, createMissingObjectIDError, createObjectNotFoundError, createSearchClient, createValidUntilNotFoundError, customRequest, deleteApiKey, deleteBy, deleteDictionaryEntries, deleteIndex, deleteObject, deleteObjects, deleteRule, deleteSynonym, exists, findAnswers, findObject, generateSecuredApiKey, getApiKey, getAppTask, getDictionarySettings, getLogs, getObject, getObjectPosition, getObjects, getRule, getSecuredApiKeyRemainingValidity, getSettings, getSynonym, getTask, getTopUserIDs, getUserID, hasPendingMappings, initIndex, listApiKeys, listClusters, listIndices, listUserIDs, moveIndex, multipleBatch, multipleGetObjects, multipleQueries, multipleSearchForFacetValues, partialUpdateObject, partialUpdateObjects, removeUserID, replaceAllObjects, replaceAllRules, replaceAllSynonyms, replaceDictionaryEntries, restoreApiKey, saveDictionaryEntries, saveObject, saveObjects, saveRule, saveRules, saveSynonym, saveSynonyms, search, searchDictionaryEntries, searchForFacetValues, searchRules, searchSynonyms, searchUserIDs, setDictionarySettings, setSettings, updateApiKey, waitAppTask, waitTask };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/client-search",
3
- "version": "4.10.4",
3
+ "version": "4.12.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,8 +16,8 @@
16
16
  "dist"
17
17
  ],
18
18
  "dependencies": {
19
- "@algolia/client-common": "4.10.4",
20
- "@algolia/requester-common": "4.10.4",
21
- "@algolia/transporter": "4.10.4"
19
+ "@algolia/client-common": "4.12.1",
20
+ "@algolia/requester-common": "4.12.1",
21
+ "@algolia/transporter": "4.12.1"
22
22
  }
23
23
  }