@algolia/monitoring 5.2.4-beta.5 → 5.10.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +15 -7
  2. package/dist/browser.d.ts +194 -63
  3. package/dist/builds/browser.js +24 -22
  4. package/dist/builds/browser.js.map +1 -1
  5. package/dist/builds/browser.min.js +1 -1
  6. package/dist/builds/browser.min.js.map +1 -1
  7. package/dist/builds/browser.umd.js +4 -4
  8. package/dist/builds/fetch.js +388 -0
  9. package/dist/builds/fetch.js.map +1 -0
  10. package/dist/builds/node.cjs +21 -20
  11. package/dist/builds/node.cjs.map +1 -1
  12. package/dist/builds/node.js +22 -20
  13. package/dist/builds/node.js.map +1 -1
  14. package/dist/fetch.d.ts +437 -0
  15. package/dist/node.d.cts +196 -64
  16. package/dist/node.d.ts +196 -64
  17. package/dist/src/monitoringClient.cjs +19 -19
  18. package/dist/src/monitoringClient.cjs.map +1 -1
  19. package/dist/src/monitoringClient.js +19 -19
  20. package/dist/src/monitoringClient.js.map +1 -1
  21. package/index.d.ts +0 -1
  22. package/index.js +1 -2
  23. package/package.json +16 -11
  24. package/model/badRequest.ts +0 -5
  25. package/model/clientMethodProps.ts +0 -132
  26. package/model/errorBase.ts +0 -8
  27. package/model/forbidden.ts +0 -5
  28. package/model/incident.ts +0 -15
  29. package/model/incidentEntry.ts +0 -12
  30. package/model/incidentsResponse.ts +0 -7
  31. package/model/index.ts +0 -27
  32. package/model/indexingMetric.ts +0 -7
  33. package/model/indexingTimeResponse.ts +0 -7
  34. package/model/infrastructureResponse.ts +0 -7
  35. package/model/inventoryResponse.ts +0 -7
  36. package/model/latencyMetric.ts +0 -7
  37. package/model/latencyResponse.ts +0 -7
  38. package/model/metric.ts +0 -3
  39. package/model/metrics.ts +0 -30
  40. package/model/period.ts +0 -3
  41. package/model/probesMetric.ts +0 -13
  42. package/model/region.ts +0 -21
  43. package/model/server.ts +0 -33
  44. package/model/serverStatus.ts +0 -3
  45. package/model/status.ts +0 -6
  46. package/model/statusResponse.ts +0 -7
  47. package/model/timeEntry.ts +0 -13
  48. package/model/type.ts +0 -3
  49. package/model/unauthorized.ts +0 -5
@@ -24,12 +24,12 @@ __export(node_exports, {
24
24
  monitoringClient: () => monitoringClient
25
25
  });
26
26
  module.exports = __toCommonJS(node_exports);
27
- var import_client_common2 = require("@algolia/client-common");
28
27
  var import_requester_node_http = require("@algolia/requester-node-http");
28
+ var import_client_common2 = require("@algolia/client-common");
29
29
 
30
30
  // src/monitoringClient.ts
31
31
  var import_client_common = require("@algolia/client-common");
32
- var apiClientVersion = "1.2.4";
32
+ var apiClientVersion = "1.10.0";
33
33
  function getDefaultHosts() {
34
34
  return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
35
35
  }
