@algolia/monitoring 1.2.5 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +239 -124
- package/dist/builds/browser.js +50 -36
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +1 -1
- package/dist/builds/node.cjs +50 -36
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +50 -36
- package/dist/builds/node.js.map +1 -1
- package/dist/node.d.cts +239 -124
- package/dist/node.d.ts +239 -124
- package/dist/src/monitoringClient.cjs +50 -36
- package/dist/src/monitoringClient.cjs.map +1 -1
- package/dist/src/monitoringClient.js +50 -36
- package/dist/src/monitoringClient.js.map +1 -1
- package/package.json +4 -4
package/dist/node.d.ts
CHANGED
|
@@ -1,19 +1,127 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
|
-
import { ClientOptions } from '@algolia/client-common';
|
|
2
|
+
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type Metric = '*' | 'avg_build_time' | 'cpu_usage' | 'ram_indexing_usage' | 'ram_search_usage' | 'ssd_usage';
|
|
5
|
+
|
|
6
|
+
type Period = 'day' | 'hour' | 'minute' | 'month' | 'week';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Properties for the `customDelete` method.
|
|
10
10
|
*/
|
|
11
|
-
type
|
|
12
|
-
|
|
11
|
+
type CustomDeleteProps = {
|
|
12
|
+
/**
|
|
13
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
14
|
+
*/
|
|
15
|
+
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* Query parameters to apply to the current query.
|
|
18
|
+
*/
|
|
19
|
+
parameters?: Record<string, any>;
|
|
13
20
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Properties for the `customGet` method.
|
|
23
|
+
*/
|
|
24
|
+
type CustomGetProps = {
|
|
25
|
+
/**
|
|
26
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
27
|
+
*/
|
|
28
|
+
path: string;
|
|
29
|
+
/**
|
|
30
|
+
* Query parameters to apply to the current query.
|
|
31
|
+
*/
|
|
32
|
+
parameters?: Record<string, any>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Properties for the `customPost` method.
|
|
36
|
+
*/
|
|
37
|
+
type CustomPostProps = {
|
|
38
|
+
/**
|
|
39
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
40
|
+
*/
|
|
41
|
+
path: string;
|
|
42
|
+
/**
|
|
43
|
+
* Query parameters to apply to the current query.
|
|
44
|
+
*/
|
|
45
|
+
parameters?: Record<string, any>;
|
|
46
|
+
/**
|
|
47
|
+
* Parameters to send with the custom request.
|
|
48
|
+
*/
|
|
49
|
+
body?: Record<string, unknown>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Properties for the `customPut` method.
|
|
53
|
+
*/
|
|
54
|
+
type CustomPutProps = {
|
|
55
|
+
/**
|
|
56
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
57
|
+
*/
|
|
58
|
+
path: string;
|
|
59
|
+
/**
|
|
60
|
+
* Query parameters to apply to the current query.
|
|
61
|
+
*/
|
|
62
|
+
parameters?: Record<string, any>;
|
|
63
|
+
/**
|
|
64
|
+
* Parameters to send with the custom request.
|
|
65
|
+
*/
|
|
66
|
+
body?: Record<string, unknown>;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Properties for the `getClusterIncidents` method.
|
|
70
|
+
*/
|
|
71
|
+
type GetClusterIncidentsProps = {
|
|
72
|
+
/**
|
|
73
|
+
* Subset of clusters, separated by comma.
|
|
74
|
+
*/
|
|
75
|
+
clusters: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Properties for the `getClusterStatus` method.
|
|
79
|
+
*/
|
|
80
|
+
type GetClusterStatusProps = {
|
|
81
|
+
/**
|
|
82
|
+
* Subset of clusters, separated by comma.
|
|
83
|
+
*/
|
|
84
|
+
clusters: string;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Properties for the `getIndexingTime` method.
|
|
88
|
+
*/
|
|
89
|
+
type GetIndexingTimeProps = {
|
|
90
|
+
/**
|
|
91
|
+
* Subset of clusters, separated by comma.
|
|
92
|
+
*/
|
|
93
|
+
clusters: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Properties for the `getLatency` method.
|
|
97
|
+
*/
|
|
98
|
+
type GetLatencyProps = {
|
|
99
|
+
/**
|
|
100
|
+
* Subset of clusters, separated by comma.
|
|
101
|
+
*/
|
|
102
|
+
clusters: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Properties for the `getMetrics` method.
|
|
106
|
+
*/
|
|
107
|
+
type GetMetricsProps = {
|
|
108
|
+
/**
|
|
109
|
+
* Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
|
|
110
|
+
*/
|
|
111
|
+
metric: Metric;
|
|
112
|
+
/**
|
|
113
|
+
* 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.
|
|
114
|
+
*/
|
|
115
|
+
period: Period;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Properties for the `getReachability` method.
|
|
119
|
+
*/
|
|
120
|
+
type GetReachabilityProps = {
|
|
121
|
+
/**
|
|
122
|
+
* Subset of clusters, separated by comma.
|
|
123
|
+
*/
|
|
124
|
+
clusters: string;
|
|
17
125
|
};
|
|
18
126
|
|
|
19
127
|
/**
|
|
@@ -144,162 +252,169 @@ type LatencyResponse = {
|
|
|
144
252
|
metrics?: LatencyMetric;
|
|
145
253
|
};
|
|
146
254
|
|
|
147
|
-
type Metric = '*' | 'avg_build_time' | 'cpu_usage' | 'ram_indexing_usage' | 'ram_search_usage' | 'ssd_usage';
|
|
148
|
-
|
|
149
|
-
type Period = 'day' | 'hour' | 'minute' | 'month' | 'week';
|
|
150
|
-
|
|
151
255
|
type StatusResponse = {
|
|
152
256
|
status?: Record<string, Status>;
|
|
153
257
|
};
|
|
154
258
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Properties for the `customDelete` method.
|
|
161
|
-
*/
|
|
162
|
-
type CustomDeleteProps = {
|
|
259
|
+
declare const apiClientVersion = "1.3.1";
|
|
260
|
+
declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
261
|
+
transporter: _algolia_client_common.Transporter;
|
|
163
262
|
/**
|
|
164
|
-
*
|
|
263
|
+
* The `appId` currently in use.
|
|
165
264
|
*/
|
|
166
|
-
|
|
265
|
+
appId: string;
|
|
167
266
|
/**
|
|
168
|
-
*
|
|
267
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
169
268
|
*/
|
|
170
|
-
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* Properties for the `customGet` method.
|
|
174
|
-
*/
|
|
175
|
-
type CustomGetProps = {
|
|
269
|
+
clearCache(): Promise<void>;
|
|
176
270
|
/**
|
|
177
|
-
*
|
|
271
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
178
272
|
*/
|
|
179
|
-
|
|
273
|
+
readonly _ua: string;
|
|
180
274
|
/**
|
|
181
|
-
*
|
|
275
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
276
|
+
*
|
|
277
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
278
|
+
* @param version - The version of the agent.
|
|
182
279
|
*/
|
|
183
|
-
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* Properties for the `customPost` method.
|
|
187
|
-
*/
|
|
188
|
-
type CustomPostProps = {
|
|
280
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
189
281
|
/**
|
|
190
|
-
*
|
|
191
|
-
|
|
192
|
-
|
|
282
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
283
|
+
*
|
|
284
|
+
* @param params - Method params.
|
|
285
|
+
* @param params.apiKey - The new API Key to use.
|
|
286
|
+
*/
|
|
287
|
+
setClientApiKey({ apiKey }: {
|
|
288
|
+
apiKey: string;
|
|
289
|
+
}): void;
|
|
193
290
|
/**
|
|
194
|
-
*
|
|
291
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
292
|
+
*
|
|
293
|
+
* @param customDelete - The customDelete object.
|
|
294
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
295
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
296
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
195
297
|
*/
|
|
196
|
-
parameters?: Record<string,
|
|
298
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
197
299
|
/**
|
|
198
|
-
*
|
|
300
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
301
|
+
*
|
|
302
|
+
* @param customGet - The customGet object.
|
|
303
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
304
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
305
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
199
306
|
*/
|
|
200
|
-
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* Properties for the `customPut` method.
|
|
204
|
-
*/
|
|
205
|
-
type CustomPutProps = {
|
|
307
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
206
308
|
/**
|
|
207
|
-
*
|
|
309
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
310
|
+
*
|
|
311
|
+
* @param customPost - The customPost object.
|
|
312
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
313
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
314
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
315
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
208
316
|
*/
|
|
209
|
-
path: string
|
|
317
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
210
318
|
/**
|
|
211
|
-
*
|
|
319
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
320
|
+
*
|
|
321
|
+
* @param customPut - The customPut object.
|
|
322
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
323
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
324
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
325
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
212
326
|
*/
|
|
213
|
-
parameters?: Record<string,
|
|
327
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
214
328
|
/**
|
|
215
|
-
*
|
|
329
|
+
* Retrieves known incidents for the selected clusters.
|
|
330
|
+
*
|
|
331
|
+
* @param getClusterIncidents - The getClusterIncidents object.
|
|
332
|
+
* @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
|
|
333
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
216
334
|
*/
|
|
217
|
-
|
|
218
|
-
};
|
|
219
|
-
/**
|
|
220
|
-
* Properties for the `getClusterIncidents` method.
|
|
221
|
-
*/
|
|
222
|
-
type GetClusterIncidentsProps = {
|
|
335
|
+
getClusterIncidents({ clusters }: GetClusterIncidentsProps, requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
|
223
336
|
/**
|
|
224
|
-
*
|
|
337
|
+
* Retrieves the status of selected clusters.
|
|
338
|
+
*
|
|
339
|
+
* @param getClusterStatus - The getClusterStatus object.
|
|
340
|
+
* @param getClusterStatus.clusters - Subset of clusters, separated by comma.
|
|
341
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
225
342
|
*/
|
|
226
|
-
clusters:
|
|
227
|
-
};
|
|
228
|
-
/**
|
|
229
|
-
* Properties for the `getClusterStatus` method.
|
|
230
|
-
*/
|
|
231
|
-
type GetClusterStatusProps = {
|
|
343
|
+
getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse>;
|
|
232
344
|
/**
|
|
233
|
-
*
|
|
345
|
+
* Retrieves known incidents for all clusters.
|
|
346
|
+
*
|
|
347
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
234
348
|
*/
|
|
235
|
-
|
|
236
|
-
};
|
|
237
|
-
/**
|
|
238
|
-
* Properties for the `getIndexingTime` method.
|
|
239
|
-
*/
|
|
240
|
-
type GetIndexingTimeProps = {
|
|
349
|
+
getIncidents(requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
|
241
350
|
/**
|
|
242
|
-
*
|
|
351
|
+
* Retrieves average times for indexing operations for selected clusters.
|
|
352
|
+
*
|
|
353
|
+
* @param getIndexingTime - The getIndexingTime object.
|
|
354
|
+
* @param getIndexingTime.clusters - Subset of clusters, separated by comma.
|
|
355
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
243
356
|
*/
|
|
244
|
-
clusters:
|
|
245
|
-
};
|
|
246
|
-
/**
|
|
247
|
-
* Properties for the `getLatency` method.
|
|
248
|
-
*/
|
|
249
|
-
type GetLatencyProps = {
|
|
357
|
+
getIndexingTime({ clusters }: GetIndexingTimeProps, requestOptions?: RequestOptions): Promise<IndexingTimeResponse>;
|
|
250
358
|
/**
|
|
251
|
-
*
|
|
359
|
+
* Retrieves the average latency for search requests for selected clusters.
|
|
360
|
+
*
|
|
361
|
+
* @param getLatency - The getLatency object.
|
|
362
|
+
* @param getLatency.clusters - Subset of clusters, separated by comma.
|
|
363
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
252
364
|
*/
|
|
253
|
-
clusters:
|
|
254
|
-
};
|
|
255
|
-
/**
|
|
256
|
-
* Properties for the `getMetrics` method.
|
|
257
|
-
*/
|
|
258
|
-
type GetMetricsProps = {
|
|
365
|
+
getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse>;
|
|
259
366
|
/**
|
|
260
|
-
*
|
|
367
|
+
* 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).
|
|
368
|
+
*
|
|
369
|
+
* @param getMetrics - The getMetrics object.
|
|
370
|
+
* @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 `*`.
|
|
371
|
+
* @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.
|
|
372
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
261
373
|
*/
|
|
262
|
-
metric:
|
|
374
|
+
getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse>;
|
|
263
375
|
/**
|
|
264
|
-
*
|
|
376
|
+
* Test whether clusters are reachable or not.
|
|
377
|
+
*
|
|
378
|
+
* @param getReachability - The getReachability object.
|
|
379
|
+
* @param getReachability.clusters - Subset of clusters, separated by comma.
|
|
380
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
265
381
|
*/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
382
|
+
getReachability({ clusters }: GetReachabilityProps, requestOptions?: RequestOptions): Promise<Record<string, Record<string, boolean>>>;
|
|
383
|
+
/**
|
|
384
|
+
* 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.
|
|
385
|
+
*
|
|
386
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
387
|
+
*/
|
|
388
|
+
getServers(requestOptions?: RequestOptions): Promise<InventoryResponse>;
|
|
272
389
|
/**
|
|
273
|
-
*
|
|
390
|
+
* Retrieves the status of all Algolia clusters and instances.
|
|
391
|
+
*
|
|
392
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
274
393
|
*/
|
|
275
|
-
|
|
394
|
+
getStatus(requestOptions?: RequestOptions): Promise<StatusResponse>;
|
|
276
395
|
};
|
|
277
396
|
|
|
278
|
-
|
|
397
|
+
type BadRequest = {
|
|
398
|
+
reason?: string;
|
|
399
|
+
};
|
|
279
400
|
|
|
280
401
|
/**
|
|
281
|
-
*
|
|
402
|
+
* Error.
|
|
282
403
|
*/
|
|
283
|
-
type
|
|
284
|
-
|
|
285
|
-
transporter: _algolia_client_common.Transporter;
|
|
286
|
-
appId: string;
|
|
287
|
-
clearCache(): Promise<void>;
|
|
288
|
-
_ua: string;
|
|
289
|
-
addAlgoliaAgent(segment: string, version?: string): void;
|
|
290
|
-
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
|
|
291
|
-
customGet({ path, parameters }: CustomGetProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
|
|
292
|
-
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
|
|
293
|
-
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
|
|
294
|
-
getClusterIncidents({ clusters }: GetClusterIncidentsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<IncidentsResponse>;
|
|
295
|
-
getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<StatusResponse>;
|
|
296
|
-
getIncidents(requestOptions?: _algolia_client_common.RequestOptions): Promise<IncidentsResponse>;
|
|
297
|
-
getIndexingTime({ clusters }: GetIndexingTimeProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<IndexingTimeResponse>;
|
|
298
|
-
getLatency({ clusters }: GetLatencyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<LatencyResponse>;
|
|
299
|
-
getMetrics({ metric, period }: GetMetricsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<InfrastructureResponse>;
|
|
300
|
-
getReachability({ clusters }: GetReachabilityProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, Record<string, boolean>>>;
|
|
301
|
-
getServers(requestOptions?: _algolia_client_common.RequestOptions): Promise<InventoryResponse>;
|
|
302
|
-
getStatus(requestOptions?: _algolia_client_common.RequestOptions): Promise<StatusResponse>;
|
|
404
|
+
type ErrorBase = Record<string, any> & {
|
|
405
|
+
message?: string;
|
|
303
406
|
};
|
|
304
407
|
|
|
408
|
+
type Forbidden = {
|
|
409
|
+
reason?: string;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
type Unauthorized = {
|
|
413
|
+
reason?: string;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
type MonitoringClient = ReturnType<typeof createMonitoringClient>;
|
|
417
|
+
|
|
418
|
+
declare function monitoringClient(appId: string, apiKey: string, options?: ClientOptions): MonitoringClient;
|
|
419
|
+
|
|
305
420
|
export { type BadRequest, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type ErrorBase, type Forbidden, type GetClusterIncidentsProps, type GetClusterStatusProps, type GetIndexingTimeProps, type GetLatencyProps, type GetMetricsProps, type GetReachabilityProps, type Incident, type IncidentEntry, type IncidentsResponse, type IndexingMetric, type IndexingTimeResponse, type InfrastructureResponse, type InventoryResponse, type LatencyMetric, type LatencyResponse, type Metric, type Metrics, type MonitoringClient, type Period, type ProbesMetric, type Region, type Server, type ServerStatus, type Status, type StatusResponse, type TimeEntry, type Type, type Unauthorized, apiClientVersion, monitoringClient };
|
|
@@ -25,7 +25,7 @@ __export(monitoringClient_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(monitoringClient_exports);
|
|
27
27
|
var import_client_common = require("@algolia/client-common");
|
|
28
|
-
var apiClientVersion = "1.
|
|
28
|
+
var apiClientVersion = "1.3.1";
|
|
29
29
|
function getDefaultHosts() {
|
|
30
30
|
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
|
31
31
|
}
|
|
@@ -37,26 +37,25 @@ function createMonitoringClient({
|
|
|
37
37
|
...options
|
|
38
38
|
}) {
|
|
39
39
|
const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
|
|
40
|
-
const transporter = (0, import_client_common.createTransporter)({
|
|
41
|
-
hosts: getDefaultHosts(),
|
|
42
|
-
...options,
|
|
43
|
-
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
|
|
44
|
-
algoliaAgents,
|
|
45
|
-
client: "Monitoring",
|
|
46
|
-
version: apiClientVersion
|
|
47
|
-
}),
|
|
48
|
-
baseHeaders: {
|
|
49
|
-
"content-type": "text/plain",
|
|
50
|
-
...auth.headers(),
|
|
51
|
-
...options.baseHeaders
|
|
52
|
-
},
|
|
53
|
-
baseQueryParameters: {
|
|
54
|
-
...auth.queryParameters(),
|
|
55
|
-
...options.baseQueryParameters
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
40
|
return {
|
|
59
|
-
transporter,
|
|
41
|
+
transporter: (0, import_client_common.createTransporter)({
|
|
42
|
+
hosts: getDefaultHosts(),
|
|
43
|
+
...options,
|
|
44
|
+
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
|
|
45
|
+
algoliaAgents,
|
|
46
|
+
client: "Monitoring",
|
|
47
|
+
version: apiClientVersion
|
|
48
|
+
}),
|
|
49
|
+
baseHeaders: {
|
|
50
|
+
"content-type": "text/plain",
|
|
51
|
+
...auth.headers(),
|
|
52
|
+
...options.baseHeaders
|
|
53
|
+
},
|
|
54
|
+
baseQueryParameters: {
|
|
55
|
+
...auth.queryParameters(),
|
|
56
|
+
...options.baseQueryParameters
|
|
57
|
+
}
|
|
58
|
+
}),
|
|
60
59
|
/**
|
|
61
60
|
* The `appId` currently in use.
|
|
62
61
|
*/
|
|
@@ -65,13 +64,15 @@ function createMonitoringClient({
|
|
|
65
64
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
66
65
|
*/
|
|
67
66
|
clearCache() {
|
|
68
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(
|
|
67
|
+
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
|
|
68
|
+
() => void 0
|
|
69
|
+
);
|
|
69
70
|
},
|
|
70
71
|
/**
|
|
71
72
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
72
73
|
*/
|
|
73
74
|
get _ua() {
|
|
74
|
-
return transporter.algoliaAgent.value;
|
|
75
|
+
return this.transporter.algoliaAgent.value;
|
|
75
76
|
},
|
|
76
77
|
/**
|
|
77
78
|
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
@@ -80,7 +81,20 @@ function createMonitoringClient({
|
|
|
80
81
|
* @param version - The version of the agent.
|
|
81
82
|
*/
|
|
82
83
|
addAlgoliaAgent(segment, version) {
|
|
83
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
84
|
+
this.transporter.algoliaAgent.add({ segment, version });
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
88
|
+
*
|
|
89
|
+
* @param params - Method params.
|
|
90
|
+
* @param params.apiKey - The new API Key to use.
|
|
91
|
+
*/
|
|
92
|
+
setClientApiKey({ apiKey }) {
|
|
93
|
+
if (!authMode || authMode === "WithinHeaders") {
|
|
94
|
+
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
|
95
|
+
} else {
|
|
96
|
+
this.transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
|
97
|
+
}
|
|
84
98
|
},
|
|
85
99
|
/**
|
|
86
100
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -103,7 +117,7 @@ function createMonitoringClient({
|
|
|
103
117
|
queryParameters,
|
|
104
118
|
headers
|
|
105
119
|
};
|
|
106
|
-
return transporter.request(request, requestOptions);
|
|
120
|
+
return this.transporter.request(request, requestOptions);
|
|
107
121
|
},
|
|
108
122
|
/**
|
|
109
123
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -126,7 +140,7 @@ function createMonitoringClient({
|
|
|
126
140
|
queryParameters,
|
|
127
141
|
headers
|
|
128
142
|
};
|
|
129
|
-
return transporter.request(request, requestOptions);
|
|
143
|
+
return this.transporter.request(request, requestOptions);
|
|
130
144
|
},
|
|
131
145
|
/**
|
|
132
146
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -151,7 +165,7 @@ function createMonitoringClient({
|
|
|
151
165
|
headers,
|
|
152
166
|
data: body ? body : {}
|
|
153
167
|
};
|
|
154
|
-
return transporter.request(request, requestOptions);
|
|
168
|
+
return this.transporter.request(request, requestOptions);
|
|
155
169
|
},
|
|
156
170
|
/**
|
|
157
171
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -176,7 +190,7 @@ function createMonitoringClient({
|
|
|
176
190
|
headers,
|
|
177
191
|
data: body ? body : {}
|
|
178
192
|
};
|
|
179
|
-
return transporter.request(request, requestOptions);
|
|
193
|
+
return this.transporter.request(request, requestOptions);
|
|
180
194
|
},
|
|
181
195
|
/**
|
|
182
196
|
* Retrieves known incidents for the selected clusters.
|
|
@@ -198,7 +212,7 @@ function createMonitoringClient({
|
|
|
198
212
|
queryParameters,
|
|
199
213
|
headers
|
|
200
214
|
};
|
|
201
|
-
return transporter.request(request, requestOptions);
|
|
215
|
+
return this.transporter.request(request, requestOptions);
|
|
202
216
|
},
|
|
203
217
|
/**
|
|
204
218
|
* Retrieves the status of selected clusters.
|
|
@@ -220,7 +234,7 @@ function createMonitoringClient({
|
|
|
220
234
|
queryParameters,
|
|
221
235
|
headers
|
|
222
236
|
};
|
|
223
|
-
return transporter.request(request, requestOptions);
|
|
237
|
+
return this.transporter.request(request, requestOptions);
|
|
224
238
|
},
|
|
225
239
|
/**
|
|
226
240
|
* Retrieves known incidents for all clusters.
|
|
@@ -237,7 +251,7 @@ function createMonitoringClient({
|
|
|
237
251
|
queryParameters,
|
|
238
252
|
headers
|
|
239
253
|
};
|
|
240
|
-
return transporter.request(request, requestOptions);
|
|
254
|
+
return this.transporter.request(request, requestOptions);
|
|
241
255
|
},
|
|
242
256
|
/**
|
|
243
257
|
* Retrieves average times for indexing operations for selected clusters.
|
|
@@ -259,7 +273,7 @@ function createMonitoringClient({
|
|
|
259
273
|
queryParameters,
|
|
260
274
|
headers
|
|
261
275
|
};
|
|
262
|
-
return transporter.request(request, requestOptions);
|
|
276
|
+
return this.transporter.request(request, requestOptions);
|
|
263
277
|
},
|
|
264
278
|
/**
|
|
265
279
|
* Retrieves the average latency for search requests for selected clusters.
|
|
@@ -281,7 +295,7 @@ function createMonitoringClient({
|
|
|
281
295
|
queryParameters,
|
|
282
296
|
headers
|
|
283
297
|
};
|
|
284
|
-
return transporter.request(request, requestOptions);
|
|
298
|
+
return this.transporter.request(request, requestOptions);
|
|
285
299
|
},
|
|
286
300
|
/**
|
|
287
301
|
* 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).
|
|
@@ -307,7 +321,7 @@ function createMonitoringClient({
|
|
|
307
321
|
queryParameters,
|
|
308
322
|
headers
|
|
309
323
|
};
|
|
310
|
-
return transporter.request(request, requestOptions);
|
|
324
|
+
return this.transporter.request(request, requestOptions);
|
|
311
325
|
},
|
|
312
326
|
/**
|
|
313
327
|
* Test whether clusters are reachable or not.
|
|
@@ -329,7 +343,7 @@ function createMonitoringClient({
|
|
|
329
343
|
queryParameters,
|
|
330
344
|
headers
|
|
331
345
|
};
|
|
332
|
-
return transporter.request(request, requestOptions);
|
|
346
|
+
return this.transporter.request(request, requestOptions);
|
|
333
347
|
},
|
|
334
348
|
/**
|
|
335
349
|
* 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.
|
|
@@ -346,7 +360,7 @@ function createMonitoringClient({
|
|
|
346
360
|
queryParameters,
|
|
347
361
|
headers
|
|
348
362
|
};
|
|
349
|
-
return transporter.request(request, requestOptions);
|
|
363
|
+
return this.transporter.request(request, requestOptions);
|
|
350
364
|
},
|
|
351
365
|
/**
|
|
352
366
|
* Retrieves the status of all Algolia clusters and instances.
|
|
@@ -363,7 +377,7 @@ function createMonitoringClient({
|
|
|
363
377
|
queryParameters,
|
|
364
378
|
headers
|
|
365
379
|
};
|
|
366
|
-
return transporter.request(request, requestOptions);
|
|
380
|
+
return this.transporter.request(request, requestOptions);
|
|
367
381
|
}
|
|
368
382
|
};
|
|
369
383
|
}
|