@algolia/client-query-suggestions 5.26.0 → 5.28.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/node.d.cts CHANGED
@@ -5,41 +5,41 @@ type BaseResponse = {
5
5
  /**
6
6
  * HTTP status code.
7
7
  */
8
- status?: number;
8
+ status?: number | undefined;
9
9
  /**
10
10
  * Details about the response, such as error messages.
11
11
  */
12
- message?: string;
12
+ message?: string | undefined;
13
13
  };
14
14
 
15
15
  type ConfigStatus = {
16
16
  /**
17
17
  * Name of the Query Suggestions index (case-sensitive).
18
18
  */
19
- indexName?: string;
19
+ indexName?: string | undefined;
20
20
  /**
21
21
  * Whether the creation or update of the Query Suggestions index is in progress.
22
22
  */
23
- isRunning?: boolean;
23
+ isRunning?: boolean | undefined;
24
24
  /**
25
25
  * Date and time when the Query Suggestions index was last built, in RFC 3339 format.
26
26
  */
27
- lastBuiltAt?: string;
27
+ lastBuiltAt?: string | undefined;
28
28
  /**
29
29
  * Date and time when the Query Suggestions index was last updated successfully.
30
30
  */
31
- lastSuccessfulBuiltAt?: string;
31
+ lastSuccessfulBuiltAt?: string | undefined;
32
32
  /**
33
33
  * Duration of the last successful build in seconds.
34
34
  */
35
- lastSuccessfulBuildDuration?: string;
35
+ lastSuccessfulBuildDuration?: string | undefined;
36
36
  };
37
37
 
38
38
  type AppID = {
39
39
  /**
40
40
  * Algolia application ID to which this Query Suggestions configuration belongs.
41
41
  */
42
- appID?: string;
42
+ appID?: string | undefined;
43
43
  };
44
44
 
45
45
  /**
@@ -54,11 +54,11 @@ type Facet = {
54
54
  /**
55
55
  * Facet name.
56
56
  */
57
- attribute?: string;
57
+ attribute?: string | undefined;
58
58
  /**
59
59
  * Number of suggestions.
60
60
  */
61
- amount?: number;
61
+ amount?: number | undefined;
62
62
  };
63
63
 
64
64
  /**
@@ -72,19 +72,19 @@ type SourceIndex = {
72
72
  /**
73
73
  * If true, Query Suggestions uses all replica indices to find popular searches. If false, only the primary index is used.
74
74
  */
75
- replicas?: boolean;
76
- analyticsTags?: Array<string> | null;
77
- facets?: Array<Facet> | null;
75
+ replicas?: boolean | undefined;
76
+ analyticsTags?: Array<string> | null | undefined;
77
+ facets?: Array<Facet> | null | undefined;
78
78
  /**
79
79
  * Minimum number of hits required to be included as a suggestion. A search query must at least generate `minHits` search results to be included in the Query Suggestions index.
80
80
  */
81
- minHits?: number;
81
+ minHits?: number | undefined;
82
82
  /**
83
83
  * Minimum letters required to be included as a suggestion. A search query must be at least `minLetters` long to be included in the Query Suggestions index.
84
84
  */
85
- minLetters?: number;
86
- generate?: Array<Array<string>> | null;
87
- external?: Array<string> | null;
85
+ minLetters?: number | undefined;
86
+ generate?: Array<Array<string>> | null | undefined;
87
+ external?: Array<string> | null | undefined;
88
88
  };
89
89
 
90
90
  /**
@@ -95,16 +95,16 @@ type Configuration = {
95
95
  * Algolia indices from which to get the popular searches for query suggestions.
96
96
  */
97
97
  sourceIndices: Array<SourceIndex>;
98
- languages?: Languages;
99
- exclude?: Array<string> | null;
98
+ languages?: Languages | undefined;
99
+ exclude?: Array<string> | null | undefined;
100
100
  /**
101
101
  * Whether to turn on personalized query suggestions.
102
102
  */
103
- enablePersonalization?: boolean;
103
+ enablePersonalization?: boolean | undefined;
104
104
  /**
105
105
  * Whether to include suggestions with special characters.
106
106
  */
107
- allowSpecialCharacters?: boolean;
107
+ allowSpecialCharacters?: boolean | undefined;
108
108
  };
109
109
 
