@algolia/monitoring 1.3.1 → 1.4.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.
@@ -0,0 +1,399 @@
1
+ // builds/fetch.ts
2
+ import {
3
+ createMemoryCache,
4
+ createNullCache,
5
+ DEFAULT_CONNECT_TIMEOUT_NODE,
6
+ DEFAULT_READ_TIMEOUT_NODE,
7
+ DEFAULT_WRITE_TIMEOUT_NODE
8
+ } from "@algolia/client-common";
9
+ import { createFetchRequester } from "@algolia/requester-fetch";
10
+
11
+ // src/monitoringClient.ts
12
+ import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
13
+ var apiClientVersion = "1.4.0";
14
+ function getDefaultHosts() {
15
+ return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
16
+ }
17
+ function createMonitoringClient({
18
+ appId: appIdOption,
19
+ apiKey: apiKeyOption,
20
+ authMode,
21
+ algoliaAgents,
22
+ ...options
23
+ }) {
24
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
25
+ const transporter = createTransporter({
26
+ hosts: getDefaultHosts(),
27
+ ...options,
28
+ algoliaAgent: getAlgoliaAgent({
29
+ algoliaAgents,
30
+ client: "Monitoring",
31
+ version: apiClientVersion
32
+ }),
33
+ baseHeaders: {
34
+ "content-type": "text/plain",
35
+ ...auth.headers(),
36
+ ...options.baseHeaders
37
+ },
38
+ baseQueryParameters: {
39
+ ...auth.queryParameters(),
40
+ ...options.baseQueryParameters
41
+ }
42
+ });
43
+ return {
44
+ transporter,
45
+ /**
46
+ * The `appId` currently in use.
47
+ */
48
+ appId: appIdOption,
49
+ /**
50
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
51
+ */
52
+ clearCache() {
53
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
54
+ },
55
+ /**
56
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
57
+ */
58
+ get _ua() {
59
+ return transporter.algoliaAgent.value;
60
+ },
61
+ /**
62
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
63
+ *
64
+ * @param segment - The algolia agent (user-agent) segment to add.
65
+ * @param version - The version of the agent.
66
+ */
67
+ addAlgoliaAgent(segment, version) {
68
+ transporter.algoliaAgent.add({ segment, version });
69
+ },
70
+ /**
71
+ * Helper method to switch the API key used to authenticate the requests.
72
+ *
73
+ * @param params - Method params.
74
+ * @param params.apiKey - The new API Key to use.
75
+ */
76
+ setClientApiKey({ apiKey }) {
77
+ if (!authMode || authMode === "WithinHeaders") {
78
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
79
+ } else {
80
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
81
+ }
82
+ },
83
+ /**
84
+ * This method allow you to send requests to the Algolia REST API.
85
+ *
86
+ * @param customDelete - The customDelete object.
87
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
88
+ * @param customDelete.parameters - Query parameters to apply to the current query.
89
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
90
+ */
91
+ customDelete({ path, parameters }, requestOptions) {
92
+ if (!path) {
93
+ throw new Error("Parameter `path` is required when calling `customDelete`.");
94
+ }
95
+ const requestPath = "/{path}".replace("{path}", path);
96
+ const headers = {};
97
+ const queryParameters = parameters ? parameters : {};
98
+ const request = {
99
+ method: "DELETE",
100
+ path: requestPath,
101
+ queryParameters,
102
+ headers
103
+ };
104
+ return transporter.request(request, requestOptions);
105
+ },
106
+ /**
107
+ * This method allow you to send requests to the Algolia REST API.
108
+ *
109
+ * @param customGet - The customGet object.
110
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
111
+ * @param customGet.parameters - Query parameters to apply to the current query.
112
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
113
+ */
114
+ customGet({ path, parameters }, requestOptions) {
115
+ if (!path) {
116
+ throw new Error("Parameter `path` is required when calling `customGet`.");
117
+ }
118
+ const requestPath = "/{path}".replace("{path}", path);
119
+ const headers = {};
120
+ const queryParameters = parameters ? parameters : {};
121
+ const request = {
122
+ method: "GET",
123
+ path: requestPath,
124
+ queryParameters,
125
+ headers
126
+ };
127
+ return transporter.request(request, requestOptions);
128
+ },
129
+ /**
130
+ * This method allow you to send requests to the Algolia REST API.
131
+ *
132
+ * @param customPost - The customPost object.
133
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
134
+ * @param customPost.parameters - Query parameters to apply to the current query.
135
+ * @param customPost.body - Parameters to send with the custom request.
136
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
137
+ */
138
+ customPost({ path, parameters, body }, requestOptions) {
139
+ if (!path) {
140
+ throw new Error("Parameter `path` is required when calling `customPost`.");
141
+ }
142
+ const requestPath = "/{path}".replace("{path}", path);
143
+ const headers = {};
144
+ const queryParameters = parameters ? parameters : {};
145
+ const request = {
146
+ method: "POST",
147
+ path: requestPath,
148
+ queryParameters,
149
+ headers,
150
+ data: body ? body : {}
151
+ };
152
+ return transporter.request(request, requestOptions);
153
+ },
154
+ /**
155
+ * This method allow you to send requests to the Algolia REST API.
156
+ *
157
+ * @param customPut - The customPut object.
158
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
159
+ * @param customPut.parameters - Query parameters to apply to the current query.
160
+ * @param customPut.body - Parameters to send with the custom request.
161
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
162
+ */
163
+ customPut({ path, parameters, body }, requestOptions) {
164
+ if (!path) {
165
+ throw new Error("Parameter `path` is required when calling `customPut`.");
166
+ }
167
+ const requestPath = "/{path}".replace("{path}", path);
168
+ const headers = {};
169
+ const queryParameters = parameters ? parameters : {};
170
+ const request = {
171
+ method: "PUT",
172
+ path: requestPath,
173
+ queryParameters,
174
+ headers,
175
+ data: body ? body : {}
176
+ };
177
+ return transporter.request(request, requestOptions);
178
+ },
179
+ /**
180
+ * Retrieves known incidents for the selected clusters.
181
+ *
182
+ * @param getClusterIncidents - The getClusterIncidents object.
183
+ * @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
184
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
185
+ */
186
+ getClusterIncidents({ clusters }, requestOptions) {
187
+ if (!clusters) {
188
+ throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");
189
+ }
190
+ const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
191
+ const headers = {};
192
+ const queryParameters = {};
193
+ const request = {
194
+ method: "GET",
195
+ path: requestPath,
196
+ queryParameters,
197
+ headers
198
+ };
199
+ return transporter.request(request, requestOptions);
200
+ },
201
+ /**
202
+ * Retrieves the status of selected clusters.
203
+ *
204
+ * @param getClusterStatus - The getClusterStatus object.
205
+ * @param getClusterStatus.clusters - Subset of clusters, separated by comma.
206
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
207
+ */
208
+ getClusterStatus({ clusters }, requestOptions) {
209
+ if (!clusters) {
210
+ throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");
211
+ }
212
+ const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
213
+ const headers = {};
214
+ const queryParameters = {};
215
+ const request = {
216
+ method: "GET",
217
+ path: requestPath,
218
+ queryParameters,
219
+ headers
220
+ };
221
+ return transporter.request(request, requestOptions);
222
+ },
223
+ /**
224
+ * Retrieves known incidents for all clusters.
225
+ *
226
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
227
+ */
228
+ getIncidents(requestOptions) {
229
+ const requestPath = "/1/incidents";
230
+ const headers = {};
231
+ const queryParameters = {};
232
+ const request = {
233
+ method: "GET",
234
+ path: requestPath,
235
+ queryParameters,
236
+ headers
237
+ };
238
+ return transporter.request(request, requestOptions);
239
+ },
240
+ /**
241
+ * Retrieves average times for indexing operations for selected clusters.
242
+ *
243
+ * @param getIndexingTime - The getIndexingTime object.
244
+ * @param getIndexingTime.clusters - Subset of clusters, separated by comma.
245
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
246
+ */
247
+ getIndexingTime({ clusters }, requestOptions) {
248
+ if (!clusters) {
249
+ throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");
250
+ }
251
+ const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
252
+ const headers = {};
253
+ const queryParameters = {};
254
+ const request = {
255
+ method: "GET",
256
+ path: requestPath,
257
+ queryParameters,
258
+ headers
259
+ };
260
+ return transporter.request(request, requestOptions);
261
+ },
262
+ /**
263
+ * Retrieves the average latency for search requests for selected clusters.
264
+ *
265
+ * @param getLatency - The getLatency object.
266
+ * @param getLatency.clusters - Subset of clusters, separated by comma.
267
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
268
+ */
269
+ getLatency({ clusters }, requestOptions) {
270
+ if (!clusters) {
271
+ throw new Error("Parameter `clusters` is required when calling `getLatency`.");
272
+ }
273
+ const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
274
+ const headers = {};
275
+ const queryParameters = {};
276
+ const request = {
277
+ method: "GET",
278
+ path: requestPath,
279
+ queryParameters,
280
+ headers
281
+ };
282
+ return transporter.request(request, requestOptions);
283
+ },
284
+ /**
285
+ * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).
286
+ *
287
+ * @param getMetrics - The getMetrics object.
288
+ * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
289
+ * @param getMetrics.period - Period over which to aggregate the metrics: - `minute`. Aggregate the last minute. 1 data point per 10 seconds. - `hour`. Aggregate the last hour. 1 data point per minute. - `day`. Aggregate the last day. 1 data point per 10 minutes. - `week`. Aggregate the last week. 1 data point per hour. - `month`. Aggregate the last month. 1 data point per day.
290
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
291
+ */
292
+ getMetrics({ metric, period }, requestOptions) {
293
+ if (!metric) {
294
+ throw new Error("Parameter `metric` is required when calling `getMetrics`.");
295
+ }
296
+ if (!period) {
297
+ throw new Error("Parameter `period` is required when calling `getMetrics`.");
298
+ }
299
+ const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
300
+ const headers = {};
301
+ const queryParameters = {};
302
+ const request = {
303
+ method: "GET",
304
+ path: requestPath,
305
+ queryParameters,
306
+ headers
307
+ };
308
+ return transporter.request(request, requestOptions);
309
+ },
310
+ /**
311
+ * Test whether clusters are reachable or not.
312
+ *
313
+ * @param getReachability - The getReachability object.
314
+ * @param getReachability.clusters - Subset of clusters, separated by comma.
315
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
316
+ */
317
+ getReachability({ clusters }, requestOptions) {
318
+ if (!clusters) {
319
+ throw new Error("Parameter `clusters` is required when calling `getReachability`.");
320
+ }
321
+ const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
322
+ const headers = {};
323
+ const queryParameters = {};
324
+ const request = {
325
+ method: "GET",
326
+ path: requestPath,
327
+ queryParameters,
328
+ headers
329
+ };
330
+ return transporter.request(request, requestOptions);
331
+ },
332
+ /**
333
+ * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.
334
+ *
335
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
336
+ */
337
+ getServers(requestOptions) {
338
+ const requestPath = "/1/inventory/servers";
339
+ const headers = {};
340
+ const queryParameters = {};
341
+ const request = {
342
+ method: "GET",
343
+ path: requestPath,
344
+ queryParameters,
345
+ headers
346
+ };
347
+ return transporter.request(request, requestOptions);
348
+ },
349
+ /**
350
+ * Retrieves the status of all Algolia clusters and instances.
351
+ *
352
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
353
+ */
354
+ getStatus(requestOptions) {
355
+ const requestPath = "/1/status";
356
+ const headers = {};
357
+ const queryParameters = {};
358
+ const request = {
359
+ method: "GET",
360
+ path: requestPath,
361
+ queryParameters,
362
+ headers
363
+ };
364
+ return transporter.request(request, requestOptions);
365
+ }
366
+ };
367
+ }
368
+
369
+ // builds/fetch.ts
370
+ function monitoringClient(appId, apiKey, options) {
371
+ if (!appId || typeof appId !== "string") {
372
+ throw new Error("`appId` is missing.");
373
+ }
374
+ if (!apiKey || typeof apiKey !== "string") {
375
+ throw new Error("`apiKey` is missing.");
376
+ }
377
+ return {
378
+ ...createMonitoringClient({
379
+ appId,
380
+ apiKey,
381
+ timeouts: {
382
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
383
+ read: DEFAULT_READ_TIMEOUT_NODE,
384
+ write: DEFAULT_WRITE_TIMEOUT_NODE
385
+ },
386
+ algoliaAgents: [{ segment: "Fetch" }],
387
+ requester: createFetchRequester(),
388
+ responsesCache: createNullCache(),
389
+ requestsCache: createNullCache(),
390
+ hostsCache: createMemoryCache(),
391
+ ...options
392
+ })
393
+ };
394
+ }
395
+ export {
396
+ apiClientVersion,
397
+ monitoringClient
398
+ };
399
+ //# sourceMappingURL=fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../builds/fetch.ts","../../src/monitoringClient.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 { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createNullCache,\n DEFAULT_CONNECT_TIMEOUT_NODE,\n DEFAULT_READ_TIMEOUT_NODE,\n DEFAULT_WRITE_TIMEOUT_NODE,\n} from '@algolia/client-common';\nimport { createFetchRequester } from '@algolia/requester-fetch';\n\nimport { createMonitoringClient } from '../src/monitoringClient';\n\nexport type MonitoringClient = ReturnType<typeof createMonitoringClient>;\n\nexport { apiClientVersion } from '../src/monitoringClient';\nexport * from '../model';\n\nexport function monitoringClient(appId: string, apiKey: string, options?: ClientOptions): MonitoringClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createMonitoringClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n read: DEFAULT_READ_TIMEOUT_NODE,\n write: DEFAULT_WRITE_TIMEOUT_NODE,\n },\n algoliaAgents: [{ segment: 'Fetch' }],\n requester: createFetchRequester(),\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// 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 { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n GetClusterIncidentsProps,\n GetClusterStatusProps,\n GetIndexingTimeProps,\n GetLatencyProps,\n GetMetricsProps,\n GetReachabilityProps,\n} from '../model/clientMethodProps';\nimport type { IncidentsResponse } from '../model/incidentsResponse';\nimport type { IndexingTimeResponse } from '../model/indexingTimeResponse';\nimport type { InfrastructureResponse } from '../model/infrastructureResponse';\nimport type { InventoryResponse } from '../model/inventoryResponse';\nimport type { LatencyResponse } from '../model/latencyResponse';\nimport type { StatusResponse } from '../model/statusResponse';\n\nexport const apiClientVersion = '1.4.0';\n\nfunction getDefaultHosts(): Host[] {\n return [{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createMonitoringClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Monitoring',\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 * 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 * This method allow you to send requests to the Algolia REST API.\n *\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 allow you to send requests to the Algolia REST API.\n *\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 allow you to send requests to the Algolia REST API.\n *\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 allow you to send requests to the Algolia REST API.\n *\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 * Retrieves known incidents for the selected clusters.\n *\n * @param getClusterIncidents - The getClusterIncidents object.\n * @param getClusterIncidents.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterIncidents(\n { clusters }: GetClusterIncidentsProps,\n requestOptions?: RequestOptions,\n ): Promise<IncidentsResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterIncidents`.');\n }\n\n const requestPath = '/1/incidents/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\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 status of selected clusters.\n *\n * @param getClusterStatus - The getClusterStatus object.\n * @param getClusterStatus.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterStatus`.');\n }\n\n const requestPath = '/1/status/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\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 known incidents for all clusters.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIncidents(requestOptions?: RequestOptions): Promise<IncidentsResponse> {\n const requestPath = '/1/incidents';\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 average times for indexing operations for selected clusters.\n *\n * @param getIndexingTime - The getIndexingTime object.\n * @param getIndexingTime.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIndexingTime(\n { clusters }: GetIndexingTimeProps,\n requestOptions?: RequestOptions,\n ): Promise<IndexingTimeResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getIndexingTime`.');\n }\n\n const requestPath = '/1/indexing/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\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 average latency for search requests for selected clusters.\n *\n * @param getLatency - The getLatency object.\n * @param getLatency.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getLatency`.');\n }\n\n const requestPath = '/1/latency/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\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 metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).\n *\n * @param getMetrics - The getMetrics object.\n * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.\n * @param getMetrics.period - Period over which to aggregate the metrics: - `minute`. Aggregate the last minute. 1 data point per 10 seconds. - `hour`. Aggregate the last hour. 1 data point per minute. - `day`. Aggregate the last day. 1 data point per 10 minutes. - `week`. Aggregate the last week. 1 data point per hour. - `month`. Aggregate the last month. 1 data point per day.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse> {\n if (!metric) {\n throw new Error('Parameter `metric` is required when calling `getMetrics`.');\n }\n\n if (!period) {\n throw new Error('Parameter `period` is required when calling `getMetrics`.');\n }\n\n const requestPath = '/1/infrastructure/{metric}/period/{period}'\n .replace('{metric}', encodeURIComponent(metric))\n .replace('{period}', encodeURIComponent(period));\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 * Test whether clusters are reachable or not.\n *\n * @param getReachability - The getReachability object.\n * @param getReachability.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getReachability(\n { clusters }: GetReachabilityProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, Record<string, boolean>>> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getReachability`.');\n }\n\n const requestPath = '/1/reachability/{clusters}/probes'.replace('{clusters}', encodeURIComponent(clusters));\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 servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getServers(requestOptions?: RequestOptions): Promise<InventoryResponse> {\n const requestPath = '/1/inventory/servers';\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 status of all Algolia clusters and instances.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getStatus(requestOptions?: RequestOptions): Promise<StatusResponse> {\n const requestPath = '/1/status';\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"],"mappings":";AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;;;ACRrC,SAAS,YAAY,mBAAmB,uBAAuB;AA6BxD,IAAM,mBAAmB;AAEhC,SAAS,kBAA0B;AACjC,SAAO,CAAC,EAAE,KAAK,sBAAsB,QAAQ,aAAa,UAAU,QAAQ,CAAC;AAC/E;AAGO,SAAS,uBAAuB;AAAA,EACrC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ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bO,SAAS,iBAAiB,OAAe,QAAgB,SAA2C;AACzG,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,GAAG,uBAAuB;AAAA,MACxB;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,eAAe,CAAC,EAAE,SAAS,QAAQ,CAAC;AAAA,MACpC,WAAW,qBAAqB;AAAA,MAChC,gBAAgB,gBAAgB;AAAA,MAChC,eAAe,gBAAgB;AAAA,MAC/B,YAAY,kBAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -29,7 +29,7 @@ var import_requester_node_http = require("@algolia/requester-node-http");
29
29
 