@@ -87,8 +87,20 @@ function createMonitoringClient({
87
87
  transporter.algoliaAgent.add({ segment, version });
88
88
  },
89
89
  /**
90
- * This method allow you to send requests to the Algolia REST API.
90
+ * Helper method to switch the API key used to authenticate the requests.
91
91
  *
92
+ * @param params - Method params.
93
+ * @param params.apiKey - The new API Key to use.
94
+ */
95
+ setClientApiKey({ apiKey }) {
96
+ if (!authMode || authMode === "WithinHeaders") {
97
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
98
+ } else {
99
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
100
+ }
101
+ },
102
+ /**
103
+ * This method allow you to send requests to the Algolia REST API.
92
104
  * @param customDelete - The customDelete object.
93
105
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
94
106
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -111,7 +123,6 @@ function createMonitoringClient({
111
123
  },
112
124
  /**
113
125
  * This method allow you to send requests to the Algolia REST API.
114
- *
115
126
  * @param customGet - The customGet object.
116
127
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
117
128
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -134,7 +145,6 @@ function createMonitoringClient({
134
145
  },
135
146
  /**
136
147
  * This method allow you to send requests to the Algolia REST API.
137
- *
138
148
  * @param customPost - The customPost object.
139
149
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
140
150
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -159,7 +169,6 @@ function createMonitoringClient({
159
169
  },
160
170
  /**
161
171
  * This method allow you to send requests to the Algolia REST API.
162
- *
163
172
  * @param customPut - The customPut object.
164
173
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
165
174
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -184,9 +193,8 @@ function createMonitoringClient({
184
193
  },
185
194
  /**
186
195
  * Retrieves known incidents for the selected clusters.
187
- *
188
196
  * @param getClusterIncidents - The getClusterIncidents object.
189
- * @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
197
+ * @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
190
198
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
191
199
  */
192
200
  getClusterIncidents({ clusters }, requestOptions) {
@@ -206,9 +214,8 @@ function createMonitoringClient({
206
214
  },
207
215
  /**
208
216
  * Retrieves the status of selected clusters.
209
- *
210
217
  * @param getClusterStatus - The getClusterStatus object.
211
- * @param getClusterStatus.clusters - Subset of clusters, separated by comma.
218
+ * @param getClusterStatus.clusters - Subset of clusters, separated by commas.
212
219
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
213
220
  */
214
221
  getClusterStatus({ clusters }, requestOptions) {
@@ -228,7 +235,6 @@ function createMonitoringClient({
228
235
  },
229
236
  /**
230
237
  * Retrieves known incidents for all clusters.
231
- *
232
238
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
233
239
  */
234
240
  getIncidents(requestOptions) {
@@ -245,9 +251,8 @@ function createMonitoringClient({
245
251
  },
246
252
  /**
247
253
  * Retrieves average times for indexing operations for selected clusters.
248
- *
249
254
  * @param getIndexingTime - The getIndexingTime object.
250
- * @param getIndexingTime.clusters - Subset of clusters, separated by comma.
255
+ * @param getIndexingTime.clusters - Subset of clusters, separated by commas.
251
256
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
252
257
  */
253
258
  getIndexingTime({ clusters }, requestOptions) {
@@ -267,9 +272,8 @@ function createMonitoringClient({
267
272
  },
268
273
  /**
269
274
  * Retrieves the average latency for search requests for selected clusters.
270
- *
271
275
  * @param getLatency - The getLatency object.
272
- * @param getLatency.clusters - Subset of clusters, separated by comma.
276
+ * @param getLatency.clusters - Subset of clusters, separated by commas.
273
277
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
274
278
  */
275
279
  getLatency({ clusters }, requestOptions) {
@@ -289,7 +293,6 @@ function createMonitoringClient({
289
293
  },
290
294
  /**
291
295
  * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).
292
- *
293
296
  * @param getMetrics - The getMetrics object.
294
297
  * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
295
298
  * @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.
@@ -315,9 +318,8 @@ function createMonitoringClient({
315
318
  },
316
319
  /**
317
320
  * Test whether clusters are reachable or not.
318
- *
319
321
  * @param getReachability - The getReachability object.
320
- * @param getReachability.clusters - Subset of clusters, separated by comma.
322
+ * @param getReachability.clusters - Subset of clusters, separated by commas.
321
323
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
322
324
  */
323
325
  getReachability({ clusters }, requestOptions) {
@@ -337,7 +339,6 @@ function createMonitoringClient({
337
339
  },
338
340
  /**
339
341
  * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.
340
- *
341
342
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
342
343
  */
343
344
  getServers(requestOptions) {
@@ -354,7 +355,6 @@ function createMonitoringClient({
354
355
  },
355
356
  /**
356
357
  * Retrieves the status of all Algolia clusters and instances.
357
- *
358
358
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
359
359
  */
360
360
  getStatus(requestOptions) {
@@ -389,6 +389,7 @@ function monitoringClient(appId, apiKey, options) {
389
389
  read: import_client_common2.DEFAULT_READ_TIMEOUT_NODE,
390
390
  write: import_client_common2.DEFAULT_WRITE_TIMEOUT_NODE
391
391
  },
392
+ logger: (0, import_client_common2.createNullLogger)(),
392
393
  requester: (0, import_requester_node_http.createHttpRequester)(),
393
394
  algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
394
395
  responsesCache: (0, import_client_common2.createNullCache)(),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/node.ts","../../src/monitoringClient.ts"],"sourcesContent":["// 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.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createNullCache,\n DEFAULT_CONNECT_TIMEOUT_NODE,\n DEFAULT_READ_TIMEOUT_NODE,\n DEFAULT_WRITE_TIMEOUT_NODE,\n} from '@algolia/client-common';\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createMonitoringClient } from '../src/monitoringClient';\n\nexport { apiClientVersion } from '../src/monitoringClient';\nexport * from '../model';\n\n/**\n * The client type.\n */\nexport type MonitoringClient = ReturnType<typeof monitoringClient>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function monitoringClient(appId: string, apiKey: string, options?: ClientOptions) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createMonitoringClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n read: DEFAULT_READ_TIMEOUT_NODE,\n write: DEFAULT_WRITE_TIMEOUT_NODE,\n },\n requester: createHttpRequester(),\n algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// 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.\n\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n GetClusterIncidentsProps,\n GetClusterStatusProps,\n GetIndexingTimeProps,\n GetLatencyProps,\n GetMetricsProps,\n GetReachabilityProps,\n} from '../model/clientMethodProps';\nimport type { IncidentsResponse } from '../model/incidentsResponse';\nimport type { IndexingTimeResponse } from '../model/indexingTimeResponse';\nimport type { InfrastructureResponse } from '../model/infrastructureResponse';\nimport type { InventoryResponse } from '../model/inventoryResponse';\nimport type { LatencyResponse } from '../model/latencyResponse';\nimport type { StatusResponse } from '../model/statusResponse';\n\nexport const apiClientVersion = '1.2.4';\n\nfunction getDefaultHosts(): Host[] {\n return [{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createMonitoringClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Monitoring',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves known incidents for the selected clusters.\n *\n * @param getClusterIncidents - The getClusterIncidents object.\n * @param getClusterIncidents.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterIncidents(\n { clusters }: GetClusterIncidentsProps,\n requestOptions?: RequestOptions,\n ): Promise<IncidentsResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterIncidents`.');\n }\n\n const requestPath = '/1/incidents/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the status of selected clusters.\n *\n * @param getClusterStatus - The getClusterStatus object.\n * @param getClusterStatus.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterStatus`.');\n }\n\n const requestPath = '/1/status/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves known incidents for all clusters.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIncidents(requestOptions?: RequestOptions): Promise<IncidentsResponse> {\n const requestPath = '/1/incidents';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves average times for indexing operations for selected clusters.\n *\n * @param getIndexingTime - The getIndexingTime object.\n * @param getIndexingTime.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIndexingTime(\n { clusters }: GetIndexingTimeProps,\n requestOptions?: RequestOptions,\n ): Promise<IndexingTimeResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getIndexingTime`.');\n }\n\n const requestPath = '/1/indexing/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the average latency for search requests for selected clusters.\n *\n * @param getLatency - The getLatency object.\n * @param getLatency.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getLatency`.');\n }\n\n const requestPath = '/1/latency/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).\n *\n * @param getMetrics - The getMetrics object.\n * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.\n * @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.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse> {\n if (!metric) {\n throw new Error('Parameter `metric` is required when calling `getMetrics`.');\n }\n\n if (!period) {\n throw new Error('Parameter `period` is required when calling `getMetrics`.');\n }\n\n const requestPath = '/1/infrastructure/{metric}/period/{period}'\n .replace('{metric}', encodeURIComponent(metric))\n .replace('{period}', encodeURIComponent(period));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Test whether clusters are reachable or not.\n *\n * @param getReachability - The getReachability object.\n * @param getReachability.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getReachability(\n { clusters }: GetReachabilityProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, Record<string, boolean>>> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getReachability`.');\n }\n\n const requestPath = '/1/reachability/{clusters}/probes'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getServers(requestOptions?: RequestOptions): Promise<InventoryResponse> {\n const requestPath = '/1/inventory/servers';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the status of all Algolia clusters and instances.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getStatus(requestOptions?: RequestOptions): Promise<StatusResponse> {\n const requestPath = '/1/status';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,IAAAA,wBAMO;AACP,iCAAoC;;;ACRpC,2BAA+D;AA6BxD,IAAM,mBAAmB;AAEhC,SAAS,kBAA0B;AACjC,SAAO,CAAC,EAAE,KAAK,sBAAsB,QAAQ,aAAa,UAAU,QAAQ,CAAC;AAC/E;AAGO,SAAS,uBAAuB;AAAA,EACrC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,kBAAc,wCAAkB;AAAA,IACpC,OAAO,gBAAgB;AAAA,IACvB,GAAG;AAAA,IACH,kBAAc,sCAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CAAC;AAED,SAAO;AAAA,I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"sources":["../../builds/node.ts","../../src/monitoringClient.ts"],"sourcesContent":["// 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.\n\nexport type MonitoringClient = ReturnType<typeof createMonitoringClient>;\n\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport {\n ClientOptions,\n createMemoryCache,\n createNullCache,\n createNullLogger,\n DEFAULT_CONNECT_TIMEOUT_NODE,\n DEFAULT_READ_TIMEOUT_NODE,\n DEFAULT_WRITE_TIMEOUT_NODE,\n} from '@algolia/client-common';\n\nimport { createMonitoringClient } from '../src/monitoringClient';\n\nexport * from '../model';\nexport { apiClientVersion } from '../src/monitoringClient';\n\nexport function monitoringClient(appId: string, apiKey: string, options?: ClientOptions): MonitoringClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createMonitoringClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n read: DEFAULT_READ_TIMEOUT_NODE,\n write: DEFAULT_WRITE_TIMEOUT_NODE,\n },\n logger: createNullLogger(),\n requester: createHttpRequester(),\n algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// 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.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { IncidentsResponse } from '../model/incidentsResponse';\nimport type { IndexingTimeResponse } from '../model/indexingTimeResponse';\nimport type { InfrastructureResponse } from '../model/infrastructureResponse';\nimport type { InventoryResponse } from '../model/inventoryResponse';\nimport type { LatencyResponse } from '../model/latencyResponse';\n\nimport type { StatusResponse } from '../model/statusResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n GetClusterIncidentsProps,\n GetClusterStatusProps,\n GetIndexingTimeProps,\n GetLatencyProps,\n GetMetricsProps,\n GetReachabilityProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.10.0';\n\nfunction getDefaultHosts(): Host[] {\n return [{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createMonitoringClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Monitoring',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves known incidents for the selected clusters.\n * @param getClusterIncidents - The getClusterIncidents object.\n * @param getClusterIncidents.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterIncidents(\n { clusters }: GetClusterIncidentsProps,\n requestOptions?: RequestOptions,\n ): Promise<IncidentsResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterIncidents`.');\n }\n\n const requestPath = '/1/incidents/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the status of selected clusters.\n * @param getClusterStatus - The getClusterStatus object.\n * @param getClusterStatus.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterStatus`.');\n }\n\n const requestPath = '/1/status/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves known incidents for all clusters.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIncidents(requestOptions?: RequestOptions): Promise<IncidentsResponse> {\n const requestPath = '/1/incidents';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves average times for indexing operations for selected clusters.\n * @param getIndexingTime - The getIndexingTime object.\n * @param getIndexingTime.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIndexingTime(\n { clusters }: GetIndexingTimeProps,\n requestOptions?: RequestOptions,\n ): Promise<IndexingTimeResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getIndexingTime`.');\n }\n\n const requestPath = '/1/indexing/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the average latency for search requests for selected clusters.\n * @param getLatency - The getLatency object.\n * @param getLatency.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getLatency`.');\n }\n\n const requestPath = '/1/latency/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).\n * @param getMetrics - The getMetrics object.\n * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.\n * @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.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse> {\n if (!metric) {\n throw new Error('Parameter `metric` is required when calling `getMetrics`.');\n }\n\n if (!period) {\n throw new Error('Parameter `period` is required when calling `getMetrics`.');\n }\n\n const requestPath = '/1/infrastructure/{metric}/period/{period}'\n .replace('{metric}', encodeURIComponent(metric))\n .replace('{period}', encodeURIComponent(period));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Test whether clusters are reachable or not.\n * @param getReachability - The getReachability object.\n * @param getReachability.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getReachability(\n { clusters }: GetReachabilityProps,\n requestOptions?: RequestOptions,\n ): Promise<{ [key: string]: { [key: string]: boolean } }> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getReachability`.');\n }\n\n const requestPath = '/1/reachability/{clusters}/probes'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getServers(requestOptions?: RequestOptions): Promise<InventoryResponse> {\n const requestPath = '/1/inventory/servers';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the status of all Algolia clusters and instances.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getStatus(requestOptions?: RequestOptions): Promise<StatusResponse> {\n const requestPath = '/1/status';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,iCAAoC;AAEpC,IAAAA,wBAQO;;;ACJP,2BAA+D;AAuBxD,IAAM,mBAAmB;AAEhC,SAAS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AAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACF;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;;;AD/aO,SAAS,iBAAiB,OAAe,QAAgB,SAA2C;AACzG,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,GAAG,uBAAuB;AAAA,MACxB;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,YAAQ,wCAAiB;AAAA,MACzB,eAAW,gDAAoB;AAAA,MAC/B,eAAe,CAAC,EAAE,SAAS,WAAW,SAAS,QAAQ,SAAS,KAAK,CAAC;AAAA,MACtE,oBAAgB,uCAAgB;AAAA,MAChC,mBAAe,uCAAgB;AAAA,MAC/B,gBAAY,yCAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":["import_client_common"]}
@@ -1,16 +1,17 @@
1
1
  // builds/node.ts
2
+ import { createHttpRequester } from "@algolia/requester-node-http";
2
3
  import {
3
4
  createMemoryCache,
4
5
  createNullCache,
6
+ createNullLogger,
5
7
  DEFAULT_CONNECT_TIMEOUT_NODE,
6
8
  DEFAULT_READ_TIMEOUT_NODE,
7
9
  DEFAULT_WRITE_TIMEOUT_NODE
8
10
  } from "@algolia/client-common";
9
- import { createHttpRequester } from "@algolia/requester-node-http";
10
11
 
11
12
  // src/monitoringClient.ts
12
13
  import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
13
- var apiClientVersion = "1.2.4";
14
+ var apiClientVersion = "1.10.0";
14
15
  function getDefaultHosts() {
15
16
  return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
16
17
  }
@@ -68,8 +69,20 @@ function createMonitoringClient({
68
69
  transporter.algoliaAgent.add({ segment, version });
69
70
  },
70
71
  /**
71
- * This method allow you to send requests to the Algolia REST API.
72
+ * Helper method to switch the API key used to authenticate the requests.
72
73
  *
74
+ * @param params - Method params.
75
+ * @param params.apiKey - The new API Key to use.
76
+ */
77
+ setClientApiKey({ apiKey }) {
78
+ if (!authMode || authMode === "WithinHeaders") {
79
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
80
+ } else {
81
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
82
+ }
83
+ },
84
+ /**
85
+ * This method allow you to send requests to the Algolia REST API.
73
86
  * @param customDelete - The customDelete object.
74
87
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
75
88
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -92,7 +105,6 @@ function createMonitoringClient({
92
105
  },
93
106
  /**
94
107
  * This method allow you to send requests to the Algolia REST API.
95
- *
96
108
  * @param customGet - The customGet object.
97
109
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
98
110
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -115,7 +127,6 @@ function createMonitoringClient({
115
127
  },
116
128
  /**
117
129
  * This method allow you to send requests to the Algolia REST API.
118
- *
119
130
  * @param customPost - The customPost object.
120
131
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
121
132
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -140,7 +151,6 @@ function createMonitoringClient({
140
151
  },
141
152
  /**
142
153
  * This method allow you to send requests to the Algolia REST API.
143
- *
144
154
  * @param customPut - The customPut object.
145
155
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
146
156
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -165,9 +175,8 @@ function createMonitoringClient({
165
175
  },
166
176
  /**
167
177
  * Retrieves known incidents for the selected clusters.
168
- *
169
178
  * @param getClusterIncidents - The getClusterIncidents object.
170
- * @param getClusterIncidents.clusters - Subset of clusters, separated by comma.
179
+ * @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
171
180
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
172
181
  */
173
182
  getClusterIncidents({ clusters }, requestOptions) {
@@ -187,9 +196,8 @@ function createMonitoringClient({
187
196
  },
188
197
  /**
189
198
  * Retrieves the status of selected clusters.
190
- *
191
199
  * @param getClusterStatus - The getClusterStatus object.
192
- * @param getClusterStatus.clusters - Subset of clusters, separated by comma.
200
+ * @param getClusterStatus.clusters - Subset of clusters, separated by commas.
193
201
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
194
202
  */
195
203
  getClusterStatus({ clusters }, requestOptions) {
@@ -209,7 +217,6 @@ function createMonitoringClient({
209
217
  },
210
218
  /**
211
219
  * Retrieves known incidents for all clusters.
212
- *
213
220
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
214
221
  */
215
222
  getIncidents(requestOptions) {
@@ -226,9 +233,8 @@ function createMonitoringClient({
226
233
  },
227
234
  /**
228
235
  * Retrieves average times for indexing operations for selected clusters.
229
- *
230
236
  * @param getIndexingTime - The getIndexingTime object.
231
- * @param getIndexingTime.clusters - Subset of clusters, separated by comma.
237
+ * @param getIndexingTime.clusters - Subset of clusters, separated by commas.
232
238
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
233
239
  */
234
240
  getIndexingTime({ clusters }, requestOptions) {
@@ -248,9 +254,8 @@ function createMonitoringClient({
248
254
  },
249
255
  /**
250
256
  * Retrieves the average latency for search requests for selected clusters.
251
- *
252
257
  * @param getLatency - The getLatency object.
253
- * @param getLatency.clusters - Subset of clusters, separated by comma.
258
+ * @param getLatency.clusters - Subset of clusters, separated by commas.
254
259
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
255
260
  */
256
261
  getLatency({ clusters }, requestOptions) {
@@ -270,7 +275,6 @@ function createMonitoringClient({
270
275
  },
271
276
  /**
272
277
  * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).
273
- *
274
278
  * @param getMetrics - The getMetrics object.
275
279
  * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
276
280
  * @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.
@@ -296,9 +300,8 @@ function createMonitoringClient({
296
300
  },
297
301
  /**
298
302
  * Test whether clusters are reachable or not.
299
- *
300
303
  * @param getReachability - The getReachability object.
301
- * @param getReachability.clusters - Subset of clusters, separated by comma.
304
+ * @param getReachability.clusters - Subset of clusters, separated by commas.
302
305
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
303
306
  */
304
307
  getReachability({ clusters }, requestOptions) {
@@ -318,7 +321,6 @@ function createMonitoringClient({
318
321
  },
319
322
  /**
320
323
  * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.
321
- *
322
324
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
323
325
  */
324
326
  getServers(requestOptions) {
@@ -335,7 +337,6 @@ function createMonitoringClient({
335
337
  },
336
338
  /**
337
339
  * Retrieves the status of all Algolia clusters and instances.
338
- *
339
340
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
340
341
  */
341
342
  getStatus(requestOptions) {
@@ -370,6 +371,7 @@ function monitoringClient(appId, apiKey, options) {
370
371
  read: DEFAULT_READ_TIMEOUT_NODE,
371
372
  write: DEFAULT_WRITE_TIMEOUT_NODE
372
373
  },
374
+ logger: createNullLogger(),
373
375
  requester: createHttpRequester(),
374
376
  algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
375
377
  responsesCache: createNullCache(),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/node.ts","../../src/monitoringClient.ts"],"sourcesContent":["// 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.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createNullCache,\n DEFAULT_CONNECT_TIMEOUT_NODE,\n DEFAULT_READ_TIMEOUT_NODE,\n DEFAULT_WRITE_TIMEOUT_NODE,\n} from '@algolia/client-common';\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createMonitoringClient } from '../src/monitoringClient';\n\nexport { apiClientVersion } from '../src/monitoringClient';\nexport * from '../model';\n\n/**\n * The client type.\n */\nexport type MonitoringClient = ReturnType<typeof monitoringClient>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function monitoringClient(appId: string, apiKey: string, options?: ClientOptions) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createMonitoringClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n read: DEFAULT_READ_TIMEOUT_NODE,\n write: DEFAULT_WRITE_TIMEOUT_NODE,\n },\n requester: createHttpRequester(),\n algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// 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.\n\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n GetClusterIncidentsProps,\n GetClusterStatusProps,\n GetIndexingTimeProps,\n GetLatencyProps,\n GetMetricsProps,\n GetReachabilityProps,\n} from '../model/clientMethodProps';\nimport type { IncidentsResponse } from '../model/incidentsResponse';\nimport type { IndexingTimeResponse } from '../model/indexingTimeResponse';\nimport type { InfrastructureResponse } from '../model/infrastructureResponse';\nimport type { InventoryResponse } from '../model/inventoryResponse';\nimport type { LatencyResponse } from '../model/latencyResponse';\nimport type { StatusResponse } from '../model/statusResponse';\n\nexport const apiClientVersion = '1.2.4';\n\nfunction getDefaultHosts(): Host[] {\n return [{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createMonitoringClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Monitoring',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves known incidents for the selected clusters.\n *\n * @param getClusterIncidents - The getClusterIncidents object.\n * @param getClusterIncidents.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterIncidents(\n { clusters }: GetClusterIncidentsProps,\n requestOptions?: RequestOptions,\n ): Promise<IncidentsResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterIncidents`.');\n }\n\n const requestPath = '/1/incidents/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the status of selected clusters.\n *\n * @param getClusterStatus - The getClusterStatus object.\n * @param getClusterStatus.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterStatus`.');\n }\n\n const requestPath = '/1/status/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves known incidents for all clusters.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIncidents(requestOptions?: RequestOptions): Promise<IncidentsResponse> {\n const requestPath = '/1/incidents';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves average times for indexing operations for selected clusters.\n *\n * @param getIndexingTime - The getIndexingTime object.\n * @param getIndexingTime.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIndexingTime(\n { clusters }: GetIndexingTimeProps,\n requestOptions?: RequestOptions,\n ): Promise<IndexingTimeResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getIndexingTime`.');\n }\n\n const requestPath = '/1/indexing/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the average latency for search requests for selected clusters.\n *\n * @param getLatency - The getLatency object.\n * @param getLatency.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getLatency`.');\n }\n\n const requestPath = '/1/latency/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).\n *\n * @param getMetrics - The getMetrics object.\n * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.\n * @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.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse> {\n if (!metric) {\n throw new Error('Parameter `metric` is required when calling `getMetrics`.');\n }\n\n if (!period) {\n throw new Error('Parameter `period` is required when calling `getMetrics`.');\n }\n\n const requestPath = '/1/infrastructure/{metric}/period/{period}'\n .replace('{metric}', encodeURIComponent(metric))\n .replace('{period}', encodeURIComponent(period));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Test whether clusters are reachable or not.\n *\n * @param getReachability - The getReachability object.\n * @param getReachability.clusters - Subset of clusters, separated by comma.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getReachability(\n { clusters }: GetReachabilityProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, Record<string, boolean>>> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getReachability`.');\n }\n\n const requestPath = '/1/reachability/{clusters}/probes'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getServers(requestOptions?: RequestOptions): Promise<InventoryResponse> {\n const requestPath = '/1/inventory/servers';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the status of all Algolia clusters and instances.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getStatus(requestOptions?: RequestOptions): Promise<StatusResponse> {\n const requestPath = '/1/status';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAC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AA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACF;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;;;AD3aO,SAAS,iBAAiB,OAAe,QAAgB,SAAyB;AACvF,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,GAAG,uBAAuB;AAAA,MACxB;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,WAAW,oBAAoB;AAAA,MAC/B,eAAe,CAAC,EAAE,SAAS,WAAW,SAAS,QAAQ,SAAS,KAAK,CAAC;AAAA,MACtE,gBAAgB,gBAAgB;AAAA,MAChC,eAAe,gBAAgB;AAAA,MAC/B,YAAY,kBAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../builds/node.ts","../../src/monitoringClient.ts"],"sourcesContent":["// 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.\n\nexport type MonitoringClient = ReturnType<typeof createMonitoringClient>;\n\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport {\n ClientOptions,\n createMemoryCache,\n createNullCache,\n createNullLogger,\n DEFAULT_CONNECT_TIMEOUT_NODE,\n DEFAULT_READ_TIMEOUT_NODE,\n DEFAULT_WRITE_TIMEOUT_NODE,\n} from '@algolia/client-common';\n\nimport { createMonitoringClient } from '../src/monitoringClient';\n\nexport * from '../model';\nexport { apiClientVersion } from '../src/monitoringClient';\n\nexport function monitoringClient(appId: string, apiKey: string, options?: ClientOptions): MonitoringClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createMonitoringClient({\n appId,\n apiKey,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n read: DEFAULT_READ_TIMEOUT_NODE,\n write: DEFAULT_WRITE_TIMEOUT_NODE,\n },\n logger: createNullLogger(),\n requester: createHttpRequester(),\n algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// 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.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { IncidentsResponse } from '../model/incidentsResponse';\nimport type { IndexingTimeResponse } from '../model/indexingTimeResponse';\nimport type { InfrastructureResponse } from '../model/infrastructureResponse';\nimport type { InventoryResponse } from '../model/inventoryResponse';\nimport type { LatencyResponse } from '../model/latencyResponse';\n\nimport type { StatusResponse } from '../model/statusResponse';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n GetClusterIncidentsProps,\n GetClusterStatusProps,\n GetIndexingTimeProps,\n GetLatencyProps,\n GetMetricsProps,\n GetReachabilityProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '1.10.0';\n\nfunction getDefaultHosts(): Host[] {\n return [{ url: 'status.algolia.com', accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createMonitoringClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Monitoring',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves known incidents for the selected clusters.\n * @param getClusterIncidents - The getClusterIncidents object.\n * @param getClusterIncidents.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterIncidents(\n { clusters }: GetClusterIncidentsProps,\n requestOptions?: RequestOptions,\n ): Promise<IncidentsResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterIncidents`.');\n }\n\n const requestPath = '/1/incidents/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the status of selected clusters.\n * @param getClusterStatus - The getClusterStatus object.\n * @param getClusterStatus.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getClusterStatus`.');\n }\n\n const requestPath = '/1/status/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves known incidents for all clusters.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIncidents(requestOptions?: RequestOptions): Promise<IncidentsResponse> {\n const requestPath = '/1/incidents';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves average times for indexing operations for selected clusters.\n * @param getIndexingTime - The getIndexingTime object.\n * @param getIndexingTime.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getIndexingTime(\n { clusters }: GetIndexingTimeProps,\n requestOptions?: RequestOptions,\n ): Promise<IndexingTimeResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getIndexingTime`.');\n }\n\n const requestPath = '/1/indexing/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the average latency for search requests for selected clusters.\n * @param getLatency - The getLatency object.\n * @param getLatency.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getLatency`.');\n }\n\n const requestPath = '/1/latency/{clusters}'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).\n * @param getMetrics - The getMetrics object.\n * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.\n * @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.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse> {\n if (!metric) {\n throw new Error('Parameter `metric` is required when calling `getMetrics`.');\n }\n\n if (!period) {\n throw new Error('Parameter `period` is required when calling `getMetrics`.');\n }\n\n const requestPath = '/1/infrastructure/{metric}/period/{period}'\n .replace('{metric}', encodeURIComponent(metric))\n .replace('{period}', encodeURIComponent(period));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Test whether clusters are reachable or not.\n * @param getReachability - The getReachability object.\n * @param getReachability.clusters - Subset of clusters, separated by commas.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getReachability(\n { clusters }: GetReachabilityProps,\n requestOptions?: RequestOptions,\n ): Promise<{ [key: string]: { [key: string]: boolean } }> {\n if (!clusters) {\n throw new Error('Parameter `clusters` is required when calling `getReachability`.');\n }\n\n const requestPath = '/1/reachability/{clusters}/probes'.replace('{clusters}', encodeURIComponent(clusters));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getServers(requestOptions?: RequestOptions): Promise<InventoryResponse> {\n const requestPath = '/1/inventory/servers';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the status of all Algolia clusters and instances.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getStatus(requestOptions?: RequestOptions): Promise<StatusResponse> {\n const requestPath = '/1/status';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,2BAA2B;AAEpC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,YAAY,mBAAmB,uBAAuB;AAuBxD,IAAM,mBAAmB;AAEhC,SAAS,kBAA0B;AACjC,SAAO,CAAC,EAAE,KAAK,sBAAsB,QAAQ,aAAa,UAAU,QAAQ,CAAC;AAC/E;AAEO,SAAS,uBAAuB;AAAA,EACrC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB;AAAA,IACvB,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB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