110
110
  /**
@@ -126,16 +126,16 @@ type LogFile = {
126
126
  /**
127
127
  * Date and time of the log entry, in RFC 3339 format.
128
128
  */
129
- timestamp?: string;
130
- level?: LogLevel;
129
+ timestamp?: string | undefined;
130
+ level?: LogLevel | undefined;
131
131
  /**
132
132
  * Details about this log entry.
133
133
  */
134
- message?: string;
134
+ message?: string | undefined;
135
135
  /**
136
136
  * Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
137
137
  */
138
- contextLevel?: number;
138
+ contextLevel?: number | undefined;
139
139
  };
140
140
 
141
141
  /**
@@ -151,7 +151,7 @@ type CustomDeleteProps = {
151
151
  */
152
152
  parameters?: {
153
153
  [key: string]: any;
154
- };
154
+ } | undefined;
155
155
  };
156
156
  /**
157
157
  * Properties for the `customGet` method.
@@ -166,7 +166,7 @@ type CustomGetProps = {
166
166
  */
167
167
  parameters?: {
168
168
  [key: string]: any;
169
- };
169
+ } | undefined;
170
170
  };
171
171
  /**
172
172
  * Properties for the `customPost` method.
@@ -181,11 +181,11 @@ type CustomPostProps = {
181
181
  */
182
182
  parameters?: {
183
183
  [key: string]: any;
184
- };
184
+ } | undefined;
185
185
  /**
186
186
  * Parameters to send with the custom request.
187
187
  */
188
- body?: Record<string, unknown>;
188
+ body?: Record<string, unknown> | undefined;
189
189
  };
190
190
  /**
191
191
  * Properties for the `customPut` method.
@@ -200,11 +200,11 @@ type CustomPutProps = {
200
200
  */
201
201
  parameters?: {
202
202
  [key: string]: any;
203
- };
203
+ } | undefined;
204
204
  /**
205
205
  * Parameters to send with the custom request.
206
206
  */
207
- body?: Record<string, unknown>;
207
+ body?: Record<string, unknown> | undefined;
208
208
  };
209
209
  /**
210
210
  * Properties for the `deleteConfig` method.
@@ -253,7 +253,7 @@ type UpdateConfigProps = {
253
253
  configuration: Configuration;
254
254
  };
255
255
 
256
- declare const apiClientVersion = "5.26.0";
256
+ declare const apiClientVersion = "5.28.0";
257
257
  declare const REGIONS: readonly ["eu", "us"];
258
258
  type Region = (typeof REGIONS)[number];
259
259
  type RegionOptions = {
@@ -283,7 +283,7 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
283
283
  * @param segment - The algolia agent (user-agent) segment to add.
284
284
  * @param version - The version of the agent.
285
285
  */
286
- addAlgoliaAgent(segment: string, version?: string): void;
286
+ addAlgoliaAgent(segment: string, version?: string | undefined): void;
287
287
  /**
288
288
  * Helper method to switch the API key used to authenticate the requests.
289
289
  *
@@ -353,7 +353,7 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
353
353
  * - settings
354
354
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
355
355
  */
356
- getAllConfigs(requestOptions?: RequestOptions): Promise<Array<ConfigurationResponse>>;
356
+ getAllConfigs(requestOptions?: RequestOptions | undefined): Promise<Array<ConfigurationResponse>>;
357
357
  /**
358
358
  * Retrieves a single Query Suggestions configuration by its index name.
359
359
  *
@@ -401,11 +401,11 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
401
401
  * Error.
402
402
  */
403
403
  type ErrorBase = Record<string, any> & {
404
- message?: string;
404
+ message?: string | undefined;
405
405
  };
406
406
 
407
407
  type QuerySuggestionsClient = ReturnType<typeof createQuerySuggestionsClient>;
408
408
 
409
- declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): QuerySuggestionsClient;
409
+ declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions | undefined): QuerySuggestionsClient;
410
410
 
411
411
  export { type AppID, type BaseResponse, type ConfigStatus, type Configuration, type ConfigurationResponse, type ConfigurationWithIndex, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteConfigProps, type ErrorBase, type Facet, type GetConfigProps, type GetConfigStatusProps, type GetLogFileProps, type Languages, type LogFile, type LogLevel, type QuerySuggestionsClient, type Region, type RegionOptions, type SourceIndex, type UpdateConfigProps, apiClientVersion, querySuggestionsClient };
