@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.
@@ -7,7 +7,7 @@ import {
7
7
  ApiError,
8
8
  createIterablePromise
9
9
  } from "@algolia/client-common";
10
- var apiClientVersion = "5.3.0";
10
+ var apiClientVersion = "5.3.2";
11
11
  function getDefaultHosts(appId) {
12
12
  return [
13
13
  {
@@ -48,25 +48,26 @@ function createSearchClient({
48
48
  ...options
49
49
  }) {
50
50
  const auth = createAuth(appIdOption, apiKeyOption, authMode);
51
- return {
52
- transporter: createTransporter({
53
- hosts: getDefaultHosts(appIdOption),
54
- ...options,
55
- algoliaAgent: getAlgoliaAgent({
56
- algoliaAgents,
57
- client: "Search",
58
- version: apiClientVersion
59
- }),
60
- baseHeaders: {
61
- "content-type": "text/plain",
62
- ...auth.headers(),
63
- ...options.baseHeaders
64
- },
65
- baseQueryParameters: {
66
- ...auth.queryParameters(),
67
- ...options.baseQueryParameters
68
- }
51
+ const transporter = createTransporter({
52
+ hosts: getDefaultHosts(appIdOption),
53
+ ...options,
54
+ algoliaAgent: getAlgoliaAgent({
55
+ algoliaAgents,
56
+ client: "Search",
57
+ version: apiClientVersion
69
58
  }),
59
+ baseHeaders: {
60
+ "content-type": "text/plain",
61
+ ...auth.headers(),
62
+ ...options.baseHeaders
63
+ },
64
+ baseQueryParameters: {
65
+ ...auth.queryParameters(),
66
+ ...options.baseQueryParameters
67
+ }
68
+ });
69
+ return {
70
+ transporter,
70
71
  /**
71
72
  * The `appId` currently in use.
72
73
  */
@@ -75,15 +76,13 @@ function createSearchClient({
75
76
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
76
77
  */
77
78
  clearCache() {
78
- return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
79
- () => void 0
80
- );
79
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
81
80
  },
82
81
  /**
83
82
  * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
84
83
  */
85
84
  get _ua() {
86
- return this.transporter.algoliaAgent.value;
85
+ return transporter.algoliaAgent.value;
87
86
  },
88
87
  /**
89
88
  * Adds a `segment` to the `x-algolia-agent` sent with every requests.
@@ -92,7 +91,7 @@ function createSearchClient({
92
91
  * @param version - The version of the agent.
93
92
  */
94
93
  addAlgoliaAgent(segment, version) {
95
- this.transporter.algoliaAgent.add({ segment, version });
94
+ transporter.algoliaAgent.add({ segment, version });
96
95
  },
97
96
  /**
98
97
  * Helper method to switch the API key used to authenticate the requests.
@@ -101,7 +100,11 @@ function createSearchClient({
101
100
  * @param params.apiKey - The new API Key to use.
102
101
  */
103
102
  setClientApiKey({ apiKey }) {
104
- this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
103
+ if (!authMode || authMode === "WithinHeaders") {
104
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
105
+ } else {
106
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
107
+ }
105
108
  },
106
109
  /**
107
110
  * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
@@ -524,7 +527,7 @@ function createSearchClient({
524
527
  headers,
525
528
  data: apiKey
526
529
  };
527
- return this.transporter.request(request, requestOptions);
530
+ return transporter.request(request, requestOptions);
528
531
  },
529
532
  /**
530
533
  * 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).
@@ -558,7 +561,7 @@ function createSearchClient({
558
561
  headers,
559
562
  data: body
560
563
  };
561
- return this.transporter.request(request, requestOptions);
564
+ return transporter.request(request, requestOptions);
562
565
  },
563
566
  /**
564
567
  * Adds a source to the list of allowed sources.
@@ -586,7 +589,7 @@ function createSearchClient({
586
589
  headers,
587
590
  data: source
588
591
  };
589
- return this.transporter.request(request, requestOptions);
592
+ return transporter.request(request, requestOptions);
590
593
  },
591
594
  /**
592
595
  * 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.
@@ -622,7 +625,7 @@ function createSearchClient({
622
625
  headers,
623
626
  data: assignUserIdParams
624
627
  };
625
- return this.transporter.request(request, requestOptions);
628
+ return transporter.request(request, requestOptions);
626
629
  },
627
630
  /**
628
631
  * 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.
@@ -652,7 +655,7 @@ function createSearchClient({
652
655
  headers,
653
656
  data: batchWriteParams
654
657
  };
655
- return this.transporter.request(request, requestOptions);
658
+ return transporter.request(request, requestOptions);
656
659
  },
657
660
  /**
658
661
  * Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
@@ -691,7 +694,7 @@ function createSearchClient({
691
694
  headers,
692
695
  data: batchAssignUserIdsParams
693
696
  };
694
- return this.transporter.request(request, requestOptions);
697
+ return transporter.request(request, requestOptions);
695
698
  },
696
699
  /**
697
700
  * Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
@@ -729,7 +732,7 @@ function createSearchClient({
729
732
  headers,
730
733
  data: batchDictionaryEntriesParams
731
734
  };
732
- return this.transporter.request(request, requestOptions);
735
+ return transporter.request(request, requestOptions);
733
736
  },
734
737
  /**
735
738
  * 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.
@@ -756,7 +759,7 @@ function createSearchClient({
756
759
  headers,
757
760
  data: browseParams ? browseParams : {}
758
761
  };
759
- return this.transporter.request(request, requestOptions);
762
+ return transporter.request(request, requestOptions);
760
763
  },
761
764
  /**
762
765
  * Deletes only the records from an index while keeping settings, synonyms, and rules.
@@ -781,7 +784,7 @@ function createSearchClient({
781
784
  queryParameters,
782
785
  headers
783
786
  };
784
- return this.transporter.request(request, requestOptions);
787
+ return transporter.request(request, requestOptions);
785
788
  },
786
789
  /**
787
790
  * Deletes all rules from the index.
@@ -810,7 +813,7 @@ function createSearchClient({
810
813
  queryParameters,
811
814
  headers
812
815
  };
813
- return this.transporter.request(request, requestOptions);
816
+ return transporter.request(request, requestOptions);
814
817
  },
815
818
  /**
816
819
  * Deletes all synonyms from the index.
@@ -839,7 +842,7 @@ function createSearchClient({
839
842
  queryParameters,
840
843
  headers
841
844
  };
842
- return this.transporter.request(request, requestOptions);
845
+ return transporter.request(request, requestOptions);
843
846
  },
844
847
  /**
845
848
  * This method allow you to send requests to the Algolia REST API.
@@ -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.
@@ -910,7 +913,7 @@ function createSearchClient({
910
913
  headers,
911
914
  data: body ? body : {}
912
915
  };
913
- return this.transporter.request(request, requestOptions);
916
+ return transporter.request(request, requestOptions);
914
917
  },
915
918
  /**
916
919
  * This method allow you to send requests to the Algolia REST API.
@@ -935,7 +938,7 @@ function createSearchClient({
935
938
  headers,
936
939
  data: body ? body : {}
937
940
  };
938
- return this.transporter.request(request, requestOptions);
941
+ return transporter.request(request, requestOptions);
939
942
  },
940
943
  /**
941
944
  * Deletes the API key.
@@ -960,7 +963,7 @@ function createSearchClient({
960
963
  queryParameters,
961
964
  headers
962
965
  };
963
- return this.transporter.request(request, requestOptions);
966
+ return transporter.request(request, requestOptions);
964
967
  },
965
968
  /**
966
969
  * 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).
@@ -990,7 +993,7 @@ function createSearchClient({
990
993
  headers,
991
994
  data: deleteByParams
992
995
  };
993
- return this.transporter.request(request, requestOptions);
996
+ return transporter.request(request, requestOptions);
994
997
  },
995
998
  /**
996
999
  * 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/).
@@ -1015,7 +1018,7 @@ function createSearchClient({
1015
1018
  queryParameters,
1016
1019
  headers
1017
1020
  };
1018
- return this.transporter.request(request, requestOptions);
1021
+ return transporter.request(request, requestOptions);
1019
1022
  },
1020
1023
  /**
1021
1024
  * 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).
@@ -1044,7 +1047,7 @@ function createSearchClient({
1044
1047
  queryParameters,
1045
1048
  headers
1046
1049
  };
1047
- return this.transporter.request(request, requestOptions);
1050
+ return transporter.request(request, requestOptions);
1048
1051
  },
1049
1052
  /**
1050
1053
  * Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
@@ -1077,7 +1080,7 @@ function createSearchClient({
1077
1080
  queryParameters,
1078
1081
  headers
1079
1082
  };
1080
- return this.transporter.request(request, requestOptions);
1083
+ return transporter.request(request, requestOptions);
1081
1084
  },
1082
1085
  /**
1083
1086
  * Deletes a source from the list of allowed sources.
@@ -1102,7 +1105,7 @@ function createSearchClient({
1102
1105
  queryParameters,
1103
1106
  headers
1104
1107
  };
1105
- return this.transporter.request(request, requestOptions);
1108
+ return transporter.request(request, requestOptions);
1106
1109
  },
1107
1110
  /**
1108
1111
  * Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
@@ -1135,7 +1138,7 @@ function createSearchClient({
1135
1138
  queryParameters,
1136
1139
  headers
1137
1140
  };
1138
- return this.transporter.request(request, requestOptions);
1141
+ return transporter.request(request, requestOptions);
1139
1142
  },
1140
1143
  /**
1141
1144
  * 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.
@@ -1157,7 +1160,7 @@ function createSearchClient({
1157
1160
  queryParameters,
1158
1161
  headers
1159
1162
  };
1160
- return this.transporter.request(request, requestOptions);
1163
+ return transporter.request(request, requestOptions);
1161
1164
  },
1162
1165
  /**
1163
1166
  * Checks the status of a given application task.
@@ -1182,7 +1185,7 @@ function createSearchClient({
1182
1185
  queryParameters,
1183
1186
  headers
1184
1187
  };
1185
- return this.transporter.request(request, requestOptions);
1188
+ return transporter.request(request, requestOptions);
1186
1189
  },
1187
1190
  /**
1188
1191
  * Lists supported languages with their supported dictionary types and number of custom entries.
@@ -1202,7 +1205,7 @@ function createSearchClient({
1202
1205
  queryParameters,
1203
1206
  headers
1204
1207
  };
1205
- return this.transporter.request(request, requestOptions);
1208
+ return transporter.request(request, requestOptions);
1206
1209
  },
1207
1210
  /**
1208
1211
  * Retrieves the languages for which standard dictionary entries are turned off.
@@ -1222,7 +1225,7 @@ function createSearchClient({
1222
1225
  queryParameters,
1223
1226
  headers
1224
1227
  };
1225
- return this.transporter.request(request, requestOptions);
1228
+ return transporter.request(request, requestOptions);
1226
1229
  },
1227
1230
  /**
1228
1231
  * 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.
@@ -1259,7 +1262,7 @@ function createSearchClient({
1259
1262
  queryParameters,
1260
1263
  headers
1261
1264
  };
1262
- return this.transporter.request(request, requestOptions);
1265
+ return transporter.request(request, requestOptions);
1263
1266
  },
1264
1267
  /**
1265
1268
  * Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
@@ -1292,7 +1295,7 @@ function createSearchClient({
1292
1295
  queryParameters,
1293
1296
  headers
1294
1297
  };
1295
- return this.transporter.request(request, requestOptions);
1298
+ return transporter.request(request, requestOptions);
1296
1299
  },
1297
1300
  /**
1298
1301
  * Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
@@ -1322,7 +1325,7 @@ function createSearchClient({
1322
1325
  useReadTransporter: true,
1323
1326
  cacheable: true
1324
1327
  };
1325
- return this.transporter.request(request, requestOptions);
1328
+ return transporter.request(request, requestOptions);
1326
1329
  },
1327
1330
  /**
1328
1331
  * Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
@@ -1351,7 +1354,7 @@ function createSearchClient({
1351
1354
  queryParameters,
1352
1355
  headers
1353
1356
  };
1354
- return this.transporter.request(request, requestOptions);
1357
+ return transporter.request(request, requestOptions);
1355
1358
  },
1356
1359
  /**
1357
1360
  * Retrieves an object with non-null index settings.
@@ -1376,7 +1379,7 @@ function createSearchClient({
1376
1379
  queryParameters,
1377
1380
  headers
1378
1381
  };
1379
- return this.transporter.request(request, requestOptions);
1382
+ return transporter.request(request, requestOptions);
1380
1383
  },
1381
1384
  /**
1382
1385
  * Retrieves all allowed IP addresses with access to your application.
@@ -1396,7 +1399,7 @@ function createSearchClient({
1396
1399
  queryParameters,
1397
1400
  headers
1398
1401
  };
1399
- return this.transporter.request(request, requestOptions);
1402
+ return transporter.request(request, requestOptions);
1400
1403
  },
1401
1404
  /**
1402
1405
  * Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
@@ -1425,7 +1428,7 @@ function createSearchClient({
1425
1428
  queryParameters,
1426
1429
  headers
1427
1430
  };
1428
- return this.transporter.request(request, requestOptions);
1431
+ return transporter.request(request, requestOptions);
1429
1432
  },
1430
1433
  /**
1431
1434
  * 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.
@@ -1454,7 +1457,7 @@ function createSearchClient({
1454
1457
  queryParameters,
1455
1458
  headers
1456
1459
  };
1457
- return this.transporter.request(request, requestOptions);
1460
+ return transporter.request(request, requestOptions);
1458
1461
  },
1459
1462
  /**
1460
1463
  * 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.
@@ -1474,7 +1477,7 @@ function createSearchClient({
1474
1477
  queryParameters,
1475
1478
  headers
1476
1479
  };
1477
- return this.transporter.request(request, requestOptions);
1480
+ return transporter.request(request, requestOptions);
1478
1481
  },
1479
1482
  /**
1480
1483
  * 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.
@@ -1499,7 +1502,7 @@ function createSearchClient({
1499
1502
  queryParameters,
1500
1503
  headers
1501
1504
  };
1502
- return this.transporter.request(request, requestOptions);
1505
+ return transporter.request(request, requestOptions);
1503
1506
  },
1504
1507
  /**
1505
1508
  * 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.
@@ -1524,7 +1527,7 @@ function createSearchClient({
1524
1527
  queryParameters,
1525
1528
  headers
1526
1529
  };
1527
- return this.transporter.request(request, requestOptions);
1530
+ return transporter.request(request, requestOptions);
1528
1531
  },
1529
1532
  /**
1530
1533
  * Lists all API keys associated with your Algolia application, including their permissions and restrictions.
@@ -1544,7 +1547,7 @@ function createSearchClient({
1544
1547
  queryParameters,
1545
1548
  headers
1546
1549
  };
1547
- return this.transporter.request(request, requestOptions);
1550
+ return transporter.request(request, requestOptions);
1548
1551
  },
1549
1552
  /**
1550
1553
  * Lists the available clusters in a multi-cluster setup.
@@ -1564,7 +1567,7 @@ function createSearchClient({
1564
1567
  queryParameters,
1565
1568
  headers
1566
1569
  };
1567
- return this.transporter.request(request, requestOptions);
1570
+ return transporter.request(request, requestOptions);
1568
1571
  },
1569
1572
  /**
1570
1573
  * Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
@@ -1593,7 +1596,7 @@ function createSearchClient({
1593
1596
  queryParameters,
1594
1597
  headers
1595
1598
  };
1596
- return this.transporter.request(request, requestOptions);
1599
+ return transporter.request(request, requestOptions);
1597
1600
  },
1598
1601
  /**
1599
1602
  * 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.
@@ -1622,7 +1625,7 @@ function createSearchClient({
1622
1625
  queryParameters,
1623
1626
  headers
1624
1627
  };
1625
- return this.transporter.request(request, requestOptions);
1628
+ return transporter.request(request, requestOptions);
1626
1629
  },
1627
1630
  /**
1628
1631
  * 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.
@@ -1647,7 +1650,7 @@ function createSearchClient({
1647
1650
  headers,
1648
1651
  data: batchParams
1649
1652
  };
1650
- return this.transporter.request(request, requestOptions);
1653
+ return transporter.request(request, requestOptions);
1651
1654
  },
1652
1655
  /**
1653
1656
  * 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/).
@@ -1683,7 +1686,7 @@ function createSearchClient({
1683
1686
  headers,
1684
1687
  data: operationIndexParams
1685
1688
  };
1686
- return this.transporter.request(request, requestOptions);
1689
+ return transporter.request(request, requestOptions);
1687
1690
  },
1688
1691
  /**
1689
1692
  * 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.
@@ -1721,7 +1724,7 @@ function createSearchClient({
1721
1724
  headers,
1722
1725
  data: attributesToUpdate
1723
1726
  };
1724
- return this.transporter.request(request, requestOptions);
1727
+ return transporter.request(request, requestOptions);
1725
1728
  },
1726
1729
  /**
1727
1730
  * Deletes a user ID and its associated data from the clusters.
@@ -1746,7 +1749,7 @@ function createSearchClient({
1746
1749
  queryParameters,
1747
1750
  headers
1748
1751
  };
1749
- return this.transporter.request(request, requestOptions);
1752
+ return transporter.request(request, requestOptions);
1750
1753
  },
1751
1754
  /**
1752
1755
  * Replaces the list of allowed sources.
@@ -1772,7 +1775,7 @@ function createSearchClient({
1772
1775
  headers,
1773
1776
  data: source
1774
1777
  };
1775
- return this.transporter.request(request, requestOptions);
1778
+ return transporter.request(request, requestOptions);
1776
1779
  },
1777
1780
  /**
1778
1781
  * 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.
@@ -1797,7 +1800,7 @@ function createSearchClient({
1797
1800
  queryParameters,
1798
1801
  headers
1799
1802
  };
1800
- return this.transporter.request(request, requestOptions);
1803
+ return transporter.request(request, requestOptions);
1801
1804
  },
1802
1805
  /**
1803
1806
  * 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).
@@ -1827,7 +1830,7 @@ function createSearchClient({
1827
1830
  headers,
1828
1831
  data: body
1829
1832
  };
1830
- return this.transporter.request(request, requestOptions);
1833
+ return transporter.request(request, requestOptions);
1831
1834
  },
1832
1835
  /**
1833
1836
  * 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).
@@ -1868,7 +1871,7 @@ function createSearchClient({
1868
1871
  headers,
1869
1872
  data: rule
1870
1873
  };
1871
- return this.transporter.request(request, requestOptions);
1874
+ return transporter.request(request, requestOptions);
1872
1875
  },
1873
1876
  /**
1874
1877
  * 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.
@@ -1906,7 +1909,7 @@ function createSearchClient({
1906
1909
  headers,
1907
1910
  data: rules
1908
1911
  };
1909
- return this.transporter.request(request, requestOptions);
1912
+ return transporter.request(request, requestOptions);
1910
1913
  },
1911
1914
  /**
1912
1915
  * 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).
@@ -1950,7 +1953,7 @@ function createSearchClient({
1950
1953
  headers,
1951
1954
  data: synonymHit
1952
1955
  };
1953
- return this.transporter.request(request, requestOptions);
1956
+ return transporter.request(request, requestOptions);
1954
1957
  },
1955
1958
  /**
1956
1959
  * If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
@@ -1988,7 +1991,7 @@ function createSearchClient({
1988
1991
  headers,
1989
1992
  data: synonymHit
1990
1993
  };
1991
- return this.transporter.request(request, requestOptions);
1994
+ return transporter.request(request, requestOptions);
1992
1995
  },
1993
1996
  /**
1994
1997
  * 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.
@@ -2039,7 +2042,7 @@ function createSearchClient({
2039
2042
  useReadTransporter: true,
2040
2043
  cacheable: true
2041
2044
  };
2042
- return this.transporter.request(request, requestOptions);
2045
+ return transporter.request(request, requestOptions);
2043
2046
  },
2044
2047
  /**
2045
2048
  * Searches for standard and custom dictionary entries.
@@ -2081,7 +2084,7 @@ function createSearchClient({
2081
2084
  useReadTransporter: true,
2082
2085
  cacheable: true
2083
2086
  };
2084
- return this.transporter.request(request, requestOptions);
2087
+ return transporter.request(request, requestOptions);
2085
2088
  },
2086
2089
  /**
2087
2090
  * 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**.
@@ -2114,7 +2117,7 @@ function createSearchClient({
2114
2117
  useReadTransporter: true,
2115
2118
  cacheable: true
2116
2119
  };
2117
- return this.transporter.request(request, requestOptions);
2120
+ return transporter.request(request, requestOptions);
2118
2121
  },
2119
2122
  /**
2120
2123
  * Searches for rules in your index.
@@ -2143,7 +2146,7 @@ function createSearchClient({
2143
2146
  useReadTransporter: true,
2144
2147
  cacheable: true
2145
2148
  };
2146
- return this.transporter.request(request, requestOptions);
2149
+ return transporter.request(request, requestOptions);
2147
2150
  },
2148
2151
  /**
2149
2152
  * 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.
@@ -2172,7 +2175,7 @@ function createSearchClient({
2172
2175
  useReadTransporter: true,
2173
2176
  cacheable: true
2174
2177
  };
2175
- return this.transporter.request(request, requestOptions);
2178
+ return transporter.request(request, requestOptions);
2176
2179
  },
2177
2180
  /**
2178
2181
  * Searches for synonyms in your index.
@@ -2204,7 +2207,7 @@ function createSearchClient({
2204
2207
  useReadTransporter: true,
2205
2208
  cacheable: true
2206
2209
  };
2207
- return this.transporter.request(request, requestOptions);
2210
+ return transporter.request(request, requestOptions);
2208
2211
  },
2209
2212
  /**
2210
2213
  * 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).
@@ -2234,7 +2237,7 @@ function createSearchClient({
2234
2237
  useReadTransporter: true,
2235
2238
  cacheable: true
2236
2239
  };
2237
- return this.transporter.request(request, requestOptions);
2240
+ return transporter.request(request, requestOptions);
2238
2241
  },
2239
2242
  /**
2240
2243
  * Turns standard stop word dictionary entries on or off for a given language.
@@ -2264,7 +2267,7 @@ function createSearchClient({
2264
2267
  headers,
2265
2268
  data: dictionarySettingsParams
2266
2269
  };
2267
- return this.transporter.request(request, requestOptions);
2270
+ return transporter.request(request, requestOptions);
2268
2271
  },
2269
2272
  /**
2270
2273
  * 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.
@@ -2298,7 +2301,7 @@ function createSearchClient({
2298
2301
  headers,
2299
2302
  data: indexSettings
2300
2303
  };
2301
- return this.transporter.request(request, requestOptions);
2304
+ return transporter.request(request, requestOptions);
2302
2305
  },
2303
2306
  /**
2304
2307
  * Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
@@ -2331,7 +2334,7 @@ function createSearchClient({
2331
2334
  headers,
2332
2335
  data: apiKey
2333
2336
  };
2334
- return this.transporter.request(request, requestOptions);
2337
+ return transporter.request(request, requestOptions);
2335
2338
  }
2336
2339
  };
2337
2340
  }