@algolia/monitoring 1.0.0-alpha.3 → 1.0.0-alpha.31
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.js → monitoring.cjs} +65 -103
- package/dist/monitoring.esm.browser.js +110 -135
- package/dist/monitoring.esm.node.js +66 -104
- package/dist/monitoring.umd.js +2 -2
- package/dist/src/monitoringClient.d.ts +30 -43
- package/dist/src/monitoringClient.d.ts.map +1 -1
- package/index.js +1 -1
- package/model/clientMethodProps.ts +40 -40
- package/package.json +9 -9
|
@@ -1,43 +1,18 @@
|
|
|
1
|
-
import { createAuth, createTransporter, getAlgoliaAgent,
|
|
1
|
+
import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';
|
|
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.
|
|
6
|
-
function getDefaultHosts(
|
|
5
|
+
const apiClientVersion = '1.0.0-alpha.31';
|
|
6
|
+
function getDefaultHosts() {
|
|
7
7
|
return [
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
accept: 'read',
|
|
11
|
-
protocol: 'https',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
url: `${appId}.algolia.net`,
|
|
15
|
-
accept: 'write',
|
|
16
|
-
protocol: 'https',
|
|
17
|
-
},
|
|
18
|
-
].concat(shuffle([
|
|
19
|
-
{
|
|
20
|
-
url: `${appId}-1.algolianet.com`,
|
|
21
|
-
accept: 'readWrite',
|
|
22
|
-
protocol: 'https',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
url: `${appId}-2.algolianet.com`,
|
|
26
|
-
accept: 'readWrite',
|
|
27
|
-
protocol: 'https',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
url: `${appId}-3.algolianet.com`,
|
|
31
|
-
accept: 'readWrite',
|
|
32
|
-
protocol: 'https',
|
|
33
|
-
},
|
|
34
|
-
]));
|
|
8
|
+
{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' },
|
|
9
|
+
];
|
|
35
10
|
}
|
|
36
11
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
37
12
|
function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
|
|
38
13
|
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
39
14
|
const transporter = createTransporter({
|
|
40
|
-
hosts: getDefaultHosts(
|
|
15
|
+
hosts: getDefaultHosts(),
|
|
41
16
|
...options,
|
|
42
17
|
algoliaAgent: getAlgoliaAgent({
|
|
43
18
|
algoliaAgents,
|
|
@@ -87,15 +62,14 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
87
62
|
/**
|
|
88
63
|
* This method allow you to send requests to the Algolia REST API.
|
|
89
64
|
*
|
|
90
|
-
* @
|
|
91
|
-
* @param
|
|
92
|
-
* @param
|
|
93
|
-
* @param del.parameters - Query parameters to apply to the current query.
|
|
65
|
+
* @param customDelete - The customDelete object.
|
|
66
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
67
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
94
68
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
95
69
|
*/
|
|
96
|
-
|
|
70
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
97
71
|
if (!path) {
|
|
98
|
-
throw new Error('Parameter `path` is required when calling `
|
|
72
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
99
73
|
}
|
|
100
74
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
101
75
|
const headers = {};
|
|
@@ -111,15 +85,14 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
111
85
|
/**
|
|
112
86
|
* This method allow you to send requests to the Algolia REST API.
|
|
113
87
|
*
|
|
114
|
-
* @
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @param get.parameters - Query parameters to apply to the current query.
|
|
88
|
+
* @param customGet - The customGet object.
|
|
89
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
90
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
118
91
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
119
92
|
*/
|
|
120
|
-
|
|
93
|
+
customGet({ path, parameters }, requestOptions) {
|
|
121
94
|
if (!path) {
|
|
122
|
-
throw new Error('Parameter `path` is required when calling `
|
|
95
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
123
96
|
}
|
|
124
97
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
125
98
|
const headers = {};
|
|
@@ -132,10 +105,59 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
132
105
|
};
|
|
133
106
|
return transporter.request(request, requestOptions);
|
|
134
107
|
},
|
|
108
|
+
/**
|
|
109
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
110
|
+
*
|
|
111
|
+
* @param customPost - The customPost object.
|
|
112
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
113
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
114
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
115
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
116
|
+
*/
|
|
117
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
118
|
+
if (!path) {
|
|
119
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
120
|
+
}
|
|
121
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
122
|
+
const headers = {};
|
|
123
|
+
const queryParameters = parameters ? parameters : {};
|
|
124
|
+
const request = {
|
|
125
|
+
method: 'POST',
|
|
126
|
+
path: requestPath,
|
|
127
|
+
queryParameters,
|
|
128
|
+
headers,
|
|
129
|
+
data: body ? body : {},
|
|
130
|
+
};
|
|
131
|
+
return transporter.request(request, requestOptions);
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
135
|
+
*
|
|
136
|
+
* @param customPut - The customPut object.
|
|
137
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
138
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
139
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
140
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
141
|
+
*/
|
|
142
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
143
|
+
if (!path) {
|
|
144
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
145
|
+
}
|
|
146
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
147
|
+
const headers = {};
|
|
148
|
+
const queryParameters = parameters ? parameters : {};
|
|
149
|
+
const request = {
|
|
150
|
+
method: 'PUT',
|
|
151
|
+
path: requestPath,
|
|
152
|
+
queryParameters,
|
|
153
|
+
headers,
|
|
154
|
+
data: body ? body : {},
|
|
155
|
+
};
|
|
156
|
+
return transporter.request(request, requestOptions);
|
|
157
|
+
},
|
|
135
158
|
/**
|
|
136
159
|
* List known incidents for selected clusters.
|
|
137
160
|
*
|
|
138
|
-
* @summary List incidents for selected clusters.
|
|
139
161
|
* @param getClusterIncidents - The getClusterIncidents object.
|
|
140
162
|
* @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
|
|
141
163
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -158,7 +180,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
158
180
|
/**
|
|
159
181
|
* Report whether a cluster is operational.
|
|
160
182
|
*
|
|
161
|
-
* @summary List statuses of selected clusters.
|
|
162
183
|
* @param getClusterStatus - The getClusterStatus object.
|
|
163
184
|
* @param getClusterStatus.clusters - Subset of clusters, separated by comma.
|
|
164
185
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -181,7 +202,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
181
202
|
/**
|
|
182
203
|
* List known incidents for all clusters.
|
|
183
204
|
*
|
|
184
|
-
* @summary List incidents.
|
|
185
205
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
186
206
|
*/
|
|
187
207
|
getIncidents(requestOptions) {
|
|
@@ -199,7 +219,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
199
219
|
/**
|
|
200
220
|
* List the average times for indexing operations for selected clusters.
|
|
201
221
|
*
|
|
202
|
-
* @summary Get indexing times.
|
|
203
222
|
* @param getIndexingTime - The getIndexingTime object.
|
|
204
223
|
* @param getIndexingTime.clusters - Subset of clusters, separated by comma.
|
|
205
224
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -222,7 +241,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
222
241
|
/**
|
|
223
242
|
* List the servers belonging 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.
|
|
224
243
|
*
|
|
225
|
-
* @summary List servers.
|
|
226
244
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
227
245
|
*/
|
|
228
246
|
getInventory(requestOptions) {
|
|
@@ -240,7 +258,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
240
258
|
/**
|
|
241
259
|
* List the average latency for search requests for selected clusters.
|
|
242
260
|
*
|
|
243
|
-
* @summary Get search latency times.
|
|
244
261
|
* @param getLatency - The getLatency object.
|
|
245
262
|
* @param getLatency.clusters - Subset of clusters, separated by comma.
|
|
246
263
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -263,7 +280,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
263
280
|
/**
|
|
264
281
|
* Report the aggregate value of a metric for a selected period of time.
|
|
265
282
|
*
|
|
266
|
-
* @summary Get metrics for a given period.
|
|
267
283
|
* @param getMetrics - The getMetrics object.
|
|
268
284
|
* @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the response. To include all metrics, use `*` as the parameter.
|
|
269
285
|
* @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.
|
|
@@ -292,7 +308,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
292
308
|
/**
|
|
293
309
|
* Test whether clusters are reachable or not.
|
|
294
310
|
*
|
|
295
|
-
* @summary Test the reachability of clusters.
|
|
296
311
|
* @param getReachability - The getReachability object.
|
|
297
312
|
* @param getReachability.clusters - Subset of clusters, separated by comma.
|
|
298
313
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -315,7 +330,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
315
330
|
/**
|
|
316
331
|
* Report whether clusters are operational. The response depends on whether you authenticate your API request. - With authentication, the response includes the status of the cluster assigned to your Algolia application. - Without authentication, the response lists the statuses of all public Algolia clusters.
|
|
317
332
|
*
|
|
318
|
-
* @summary List cluster statuses.
|
|
319
333
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
320
334
|
*/
|
|
321
335
|
getStatus(requestOptions) {
|
|
@@ -330,58 +344,6 @@ function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, auth
|
|
|
330
344
|
};
|
|
331
345
|
return transporter.request(request, requestOptions);
|
|
332
346
|
},
|
|
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
347
|
};
|
|
386
348
|
}
|
|
387
349
|
|
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.3";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.31 | © 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 m extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),i(this,"status",void 0),this.status=t}}class h extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class d extends m{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]).replaceAll("+","%20")}`)).join("&")}(r);let a=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(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 h(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 m(s.message,t,r)}catch(e){}return new m(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.31";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:[{url:"status.algolia.com",accept:"readWrite",protocol:"https"}],...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.31";
|
|
10
10
|
export declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
11
11
|
transporter: import("@algolia/client-common").Transporter;
|
|
12
12
|
/**
|
|
@@ -31,27 +31,44 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
31
31
|
/**
|
|
32
32
|
* This method allow you to send requests to the Algolia REST API.
|
|
33
33
|
*
|
|
34
|
-
* @
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param del.parameters - Query parameters to apply to the current query.
|
|
34
|
+
* @param customDelete - The customDelete object.
|
|
35
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
36
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
38
37
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
39
38
|
*/
|
|
40
|
-
|
|
39
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
41
40
|
/**
|
|
42
41
|
* This method allow you to send requests to the Algolia REST API.
|
|
43
42
|
*
|
|
44
|
-
* @
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param get.parameters - Query parameters to apply to the current query.
|
|
43
|
+
* @param customGet - The customGet object.
|
|
44
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
45
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
48
46
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
49
47
|
*/
|
|
50
|
-
|
|
48
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
49
|
+
/**
|
|
50
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
51
|
+
*
|
|
52
|
+
* @param customPost - The customPost object.
|
|
53
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
54
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
55
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
56
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
57
|
+
*/
|
|
58
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
59
|
+
/**
|
|
60
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
61
|
+
*
|
|
62
|
+
* @param customPut - The customPut object.
|
|
63
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
64
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
65
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
66
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
67
|
+
*/
|
|
68
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
51
69
|
/**
|
|
52
70
|
* List known incidents for selected clusters.
|
|
53
71
|
*
|
|
54
|
-
* @summary List incidents for selected clusters.
|
|
55
72
|
* @param getClusterIncidents - The getClusterIncidents object.
|
|
56
73
|
* @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
|
|
57
74
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -60,7 +77,6 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
60
77
|
/**
|
|
61
78
|
* Report whether a cluster is operational.
|
|
62
79
|
*
|
|
63
|
-
* @summary List statuses of selected clusters.
|
|
64
80
|
* @param getClusterStatus - The getClusterStatus object.
|
|
65
81
|
* @param getClusterStatus.clusters - Subset of clusters, separated by comma.
|
|
66
82
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -69,14 +85,12 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
69
85
|
/**
|
|
70
86
|
* List known incidents for all clusters.
|
|
71
87
|
*
|
|
72
|
-
* @summary List incidents.
|
|
73
88
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
74
89
|
*/
|
|
75
90
|
getIncidents(requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
|
76
91
|
/**
|
|
77
92
|
* List the average times for indexing operations for selected clusters.
|
|
78
93
|
*
|
|
79
|
-
* @summary Get indexing times.
|
|
80
94
|
* @param getIndexingTime - The getIndexingTime object.
|
|
81
95
|
* @param getIndexingTime.clusters - Subset of clusters, separated by comma.
|
|
82
96
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -85,14 +99,12 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
85
99
|
/**
|
|
86
100
|
* List the servers belonging 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.
|
|
87
101
|
*
|
|
88
|
-
* @summary List servers.
|
|
89
102
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
90
103
|
*/
|
|
91
104
|
getInventory(requestOptions?: RequestOptions): Promise<InventoryResponse>;
|
|
92
105
|
/**
|
|
93
106
|
* List the average latency for search requests for selected clusters.
|
|
94
107
|
*
|
|
95
|
-
* @summary Get search latency times.
|
|
96
108
|
* @param getLatency - The getLatency object.
|
|
97
109
|
* @param getLatency.clusters - Subset of clusters, separated by comma.
|
|
98
110
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -101,7 +113,6 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
101
113
|
/**
|
|
102
114
|
* Report the aggregate value of a metric for a selected period of time.
|
|
103
115
|
*
|
|
104
|
-
* @summary Get metrics for a given period.
|
|
105
116
|
* @param getMetrics - The getMetrics object.
|
|
106
117
|
* @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the response. To include all metrics, use `*` as the parameter.
|
|
107
118
|
* @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.
|
|
@@ -111,7 +122,6 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
111
122
|
/**
|
|
112
123
|
* Test whether clusters are reachable or not.
|
|
113
124
|
*
|
|
114
|
-
* @summary Test the reachability of clusters.
|
|
115
125
|
* @param getReachability - The getReachability object.
|
|
116
126
|
* @param getReachability.clusters - Subset of clusters, separated by comma.
|
|
117
127
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -120,32 +130,9 @@ export declare function createMonitoringClient({ appId: appIdOption, apiKey: api
|
|
|
120
130
|
/**
|
|
121
131
|
* Report whether clusters are operational. The response depends on whether you authenticate your API request. - With authentication, the response includes the status of the cluster assigned to your Algolia application. - Without authentication, the response lists the statuses of all public Algolia clusters.
|
|
122
132
|
*
|
|
123
|
-
* @summary List cluster statuses.
|
|
124
133
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
125
134
|
*/
|
|
126
135
|
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
136
|
};
|
|
150
137
|
/**
|
|
151
138
|
* The client type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitoringClient.d.ts","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"monitoringClient.d.ts","sourceRoot":"","sources":["../../src/monitoringClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAKnB,cAAc,EACf,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;AASjD,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;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;OAOG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;OAMG;sCAEa,wBAAwB,mBACrB,cAAc,GAC9B,QAAQ,iBAAiB,CAAC;IAwB7B;;;;;;OAMG;mCAEa,qBAAqB,mBAClB,cAAc,GAC9B,QAAQ,cAAc,CAAC;IAwB1B;;;;OAIG;kCAC2B,cAAc,GAAG,QAAQ,iBAAiB,CAAC;IAezE;;;;;;OAMG;kCAEa,oBAAoB,mBACjB,cAAc,GAC9B,QAAQ,oBAAoB,CAAC;IAwBhC;;;;OAIG;kCAC2B,cAAc,GAAG,QAAQ,iBAAiB,CAAC;IAezE;;;;;;OAMG;6BAEa,eAAe,mBACZ,cAAc,GAC9B,QAAQ,eAAe,CAAC;IAwB3B;;;;;;;OAOG;mCAEmB,eAAe,mBAClB,cAAc,GAC9B,QAAQ,sBAAsB,CAAC;IA6BlC;;;;;;OAMG;kCAEa,oBAAoB,mBACjB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAwBnD;;;;OAIG;+BACwB,cAAc,GAAG,QAAQ,cAAc,CAAC;EAetE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-commonjs,import/extensions
|
|
2
|
-
module.exports = require('./dist/monitoring.cjs
|
|
2
|
+
module.exports = require('./dist/monitoring.cjs');
|
|
@@ -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
|
-
};
|