package/dist/node.d.ts CHANGED
@@ -5,41 +5,41 @@ type BaseResponse = {
5
5
  /**
6
6
  * HTTP status code.
7
7
  */
8
- status?: number;
8
+ status?: number | undefined;
9
9
  /**
10
10
  * Details about the response, such as error messages.
11
11
  */
12
- message?: string;
12
+ message?: string | undefined;
13
13
  };
14
14
 
15
15
  type ConfigStatus = {
16
16
  /**
17
17
  * Name of the Query Suggestions index (case-sensitive).
18
18
  */
19
- indexName?: string;
19
+ indexName?: string | undefined;
20
20
  /**
21
21
  * Whether the creation or update of the Query Suggestions index is in progress.
22
22
  */
23
- isRunning?: boolean;
23
+ isRunning?: boolean | undefined;
24
24
  /**
25
25
  * Date and time when the Query Suggestions index was last built, in RFC 3339 format.
26
26
  */
27
- lastBuiltAt?: string;
27
+ lastBuiltAt?: string | undefined;
28
28
  /**
29
29
  * Date and time when the Query Suggestions index was last updated successfully.
30
30
  */
31
- lastSuccessfulBuiltAt?: string;
31
+ lastSuccessfulBuiltAt?: string | undefined;
32
32
  /**
33
33
  * Duration of the last successful build in seconds.
34
34
  */
35
- lastSuccessfulBuildDuration?: string;
35
+ lastSuccessfulBuildDuration?: string | undefined;
36
36
  };
37
37
 
38
38
  type AppID = {
39
39
  /**
40
40
  * Algolia application ID to which this Query Suggestions configuration belongs.
41
41
  */
42
- appID?: string;
42
+ appID?: string | undefined;
43
43
  };
44
44
 
45
45
  /**
@@ -54,11 +54,11 @@ type Facet = {
54
54
  /**
55
55
  * Facet name.
56
56
  */
57
- attribute?: string;
57
+ attribute?: string | undefined;
58
58
  /**
59
59
  * Number of suggestions.
60
60
  */
61
- amount?: number;
61
+ amount?: number | undefined;
62
62
  };
63
63
 
64
64
  /**
@@ -72,19 +72,19 @@ type SourceIndex = {
72
72
  /**
73
73
  * If true, Query Suggestions uses all replica indices to find popular searches. If false, only the primary index is used.
74
74
  */
75
- replicas?: boolean;
76
- analyticsTags?: Array<string> | null;
77
- facets?: Array<Facet> | null;
75
+ replicas?: boolean | undefined;
76
+ analyticsTags?: Array<string> | null | undefined;
77
+ facets?: Array<Facet> | null | undefined;
78
78
  /**
79
79
  * Minimum number of hits required to be included as a suggestion. A search query must at least generate `minHits` search results to be included in the Query Suggestions index.
80
80
  */
81
- minHits?: number;
81
+ minHits?: number | undefined;
82
82
  /**
83
83
  * Minimum letters required to be included as a suggestion. A search query must be at least `minLetters` long to be included in the Query Suggestions index.
84
84
  */
85
- minLetters?: number;
86
- generate?: Array<Array<string>> | null;
87
- external?: Array<string> | null;
85
+ minLetters?: number | undefined;
86
+ generate?: Array<Array<string>> | null | undefined;
87
+ external?: Array<string> | null | undefined;
88
88
  };
89
89
 
90
90
  /**
@@ -95,16 +95,16 @@ type Configuration = {
95
95
  * Algolia indices from which to get the popular searches for query suggestions.
96
96
  */
97
97
  sourceIndices: Array<SourceIndex>;
98
- languages?: Languages;
99
- exclude?: Array<string> | null;
98
+ languages?: Languages | undefined;
99
+ exclude?: Array<string> | null | undefined;
100
100
  /**
101
101
  * Whether to turn on personalized query suggestions.
102
102
  */
103
- enablePersonalization?: boolean;
103
+ enablePersonalization?: boolean | undefined;
104
104
  /**
105
105
  * Whether to include suggestions with special characters.
106
106
  */
107
- allowSpecialCharacters?: boolean;
107
+ allowSpecialCharacters?: boolean | undefined;
108
108
  };
109
109
 
110
110
  /**
@@ -126,16 +126,16 @@ type LogFile = {
126
126
  /**
127
127
  * Date and time of the log entry, in RFC 3339 format.
128
128
  */
