@algolia/client-search 5.3.0 → 5.3.2

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.
@@ -30,7 +30,7 @@ var import_requester_node_http = require("@algolia/requester-node-http");
30
30
 
31
31
  // src/searchClient.ts
32
32
  var import_client_common = require("@algolia/client-common");
33
- var apiClientVersion = "5.3.0";
33
+ var apiClientVersion = "5.3.2";
34
34
  function getDefaultHosts(appId) {
35
35
  return [
36
36
  {
@@ -71,25 +71,26 @@ function createSearchClient({
71
71
  ...options
72
72
  }) {
73
73
  const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
74
- return {
75
- transporter: (0, import_client_common.createTransporter)({
76
- hosts: getDefaultHosts(appIdOption),
77
- ...options,
78
- algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
79
- algoliaAgents,
80
- client: "Search",
81
- version: apiClientVersion
82
- }),
83
- baseHeaders: {
84
- "content-type": "text/plain",
85
- ...auth.headers(),
86
- ...options.baseHeaders
87
- },
88
- baseQueryParameters: {
89
- ...auth.queryParameters(),
90
- ...options.baseQueryParameters
91
- }
74
+ const transporter = (0, import_client_common.createTransporter)({
75
+ hosts: getDefaultHosts(appIdOption),
76
+ ...options,
77
+ algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
78
+ algoliaAgents,
79
+ client: "Search",
80
+ version: apiClientVersion
92
81
  }),
82
+ baseHeaders: {
83
+ "content-type": "text/plain",
84
+ ...auth.headers(),
85
+ ...options.baseHeaders
86
+ },
87
+ baseQueryParameters: {
88
+ ...auth.queryParameters(),
89
+ ...options.baseQueryParameters
90
+ }
91
+ });
92
+ return {
93
+ transporter,
93
94
  /**
94
95
  * The `appId` currently in use.
95
96
  */
@@ -98,15 +99,13 @@ function createSearchClient({
98
99
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
99
100
  */
100
101
  clearCache() {
101
- return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
102
- () => void 0
103
- );
102
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
104
103
  },
105
104
  /**
106
105
  * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
107
106
  */
108
107
  get _ua() {
109
- return this.transporter.algoliaAgent.value;
108
+ return transporter.algoliaAgent.value;
110
109
  },
111
110
  /**
112
111
  * Adds a `segment` to the `x-algolia-agent` sent with every requests.
@@ -115,7 +114,7 @@ function createSearchClient({
115
114
  * @param version - The version of the agent.
116
115
  */
117
116
  addAlgoliaAgent(segment, version) {
118
- this.transporter.algoliaAgent.add({ segment, version });
117
+ transporter.algoliaAgent.add({ segment, version });
119
118
  },
120
119
  /**
121
120
  * Helper method to switch the API key used to authenticate the requests.
@@ -124,7 +123,11 @@ function createSearchClient({
124
123
  * @param params.apiKey - The new API Key to use.
125
124
  */
126
125
  setClientApiKey({ apiKey }) {
127
- this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
126
+ if (!authMode || authMode === "WithinHeaders") {
127
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
128
+ } else {
129
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
130
+ }
128
131
  },
129
132
  /**
130
133
  * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
@@ -547,7 +550,7 @@ function createSearchClient({
547
550
  headers,
548
551
  data: apiKey
549
552
  };
550
- return this.transporter.request(request, requestOptions);
553
+ return transporter.request(request, requestOptions);
551
554
  },
552
555
  /**
553
556
  * If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. To update _some_ attributes of an existing record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject) instead. To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).
@@ -581,7 +584,7 @@ function createSearchClient({
581
584
  headers,
582
585
  data: body
583
586
  };
584
- return this.transporter.request(request, requestOptions);
587
+ return transporter.request(request, requestOptions);
585
588
  },
586
589
  /**
587
590
  * Adds a source to the list of allowed sources.
@@ -609,7 +612,7 @@ function createSearchClient({
609
612
  headers,
610
613
  data: source
611
614
  };
612
- return this.transporter.request(request, requestOptions);
615
+ return transporter.request(request, requestOptions);
613
616
  },
614
617
  /**
615
618
  * Assigns or moves a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.
@@ -645,7 +648,7 @@ function createSearchClient({
645
648
  headers,
646
649
  data: assignUserIdParams
647
650
  };
648
- return this.transporter.request(request, requestOptions);
651
+ return transporter.request(request, requestOptions);
649
652
  },
650
653
  /**
651
654
  * Adds, updates, or deletes records in one index with a single API request. Batching index updates reduces latency and increases data integrity. - Actions are applied in the order they\'re specified. - Actions are equivalent to the individual API requests of the same name.
@@ -675,7 +678,7 @@ function createSearchClient({
675
678
  headers,
676
679
  data: batchWriteParams
677
680
  };
678
- return this.transporter.request(request, requestOptions);
681
+ return transporter.request(request, requestOptions);
679
682
  },
680
683
  /**
681
684
  * Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
@@ -714,7 +717,7 @@ function createSearchClient({
714
717
  headers,
715
718
  data: batchAssignUserIdsParams
716
719
  };
717
- return this.transporter.request(request, requestOptions);
720
+ return transporter.request(request, requestOptions);
718
721
  },
719
722
  /**
720
723
  * Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
@@ -752,7 +755,7 @@ function createSearchClient({
752
755
  headers,
753
756
  data: batchDictionaryEntriesParams
754
757
  };
755
- return this.transporter.request(request, requestOptions);
758
+ return transporter.request(request, requestOptions);
756
759
  },
757
760
  /**
758
761
  * Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to `true`) If you send these parameters with your browse requests, they\'ll be ignored.
@@ -779,7 +782,7 @@ function createSearchClient({
779
782
  headers,
780
783
  data: browseParams ? browseParams : {}
781
784
  };
782
- return this.transporter.request(request, requestOptions);
785
+ return transporter.request(request, requestOptions);
783
786
  },
784
787
  /**
785
788
  * Deletes only the records from an index while keeping settings, synonyms, and rules.
@@ -804,7 +807,7 @@ function createSearchClient({
804
807
  queryParameters,
805
808
  headers
806
809
  };
807
- return this.transporter.request(request, requestOptions);
810
+ return transporter.request(request, requestOptions);
808
811
  },
809
812
  /**
810
813
  * Deletes all rules from the index.
@@ -833,7 +836,7 @@ function createSearchClient({
833
836
  queryParameters,
834
837
  headers
835
838
  };
836
- return this.transporter.request(request, requestOptions);
839
+ return transporter.request(request, requestOptions);
837
840
  },
838
841
  /**
839
842
  * Deletes all synonyms from the index.
@@ -862,7 +865,7 @@ function createSearchClient({
862
865
  queryParameters,
863
866
  headers
864
867
  };
865
- return this.transporter.request(request, requestOptions);
868
+ return transporter.request(request, requestOptions);
866
869
  },
867
870
  /**
868
871
  * This method allow you to send requests to the Algolia REST API.
@@ -885,7 +888,7 @@ function createSearchClient({
885
888
  queryParameters,
886
889
  headers
887
890
  };
888
- return this.transporter.request(request, requestOptions);
891
+ return transporter.request(request, requestOptions);
889
892
  },
890
893
  /**
891
894
  * This method allow you to send requests to the Algolia REST API.
@@ -908,7 +911,7 @@ function createSearchClient({
908
911
  queryParameters,
909
912
  headers
910
913
  };
911
- return this.transporter.request(request, requestOptions);
914
+ return transporter.request(request, requestOptions);
912
915
  },
913
916
  /**
914
917
  * This method allow you to send requests to the Algolia REST API.
@@ -933,7 +936,7 @@ function createSearchClient({
933
936
  headers,
934
937
  data: body ? body : {}
935
938
  };
936
- return this.transporter.request(request, requestOptions);
939
+ return transporter.request(request, requestOptions);
937
940
  },
938
941
  /**
939
942
  * This method allow you to send requests to the Algolia REST API.
@@ -958,7 +961,7 @@ function createSearchClient({
958
961
  headers,
959
962
  data: body ? body : {}
960
963
  };
961
- return this.transporter.request(request, requestOptions);
964
+ return transporter.request(request, requestOptions);
962
965
  },
963
966
  /**
964
967
  * Deletes the API key.
@@ -983,7 +986,7 @@ function createSearchClient({
983
986
  queryParameters,
984
987
  headers
985
988
  };
986
- return this.transporter.request(request, requestOptions);
989
+ return transporter.request(request, requestOptions);
987
990
  },
988
991
  /**
989
992
  * This operation doesn\'t accept empty queries or filters. It\'s more efficient to get a list of object IDs with the [`browse` operation](#tag/Search/operation/browse), and then delete the records using the [`batch` operation](#tag/Records/operation/batch).
@@ -1013,7 +1016,7 @@ function createSearchClient({
1013
1016
  headers,
1014
1017
  data: deleteByParams
1015
1018
  };
1016
- return this.transporter.request(request, requestOptions);
1019
+ return transporter.request(request, requestOptions);
1017
1020
  },
1018
1021
  /**
1019
1022
  * Deletes an index and all its settings. - Deleting an index doesn\'t delete its analytics data. - If you try to delete a non-existing index, the operation is ignored without warning. - If the index you want to delete has replica indices, the replicas become independent indices. - If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. For more information, see [Delete replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/deleting-replicas/).
@@ -1038,7 +1041,7 @@ function createSearchClient({
1038
1041
  queryParameters,
1039
1042
  headers
1040
1043
  };
1041
- return this.transporter.request(request, requestOptions);
1044
+ return transporter.request(request, requestOptions);
1042
1045
  },
1043
1046
  /**
1044
1047
  * Deletes a record by its object ID. To delete more than one record, use the [`batch` operation](#tag/Records/operation/batch). To delete records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy).
@@ -1067,7 +1070,7 @@ function createSearchClient({
1067
1070
  queryParameters,
1068
1071
  headers
1069
1072
  };
1070
- return this.transporter.request(request, requestOptions);
1073
+ return transporter.request(request, requestOptions);
1071
1074
  },
1072
1075
  /**
1073
1076
  * Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
@@ -1100,7 +1103,7 @@ function createSearchClient({
1100
1103
  queryParameters,
1101
1104
  headers
1102
1105
  };
1103
- return this.transporter.request(request, requestOptions);
1106
+ return transporter.request(request, requestOptions);
1104
1107
  },
1105
1108
  /**
1106
1109
  * Deletes a source from the list of allowed sources.
@@ -1125,7 +1128,7 @@ function createSearchClient({
1125
1128
  queryParameters,
1126
1129
  headers
1127
1130
  };
1128
- return this.transporter.request(request, requestOptions);
1131
+ return transporter.request(request, requestOptions);
1129
1132
  },
1130
1133
  /**
1131
1134
  * Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
@@ -1158,7 +1161,7 @@ function createSearchClient({
1158
1161
  queryParameters,
1159
1162
  headers
1160
1163
  };
1161
- return this.transporter.request(request, requestOptions);
1164
+ return transporter.request(request, requestOptions);
1162
1165
  },
1163
1166
  /**
1164
1167
  * Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application\'s keys. When authenticating with other API keys, you can only retrieve information for that key.
@@ -1180,7 +1183,7 @@ function createSearchClient({
1180
1183
  queryParameters,
1181
1184
  headers
1182
1185
  };
1183
- return this.transporter.request(request, requestOptions);
1186
+ return transporter.request(request, requestOptions);
1184
1187
  },
1185
1188
  /**
1186
1189
  * Checks the status of a given application task.
@@ -1205,7 +1208,7 @@ function createSearchClient({
1205
1208
  queryParameters,
1206
1209
  headers
1207
1210
  };
1208
- return this.transporter.request(request, requestOptions);
1211
+ return transporter.request(request, requestOptions);
1209
1212
  },
1210
1213
  /**
1211
1214
  * Lists supported languages with their supported dictionary types and number of custom entries.
@@ -1225,7 +1228,7 @@ function createSearchClient({
1225
1228
  queryParameters,
1226
1229
  headers
1227
1230
  };
1228
- return this.transporter.request(request, requestOptions);
1231
+ return transporter.request(request, requestOptions);
1229
1232
  },
1230
1233
  /**
1231
1234
  * Retrieves the languages for which standard dictionary entries are turned off.
@@ -1245,7 +1248,7 @@ function createSearchClient({
1245
1248
  queryParameters,
1246
1249
  headers
1247
1250
  };
1248
- return this.transporter.request(request, requestOptions);
1251
+ return transporter.request(request, requestOptions);
1249
1252
  },
1250
1253
  /**
1251
1254
  * The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). - Logs are held for the last seven days. - Up to 1,000 API requests per server are logged. - This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn\'t appear in the logs itself.
@@ -1282,7 +1285,7 @@ function createSearchClient({
1282
1285
  queryParameters,
1283
1286
  headers
1284
1287
  };
1285
- return this.transporter.request(request, requestOptions);
1288
+ return transporter.request(request, requestOptions);
1286
1289
  },
1287
1290
  /**
1288
1291
  * Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
@@ -1315,7 +1318,7 @@ function createSearchClient({
1315
1318
  queryParameters,
1316
1319
  headers
1317
1320
  };
1318
- return this.transporter.request(request, requestOptions);
1321
+ return transporter.request(request, requestOptions);
1319
1322
  },
1320
1323
  /**
1321
1324
  * Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
@@ -1345,7 +1348,7 @@ function createSearchClient({
1345
1348
  useReadTransporter: true,
1346
1349
  cacheable: true
1347
1350
  };
1348
- return this.transporter.request(request, requestOptions);
1351
+ return transporter.request(request, requestOptions);
1349
1352
  },
1350
1353
  /**
1351
1354
  * Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
@@ -1374,7 +1377,7 @@ function createSearchClient({
1374
1377
  queryParameters,
1375
1378
  headers
1376
1379
  };
1377
- return this.transporter.request(request, requestOptions);
1380
+ return transporter.request(request, requestOptions);
1378
1381
  },
1379
1382
  /**
1380
1383
  * Retrieves an object with non-null index settings.
@@ -1399,7 +1402,7 @@ function createSearchClient({
1399
1402
  queryParameters,
1400
1403
  headers
1401
1404
  };
1402
- return this.transporter.request(request, requestOptions);
1405
+ return transporter.request(request, requestOptions);
1403
1406
  },
1404
1407
  /**
1405
1408
  * Retrieves all allowed IP addresses with access to your application.
@@ -1419,7 +1422,7 @@ function createSearchClient({
1419
1422
  queryParameters,
1420
1423
  headers
1421
1424
  };
1422
- return this.transporter.request(request, requestOptions);
1425
+ return transporter.request(request, requestOptions);
1423
1426
  },
1424
1427
  /**
1425
1428
  * Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
@@ -1448,7 +1451,7 @@ function createSearchClient({
1448
1451
  queryParameters,
1449
1452
  headers
1450
1453
  };
1451
- return this.transporter.request(request, requestOptions);
1454
+ return transporter.request(request, requestOptions);
1452
1455
  },
1453
1456
  /**
1454
1457
  * Checks the status of a given task. Indexing tasks are asynchronous. When you add, update, or delete records or indices, a task is created on a queue and completed depending on the load on the server. The indexing tasks\' responses include a task ID that you can use to check the status.
@@ -1477,7 +1480,7 @@ function createSearchClient({
1477
1480
  queryParameters,
1478
1481
  headers
1479
1482
  };
1480
- return this.transporter.request(request, requestOptions);
1483
+ return transporter.request(request, requestOptions);
1481
1484
  },
1482
1485
  /**
1483
1486
  * Get the IDs of the 10 users with the highest number of records per cluster. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
@@ -1497,7 +1500,7 @@ function createSearchClient({
1497
1500
  queryParameters,
1498
1501
  headers
1499
1502
  };
1500
- return this.transporter.request(request, requestOptions);
1503
+ return transporter.request(request, requestOptions);
1501
1504
  },
1502
1505
  /**
1503
1506
  * Returns the user ID data stored in the mapping. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
@@ -1522,7 +1525,7 @@ function createSearchClient({
1522
1525
  queryParameters,
1523
1526
  headers
1524
1527
  };
1525
- return this.transporter.request(request, requestOptions);
1528
+ return transporter.request(request, requestOptions);
1526
1529
  },
1527
1530
  /**
1528
1531
  * To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.
@@ -1547,7 +1550,7 @@ function createSearchClient({
1547
1550
  queryParameters,
1548
1551
  headers
1549
1552
  };
1550
- return this.transporter.request(request, requestOptions);
1553
+ return transporter.request(request, requestOptions);
1551
1554
  },
1552
1555
  /**
1553
1556
  * Lists all API keys associated with your Algolia application, including their permissions and restrictions.
@@ -1567,7 +1570,7 @@ function createSearchClient({
1567
1570
  queryParameters,
1568
1571
  headers
1569
1572
  };
1570
- return this.transporter.request(request, requestOptions);
1573
+ return transporter.request(request, requestOptions);
1571
1574
  },
1572
1575
  /**
1573
1576
  * Lists the available clusters in a multi-cluster setup.
@@ -1587,7 +1590,7 @@ function createSearchClient({
1587
1590
  queryParameters,
1588
1591
  headers
1589
1592
  };
1590
- return this.transporter.request(request, requestOptions);
1593
+ return transporter.request(request, requestOptions);
1591
1594
  },
1592
1595
  /**
1593
1596
  * Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
@@ -1616,7 +1619,7 @@ function createSearchClient({
1616
1619
  queryParameters,
1617
1620
  headers
1618
1621
  };
1619
- return this.transporter.request(request, requestOptions);
1622
+ return transporter.request(request, requestOptions);
1620
1623
  },
1621
1624
  /**
1622
1625
  * Lists the userIDs assigned to a multi-cluster application. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
@@ -1645,7 +1648,7 @@ function createSearchClient({
1645
1648
  queryParameters,
1646
1649
  headers
1647
1650
  };
1648
- return this.transporter.request(request, requestOptions);
1651
+ return transporter.request(request, requestOptions);
1649
1652
  },
1650
1653
  /**
1651
1654
  * Adds, updates, or deletes records in multiple indices with a single API request. - Actions are applied in the order they are specified. - Actions are equivalent to the individual API requests of the same name.
@@ -1670,7 +1673,7 @@ function createSearchClient({
1670
1673
  headers,
1671
1674
  data: batchParams
1672
1675
  };
1673
- return this.transporter.request(request, requestOptions);
1676
+ return transporter.request(request, requestOptions);
1674
1677
  },
1675
1678
  /**
1676
1679
  * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
@@ -1706,7 +1709,7 @@ function createSearchClient({
1706
1709
  headers,
1707
1710
  data: operationIndexParams
1708
1711
  };
1709
- return this.transporter.request(request, requestOptions);
1712
+ return transporter.request(request, requestOptions);
1710
1713
  },
1711
1714
  /**
1712
1715
  * Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn\'t exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn\'t exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don\'t have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it\'s not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn\'t exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn\'t exist yet, the engine only creates it if you pass an IncrementSet value that\'s greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
@@ -1744,7 +1747,7 @@ function createSearchClient({
1744
1747
  headers,
1745
1748
  data: attributesToUpdate
1746
1749
  };
1747
- return this.transporter.request(request, requestOptions);
1750
+ return transporter.request(request, requestOptions);
1748
1751
  },
1749
1752
  /**
1750
1753
  * Deletes a user ID and its associated data from the clusters.
@@ -1769,7 +1772,7 @@ function createSearchClient({
1769
1772
  queryParameters,
1770
1773
  headers
1771
1774
  };
1772
- return this.transporter.request(request, requestOptions);
1775
+ return transporter.request(request, requestOptions);
1773
1776
  },
1774
1777
  /**
1775
1778
  * Replaces the list of allowed sources.
@@ -1795,7 +1798,7 @@ function createSearchClient({
1795
1798
  headers,
1796
1799
  data: source
1797
1800
  };
1798
- return this.transporter.request(request, requestOptions);
1801
+ return transporter.request(request, requestOptions);
1799
1802
  },
1800
1803
  /**
1801
1804
  * Restores a deleted API key. Restoring resets the `validity` attribute to `0`. Algolia stores up to 1,000 API keys per application. If you create more, the oldest API keys are deleted and can\'t be restored.
@@ -1820,7 +1823,7 @@ function createSearchClient({
1820
1823
  queryParameters,
1821
1824
  headers
1822
1825
  };
1823
- return this.transporter.request(request, requestOptions);
1826
+ return transporter.request(request, requestOptions);
1824
1827
  },
1825
1828
  /**
1826
1829
  * Adds a record to an index or replace it. - If the record doesn\'t have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn\'t exist, a new record is added to your index. - If you add a record to an index that doesn\'t exist yet, a new index is created. To update _some_ attributes of a record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).
@@ -1850,7 +1853,7 @@ function createSearchClient({
1850
1853
  headers,
1851
1854
  data: body
1852
1855
  };
1853
- return this.transporter.request(request, requestOptions);
1856
+ return transporter.request(request, requestOptions);
1854
1857
  },
1855
1858
  /**
1856
1859
  * If a rule with the specified object ID doesn\'t exist, it\'s created. Otherwise, the existing rule is replaced. To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
@@ -1891,7 +1894,7 @@ function createSearchClient({
1891
1894
  headers,
1892
1895
  data: rule
1893
1896
  };
1894
- return this.transporter.request(request, requestOptions);
1897
+ return transporter.request(request, requestOptions);
1895
1898
  },
1896
1899
  /**
1897
1900
  * Create or update multiple rules. If a rule with the specified object ID doesn\'t exist, Algolia creates a new one. Otherwise, existing rules are replaced.
@@ -1929,7 +1932,7 @@ function createSearchClient({
1929
1932
  headers,
1930
1933
  data: rules
1931
1934
  };
1932
- return this.transporter.request(request, requestOptions);
1935
+ return transporter.request(request, requestOptions);
1933
1936
  },
1934
1937
  /**
1935
1938
  * If a synonym with the specified object ID doesn\'t exist, Algolia adds a new one. Otherwise, the existing synonym is replaced. To add multiple synonyms in a single API request, use the [`batch` operation](#tag/Synonyms/operation/saveSynonyms).
@@ -1973,7 +1976,7 @@ function createSearchClient({
1973
1976
  headers,
1974
1977
  data: synonymHit
1975
1978
  };
1976
- return this.transporter.request(request, requestOptions);
1979
+ return transporter.request(request, requestOptions);
1977
1980
  },
1978
1981
  /**
1979
1982
  * If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
@@ -2011,7 +2014,7 @@ function createSearchClient({
2011
2014
  headers,
2012
2015
  data: synonymHit
2013
2016
  };
2014
- return this.transporter.request(request, requestOptions);
2017
+ return transporter.request(request, requestOptions);
2015
2018
  },
2016
2019
  /**
2017
2020
  * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.
@@ -2062,7 +2065,7 @@ function createSearchClient({
2062
2065
  useReadTransporter: true,
2063
2066
  cacheable: true
2064
2067
  };
2065
- return this.transporter.request(request, requestOptions);
2068
+ return transporter.request(request, requestOptions);
2066
2069
  },
2067
2070
  /**
2068
2071
  * Searches for standard and custom dictionary entries.
@@ -2104,7 +2107,7 @@ function createSearchClient({
2104
2107
  useReadTransporter: true,
2105
2108
  cacheable: true
2106
2109
  };
2107
- return this.transporter.request(request, requestOptions);
2110
+ return transporter.request(request, requestOptions);
2108
2111
  },
2109
2112
  /**
2110
2113
  * Searches for values of a specified facet attribute. - 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**.
@@ -2137,7 +2140,7 @@ function createSearchClient({
2137
2140
  useReadTransporter: true,
2138
2141
  cacheable: true
2139
2142
  };
2140
- return this.transporter.request(request, requestOptions);
2143
+ return transporter.request(request, requestOptions);
2141
2144
  },
2142
2145
  /**
2143
2146
  * Searches for rules in your index.
@@ -2166,7 +2169,7 @@ function createSearchClient({
2166
2169
  useReadTransporter: true,
2167
2170
  cacheable: true
2168
2171
  };
2169
- return this.transporter.request(request, requestOptions);
2172
+ return transporter.request(request, requestOptions);
2170
2173
  },
2171
2174
  /**
2172
2175
  * Searches a single index and return matching search results (_hits_). This method lets you retrieve up to 1,000 hits. If you need more, use the [`browse` operation](#tag/Search/operation/browse) or increase the `paginatedLimitedTo` index setting.
@@ -2195,7 +2198,7 @@ function createSearchClient({
2195
2198
  useReadTransporter: true,
2196
2199
  cacheable: true
2197
2200
  };
2198
- return this.transporter.request(request, requestOptions);
2201
+ return transporter.request(request, requestOptions);
2199
2202
  },
2200
2203
  /**
2201
2204
  * Searches for synonyms in your index.
@@ -2227,7 +2230,7 @@ function createSearchClient({
2227
2230
  useReadTransporter: true,
2228
2231
  cacheable: true
2229
2232
  };
2230
- return this.transporter.request(request, requestOptions);
2233
+ return transporter.request(request, requestOptions);
2231
2234
  },
2232
2235
  /**
2233
2236
  * Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time. To ensure rapid updates, the user IDs index isn\'t built at the same time as the mapping. Instead, it\'s built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).
@@ -2257,7 +2260,7 @@ function createSearchClient({
2257
2260
  useReadTransporter: true,
2258
2261
  cacheable: true
2259
2262
  };
2260
- return this.transporter.request(request, requestOptions);
2263
+ return transporter.request(request, requestOptions);
2261
2264
  },
2262
2265
  /**
2263
2266
  * Turns standard stop word dictionary entries on or off for a given language.
@@ -2287,7 +2290,7 @@ function createSearchClient({
2287
2290
  headers,
2288
2291
  data: dictionarySettingsParams
2289
2292
  };
2290
- return this.transporter.request(request, requestOptions);
2293
+ return transporter.request(request, requestOptions);
2291
2294
  },
2292
2295
  /**
2293
2296
  * Update the specified index settings. Index settings that you don\'t specify are left unchanged. Specify `null` to reset a setting to its default value. For best performance, update the index settings before you add new records to your index.
@@ -2321,7 +2324,7 @@ function createSearchClient({
2321
2324
  headers,
2322
2325
  data: indexSettings
2323
2326
  };
2324
- return this.transporter.request(request, requestOptions);
2327
+ return transporter.request(request, requestOptions);
2325
2328
  },
2326
2329
  /**
2327
2330
  * Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
@@ -2354,7 +2357,7 @@ function createSearchClient({
2354
2357
  headers,
2355
2358
  data: apiKey
2356
2359
  };
2357
- return this.transporter.request(request, requestOptions);
2360
+ return transporter.request(request, requestOptions);
2358
2361
  }
2359
2362
  };
2360
2363
  }