30
30
  // src/monitoringClient.ts
31
31
  var import_client_common = require("@algolia/client-common");
32
- var apiClientVersion = "1.3.1";
32
+ var apiClientVersion = "1.4.0";
33
33
  function getDefaultHosts() {
34
34
  return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
35
35
  }
@@ -41,25 +41,26 @@ function createMonitoringClient({
41
41
  ...options
42
42
  }) {
43
43
  const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
44
- return {
45
- transporter: (0, import_client_common.createTransporter)({
46
- hosts: getDefaultHosts(),
47
- ...options,
48
- algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
49
- algoliaAgents,
50
- client: "Monitoring",
51
- version: apiClientVersion
52
- }),
53
- baseHeaders: {
54
- "content-type": "text/plain",
55
- ...auth.headers(),
56
- ...options.baseHeaders
57
- },
58
- baseQueryParameters: {
59
- ...auth.queryParameters(),
60
- ...options.baseQueryParameters
61
- }
44
+ const transporter = (0, import_client_common.createTransporter)({
45
+ hosts: getDefaultHosts(),
46
+ ...options,
47
+ algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
48
+ algoliaAgents,
49
+ client: "Monitoring",
50
+ version: apiClientVersion
62
51
  }),
52
+ baseHeaders: {
53
+ "content-type": "text/plain",
54
+ ...auth.headers(),
55
+ ...options.baseHeaders
56
+ },
57
+ baseQueryParameters: {
58
+ ...auth.queryParameters(),
59
+ ...options.baseQueryParameters
60
+ }
61
+ });
62
+ return {
63
+ transporter,
63
64
  /**
64
65
  * The `appId` currently in use.
65
66
  */
@@ -68,15 +69,13 @@ function createMonitoringClient({
68
69
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
69
70
  */
70
71
  clearCache() {
71
- return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
72
- () => void 0
73
- );
72
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
74
73
  },
75
74
  /**
76
75
  * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
77
76
  */
78
77
  get _ua() {
79
- return this.transporter.algoliaAgent.value;
78
+ return transporter.algoliaAgent.value;
80
79
  },
81
80
  /**
82
81
  * Adds a `segment` to the `x-algolia-agent` sent with every requests.
@@ -85,7 +84,7 @@ function createMonitoringClient({
85
84
  * @param version - The version of the agent.
86
85
  */
87
86
  addAlgoliaAgent(segment, version) {
88
- this.transporter.algoliaAgent.add({ segment, version });
87
+ transporter.algoliaAgent.add({ segment, version });
89
88
  },
90
89
  /**
91
90
  * Helper method to switch the API key used to authenticate the requests.
@@ -95,9 +94,9 @@ function createMonitoringClient({
95
94
  */
96
95
  setClientApiKey({ apiKey }) {
97
96
  if (!authMode || authMode === "WithinHeaders") {
98
- this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
97
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
99
98
  } else {
100
- this.transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
99
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
101
100
  }
102
101
  },
103
102
  /**
@@ -121,7 +120,7 @@ function createMonitoringClient({
121
120
  queryParameters,
122
121
  headers
123
122
  };
124
- return this.transporter.request(request, requestOptions);
123
+ return transporter.request(request, requestOptions);
125
124
  },
126
125
  /**
127
126
  * This method allow you to send requests to the Algolia REST API.
@@ -144,7 +143,7 @@ function createMonitoringClient({
144
143
  queryParameters,
145
144
  headers
146
145
  };
147
- return this.transporter.request(request, requestOptions);
146
+ return transporter.request(request, requestOptions);
148
147
  },
149
148
  /**
150
149
  * This method allow you to send requests to the Algolia REST API.
@@ -169,7 +168,7 @@ function createMonitoringClient({
169
168
  headers,
170
169
  data: body ? body : {}
171
170
  };
172
- return this.transporter.request(request, requestOptions);
171
+ return transporter.request(request, requestOptions);
173
172
  },
174
173
  /**
175
174
  * This method allow you to send requests to the Algolia REST API.
@@ -194,7 +193,7 @@ function createMonitoringClient({
194
193
  headers,
195
194
  data: body ? body : {}
196
195
  };
197
- return this.transporter.request(request, requestOptions);
196
+ return transporter.request(request, requestOptions);
198
197
  },
199
198
  /**
200
199
  * Retrieves known incidents for the selected clusters.
@@ -216,7 +215,7 @@ function createMonitoringClient({
216
215
  queryParameters,
217
216
  headers
218
217
  };
219
- return this.transporter.request(request, requestOptions);
218
+ return transporter.request(request, requestOptions);
220
219
  },
221
220
  /**
222
221
  * Retrieves the status of selected clusters.
@@ -238,7 +237,7 @@ function createMonitoringClient({
238
237
  queryParameters,
239
238
  headers
240
239
  };
241
- return this.transporter.request(request, requestOptions);
240
+ return transporter.request(request, requestOptions);
242
241
  },
243
242
  /**
244
243
  * Retrieves known incidents for all clusters.
@@ -255,7 +254,7 @@ function createMonitoringClient({
255
254
  queryParameters,
256
255
  headers
257
256
  };
258
- return this.transporter.request(request, requestOptions);
257
+ return transporter.request(request, requestOptions);
259
258
  },
260
259
  /**
261
260
  * Retrieves average times for indexing operations for selected clusters.
@@ -277,7 +276,7 @@ function createMonitoringClient({
277
276
  queryParameters,
278
277
  headers
279
278
  };
280
- return this.transporter.request(request, requestOptions);
279
+ return transporter.request(request, requestOptions);
281
280
  },
282
281
  /**
283
282
  * Retrieves the average latency for search requests for selected clusters.
@@ -299,7 +298,7 @@ function createMonitoringClient({
299
298
  queryParameters,
300
299
  headers
301
300
  };
302
- return this.transporter.request(request, requestOptions);
301
+ return transporter.request(request, requestOptions);
303
302
  },
304
303
  /**
305
304
  * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).
@@ -325,7 +324,7 @@ function createMonitoringClient({
325
324
  queryParameters,
326
325
  headers
327
326
  };
328
- return this.transporter.request(request, requestOptions);
327
+ return transporter.request(request, requestOptions);
329
328
  },
330
329
  /**
331
330
  * Test whether clusters are reachable or not.
@@ -347,7 +346,7 @@ function createMonitoringClient({
347
346
  queryParameters,
348
347
  headers
349
348
  };
350
- return this.transporter.request(request, requestOptions);
349
+ return transporter.request(request, requestOptions);
351
350
  },
352
351
  /**
353
352
  * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.
@@ -364,7 +363,7 @@ function createMonitoringClient({
364
363
  queryParameters,
365
364
  headers
366
365
  };
367
- return this.transporter.request(request, requestOptions);
366
+ return transporter.request(request, requestOptions);
368
367
  },
369
368
  /**
370
369
  * Retrieves the status of all Algolia clusters and instances.
@@ -381,7 +380,7 @@ function createMonitoringClient({
381
380
  queryParameters,
382
381
  headers
383
382
  };
384
- return this.transporter.request(request, requestOptions);
383
+ return transporter.request(request, requestOptions);
385
384
  }
386
385
  };
387
386
  }