129
- timestamp?: string;
130
- level?: LogLevel;
129
+ timestamp?: string | undefined;
130
+ level?: LogLevel | undefined;
131
131
  /**
132
132
  * Details about this log entry.
133
133
  */
134
- message?: string;
134
+ message?: string | undefined;
135
135
  /**
136
136
  * Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0.
137
137
  */
138
- contextLevel?: number;
138
+ contextLevel?: number | undefined;
139
139
  };
140
140
 
141
141
  /**
@@ -151,7 +151,7 @@ type CustomDeleteProps = {
151
151
  */
152
152
  parameters?: {
153
153
  [key: string]: any;
154
- };
154
+ } | undefined;
155
155
  };
156
156
  /**
157
157
  * Properties for the `customGet` method.
@@ -166,7 +166,7 @@ type CustomGetProps = {
166
166
  */
167
167
  parameters?: {
168
168
  [key: string]: any;
169
- };
169
+ } | undefined;
170
170
  };
171
171
  /**
172
172
  * Properties for the `customPost` method.
@@ -181,11 +181,11 @@ type CustomPostProps = {
181
181
  */
182
182
  parameters?: {
183
183
  [key: string]: any;
184
- };
184
+ } | undefined;
185
185
  /**
186
186
  * Parameters to send with the custom request.
187
187
  */
188
- body?: Record<string, unknown>;
188
+ body?: Record<string, unknown> | undefined;
189
189
  };
190
190
  /**
191
191
  * Properties for the `customPut` method.
@@ -200,11 +200,11 @@ type CustomPutProps = {
200
200
  */
201
201
  parameters?: {
202
202
  [key: string]: any;
203
- };
203
+ } | undefined;
204
204
  /**
205
205
  * Parameters to send with the custom request.
206
206
  */
207
- body?: Record<string, unknown>;
207
+ body?: Record<string, unknown> | undefined;
208
208
  };
209
209
  /**
210
210
  * Properties for the `deleteConfig` method.
@@ -253,7 +253,7 @@ type UpdateConfigProps = {
253
253
  configuration: Configuration;
254
254
  };
255
255
 
256
- declare const apiClientVersion = "5.26.0";
256
+ declare const apiClientVersion = "5.28.0";
257
257
  declare const REGIONS: readonly ["eu", "us"];
258
258
  type Region = (typeof REGIONS)[number];
259
259
  type RegionOptions = {
@@ -283,7 +283,7 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
283
283
  * @param segment - The algolia agent (user-agent) segment to add.
284
284
  * @param version - The version of the agent.
285
285
  */
286
- addAlgoliaAgent(segment: string, version?: string): void;
286
+ addAlgoliaAgent(segment: string, version?: string | undefined): void;
287
287
  /**
288
288
  * Helper method to switch the API key used to authenticate the requests.
289
289
  *
@@ -353,7 +353,7 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
353
353
  * - settings
354
354
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
355
355
  */
356
- getAllConfigs(requestOptions?: RequestOptions): Promise<Array<ConfigurationResponse>>;
356
+ getAllConfigs(requestOptions?: RequestOptions | undefined): Promise<Array<ConfigurationResponse>>;
357
357
  /**
358
358
  * Retrieves a single Query Suggestions configuration by its index name.
359
359
  *
@@ -401,11 +401,11 @@ declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiK
401
401
  * Error.
402
402
  */
403
403
  type ErrorBase = Record<string, any> & {
404
- message?: string;
404
+ message?: string | undefined;
405
405
  };
406
406
 
407
407
  type QuerySuggestionsClient = ReturnType<typeof createQuerySuggestionsClient>;
408
408
 
409
- declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): QuerySuggestionsClient;
409
+ declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions | undefined): QuerySuggestionsClient;
410
410
 
411
411
  export { type AppID, type BaseResponse, type ConfigStatus, type Configuration, type ConfigurationResponse, type ConfigurationWithIndex, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteConfigProps, type ErrorBase, type Facet, type GetConfigProps, type GetConfigStatusProps, type GetLogFileProps, type Languages, type LogFile, type LogLevel, type QuerySuggestionsClient, type Region, type RegionOptions, type SourceIndex, type UpdateConfigProps, apiClientVersion, querySuggestionsClient };
