@algolia/monitoring 1.2.3 → 5.2.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +305 -0
- package/dist/builds/browser.js +388 -0
- package/dist/builds/browser.js.map +1 -0
- package/dist/builds/browser.min.js +2 -0
- package/dist/builds/browser.min.js.map +1 -0
- package/dist/builds/browser.umd.js +12 -0
- package/dist/builds/node.cjs +406 -0
- package/dist/builds/node.cjs.map +1 -0
- package/dist/builds/node.js +386 -0
- package/dist/builds/node.js.map +1 -0
- package/dist/node.d.cts +305 -0
- package/dist/node.d.ts +305 -0
- package/dist/src/monitoringClient.cjs +375 -0
- package/dist/src/monitoringClient.cjs.map +1 -0
- package/dist/src/monitoringClient.js +349 -0
- package/dist/src/monitoringClient.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +27 -27
- package/dist/builds/browser.d.ts +0 -28
- package/dist/builds/browser.d.ts.map +0 -1
- package/dist/builds/node.d.ts +0 -28
- package/dist/builds/node.d.ts.map +0 -1
- package/dist/model/badRequest.d.ts +0 -4
- package/dist/model/badRequest.d.ts.map +0 -1
- package/dist/model/clientMethodProps.d.ts +0 -121
- package/dist/model/clientMethodProps.d.ts.map +0 -1
- package/dist/model/errorBase.d.ts +0 -7
- package/dist/model/errorBase.d.ts.map +0 -1
- package/dist/model/forbidden.d.ts +0 -4
- package/dist/model/forbidden.d.ts.map +0 -1
- package/dist/model/incident.d.ts +0 -12
- package/dist/model/incident.d.ts.map +0 -1
- package/dist/model/incidentEntry.d.ts +0 -9
- package/dist/model/incidentEntry.d.ts.map +0 -1
- package/dist/model/incidentsResponse.d.ts +0 -5
- package/dist/model/incidentsResponse.d.ts.map +0 -1
- package/dist/model/index.d.ts +0 -26
- package/dist/model/index.d.ts.map +0 -1
- package/dist/model/indexingMetric.d.ts +0 -5
- package/dist/model/indexingMetric.d.ts.map +0 -1
- package/dist/model/indexingTimeResponse.d.ts +0 -5
- package/dist/model/indexingTimeResponse.d.ts.map +0 -1
- package/dist/model/infrastructureResponse.d.ts +0 -5
- package/dist/model/infrastructureResponse.d.ts.map +0 -1
- package/dist/model/inventoryResponse.d.ts +0 -5
- package/dist/model/inventoryResponse.d.ts.map +0 -1
- package/dist/model/latencyMetric.d.ts +0 -5
- package/dist/model/latencyMetric.d.ts.map +0 -1
- package/dist/model/latencyResponse.d.ts +0 -5
- package/dist/model/latencyResponse.d.ts.map +0 -1
- package/dist/model/metric.d.ts +0 -2
- package/dist/model/metric.d.ts.map +0 -1
- package/dist/model/metrics.d.ts +0 -24
- package/dist/model/metrics.d.ts.map +0 -1
- package/dist/model/period.d.ts +0 -2
- package/dist/model/period.d.ts.map +0 -1
- package/dist/model/probesMetric.d.ts +0 -11
- package/dist/model/probesMetric.d.ts.map +0 -1
- package/dist/model/region.d.ts +0 -5
- package/dist/model/region.d.ts.map +0 -1
- package/dist/model/server.d.ts +0 -25
- package/dist/model/server.d.ts.map +0 -1
- package/dist/model/serverStatus.d.ts +0 -2
- package/dist/model/serverStatus.d.ts.map +0 -1
- package/dist/model/status.d.ts +0 -5
- package/dist/model/status.d.ts.map +0 -1
- package/dist/model/statusResponse.d.ts +0 -5
- package/dist/model/statusResponse.d.ts.map +0 -1
- package/dist/model/timeEntry.d.ts +0 -11
- package/dist/model/timeEntry.d.ts.map +0 -1
- package/dist/model/type.d.ts +0 -2
- package/dist/model/type.d.ts.map +0 -1
- package/dist/model/unauthorized.d.ts +0 -4
- package/dist/model/unauthorized.d.ts.map +0 -1
- package/dist/monitoring.cjs +0 -376
- package/dist/monitoring.esm.browser.js +0 -1050
- package/dist/monitoring.esm.node.js +0 -373
- package/dist/monitoring.umd.js +0 -2
- package/dist/src/monitoringClient.d.ts +0 -137
- package/dist/src/monitoringClient.d.ts.map +0 -1
package/dist/monitoring.cjs
DELETED
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var clientCommon = require('@algolia/client-common');
|
|
4
|
-
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
|
-
|
|
6
|
-
// 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.
|
|
7
|
-
const apiClientVersion = '1.2.3';
|
|
8
|
-
function getDefaultHosts() {
|
|
9
|
-
return [{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' }];
|
|
10
|
-
}
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
12
|
-
function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
13
|
-
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
14
|
-
const transporter = clientCommon.createTransporter({
|
|
15
|
-
hosts: getDefaultHosts(),
|
|
16
|
-
...options,
|
|
17
|
-
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
18
|
-
algoliaAgents,
|
|
19
|
-
client: 'Monitoring',
|
|
20
|
-
version: apiClientVersion,
|
|
21
|
-
}),
|
|
22
|
-
baseHeaders: {
|
|
23
|
-
'content-type': 'text/plain',
|
|
24
|
-
...auth.headers(),
|
|
25
|
-
...options.baseHeaders,
|
|
26
|
-
},
|
|
27
|
-
baseQueryParameters: {
|
|
28
|
-
...auth.queryParameters(),
|
|
29
|
-
...options.baseQueryParameters,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
transporter,
|
|
34
|
-
/**
|
|
35
|
-
* The `appId` currently in use.
|
|
36
|
-
*/
|
|
37
|
-
appId: appIdOption,
|
|
38
|
-
/**
|
|
39
|
-
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
40
|
-
*/
|
|
41
|
-
clearCache() {
|
|
42
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
46
|
-
*/
|
|
47
|
-
get _ua() {
|
|
48
|
-
return transporter.algoliaAgent.value;
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
52
|
-
*
|
|
53
|
-
* @param segment - The algolia agent (user-agent) segment to add.
|
|
54
|
-
* @param version - The version of the agent.
|
|
55
|
-
*/
|
|
56
|
-
addAlgoliaAgent(segment, version) {
|
|
57
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
61
|
-
*
|
|
62
|
-
* @param customDelete - The customDelete object.
|
|
63
|
-
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
64
|
-
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
65
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
66
|
-
*/
|
|
67
|
-
customDelete({ path, parameters }, requestOptions) {
|
|
68
|
-
if (!path) {
|
|
69
|
-
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
70
|
-
}
|
|
71
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
72
|
-
const headers = {};
|
|
73
|
-
const queryParameters = parameters ? parameters : {};
|
|
74
|
-
const request = {
|
|
75
|
-
method: 'DELETE',
|
|
76
|
-
path: requestPath,
|
|
77
|
-
queryParameters,
|
|
78
|
-
headers,
|
|
79
|
-
};
|
|
80
|
-
return transporter.request(request, requestOptions);
|
|
81
|
-
},
|
|
82
|
-
/**
|
|
83
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
84
|
-
*
|
|
85
|
-
* @param customGet - The customGet object.
|
|
86
|
-
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
87
|
-
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
88
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
89
|
-
*/
|
|
90
|
-
customGet({ path, parameters }, requestOptions) {
|
|
91
|
-
if (!path) {
|
|
92
|
-
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
93
|
-
}
|
|
94
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
95
|
-
const headers = {};
|
|
96
|
-
const queryParameters = parameters ? parameters : {};
|
|
97
|
-
const request = {
|
|
98
|
-
method: 'GET',
|
|
99
|
-
path: requestPath,
|
|
100
|
-
queryParameters,
|
|
101
|
-
headers,
|
|
102
|
-
};
|
|
103
|
-
return transporter.request(request, requestOptions);
|
|
104
|
-
},
|
|
105
|
-
/**
|
|
106
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
107
|
-
*
|
|
108
|
-
* @param customPost - The customPost object.
|
|
109
|
-
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
110
|
-
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
111
|
-
* @param customPost.body - Parameters to send with the custom request.
|
|
112
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
113
|
-
*/
|
|
114
|
-
customPost({ path, parameters, body }, requestOptions) {
|
|
115
|
-
if (!path) {
|
|
116
|
-
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
117
|
-
}
|
|
118
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
119
|
-
const headers = {};
|
|
120
|
-
const queryParameters = parameters ? parameters : {};
|
|
121
|
-
const request = {
|
|
122
|
-
method: 'POST',
|
|
123
|
-
path: requestPath,
|
|
124
|
-
queryParameters,
|
|
125
|
-
headers,
|
|
126
|
-
data: body ? body : {},
|
|
127
|
-
};
|
|
128
|
-
return transporter.request(request, requestOptions);
|
|
129
|
-
},
|
|
130
|
-
/**
|
|
131
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
132
|
-
*
|
|
133
|
-
* @param customPut - The customPut object.
|
|
134
|
-
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
135
|
-
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
136
|
-
* @param customPut.body - Parameters to send with the custom request.
|
|
137
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
138
|
-
*/
|
|
139
|
-
customPut({ path, parameters, body }, requestOptions) {
|
|
140
|
-
if (!path) {
|
|
141
|
-
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
142
|
-
}
|
|
143
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
144
|
-
const headers = {};
|
|
145
|
-
const queryParameters = parameters ? parameters : {};
|
|
146
|
-
const request = {
|
|
147
|
-
method: 'PUT',
|
|
148
|
-
path: requestPath,
|
|
149
|
-
queryParameters,
|
|
150
|
-
headers,
|
|
151
|
-
data: body ? body : {},
|
|
152
|
-
};
|
|
153
|
-
return transporter.request(request, requestOptions);
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* Retrieves known incidents for the selected clusters.
|
|
157
|
-
*
|
|
158
|
-
* @param getClusterIncidents - The getClusterIncidents object.
|
|
159
|
-
* @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
|
|
160
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
161
|
-
*/
|
|
162
|
-
getClusterIncidents({ clusters }, requestOptions) {
|
|
163
|
-
if (!clusters) {
|
|
164
|
-
throw new Error('Parameter `clusters` is required when calling `getClusterIncidents`.');
|
|
165
|
-
}
|
|
166
|
-
const requestPath = '/1/incidents/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));
|
|
167
|
-
const headers = {};
|
|
168
|
-
const queryParameters = {};
|
|
169
|
-
const request = {
|
|
170
|
-
method: 'GET',
|
|
171
|
-
path: requestPath,
|
|
172
|
-
queryParameters,
|
|
173
|
-
headers,
|
|
174
|
-
};
|
|
175
|
-
return transporter.request(request, requestOptions);
|
|
176
|
-
},
|
|
177
|
-
/**
|
|
178
|
-
* Retrieves the status of selected clusters.
|
|
179
|
-
*
|
|
180
|
-
* @param getClusterStatus - The getClusterStatus object.
|
|
181
|
-
* @param getClusterStatus.clusters - Subset of clusters, separated by comma.
|
|
182
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
183
|
-
*/
|
|
184
|
-
getClusterStatus({ clusters }, requestOptions) {
|
|
185
|
-
if (!clusters) {
|
|
186
|
-
throw new Error('Parameter `clusters` is required when calling `getClusterStatus`.');
|
|
187
|
-
}
|
|
188
|
-
const requestPath = '/1/status/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));
|
|
189
|
-
const headers = {};
|
|
190
|
-
const queryParameters = {};
|
|
191
|
-
const request = {
|
|
192
|
-
method: 'GET',
|
|
193
|
-
path: requestPath,
|
|
194
|
-
queryParameters,
|
|
195
|
-
headers,
|
|
196
|
-
};
|
|
197
|
-
return transporter.request(request, requestOptions);
|
|
198
|
-
},
|
|
199
|
-
/**
|
|
200
|
-
* Retrieves known incidents for all clusters.
|
|
201
|
-
*
|
|
202
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
203
|
-
*/
|
|
204
|
-
getIncidents(requestOptions) {
|
|
205
|
-
const requestPath = '/1/incidents';
|
|
206
|
-
const headers = {};
|
|
207
|
-
const queryParameters = {};
|
|
208
|
-
const request = {
|
|
209
|
-
method: 'GET',
|
|
210
|
-
path: requestPath,
|
|
211
|
-
queryParameters,
|
|
212
|
-
headers,
|
|
213
|
-
};
|
|
214
|
-
return transporter.request(request, requestOptions);
|
|
215
|
-
},
|
|
216
|
-
/**
|
|
217
|
-
* Retrieves average times for indexing operations for selected clusters.
|
|
218
|
-
*
|
|
219
|
-
* @param getIndexingTime - The getIndexingTime object.
|
|
220
|
-
* @param getIndexingTime.clusters - Subset of clusters, separated by comma.
|
|
221
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
222
|
-
*/
|
|
223
|
-
getIndexingTime({ clusters }, requestOptions) {
|
|
224
|
-
if (!clusters) {
|
|
225
|
-
throw new Error('Parameter `clusters` is required when calling `getIndexingTime`.');
|
|
226
|
-
}
|
|
227
|
-
const requestPath = '/1/indexing/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));
|
|
228
|
-
const headers = {};
|
|
229
|
-
const queryParameters = {};
|
|
230
|
-
const request = {
|
|
231
|
-
method: 'GET',
|
|
232
|
-
path: requestPath,
|
|
233
|
-
queryParameters,
|
|
234
|
-
headers,
|
|
235
|
-
};
|
|
236
|
-
return transporter.request(request, requestOptions);
|
|
237
|
-
},
|
|
238
|
-
/**
|
|
239
|
-
* Retrieves the average latency for search requests for selected clusters.
|
|
240
|
-
*
|
|
241
|
-
* @param getLatency - The getLatency object.
|
|
242
|
-
* @param getLatency.clusters - Subset of clusters, separated by comma.
|
|
243
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
244
|
-
*/
|
|
245
|
-
getLatency({ clusters }, requestOptions) {
|
|
246
|
-
if (!clusters) {
|
|
247
|
-
throw new Error('Parameter `clusters` is required when calling `getLatency`.');
|
|
248
|
-
}
|
|
249
|
-
const requestPath = '/1/latency/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));
|
|
250
|
-
const headers = {};
|
|
251
|
-
const queryParameters = {};
|
|
252
|
-
const request = {
|
|
253
|
-
method: 'GET',
|
|
254
|
-
path: requestPath,
|
|
255
|
-
queryParameters,
|
|
256
|
-
headers,
|
|
257
|
-
};
|
|
258
|
-
return transporter.request(request, requestOptions);
|
|
259
|
-
},
|
|
260
|
-
/**
|
|
261
|
-
* 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).
|
|
262
|
-
*
|
|
263
|
-
* @param getMetrics - The getMetrics object.
|
|
264
|
-
* @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 `*`.
|
|
265
|
-
* @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.
|
|
266
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
267
|
-
*/
|
|
268
|
-
getMetrics({ metric, period }, requestOptions) {
|
|
269
|
-
if (!metric) {
|
|
270
|
-
throw new Error('Parameter `metric` is required when calling `getMetrics`.');
|
|
271
|
-
}
|
|
272
|
-
if (!period) {
|
|
273
|
-
throw new Error('Parameter `period` is required when calling `getMetrics`.');
|
|
274
|
-
}
|
|
275
|
-
const requestPath = '/1/infrastructure/{metric}/period/{period}'
|
|
276
|
-
.replace('{metric}', encodeURIComponent(metric))
|
|
277
|
-
.replace('{period}', encodeURIComponent(period));
|
|
278
|
-
const headers = {};
|
|
279
|
-
const queryParameters = {};
|
|
280
|
-
const request = {
|
|
281
|
-
method: 'GET',
|
|
282
|
-
path: requestPath,
|
|
283
|
-
queryParameters,
|
|
284
|
-
headers,
|
|
285
|
-
};
|
|
286
|
-
return transporter.request(request, requestOptions);
|
|
287
|
-
},
|
|
288
|
-
/**
|
|
289
|
-
* Test whether clusters are reachable or not.
|
|
290
|
-
*
|
|
291
|
-
* @param getReachability - The getReachability object.
|
|
292
|
-
* @param getReachability.clusters - Subset of clusters, separated by comma.
|
|
293
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
294
|
-
*/
|
|
295
|
-
getReachability({ clusters }, requestOptions) {
|
|
296
|
-
if (!clusters) {
|
|
297
|
-
throw new Error('Parameter `clusters` is required when calling `getReachability`.');
|
|
298
|
-
}
|
|
299
|
-
const requestPath = '/1/reachability/{clusters}/probes'.replace('{clusters}', encodeURIComponent(clusters));
|
|
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
|
-
* 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.
|
|
312
|
-
*
|
|
313
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
314
|
-
*/
|
|
315
|
-
getServers(requestOptions) {
|
|
316
|
-
const requestPath = '/1/inventory/servers';
|
|
317
|
-
const headers = {};
|
|
318
|
-
const queryParameters = {};
|
|
319
|
-
const request = {
|
|
320
|
-
method: 'GET',
|
|
321
|
-
path: requestPath,
|
|
322
|
-
queryParameters,
|
|
323
|
-
headers,
|
|
324
|
-
};
|
|
325
|
-
return transporter.request(request, requestOptions);
|
|
326
|
-
},
|
|
327
|
-
/**
|
|
328
|
-
* Retrieves the status of all Algolia clusters and instances.
|
|
329
|
-
*
|
|
330
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
331
|
-
*/
|
|
332
|
-
getStatus(requestOptions) {
|
|
333
|
-
const requestPath = '/1/status';
|
|
334
|
-
const headers = {};
|
|
335
|
-
const queryParameters = {};
|
|
336
|
-
const request = {
|
|
337
|
-
method: 'GET',
|
|
338
|
-
path: requestPath,
|
|
339
|
-
queryParameters,
|
|
340
|
-
headers,
|
|
341
|
-
};
|
|
342
|
-
return transporter.request(request, requestOptions);
|
|
343
|
-
},
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
// 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.
|
|
348
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
349
|
-
function monitoringClient(appId, apiKey, options) {
|
|
350
|
-
if (!appId || typeof appId !== 'string') {
|
|
351
|
-
throw new Error('`appId` is missing.');
|
|
352
|
-
}
|
|
353
|
-
if (!apiKey || typeof apiKey !== 'string') {
|
|
354
|
-
throw new Error('`apiKey` is missing.');
|
|
355
|
-
}
|
|
356
|
-
return {
|
|
357
|
-
...createMonitoringClient({
|
|
358
|
-
appId,
|
|
359
|
-
apiKey,
|
|
360
|
-
timeouts: {
|
|
361
|
-
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
362
|
-
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
363
|
-
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
364
|
-
},
|
|
365
|
-
requester: requesterNodeHttp.createHttpRequester(),
|
|
366
|
-
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
367
|
-
responsesCache: clientCommon.createNullCache(),
|
|
368
|
-
requestsCache: clientCommon.createNullCache(),
|
|
369
|
-
hostsCache: clientCommon.createMemoryCache(),
|
|
370
|
-
...options,
|
|
371
|
-
}),
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
exports.apiClientVersion = apiClientVersion;
|
|
376
|
-
exports.monitoringClient = monitoringClient;
|