@algolia/monitoring 1.2.5 → 1.3.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/browser.d.ts +239 -124
- package/dist/builds/browser.js +46 -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 +46 -36
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +46 -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 +46 -36
- package/dist/src/monitoringClient.cjs.map +1 -1
- package/dist/src/monitoringClient.js +46 -36
- package/dist/src/monitoringClient.js.map +1 -1
- package/package.json +4 -4
package/dist/browser.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.0";
|
|
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
|
-
readonly _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 };
|
package/dist/builds/browser.js
CHANGED
|
@@ -11,7 +11,7 @@ import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
|
|
11
11
|
|
|
12
12
|
// src/monitoringClient.ts
|
|
13
13
|
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
|
14
|
-
var apiClientVersion = "1.
|
|
14
|
+
var apiClientVersion = "1.3.0";
|
|
15
15
|
function getDefaultHosts() {
|
|
16
16
|
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
|
17
17
|
}
|
|
@@ -23,26 +23,25 @@ function createMonitoringClient({
|
|
|
23
23
|
...options
|
|
24
24
|
}) {
|
|
25
25
|
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
26
|
-
const transporter = createTransporter({
|
|
27
|
-
hosts: getDefaultHosts(),
|
|
28
|
-
...options,
|
|
29
|
-
algoliaAgent: getAlgoliaAgent({
|
|
30
|
-
algoliaAgents,
|
|
31
|
-
client: "Monitoring",
|
|
32
|
-
version: apiClientVersion
|
|
33
|
-
}),
|
|
34
|
-
baseHeaders: {
|
|
35
|
-
"content-type": "text/plain",
|
|
36
|
-
...auth.headers(),
|
|
37
|
-
...options.baseHeaders
|
|
38
|
-
},
|
|
39
|
-
baseQueryParameters: {
|
|
40
|
-
...auth.queryParameters(),
|
|
41
|
-
...options.baseQueryParameters
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
26
|
return {
|
|
45
|
-
transporter
|
|
27
|
+
transporter: createTransporter({
|
|
28
|
+
hosts: getDefaultHosts(),
|
|
29
|
+
...options,
|
|
30
|
+
algoliaAgent: getAlgoliaAgent({
|
|
31
|
+
algoliaAgents,
|
|
32
|
+
client: "Monitoring",
|
|
33
|
+
version: apiClientVersion
|
|
34
|
+
}),
|
|
35
|
+
baseHeaders: {
|
|
36
|
+
"content-type": "text/plain",
|
|
37
|
+
...auth.headers(),
|
|
38
|
+
...options.baseHeaders
|
|
39
|
+
},
|
|
40
|
+
baseQueryParameters: {
|
|
41
|
+
...auth.queryParameters(),
|
|
42
|
+
...options.baseQueryParameters
|
|
43
|
+
}
|
|
44
|
+
}),
|
|
46
45
|
/**
|
|
47
46
|
* The `appId` currently in use.
|
|
48
47
|
*/
|
|
@@ -51,13 +50,15 @@ function createMonitoringClient({
|
|
|
51
50
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
52
51
|
*/
|
|
53
52
|
clearCache() {
|
|
54
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(
|
|
53
|
+
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
|
|
54
|
+
() => void 0
|
|
55
|
+
);
|
|
55
56
|
},
|
|
56
57
|
/**
|
|
57
58
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
58
59
|
*/
|
|
59
60
|
get _ua() {
|
|
60
|
-
return transporter.algoliaAgent.value;
|
|
61
|
+
return this.transporter.algoliaAgent.value;
|
|
61
62
|
},
|
|
62
63
|
/**
|
|
63
64
|
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
@@ -66,7 +67,16 @@ function createMonitoringClient({
|
|
|
66
67
|
* @param version - The version of the agent.
|
|
67
68
|
*/
|
|
68
69
|
addAlgoliaAgent(segment, version) {
|
|
69
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
70
|
+
this.transporter.algoliaAgent.add({ segment, version });
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
74
|
+
*
|
|
75
|
+
* @param params - Method params.
|
|
76
|
+
* @param params.apiKey - The new API Key to use.
|
|
77
|
+
*/
|
|
78
|
+
setClientApiKey({ apiKey }) {
|
|
79
|
+
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
|
70
80
|
},
|
|
71
81
|
/**
|
|
72
82
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -89,7 +99,7 @@ function createMonitoringClient({
|
|
|
89
99
|
queryParameters,
|
|
90
100
|
headers
|
|
91
101
|
};
|
|
92
|
-
return transporter.request(request, requestOptions);
|
|
102
|
+
return this.transporter.request(request, requestOptions);
|
|
93
103
|
},
|
|
94
104
|
/**
|
|
95
105
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -112,7 +122,7 @@ function createMonitoringClient({
|
|
|
112
122
|
queryParameters,
|
|
113
123
|
headers
|
|
114
124
|
};
|
|
115
|
-
return transporter.request(request, requestOptions);
|
|
125
|
+
return this.transporter.request(request, requestOptions);
|
|
116
126
|
},
|
|
117
127
|
/**
|
|
118
128
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -137,7 +147,7 @@ function createMonitoringClient({
|
|
|
137
147
|
headers,
|
|
138
148
|
data: body ? body : {}
|
|
139
149
|
};
|
|
140
|
-
return transporter.request(request, requestOptions);
|
|
150
|
+
return this.transporter.request(request, requestOptions);
|
|
141
151
|
},
|
|
142
152
|
/**
|
|
143
153
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -162,7 +172,7 @@ function createMonitoringClient({
|
|
|
162
172
|
headers,
|
|
163
173
|
data: body ? body : {}
|
|
164
174
|
};
|
|
165
|
-
return transporter.request(request, requestOptions);
|
|
175
|
+
return this.transporter.request(request, requestOptions);
|
|
166
176
|
},
|
|
167
177
|
/**
|
|
168
178
|
* Retrieves known incidents for the selected clusters.
|
|
@@ -184,7 +194,7 @@ function createMonitoringClient({
|
|
|
184
194
|
queryParameters,
|
|
185
195
|
headers
|
|
186
196
|
};
|
|
187
|
-
return transporter.request(request, requestOptions);
|
|
197
|
+
return this.transporter.request(request, requestOptions);
|
|
188
198
|
},
|
|
189
199
|
/**
|
|
190
200
|
* Retrieves the status of selected clusters.
|
|
@@ -206,7 +216,7 @@ function createMonitoringClient({
|
|
|
206
216
|
queryParameters,
|
|
207
217
|
headers
|
|
208
218
|
};
|
|
209
|
-
return transporter.request(request, requestOptions);
|
|
219
|
+
return this.transporter.request(request, requestOptions);
|
|
210
220
|
},
|
|
211
221
|
/**
|
|
212
222
|
* Retrieves known incidents for all clusters.
|
|
@@ -223,7 +233,7 @@ function createMonitoringClient({
|
|
|
223
233
|
queryParameters,
|
|
224
234
|
headers
|
|
225
235
|
};
|
|
226
|
-
return transporter.request(request, requestOptions);
|
|
236
|
+
return this.transporter.request(request, requestOptions);
|
|
227
237
|
},
|
|
228
238
|
/**
|
|
229
239
|
* Retrieves average times for indexing operations for selected clusters.
|
|
@@ -245,7 +255,7 @@ function createMonitoringClient({
|
|
|
245
255
|
queryParameters,
|
|
246
256
|
headers
|
|
247
257
|
};
|
|
248
|
-
return transporter.request(request, requestOptions);
|
|
258
|
+
return this.transporter.request(request, requestOptions);
|
|
249
259
|
},
|
|
250
260
|
/**
|
|
251
261
|
* Retrieves the average latency for search requests for selected clusters.
|
|
@@ -267,7 +277,7 @@ function createMonitoringClient({
|
|
|
267
277
|
queryParameters,
|
|
268
278
|
headers
|
|
269
279
|
};
|
|
270
|
-
return transporter.request(request, requestOptions);
|
|
280
|
+
return this.transporter.request(request, requestOptions);
|
|
271
281
|
},
|
|
272
282
|
/**
|
|
273
283
|
* 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).
|
|
@@ -293,7 +303,7 @@ function createMonitoringClient({
|
|
|
293
303
|
queryParameters,
|
|
294
304
|
headers
|
|
295
305
|
};
|
|
296
|
-
return transporter.request(request, requestOptions);
|
|
306
|
+
return this.transporter.request(request, requestOptions);
|
|
297
307
|
},
|
|
298
308
|
/**
|
|
299
309
|
* Test whether clusters are reachable or not.
|
|
@@ -315,7 +325,7 @@ function createMonitoringClient({
|
|
|
315
325
|
queryParameters,
|
|
316
326
|
headers
|
|
317
327
|
};
|
|
318
|
-
return transporter.request(request, requestOptions);
|
|
328
|
+
return this.transporter.request(request, requestOptions);
|
|
319
329
|
},
|
|
320
330
|
/**
|
|
321
331
|
* 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.
|
|
@@ -332,7 +342,7 @@ function createMonitoringClient({
|
|
|
332
342
|
queryParameters,
|
|
333
343
|
headers
|
|
334
344
|
};
|
|
335
|
-
return transporter.request(request, requestOptions);
|
|
345
|
+
return this.transporter.request(request, requestOptions);
|
|
336
346
|
},
|
|
337
347
|
/**
|
|
338
348
|
* Retrieves the status of all Algolia clusters and instances.
|
|
@@ -349,7 +359,7 @@ function createMonitoringClient({
|
|
|
349
359
|
queryParameters,
|
|
350
360
|
headers
|
|
351
361
|
};
|
|
352
|
-
return transporter.request(request, requestOptions);
|
|
362
|
+
return this.transporter.request(request, requestOptions);
|
|
353
363
|
}
|
|
354
364
|
};
|
|
355
365
|
}
|