@algolia/monitoring 1.0.0-alpha.18 → 1.0.0-alpha.25
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/model/clientMethodProps.d.ts +38 -38
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/monitoring.cjs +63 -63
- package/dist/monitoring.esm.browser.js +106 -82
- package/dist/monitoring.esm.node.js +63 -63
- package/dist/monitoring.umd.js +2 -2
- package/dist/src/monitoringClient.d.ts +32 -32
- package/dist/src/monitoringClient.d.ts.map +1 -1
- package/model/clientMethodProps.ts +40 -40
- package/package.json +7 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Metric } from './metric';
|
|
2
2
|
import type { Period } from './period';
|
|
3
3
|
/**
|
|
4
|
-
* Properties for the `
|
|
4
|
+
* Properties for the `customDelete` method.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type CustomDeleteProps = {
|
|
7
7
|
/**
|
|
8
8
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
9
9
|
*/
|
|
@@ -14,9 +14,9 @@ export type DelProps = {
|
|
|
14
14
|
parameters?: Record<string, any>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* Properties for the `
|
|
17
|
+
* Properties for the `customGet` method.
|
|
18
18
|
*/
|
|
19
|
-
export type
|
|
19
|
+
export type CustomGetProps = {
|
|
20
20
|
/**
|
|
21
21
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
22
22
|
*/
|
|
@@ -26,6 +26,40 @@ export type GetProps = {
|
|
|
26
26
|
*/
|
|
27
27
|
parameters?: Record<string, any>;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Properties for the `customPost` method.
|
|
31
|
+
*/
|
|
32
|
+
export type CustomPostProps = {
|
|
33
|
+
/**
|
|
34
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
35
|
+
*/
|
|
36
|
+
path: string;
|
|
37
|
+
/**
|
|
38
|
+
* Query parameters to apply to the current query.
|
|
39
|
+
*/
|
|
40
|
+
parameters?: Record<string, any>;
|
|
41
|
+
/**
|
|
42
|
+
* Parameters to send with the custom request.
|
|
43
|
+
*/
|
|
44
|
+
body?: Record<string, any>;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Properties for the `customPut` method.
|
|
48
|
+
*/
|
|
49
|
+
export type CustomPutProps = {
|
|
50
|
+
/**
|
|
51
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
52
|
+
*/
|
|
53
|
+
path: string;
|
|
54
|
+
/**
|
|
55
|
+
* Query parameters to apply to the current query.
|
|
56
|
+
*/
|
|
57
|
+
parameters?: Record<string, any>;
|
|
58
|
+
/**
|
|
59
|
+
* Parameters to send with the custom request.
|
|
60
|
+
*/
|
|
61
|
+
body?: Record<string, any>;
|
|
62
|
+
};
|
|
29
63
|
/**
|
|
30
64
|
* Properties for the `getClusterIncidents` method.
|
|
31
65
|
*/
|
|
@@ -84,38 +118,4 @@ export type GetReachabilityProps = {
|
|
|
84
118
|
*/
|
|
85
119
|
clusters: string;
|
|
86
120
|
};
|
|
87
|
-
/**
|
|
88
|
-
* Properties for the `post` method.
|
|
89
|
-
*/
|
|
90
|
-
export type PostProps = {
|
|
91
|
-
/**
|
|
92
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
93
|
-
*/
|
|
94
|
-
path: string;
|
|
95
|
-
/**
|
|
96
|
-
* Query parameters to apply to the current query.
|
|
97
|
-
*/
|
|
98
|
-
parameters?: Record<string, any>;
|
|
99
|
-
/**
|
|
100
|
-
* Parameters to send with the custom request.
|
|
101
|
-
*/
|
|
102
|
-
body?: Record<string, any>;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Properties for the `put` method.
|
|
106
|
-
*/
|
|
107
|
-
export type PutProps = {
|
|
108
|
-
/**
|
|
109
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
110
|
-
*/
|
|
111
|
-
path: string;
|
|
112
|
-
/**
|
|
113
|
-
* Query parameters to apply to the current query.
|
|
114
|
-
*/
|
|
115
|
-
parameters?: Record<string, any>;
|
|
116
|
-
/**
|
|
117
|
-
* Parameters to send with the custom request.
|
|
118
|
-
*/
|
|
119
|
-
body?: Record<string, any>;
|
|
120
|
-
};
|
|
121
121
|
//# sourceMappingURL=clientMethodProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../model/clientMethodProps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../model/clientMethodProps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/dist/monitoring.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
|
|
|
4
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
5
|
|
|
6
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.0.0-alpha.
|
|
7
|
+
const apiClientVersion = '1.0.0-alpha.25';
|
|
8
8
|
function getDefaultHosts(appId) {
|
|
9
9
|
return [
|
|
10
10
|
{
|
|
@@ -90,14 +90,14 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
90
90
|
* This method allow you to send requests to the Algolia REST API.
|
|
91
91
|
*
|
|
92
92
|
* @summary Send requests to the Algolia REST API.
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
93
|
+
* @param customDelete - The customDelete object.
|
|
94
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
95
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
96
96
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
97
97
|
*/
|
|
98
|
-
|
|
98
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
99
99
|
if (!path) {
|
|
100
|
-
throw new Error('Parameter `path` is required when calling `
|
|
100
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
101
101
|
}
|
|
102
102
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
103
103
|
const headers = {};
|
|
@@ -114,14 +114,14 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
114
114
|
* This method allow you to send requests to the Algolia REST API.
|
|
115
115
|
*
|
|
116
116
|
* @summary Send requests to the Algolia REST API.
|
|
117
|
-
* @param
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
117
|
+
* @param customGet - The customGet object.
|
|
118
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
119
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
120
120
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
121
121
|
*/
|
|
122
|
-
|
|
122
|
+
customGet({ path, parameters }, requestOptions) {
|
|
123
123
|
if (!path) {
|
|
124
|
-
throw new Error('Parameter `path` is required when calling `
|
|
124
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
125
125
|
}
|
|
126
126
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
127
127
|
const headers = {};
|
|
@@ -134,6 +134,58 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
134
134
|
};
|
|
135
135
|
return transporter.request(request, requestOptions);
|
|
136
136
|
},
|
|
137
|
+
/**
|
|
138
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
139
|
+
*
|
|
140
|
+
* @summary Send requests to the Algolia REST API.
|
|
141
|
+
* @param customPost - The customPost object.
|
|
142
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
143
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
144
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
145
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
146
|
+
*/
|
|
147
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
148
|
+
if (!path) {
|
|
149
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
150
|
+
}
|
|
151
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
152
|
+
const headers = {};
|
|
153
|
+
const queryParameters = parameters ? parameters : {};
|
|
154
|
+
const request = {
|
|
155
|
+
method: 'POST',
|
|
156
|
+
path: requestPath,
|
|
157
|
+
queryParameters,
|
|
158
|
+
headers,
|
|
159
|
+
data: body ? body : {},
|
|
160
|
+
};
|
|
161
|
+
return transporter.request(request, requestOptions);
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
165
|
+
*
|
|
166
|
+
* @summary Send requests to the Algolia REST API.
|
|
167
|
+
* @param customPut - The customPut object.
|
|
168
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
169
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
170
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
171
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
172
|
+
*/
|
|
173
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
174
|
+
if (!path) {
|
|
175
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
176
|
+
}
|
|
177
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
178
|
+
const headers = {};
|
|
179
|
+
const queryParameters = parameters ? parameters : {};
|
|
180
|
+
const request = {
|
|
181
|
+
method: 'PUT',
|
|
182
|
+
path: requestPath,
|
|
183
|
+
queryParameters,
|
|
184
|
+
headers,
|
|
185
|
+
data: body ? body : {},
|
|
186
|
+
};
|
|
187
|
+
return transporter.request(request, requestOptions);
|
|
188
|
+
},
|
|
137
189
|
/**
|
|
138
190
|
* List known incidents for selected clusters.
|
|
139
191
|
*
|
|
@@ -332,58 +384,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
332
384
|
};
|
|
333
385
|
return transporter.request(request, requestOptions);
|
|
334
386
|
},
|
|
335
|
-
/**
|
|
336
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
337
|
-
*
|
|
338
|
-
* @summary Send requests to the Algolia REST API.
|
|
339
|
-
* @param post - The post object.
|
|
340
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
341
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
342
|
-
* @param post.body - Parameters to send with the custom request.
|
|
343
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
344
|
-
*/
|
|
345
|
-
post({ path, parameters, body }, requestOptions) {
|
|
346
|
-
if (!path) {
|
|
347
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
348
|
-
}
|
|
349
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
350
|
-
const headers = {};
|
|
351
|
-
const queryParameters = parameters ? parameters : {};
|
|
352
|
-
const request = {
|
|
353
|
-
method: 'POST',
|
|
354
|
-
path: requestPath,
|
|
355
|
-
queryParameters,
|
|
356
|
-
headers,
|
|
357
|
-
data: body ? body : {},
|
|
358
|
-
};
|
|
359
|
-
return transporter.request(request, requestOptions);
|
|
360
|
-
},
|
|
361
|
-
/**
|
|
362
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
363
|
-
*
|
|
364
|
-
* @summary Send requests to the Algolia REST API.
|
|
365
|
-
* @param put - The put object.
|
|
366
|
-
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
367
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
368
|
-
* @param put.body - Parameters to send with the custom request.
|
|
369
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
370
|
-
*/
|
|
371
|
-
put({ path, parameters, body }, requestOptions) {
|
|
372
|
-
if (!path) {
|
|
373
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
374
|
-
}
|
|
375
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
376
|
-
const headers = {};
|
|
377
|
-
const queryParameters = parameters ? parameters : {};
|
|
378
|
-
const request = {
|
|
379
|
-
method: 'PUT',
|
|
380
|
-
path: requestPath,
|
|
381
|
-
queryParameters,
|
|
382
|
-
headers,
|
|
383
|
-
data: body ? body : {},
|
|
384
|
-
};
|
|
385
|
-
return transporter.request(request, requestOptions);
|
|
386
|
-
},
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
|
|
@@ -26,14 +26,35 @@ function createBrowserLocalStorageCache(options) {
|
|
|
26
26
|
function getNamespace() {
|
|
27
27
|
return JSON.parse(getStorage().getItem(namespaceKey) || '{}');
|
|
28
28
|
}
|
|
29
|
+
function setNamespace(namespace) {
|
|
30
|
+
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
31
|
+
}
|
|
32
|
+
function removeOutdatedCacheItems() {
|
|
33
|
+
const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;
|
|
34
|
+
const namespace = getNamespace();
|
|
35
|
+
const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {
|
|
36
|
+
return cacheItem.timestamp !== undefined;
|
|
37
|
+
}));
|
|
38
|
+
setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);
|
|
39
|
+
if (!timeToLive) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {
|
|
43
|
+
const currentTimestamp = new Date().getTime();
|
|
44
|
+
const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;
|
|
45
|
+
return !isExpired;
|
|
46
|
+
}));
|
|
47
|
+
setNamespace(filteredNamespaceWithoutExpiredItems);
|
|
48
|
+
}
|
|
29
49
|
return {
|
|
30
50
|
get(key, defaultValue, events = {
|
|
31
51
|
miss: () => Promise.resolve()
|
|
32
52
|
}) {
|
|
33
53
|
return Promise.resolve().then(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
removeOutdatedCacheItems();
|
|
55
|
+
return getNamespace()[JSON.stringify(key)];
|
|
56
|
+
}).then(value => {
|
|
57
|
+
return Promise.all([value ? value.value : defaultValue(), value !== undefined]);
|
|
37
58
|
}).then(([value, exists]) => {
|
|
38
59
|
return Promise.all([value, exists || events.miss(value)]);
|
|
39
60
|
}).then(([value]) => value);
|
|
@@ -41,7 +62,10 @@ function createBrowserLocalStorageCache(options) {
|
|
|
41
62
|
set(key, value) {
|
|
42
63
|
return Promise.resolve().then(() => {
|
|
43
64
|
const namespace = getNamespace();
|
|
44
|
-
namespace[JSON.stringify(key)] =
|
|
65
|
+
namespace[JSON.stringify(key)] = {
|
|
66
|
+
timestamp: new Date().getTime(),
|
|
67
|
+
value
|
|
68
|
+
};
|
|
45
69
|
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
46
70
|
return value;
|
|
47
71
|
});
|
|
@@ -171,6 +195,20 @@ function createStatefulHost(host, status = 'up') {
|
|
|
171
195
|
};
|
|
172
196
|
}
|
|
173
197
|
|
|
198
|
+
function _toPrimitive(t, r) {
|
|
199
|
+
if ("object" != typeof t || !t) return t;
|
|
200
|
+
var e = t[Symbol.toPrimitive];
|
|
201
|
+
if (void 0 !== e) {
|
|
202
|
+
var i = e.call(t, r || "default");
|
|
203
|
+
if ("object" != typeof i) return i;
|
|
204
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
205
|
+
}
|
|
206
|
+
return ("string" === r ? String : Number)(t);
|
|
207
|
+
}
|
|
208
|
+
function _toPropertyKey(t) {
|
|
209
|
+
var i = _toPrimitive(t, "string");
|
|
210
|
+
return "symbol" == typeof i ? i : String(i);
|
|
211
|
+
}
|
|
174
212
|
function _defineProperty(obj, key, value) {
|
|
175
213
|
key = _toPropertyKey(key);
|
|
176
214
|
if (key in obj) {
|
|
@@ -185,20 +223,6 @@ function _defineProperty(obj, key, value) {
|
|
|
185
223
|
}
|
|
186
224
|
return obj;
|
|
187
225
|
}
|
|
188
|
-
function _toPrimitive(input, hint) {
|
|
189
|
-
if (typeof input !== "object" || input === null) return input;
|
|
190
|
-
var prim = input[Symbol.toPrimitive];
|
|
191
|
-
if (prim !== undefined) {
|
|
192
|
-
var res = prim.call(input, hint || "default");
|
|
193
|
-
if (typeof res !== "object") return res;
|
|
194
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
195
|
-
}
|
|
196
|
-
return (hint === "string" ? String : Number)(input);
|
|
197
|
-
}
|
|
198
|
-
function _toPropertyKey(arg) {
|
|
199
|
-
var key = _toPrimitive(arg, "string");
|
|
200
|
-
return typeof key === "symbol" ? key : String(key);
|
|
201
|
-
}
|
|
202
226
|
|
|
203
227
|
class AlgoliaError extends Error {
|
|
204
228
|
constructor(message, name) {
|
|
@@ -219,7 +243,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
219
243
|
}
|
|
220
244
|
class RetryError extends ErrorWithStackTrace {
|
|
221
245
|
constructor(stackTrace) {
|
|
222
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists,
|
|
246
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.', stackTrace, 'RetryError');
|
|
223
247
|
}
|
|
224
248
|
}
|
|
225
249
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -673,7 +697,7 @@ function createXhrRequester() {
|
|
|
673
697
|
}
|
|
674
698
|
|
|
675
699
|
// 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.
|
|
676
|
-
const apiClientVersion = '1.0.0-alpha.
|
|
700
|
+
const apiClientVersion = '1.0.0-alpha.25';
|
|
677
701
|
function getDefaultHosts(appId) {
|
|
678
702
|
return [
|
|
679
703
|
{
|
|
@@ -759,14 +783,14 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
759
783
|
* This method allow you to send requests to the Algolia REST API.
|
|
760
784
|
*
|
|
761
785
|
* @summary Send requests to the Algolia REST API.
|
|
762
|
-
* @param
|
|
763
|
-
* @param
|
|
764
|
-
* @param
|
|
786
|
+
* @param customDelete - The customDelete object.
|
|
787
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
788
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
765
789
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
766
790
|
*/
|
|
767
|
-
|
|
791
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
768
792
|
if (!path) {
|
|
769
|
-
throw new Error('Parameter `path` is required when calling `
|
|
793
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
770
794
|
}
|
|
771
795
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
772
796
|
const headers = {};
|
|
@@ -783,14 +807,14 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
783
807
|
* This method allow you to send requests to the Algolia REST API.
|
|
784
808
|
*
|
|
785
809
|
* @summary Send requests to the Algolia REST API.
|
|
786
|
-
* @param
|
|
787
|
-
* @param
|
|
788
|
-
* @param
|
|
810
|
+
* @param customGet - The customGet object.
|
|
811
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
812
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
789
813
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
790
814
|
*/
|
|
791
|
-
|
|
815
|
+
customGet({ path, parameters }, requestOptions) {
|
|
792
816
|
if (!path) {
|
|
793
|
-
throw new Error('Parameter `path` is required when calling `
|
|
817
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
794
818
|
}
|
|
795
819
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
796
820
|
const headers = {};
|
|
@@ -803,6 +827,58 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
803
827
|
};
|
|
804
828
|
return transporter.request(request, requestOptions);
|
|
805
829
|
},
|
|
830
|
+
/**
|
|
831
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
832
|
+
*
|
|
833
|
+
* @summary Send requests to the Algolia REST API.
|
|
834
|
+
* @param customPost - The customPost object.
|
|
835
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
836
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
837
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
838
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
839
|
+
*/
|
|
840
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
841
|
+
if (!path) {
|
|
842
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
843
|
+
}
|
|
844
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
845
|
+
const headers = {};
|
|
846
|
+
const queryParameters = parameters ? parameters : {};
|
|
847
|
+
const request = {
|
|
848
|
+
method: 'POST',
|
|
849
|
+
path: requestPath,
|
|
850
|
+
queryParameters,
|
|
851
|
+
headers,
|
|
852
|
+
data: body ? body : {},
|
|
853
|
+
};
|
|
854
|
+
return transporter.request(request, requestOptions);
|
|
855
|
+
},
|
|
856
|
+
/**
|
|
857
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
858
|
+
*
|
|
859
|
+
* @summary Send requests to the Algolia REST API.
|
|
860
|
+
* @param customPut - The customPut object.
|
|
861
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
862
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
863
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
864
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
865
|
+
*/
|
|
866
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
867
|
+
if (!path) {
|
|
868
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
869
|
+
}
|
|
870
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
871
|
+
const headers = {};
|
|
872
|
+
const queryParameters = parameters ? parameters : {};
|
|
873
|
+
const request = {
|
|
874
|
+
method: 'PUT',
|
|
875
|
+
path: requestPath,
|
|
876
|
+
queryParameters,
|
|
877
|
+
headers,
|
|
878
|
+
data: body ? body : {},
|
|
879
|
+
};
|
|
880
|
+
return transporter.request(request, requestOptions);
|
|
881
|
+
},
|
|
806
882
|
/**
|
|
807
883
|
* List known incidents for selected clusters.
|
|
808
884
|
*
|
|
@@ -1001,58 +1077,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
1001
1077
|
};
|
|
1002
1078
|
return transporter.request(request, requestOptions);
|
|
1003
1079
|
},
|
|
1004
|
-
/**
|
|
1005
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
1006
|
-
*
|
|
1007
|
-
* @summary Send requests to the Algolia REST API.
|
|
1008
|
-
* @param post - The post object.
|
|
1009
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1010
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
1011
|
-
* @param post.body - Parameters to send with the custom request.
|
|
1012
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1013
|
-
*/
|
|
1014
|
-
post({ path, parameters, body }, requestOptions) {
|
|
1015
|
-
if (!path) {
|
|
1016
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
1017
|
-
}
|
|
1018
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1019
|
-
const headers = {};
|
|
1020
|
-
const queryParameters = parameters ? parameters : {};
|
|
1021
|
-
const request = {
|
|
1022
|
-
method: 'POST',
|
|
1023
|
-
path: requestPath,
|
|
1024
|
-
queryParameters,
|
|
1025
|
-
headers,
|
|
1026
|
-
data: body ? body : {},
|
|
1027
|
-
};
|
|
1028
|
-
return transporter.request(request, requestOptions);
|
|
1029
|
-
},
|
|
1030
|
-
/**
|
|
1031
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
1032
|
-
*
|
|
1033
|
-
* @summary Send requests to the Algolia REST API.
|
|
1034
|
-
* @param put - The put object.
|
|
1035
|
-
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1036
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
1037
|
-
* @param put.body - Parameters to send with the custom request.
|
|
1038
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1039
|
-
*/
|
|
1040
|
-
put({ path, parameters, body }, requestOptions) {
|
|
1041
|
-
if (!path) {
|
|
1042
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
1043
|
-
}
|
|
1044
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1045
|
-
const headers = {};
|
|
1046
|
-
const queryParameters = parameters ? parameters : {};
|
|
1047
|
-
const request = {
|
|
1048
|
-
method: 'PUT',
|
|
1049
|
-
path: requestPath,
|
|
1050
|
-
queryParameters,
|
|
1051
|
-
headers,
|
|
1052
|
-
data: body ? body : {},
|
|
1053
|
-
};
|
|
1054
|
-
return transporter.request(request, requestOptions);
|
|
1055
|
-
},
|
|
1056
1080
|
};
|
|
1057
1081
|
}
|
|
1058
1082
|
|
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, shuffle, DEFAULT_CONNEC
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// 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.
|
|
5
|
-
const apiClientVersion = '1.0.0-alpha.
|
|
5
|
+
const apiClientVersion = '1.0.0-alpha.25';
|
|
6
6
|
function getDefaultHosts(appId) {
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
@@ -88,14 +88,14 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
88
88
|
* This method allow you to send requests to the Algolia REST API.
|
|
89
89
|
*
|
|
90
90
|
* @summary Send requests to the Algolia REST API.
|
|
91
|
-
* @param
|
|
92
|
-
* @param
|
|
93
|
-
* @param
|
|
91
|
+
* @param customDelete - The customDelete object.
|
|
92
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
93
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
94
94
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
95
95
|
*/
|
|
96
|
-
|
|
96
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
97
97
|
if (!path) {
|
|
98
|
-
throw new Error('Parameter `path` is required when calling `
|
|
98
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
99
99
|
}
|
|
100
100
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
101
101
|
const headers = {};
|
|
@@ -112,14 +112,14 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
112
112
|
* This method allow you to send requests to the Algolia REST API.
|
|
113
113
|
*
|
|
114
114
|
* @summary Send requests to the Algolia REST API.
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @param
|
|
115
|
+
* @param customGet - The customGet object.
|
|
116
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
117
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
118
118
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
customGet({ path, parameters }, requestOptions) {
|
|
121
121
|
if (!path) {
|
|
122
|
-
throw new Error('Parameter `path` is required when calling `
|
|
122
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
123
123
|
}
|
|
124
124
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
125
125
|
const headers = {};
|
|
@@ -132,6 +132,58 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
132
132
|
};
|
|
133
133
|
return transporter.request(request, requestOptions);
|
|
134
134
|
},
|
|
135
|
+
/**
|
|
136
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
137
|
+
*
|
|
138
|
+
* @summary Send requests to the Algolia REST API.
|
|
139
|
+
* @param customPost - The customPost object.
|
|
140
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
141
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
142
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
143
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
144
|
+
*/
|
|
145
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
146
|
+
if (!path) {
|
|
147
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
148
|
+
}
|
|
149
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
150
|
+
const headers = {};
|
|
151
|
+
const queryParameters = parameters ? parameters : {};
|
|
152
|
+
const request = {
|
|
153
|
+
method: 'POST',
|
|
154
|
+
path: requestPath,
|
|
155
|
+
queryParameters,
|
|
156
|
+
headers,
|
|
157
|
+
data: body ? body : {},
|
|
158
|
+
};
|
|
159
|
+
return transporter.request(request, requestOptions);
|
|
160
|
+
},
|
|
161
|
+
/**
|
|
162
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
163
|
+
*
|
|
164
|
+
* @summary Send requests to the Algolia REST API.
|
|
165
|
+
* @param customPut - The customPut object.
|
|
166
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
167
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
168
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
169
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
170
|
+
*/
|
|
171
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
172
|
+
if (!path) {
|
|
173
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
174
|
+
}
|
|
175
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
176
|
+
const headers = {};
|
|
177
|
+
const queryParameters = parameters ? parameters : {};
|
|
178
|
+
const request = {
|
|
179
|
+
method: 'PUT',
|
|
180
|
+
path: requestPath,
|
|
181
|
+
queryParameters,
|
|
182
|
+
headers,
|
|
183
|
+
data: body ? body : {},
|
|
184
|
+
};
|
|
185
|
+
return transporter.request(request, requestOptions);
|
|
186
|
+
},
|
|
135
187
|
/**
|
|
136
188
|
* List known incidents for selected clusters.
|
|
137
189
|
*
|
|
@@ -330,58 +382,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
330
382
|
};
|
|
331
383
|
return transporter.request(request, requestOptions);
|
|
332
384
|
},
|
|
333
|
-
/**
|
|
334
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
335
|
-
*
|
|
336
|
-
* @summary Send requests to the Algolia REST API.
|
|
337
|
-
* @param post - The post object.
|
|
338
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
339
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
340
|
-
* @param post.body - Parameters to send with the custom request.
|
|
341
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
342
|
-
*/
|
|
343
|
-
post({ path, parameters, body }, requestOptions) {
|
|
344
|
-
if (!path) {
|
|
345
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
346
|
-
}
|
|
347
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
348
|
-
const headers = {};
|
|
349
|
-
const queryParameters = parameters ? parameters : {};
|
|
350
|
-
const request = {
|
|
351
|
-
method: 'POST',
|
|
352
|
-
path: requestPath,
|
|
353
|
-
queryParameters,
|
|
354
|
-
headers,
|
|
355
|
-
data: body ? body : {},
|
|
356
|
-
};
|
|
357
|
-
return transporter.request(request, requestOptions);
|
|
358
|
-
},
|
|
359
|
-
/**
|
|
360
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
361
|
-
*
|
|
362
|
-
* @summary Send requests to the Algolia REST API.
|
|
363
|
-
* @param put - The put object.
|
|
364
|
-
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
365
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
366
|
-
* @param put.body - Parameters to send with the custom request.
|
|
367
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
368
|
-
*/
|
|
369
|
-
put({ path, parameters, body }, requestOptions) {
|
|
370
|
-
if (!path) {
|
|
371
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
372
|
-
}
|
|
373
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
374
|
-
const headers = {};
|
|
375
|
-
const queryParameters = parameters ? parameters : {};
|
|
376
|
-
const request = {
|
|
377
|
-
method: 'PUT',
|
|
378
|
-
path: requestPath,
|
|
379
|
-
queryParameters,
|
|
380
|
-
headers,
|
|
381
|
-
data: body ? body : {},
|
|
382
|
-
};
|
|
383
|
-
return transporter.request(request, requestOptions);
|
|
384
|
-
},
|
|
385
385
|
};
|
|
386
386
|
}
|
|
387
387
|
|
package/dist/monitoring.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! monitoring.umd.js | 1.0.0-alpha.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/monitoring"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class h extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class d extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,f=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,g),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,g.headers),q="GET"===c.method?{...c.data,...g.data}:{},v={...s,...c.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?v[e]=g.queryParameters[e].toString():v[e]=g.queryParameters[e];let b=0;const T=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>p(e)))}(y));let a=g.timeout;void 0===a&&(a=f?o.read:o.write);const q={data:P,headers:w,method:c.method,url:m(s,c.path,v),connectTimeout:r(b,o.connect),responseTimeout:r(b,a)},E=t=>{const r={request:q,response:t,host:s,triesLeft:e.length};return y.push(r),r},O=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(O)){const a=E(O);return O.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(s,n(s,O.isTimedOut?"timed out":"down")),T(e,r)}if(function({status:e}){return 2==~~(e/100)}(O))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(O);throw E(O),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new d(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(O,y)},E=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),O=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(E);return T([...O.hosts].reverse(),O.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const n=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return g.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(o,e)})},requestsCache:c,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="1.0.0-alpha.18";function P(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const s=Math.floor(Math.random()*(r+1)),a=e[r];t[r]=e[s],t[s]=a}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=y,e.monitoringClient=function(e,a,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,...a}){const n=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),o=g({hosts:P(e),...a,algoliaAgent:f({algoliaAgents:s,client:"Monitoring",version:y}),baseHeaders:{"content-type":"text/plain",...n.headers(),...a.baseHeaders},baseQueryParameters:{...n.queryParameters(),...a.baseQueryParameters}});return{transporter:o,appId:e,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((()=>{})),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,t){o.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return o.request(s,r)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return o.request(s,r)},getClusterIncidents({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");const r={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getClusterStatus({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");const r={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getIncidents(e){const t={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return o.request(t,e)},getIndexingTime({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");const r={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getInventory(e){const t={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return o.request(t,e)},getLatency({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getLatency`.");const r={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getMetrics({metric:e,period:t},r){if(!e)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!t)throw new Error("Parameter `period` is required when calling `getMetrics`.");const s={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(e)).replace("{period}",encodeURIComponent(t)),queryParameters:{},headers:{}};return o.request(s,r)},getReachability({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getReachability`.");const r={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getStatus(e){const t={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return o.request(t,e)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return o.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return o.request(a,s)}}}({appId:e,apiKey:a,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...n})}}));
|
|
1
|
+
/*! monitoring.umd.js | 1.0.0-alpha.25 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/monitoring"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}function n(e){s().setItem(r,JSON.stringify(e))}return{get:(t,r,s={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=a(),s=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(n(s),!t)return;n(Object.fromEntries(Object.entries(s).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),a()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||s.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function i(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.",e,"RetryError")}}class h extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),i(this,"status",void 0),this.status=t}}class m extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class d extends h{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function p(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function g(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:u}){async function f(c,u,f=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,u),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,u.headers),q="GET"===c.method?{...c.data,...u.data}:{},v={...s,...c.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?v[e]=u.queryParameters[e].toString():v[e]=u.queryParameters[e];let b=0;const T=async(e,r)=>{const s=e.pop();if(void 0===s)throw new l(function(e){return e.map((e=>g(e)))}(y));let a=u.timeout;void 0===a&&(a=f?o.read:o.write);const q={data:P,headers:w,method:c.method,url:p(s,c.path,v),connectTimeout:r(b,o.connect),responseTimeout:r(b,a)},O=t=>{const r={request:q,response:t,host:s,triesLeft:e.length};return y.push(r),r},E=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const a=O(E);return E.isTimedOut&&b++,console.log("Retryable failure",g(a)),await t.set(s,n(s,E.isTimedOut?"timed out":"down")),T(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new m(t.message,e)}}(E);throw O(E),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new d(s.message,t,s.error,r):new h(s.message,t,r)}catch(e){}return new h(e,t,r)}(E,y)},O=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return T([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const n=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return u.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(o,e)})},requestsCache:c,responsesCache:u}}function y({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const P="1.0.0-alpha.25";function w(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const s=Math.floor(Math.random()*(r+1)),a=e[r];t[r]=e[s],t[s]=a}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=P,e.monitoringClient=function(e,a,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,...a}){const n=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),o=f({hosts:w(e),...a,algoliaAgent:y({algoliaAgents:s,client:"Monitoring",version:P}),baseHeaders:{"content-type":"text/plain",...n.headers(),...a.baseHeaders},baseQueryParameters:{...n.queryParameters(),...a.baseQueryParameters}});return{transporter:o,appId:e,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((()=>{})),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,t){o.algoliaAgent.add({segment:e,version:t})},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return o.request(s,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return o.request(s,r)},customPost({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return o.request(a,s)},customPut({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return o.request(a,s)},getClusterIncidents({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");const r={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getClusterStatus({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");const r={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getIncidents(e){const t={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return o.request(t,e)},getIndexingTime({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");const r={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getInventory(e){const t={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return o.request(t,e)},getLatency({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getLatency`.");const r={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getMetrics({metric:e,period:t},r){if(!e)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!t)throw new Error("Parameter `period` is required when calling `getMetrics`.");const s={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(e)).replace("{period}",encodeURIComponent(t)),queryParameters:{},headers:{}};return o.request(s,r)},getReachability({clusters:e},t){if(!e)throw new Error("Parameter `clusters` is required when calling `getReachability`.");const r={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(r,t)},getStatus(e){const t={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return o.request(t,e)}}}({appId:e,apiKey:a,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${P}-${e}`}),s()]}),...n})}}));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, GetClusterIncidentsProps, GetClusterStatusProps, GetIndexingTimeProps, GetLatencyProps, GetMetricsProps, GetReachabilityProps } from '../model/clientMethodProps';
|
|
3
3
|
import type { IncidentsResponse } from '../model/incidentsResponse';
|
|
4
4
|
import type { IndexingTimeResponse } from '../model/indexingTimeResponse';
|
|
5
5
|
import type { InfrastructureResponse } from '../model/infrastructureResponse';
|
|
6
6
|
import type { InventoryResponse } from '../model/inventoryResponse';
|
|
7
7
|
import type { LatencyResponse } from '../model/latencyResponse';
|
|
8
8
|
import type { StatusResponse } from '../model/statusResponse';
|
|
9
|
-
export declare const apiClientVersion = "1.0.0-alpha.
|
|
9
|
+
export declare const apiClientVersion = "1.0.0-alpha.25";
|
|
10
10
|
export declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
11
11
|
transporter: import("@algolia/client-common").Transporter;
|
|
12
12
|
/**
|
|
@@ -32,22 +32,44 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
32
32
|
* This method allow you to send requests to the Algolia REST API.
|
|
33
33
|
*
|
|
34
34
|
* @summary Send requests to the Algolia REST API.
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
35
|
+
* @param customDelete - The customDelete object.
|
|
36
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
37
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
38
38
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
41
41
|
/**
|
|
42
42
|
* This method allow you to send requests to the Algolia REST API.
|
|
43
43
|
*
|
|
44
44
|
* @summary Send requests to the Algolia REST API.
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
45
|
+
* @param customGet - The customGet object.
|
|
46
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
47
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
48
48
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
51
|
+
/**
|
|
52
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
53
|
+
*
|
|
54
|
+
* @summary Send requests to the Algolia REST API.
|
|
55
|
+
* @param customPost - The customPost object.
|
|
56
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
57
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
58
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
59
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
60
|
+
*/
|
|
61
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
62
|
+
/**
|
|
63
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
64
|
+
*
|
|
65
|
+
* @summary Send requests to the Algolia REST API.
|
|
66
|
+
* @param customPut - The customPut object.
|
|
67
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
68
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
69
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
70
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
71
|
+
*/
|
|
72
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
51
73
|
/**
|
|
52
74
|
* List known incidents for selected clusters.
|
|
53
75
|
*
|
|
@@ -124,28 +146,6 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
124
146
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
125
147
|
*/
|
|
126
148
|
getStatus(requestOptions?: RequestOptions): Promise<StatusResponse>;
|
|
127
|
-
/**
|
|
128
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
129
|
-
*
|
|
130
|
-
* @summary Send requests to the Algolia REST API.
|
|
131
|
-
* @param post - The post object.
|
|
132
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
133
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
134
|
-
* @param post.body - Parameters to send with the custom request.
|
|
135
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
136
|
-
*/
|
|
137
|
-
post({ path, parameters, body }: PostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
138
|
-
/**
|
|
139
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
140
|
-
*
|
|
141
|
-
* @summary Send requests to the Algolia REST API.
|
|
142
|
-
* @param put - The put object.
|
|
143
|
-
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
144
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
145
|
-
* @param put.body - Parameters to send with the custom request.
|
|
146
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
147
|
-
*/
|
|
148
|
-
put({ path, parameters, body }: PutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
149
149
|
};
|
|
150
150
|
/**
|
|
151
151
|
* The client type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitoringClient.d.ts","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"monitoringClient.d.ts","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAsCjD,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,GAAG,OAAO,EACX,EAAE,mBAAmB;;IAwBlB;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;;OAQG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;;OASG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;OASG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;OAOG;sCAEa,wBAAwB,mBACrB,cAAc,GAC9B,QAAQ,iBAAiB,CAAC;IAwB7B;;;;;;;OAOG;mCAEa,qBAAqB,mBAClB,cAAc,GAC9B,QAAQ,cAAc,CAAC;IAwB1B;;;;;OAKG;kCAC2B,cAAc,GAAG,QAAQ,iBAAiB,CAAC;IAezE;;;;;;;OAOG;kCAEa,oBAAoB,mBACjB,cAAc,GAC9B,QAAQ,oBAAoB,CAAC;IAwBhC;;;;;OAKG;kCAC2B,cAAc,GAAG,QAAQ,iBAAiB,CAAC;IAezE;;;;;;;OAOG;6BAEa,eAAe,mBACZ,cAAc,GAC9B,QAAQ,eAAe,CAAC;IAwB3B;;;;;;;;OAQG;mCAEmB,eAAe,mBAClB,cAAc,GAC9B,QAAQ,sBAAsB,CAAC;IA6BlC;;;;;;;OAOG;kCAEa,oBAAoB,mBACjB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAwBnD;;;;;OAKG;+BACwB,cAAc,GAAG,QAAQ,cAAc,CAAC;EAetE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -4,9 +4,9 @@ import type { Metric } from './metric';
|
|
|
4
4
|
import type { Period } from './period';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Properties for the `
|
|
7
|
+
* Properties for the `customDelete` method.
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
9
|
+
export type CustomDeleteProps = {
|
|
10
10
|
/**
|
|
11
11
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
12
12
|
*/
|
|
@@ -18,9 +18,9 @@ export type DelProps = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Properties for the `
|
|
21
|
+
* Properties for the `customGet` method.
|
|
22
22
|
*/
|
|
23
|
-
export type
|
|
23
|
+
export type CustomGetProps = {
|
|
24
24
|
/**
|
|
25
25
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
26
26
|
*/
|
|
@@ -31,6 +31,42 @@ export type GetProps = {
|
|
|
31
31
|
parameters?: Record<string, any>;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Properties for the `customPost` method.
|
|
36
|
+
*/
|
|
37
|
+
export 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, any>;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Properties for the `customPut` method.
|
|
54
|
+
*/
|
|
55
|
+
export type CustomPutProps = {
|
|
56
|
+
/**
|
|
57
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
58
|
+
*/
|
|
59
|
+
path: string;
|
|
60
|
+
/**
|
|
61
|
+
* Query parameters to apply to the current query.
|
|
62
|
+
*/
|
|
63
|
+
parameters?: Record<string, any>;
|
|
64
|
+
/**
|
|
65
|
+
* Parameters to send with the custom request.
|
|
66
|
+
*/
|
|
67
|
+
body?: Record<string, any>;
|
|
68
|
+
};
|
|
69
|
+
|
|
34
70
|
/**
|
|
35
71
|
* Properties for the `getClusterIncidents` method.
|
|
36
72
|
*/
|
|
@@ -94,39 +130,3 @@ export type GetReachabilityProps = {
|
|
|
94
130
|
*/
|
|
95
131
|
clusters: string;
|
|
96
132
|
};
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Properties for the `post` method.
|
|
100
|
-
*/
|
|
101
|
-
export type PostProps = {
|
|
102
|
-
/**
|
|
103
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
104
|
-
*/
|
|
105
|
-
path: string;
|
|
106
|
-
/**
|
|
107
|
-
* Query parameters to apply to the current query.
|
|
108
|
-
*/
|
|
109
|
-
parameters?: Record<string, any>;
|
|
110
|
-
/**
|
|
111
|
-
* Parameters to send with the custom request.
|
|
112
|
-
*/
|
|
113
|
-
body?: Record<string, any>;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Properties for the `put` method.
|
|
118
|
-
*/
|
|
119
|
-
export type PutProps = {
|
|
120
|
-
/**
|
|
121
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
122
|
-
*/
|
|
123
|
-
path: string;
|
|
124
|
-
/**
|
|
125
|
-
* Query parameters to apply to the current query.
|
|
126
|
-
*/
|
|
127
|
-
parameters?: Record<string, any>;
|
|
128
|
-
/**
|
|
129
|
-
* Parameters to send with the custom request.
|
|
130
|
-
*/
|
|
131
|
-
body?: Record<string, any>;
|
|
132
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/monitoring",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.25",
|
|
4
4
|
"description": "JavaScript client for monitoring",
|
|
5
5
|
"repository": "algolia/algoliasearch-client-javascript",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"clean": "rm -rf ./dist || true"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@algolia/client-common": "5.0.0-alpha.
|
|
43
|
-
"@algolia/requester-browser-xhr": "5.0.0-alpha.
|
|
44
|
-
"@algolia/requester-node-http": "5.0.0-alpha.
|
|
42
|
+
"@algolia/client-common": "5.0.0-alpha.98",
|
|
43
|
+
"@algolia/requester-browser-xhr": "5.0.0-alpha.98",
|
|
44
|
+
"@algolia/requester-node-http": "5.0.0-alpha.98"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/node": "20.
|
|
48
|
-
"rollup": "4.
|
|
49
|
-
"typescript": "5.
|
|
47
|
+
"@types/node": "20.11.1",
|
|
48
|
+
"rollup": "4.9.5",
|
|
49
|
+
"typescript": "5.3.3"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">= 14.0.0"
|