@@ -26,7 +26,7 @@ __export(querySuggestionsClient_exports, {
26
26
  });
27
27
  module.exports = __toCommonJS(querySuggestionsClient_exports);
28
28
  var import_client_common = require("@algolia/client-common");
29
- var apiClientVersion = "5.26.0";
29
+ var apiClientVersion = "5.28.0";
30
30
  var REGIONS = ["eu", "us"];
31
31
  function getDefaultHosts(region) {
32
32
  const url = "query-suggestions.{region}.algolia.com".replace("{region}", region);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/querySuggestionsClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { BaseResponse } from '../model/baseResponse';\nimport type { ConfigStatus } from '../model/configStatus';\n\nimport type { ConfigurationResponse } from '../model/configurationResponse';\nimport type { ConfigurationWithIndex } from '../model/configurationWithIndex';\n\nimport type { LogFile } from '../model/logFile';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteConfigProps,\n GetConfigProps,\n GetConfigStatusProps,\n GetLogFileProps,\n UpdateConfigProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.26.0';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createQuerySuggestionsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'QuerySuggestions',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param configurationWithIndex - The configurationWithIndex object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createConfig(\n configurationWithIndex: ConfigurationWithIndex,\n requestOptions?: RequestOptions,\n ): Promise<BaseResponse> {\n if (!configurationWithIndex) {\n throw new Error('Parameter `configurationWithIndex` is required when calling `createConfig`.');\n }\n\n const requestPath = '/1/configs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationWithIndex,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. To delete the Query Suggestions index itself, use the Search API and the `Delete an index` operation.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteConfig - The deleteConfig object.\n * @param deleteConfig.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteConfig({ indexName }: DeleteConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves all Query Suggestions configurations of your Algolia application.\n *\n * Required API Key ACLs:\n * - settings\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAllConfigs(requestOptions?: RequestOptions): Promise<Array<ConfigurationResponse>> {\n const requestPath = '/1/configs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a single Query Suggestions configuration by its index name.\n *\n * Required API Key ACLs:\n * - settings\n * @param getConfig - The getConfig object.\n * @param getConfig.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig({ indexName }: GetConfigProps, requestOptions?: RequestOptions): Promise<ConfigurationResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Reports the status of a Query Suggestions index.\n *\n * Required API Key ACLs:\n * - settings\n * @param getConfigStatus - The getConfigStatus object.\n * @param getConfigStatus.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfigStatus({ indexName }: GetConfigStatusProps, requestOptions?: RequestOptions): Promise<ConfigStatus> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getConfigStatus`.');\n }\n\n const requestPath = '/1/configs/{indexName}/status'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the logs for a single Query Suggestions index.\n *\n * Required API Key ACLs:\n * - settings\n * @param getLogFile - The getLogFile object.\n * @param getLogFile.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLogFile({ indexName }: GetLogFileProps, requestOptions?: RequestOptions): Promise<LogFile> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getLogFile`.');\n }\n\n const requestPath = '/1/logs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates a QuerySuggestions configuration.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param updateConfig - The updateConfig object.\n * @param updateConfig.indexName - Query Suggestions index name.\n * @param updateConfig.configuration - The configuration object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateConfig(\n { indexName, configuration }: UpdateConfigProps,\n requestOptions?: RequestOptions,\n ): Promise<BaseResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `updateConfig`.');\n }\n\n if (!configuration) {\n throw new Error('Parameter `configuration` is required when calling `updateConfig`.');\n }\n\n if (!configuration.sourceIndices) {\n throw new Error('Parameter `configuration.sourceIndices` is required when calling `updateConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configuration,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,2BAA+D;AAsBxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,yCAAyC,QAAQ,YAAY,MAAM;AAE/E,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,6BAA6B;AAAA,EAC3C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,kBAAc,wCAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,kBAAc,sCAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,I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WAAW,cAAc,GAC3B,gBACuB;AACvB,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,gEAAgE;AAAA,MAClF;AAEA,UAAI,CAAC,eAAe;AAClB,cAAM,IAAI,MAAM,oEAAoE;AAAA,MACtF;AAEA,UAAI,CAAC,cAAc,eAAe;AAChC,cAAM,IAAI,MAAM,kFAAkF;AAAA,MACpG;AAEA,YAAM,cAAc,yBAAyB,QAAQ,eAAe,mBAAmB,SAAS,CAAC;AACjG,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MACR;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/querySuggestionsClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { BaseResponse } from '../model/baseResponse';\nimport type { ConfigStatus } from '../model/configStatus';\n\nimport type { ConfigurationResponse } from '../model/configurationResponse';\nimport type { ConfigurationWithIndex } from '../model/configurationWithIndex';\n\nimport type { LogFile } from '../model/logFile';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteConfigProps,\n GetConfigProps,\n GetConfigStatusProps,\n GetLogFileProps,\n UpdateConfigProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.28.0';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createQuerySuggestionsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'QuerySuggestions',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string | undefined): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param configurationWithIndex - The configurationWithIndex object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n createConfig(\n configurationWithIndex: ConfigurationWithIndex,\n requestOptions?: RequestOptions,\n ): Promise<BaseResponse> {\n if (!configurationWithIndex) {\n throw new Error('Parameter `configurationWithIndex` is required when calling `createConfig`.');\n }\n\n const requestPath = '/1/configs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationWithIndex,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. To delete the Query Suggestions index itself, use the Search API and the `Delete an index` operation.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteConfig - The deleteConfig object.\n * @param deleteConfig.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteConfig({ indexName }: DeleteConfigProps, requestOptions?: RequestOptions): Promise<BaseResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves all Query Suggestions configurations of your Algolia application.\n *\n * Required API Key ACLs:\n * - settings\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getAllConfigs(requestOptions?: RequestOptions | undefined): Promise<Array<ConfigurationResponse>> {\n const requestPath = '/1/configs';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a single Query Suggestions configuration by its index name.\n *\n * Required API Key ACLs:\n * - settings\n * @param getConfig - The getConfig object.\n * @param getConfig.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig({ indexName }: GetConfigProps, requestOptions?: RequestOptions): Promise<ConfigurationResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Reports the status of a Query Suggestions index.\n *\n * Required API Key ACLs:\n * - settings\n * @param getConfigStatus - The getConfigStatus object.\n * @param getConfigStatus.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfigStatus({ indexName }: GetConfigStatusProps, requestOptions?: RequestOptions): Promise<ConfigStatus> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getConfigStatus`.');\n }\n\n const requestPath = '/1/configs/{indexName}/status'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the logs for a single Query Suggestions index.\n *\n * Required API Key ACLs:\n * - settings\n * @param getLogFile - The getLogFile object.\n * @param getLogFile.indexName - Query Suggestions index name.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLogFile({ indexName }: GetLogFileProps, requestOptions?: RequestOptions): Promise<LogFile> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getLogFile`.');\n }\n\n const requestPath = '/1/logs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Updates a QuerySuggestions configuration.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param updateConfig - The updateConfig object.\n * @param updateConfig.indexName - Query Suggestions index name.\n * @param updateConfig.configuration - The configuration object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n updateConfig(\n { indexName, configuration }: UpdateConfigProps,\n requestOptions?: RequestOptions,\n ): Promise<BaseResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `updateConfig`.');\n }\n\n if (!configuration) {\n throw new Error('Parameter `configuration` is required when calling `updateConfig`.');\n }\n\n if (!configuration.sourceIndices) {\n throw new Error('Parameter `configuration.sourceIndices` is required when calling `updateConfig`.');\n }\n\n const requestPath = '/1/configs/{indexName}'.replace('{indexName}', encodeURIComponent(indexName));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configuration,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,2BAA+D;AAsBxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,yCAAyC,QAAQ,YAAY,MAAM;AAE/E,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,6BAA6B;AAAA,EAC3C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,kBAAc,wCAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,kBAAc,sCAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO;AAAA;AAAA;AAAA;AAAA,IAKP,QAAQ;AAAA;AAAA;AAAA;AAAA,IAKR,aAA4B;AAC1B,aAAO,QAAQ,IAAI,CAAC,Y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QAAQ,eAAe,mBAAmB,SAAS,CAAC;AACjG,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MACR;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  // src/querySuggestionsClient.ts
2
2
  import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
3
- var apiClientVersion = "5.26.0";
3
+ var apiClientVersion = "5.28.0";
4
4
  var REGIONS = ["eu", "us"];
5
5
  function getDefaultHosts(region) {
6
6
  const url = "query-suggestions.{region}.algolia.com".replace("{region}", region);