@algolia/monitoring 1.40.0 → 1.40.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.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your JavaScript project</h4>
7
7
 
8
8
  <p align="center">
9
- <a href="https://npmjs.org/package/@algolia/monitoring"><img src="https://img.shields.io/npm/v/@algolia/monitoring.svg?style=flat-square" alt="NPM version"></img></a>
9
+ <a href="https://npmjs.com/package/@algolia/monitoring"><img src="https://img.shields.io/npm/v/@algolia/monitoring.svg?style=flat-square" alt="NPM version"></img></a>
10
10
  <a href="http://npm-stat.com/charts.html?package=@algolia/monitoring"><img src="https://img.shields.io/npm/dm/@algolia/monitoring.svg?style=flat-square" alt="NPM downloads"></a>
11
11
  <a href="https://www.jsdelivr.com/package/npm/@algolia/monitoring"><img src="https://data.jsdelivr.com/v1/package/npm/@algolia/monitoring/badge" alt="jsDelivr Downloads"></img></a>
12
12
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
@@ -14,12 +14,11 @@
14
14
  </p>
15
15
 
16
16
  <p align="center">
17
- <a href="https://www.algolia.com/doc/libraries/javascript/" target="_blank">Documentation</a> •
17
+ <a href="https://www.algolia.com/doc/libraries/sdk/install#javascript" target="_blank">Documentation</a> •
18
18
  <a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> •
19
19
  <a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
20
20
  <a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
21
21
  <a href="https://github.com/algolia/algoliasearch-client-javascript/issues" target="_blank">Report a bug</a> •
22
- <a href="https://www.algolia.com/doc/libraries/javascript/v5/" target="_blank">FAQ</a> •
23
22
  <a href="https://alg.li/support" target="_blank">Support</a>
24
23
  </p>
25
24
 
@@ -41,11 +40,11 @@ All of our clients comes with type definition, and are available for both browse
41
40
  ### With a package manager
42
41
 
43
42
  ```bash
44
- yarn add @algolia/monitoring@1.40.0
43
+ yarn add @algolia/monitoring@1.40.1
45
44
  # or
46
- npm install @algolia/monitoring@1.40.0
45
+ npm install @algolia/monitoring@1.40.1
47
46
  # or
48
- pnpm add @algolia/monitoring@1.40.0
47
+ pnpm add @algolia/monitoring@1.40.1
49
48
  ```
50
49
 
51
50
  ### Without a package manager
@@ -53,7 +52,7 @@ pnpm add @algolia/monitoring@1.40.0
53
52
  Add the following JavaScript snippet to the <head> of your website:
54
53
 
55
54
  ```html
56
- <script src="https://cdn.jsdelivr.net/npm/@algolia/monitoring@1.40.0/dist/builds/browser.umd.js"></script>
55
+ <script src="https://cdn.jsdelivr.net/npm/@algolia/monitoring@1.40.1/dist/builds/browser.umd.js"></script>
57
56
  ```
58
57
 
59
58
  ### Usage
@@ -66,11 +65,11 @@ import { monitoringClient } from '@algolia/monitoring';
66
65
  const client = monitoringClient('YOUR_APP_ID', 'YOUR_API_KEY');
67
66
  ```
68
67
 
69
- For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/v5/methods/monitoring/)**.
68
+ For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/sdk/methods/monitoring/)**.
70
69
 
71
70
  ## ❓ Troubleshooting
72
71
 
73
- Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/libraries/javascript/v5/) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md)
72
+ Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://support.algolia.com/hc/en-us/sections/15061037630609-API-Client-FAQs) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md)
74
73
 
75
74
  ## 📄 License
76
75
 
package/dist/browser.d.ts CHANGED
@@ -282,7 +282,7 @@ type GetReachabilityProps = {
282
282
  clusters: string;
283
283
  };
284
284
 
285
- declare const apiClientVersion = "1.40.0";
285
+ declare const apiClientVersion = "1.40.1";
286
286
  declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
287
287
  transporter: _algolia_client_common.Transporter;
288
288
  /**
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  // src/monitoringClient.ts
11
11
  import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
12
- var apiClientVersion = "1.40.0";
12
+ var apiClientVersion = "1.40.1";
13
13
  function getDefaultHosts() {
14
14
  return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/browser.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 { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, createMonitoringClient } from '../src/monitoringClient';\n\nexport { apiClientVersion } from '../src/monitoringClient';\n\nexport * from '../model';\n\nexport function monitoringClient(appId: string, apiKey: string, options?: ClientOptions | undefined): 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 createMonitoringClient({\n appId,\n apiKey,\n timeouts: {\n connect: 1000,\n read: 2000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n\nexport type MonitoringClient = ReturnType<typeof createMonitoringClient>;\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.40.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 * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\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 | undefined): 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 lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 | undefined): 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 | undefined): 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 | undefined): 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":";AAEA,SAAS,0BAA0B;AAEnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACCP,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,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO;AAAA;AAAA;AA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;AAAA,IAClC,eAAe,kBAAkB,EAAE,cAAc,MAAM,CAAC;AAAA,IACxD,YAAY,wBAAwB;AAAA,MAClC,QAAQ,CAAC,+BAA+B,EAAE,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAAA,IACvG,CAAC;AAAA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../builds/browser.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 { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, createMonitoringClient } from '../src/monitoringClient';\n\nexport { apiClientVersion } from '../src/monitoringClient';\n\nexport * from '../model';\n\nexport function monitoringClient(appId: string, apiKey: string, options?: ClientOptions | undefined): 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 createMonitoringClient({\n appId,\n apiKey,\n timeouts: {\n connect: 1000,\n read: 2000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n\nexport type MonitoringClient = ReturnType<typeof createMonitoringClient>;\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.40.1';\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 * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\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 | undefined): 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 lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 | undefined): 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 | undefined): 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 | undefined): 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":";AAEA,SAAS,0BAA0B;AAEnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACCP,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,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO;AAAA;AAAA;AAAA;AAAA,IAKP,QAAQ;AAAA;AAAA;AAAA;AAAA,IAKR,aAA4B;AAC1B,aAAO,QAAQ,IAAI,CAAC,YAAY,cAAc,MAAM,GAAG,YAAY,eAAe,MAAM,CAAC,CAAC,EAAE,KAAK,MAAM,MAAS;AAAA,IAClH;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,MAAc;AAChB,aAAO,YAAY,aAAa;AAAA,IAClC;AAAA;AAAA;AAA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r(e){return new Promise(s=>{let t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach(o=>t.setRequestHeader(o,e.headers[o]));let a=(o,n)=>setTimeout(()=>{t.abort(),s({status:0,content:n,isTimedOut:!0})},o),d=a(e.connectTimeout,"Connection timeout"),i;t.onreadystatechange=()=>{t.readyState>t.OPENED&&i===void 0&&(clearTimeout(d),i=a(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{t.status===0&&(clearTimeout(d),clearTimeout(i),s({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(d),clearTimeout(i),s({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)})}return{send:r}}function M(r){let e,s=`algolia-client-js-${r.key}`;function t(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function a(){return JSON.parse(t().getItem(s)||"{}")}function d(o){t().setItem(s,JSON.stringify(o))}function i(){let o=r.timeToLive?r.timeToLive*1e3:null,n=a(),c=Object.fromEntries(Object.entries(n).filter(([,m])=>m.timestamp!==void 0));if(d(c),!o)return;let u=Object.fromEntries(Object.entries(c).filter(([,m])=>{let h=new Date().getTime();return!(m.timestamp+o<h)}));d(u)}return{get(o,n,c={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(i(),a()[JSON.stringify(o)])).then(u=>Promise.all([u?u.value:n(),u!==void 0])).then(([u,m])=>Promise.all([u,m||c.miss(u)])).then(([u])=>u)},set(o,n){return Promise.resolve().then(()=>{let c=a();return c[JSON.stringify(o)]={timestamp:new Date().getTime(),value:n},t().setItem(s,JSON.stringify(c)),n})},delete(o){return Promise.resolve().then(()=>{let n=a();delete n[JSON.stringify(o)],t().setItem(s,JSON.stringify(n))})},clear(){return Promise.resolve().then(()=>{t().removeItem(s)})}}}function K(){return{get(r,e,s={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,s.miss(a)])).then(([a])=>a)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function T(r){let e=[...r.caches],s=e.shift();return s===void 0?K():{get(t,a,d={miss:()=>Promise.resolve()}){return s.get(t,a,d).catch(()=>T({caches:e}).get(t,a,d))},set(t,a){return s.set(t,a).catch(()=>T({caches:e}).set(t,a))},delete(t){return s.delete(t).catch(()=>T({caches:e}).delete(t))},clear(){return s.clear().catch(()=>T({caches:e}).clear())}}}function I(r={serializable:!0}){let e={};return{get(s,t,a={miss:()=>Promise.resolve()}){let d=JSON.stringify(s);if(d in e)return Promise.resolve(r.serializable?JSON.parse(e[d]):e[d]);let i=t();return i.then(o=>a.miss(o)).then(()=>i)},set(s,t){return e[JSON.stringify(s)]=r.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete(s){return delete e[JSON.stringify(s)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}function V(r){let e={value:`Algolia for JavaScript (${r})`,add(s){let t=`; ${s.segment}${s.version!==void 0?` (${s.version})`:""}`;return e.value.indexOf(t)===-1&&(e.value=`${e.value}${t}`),e}};return e}function Q(r,e,s="WithinHeaders"){let t={"x-algolia-api-key":e,"x-algolia-application-id":r};return{headers(){return s==="WithinHeaders"?t:{}},queryParameters(){return s==="WithinQueryParameters"?t:{}}}}function $({algoliaAgents:r,client:e,version:s}){let t=V(s).add({segment:e,version:s});return r.forEach(a=>t.add(a)),t}function W(){return{debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var k=120*1e3;function L(r,e="up"){let s=Date.now();function t(){return e==="up"||Date.now()-s>k}function a(){return e==="timed out"&&Date.now()-s<=k}return{...r,status:e,lastUpdate:s,isUp:t,isTimedOut:a}}var j=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e)}};var J=class extends j{stackTrace;constructor(r,e,s){super(r,s),this.stackTrace=e}},Y=class extends J{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",r,"RetryError")}},b=class extends J{status;constructor(r,e,s,t="ApiError"){super(r,s,t),this.status=e}},Z=class extends j{response;constructor(r,e){super(r,"DeserializationError"),this.response=e}},ee=class extends b{error;constructor(r,e,s,t){super(r,e,t,"DetailedApiError"),this.error=s}};function re(r,e,s){let t=te(s),a=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return t.length&&(a+=`?${t}`),a}function te(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replace(/\+/g,"%20")}`).join("&")}function se(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let s=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(s)}function oe(r,e,s){let t={Accept:"application/json",...r,...e,...s},a={};return Object.keys(t).forEach(d=>{let i=t[d];a[d.toLowerCase()]=i}),a}function ne(r){try{return JSON.parse(r.content)}catch(e){throw new Z(e.message,r)}}function ae({content:r,status:e},s){try{let t=JSON.parse(r);return"error"in t?new ee(t.message,e,t.error,s):new b(t.message,e,s)}catch{}return new b(r,e,s)}function ie({isTimedOut:r,status:e}){return!r&&~~e===0}function ce({isTimedOut:r,status:e}){return r||ie({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function ue({status:r}){return~~(r/100)===2}function le(r){return r.map(e=>z(e))}function z(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function F({hosts:r,hostsCache:e,baseHeaders:s,logger:t,baseQueryParameters:a,algoliaAgent:d,timeouts:i,requester:o,requestsCache:n,responsesCache:c}){async function u(l){let p=await Promise.all(l.map(f=>e.get(f,()=>Promise.resolve(L(f))))),E=p.filter(f=>f.isUp()),g=p.filter(f=>f.isTimedOut()),w=[...E,...g];return{hosts:w.length>0?w:l,getTimeout(f,q){return(g.length===0&&f===0?1:g.length+3+f)*q}}}async function m(l,p,E=!0){let g=[],w=se(l,p),y=oe(s,l.headers,p.headers),f=l.method==="GET"?{...l.data,...p.data}:{},q={...a,...l.queryParameters,...f};if(d.value&&(q["x-algolia-agent"]=d.value),p&&p.queryParameters)for(let P of Object.keys(p.queryParameters))!p.queryParameters[P]||Object.prototype.toString.call(p.queryParameters[P])==="[object Object]"?q[P]=p.queryParameters[P]:q[P]=p.queryParameters[P].toString();let v=0,N=async(P,C)=>{let x=P.pop();if(x===void 0)throw new Y(le(g));let A={...i,...p.timeouts},_={data:w,headers:y,method:l.method,url:re(x,l.path,q),connectTimeout:C(v,A.connect),responseTimeout:C(v,E?A.read:A.write)},G=S=>{let U={request:_,response:S,host:x,triesLeft:P.length};return g.push(U),U},R=await o.send(_);if(ce(R)){let S=G(R);return R.isTimedOut&&v++,t.info("Retryable failure",z(S)),await e.set(x,L(x,R.isTimedOut?"timed out":"down")),N(P,C)}if(ue(R))return ne(R);throw G(R),ae(R,g)},X=r.filter(P=>P.accept==="readWrite"||(E?P.accept==="read":P.accept==="write")),D=await u(X);return N([...D.hosts].reverse(),D.getTimeout)}function h(l,p={}){let E=l.useReadTransporter||l.method==="GET";if(!E)return m(l,p,E);let g=()=>m(l,p);if((p.cacheable||l.cacheable)!==!0)return g();let y={request:l,requestOptions:p,transporter:{queryParameters:a,headers:s}};return c.get(y,()=>n.get(y,()=>n.set(y,g()).then(f=>Promise.all([n.delete(y),f]),f=>Promise.all([n.delete(y),Promise.reject(f)])).then(([f,q])=>q)),{miss:f=>c.set(y,f)})}return{hostsCache:e,requester:o,timeouts:i,logger:t,algoliaAgent:d,baseHeaders:s,baseQueryParameters:a,hosts:r,request:h,requestsCache:n,responsesCache:c}}var O="1.40.0";function me(){return[{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function B({appId:r,apiKey:e,authMode:s,algoliaAgents:t,...a}){let d=Q(r,e,s),i=F({hosts:me(),...a,algoliaAgent:$({algoliaAgents:t,client:"Monitoring",version:O}),baseHeaders:{"content-type":"text/plain",...d.headers(),...a.baseHeaders},baseQueryParameters:{...d.queryParameters(),...a.baseQueryParameters}});return{transporter:i,appId:r,apiKey:e,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(o,n){i.algoliaAgent.add({segment:o,version:n})},setClientApiKey({apiKey:o}){!s||s==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=o:i.baseQueryParameters["x-algolia-api-key"]=o},customDelete({path:o,parameters:n},c){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let l={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return i.request(l,c)},customGet({path:o,parameters:n},c){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let l={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return i.request(l,c)},customPost({path:o,parameters:n,body:c},u){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let p={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:c||{}};return i.request(p,u)},customPut({path:o,parameters:n,body:c},u){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let p={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:c||{}};return i.request(p,u)},getClusterIncidents({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");let h={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getClusterStatus({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");let h={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getIncidents(o){let m={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return i.request(m,o)},getIndexingTime({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");let h={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getLatency({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getLatency`.");let h={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getMetrics({metric:o,period:n},c){if(!o)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!n)throw new Error("Parameter `period` is required when calling `getMetrics`.");let l={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(o)).replace("{period}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(l,c)},getReachability({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getReachability`.");let h={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getServers(o){let m={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return i.request(m,o)},getStatus(o){let m={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return i.request(m,o)}}}function Ke(r,e,s){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");return B({appId:r,apiKey:e,timeouts:{connect:1e3,read:2e3,write:3e4},logger:W(),requester:H(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:I(),requestsCache:I({serializable:!1}),hostsCache:T({caches:[M({key:`${O}-${r}`}),I()]}),...s})}export{O as apiClientVersion,Ke as monitoringClient};
1
+ function H(){function r(e){return new Promise(s=>{let t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach(o=>t.setRequestHeader(o,e.headers[o]));let a=(o,n)=>setTimeout(()=>{t.abort(),s({status:0,content:n,isTimedOut:!0})},o),d=a(e.connectTimeout,"Connection timeout"),i;t.onreadystatechange=()=>{t.readyState>t.OPENED&&i===void 0&&(clearTimeout(d),i=a(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{t.status===0&&(clearTimeout(d),clearTimeout(i),s({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(d),clearTimeout(i),s({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)})}return{send:r}}function M(r){let e,s=`algolia-client-js-${r.key}`;function t(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function a(){return JSON.parse(t().getItem(s)||"{}")}function d(o){t().setItem(s,JSON.stringify(o))}function i(){let o=r.timeToLive?r.timeToLive*1e3:null,n=a(),c=Object.fromEntries(Object.entries(n).filter(([,m])=>m.timestamp!==void 0));if(d(c),!o)return;let u=Object.fromEntries(Object.entries(c).filter(([,m])=>{let h=new Date().getTime();return!(m.timestamp+o<h)}));d(u)}return{get(o,n,c={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(i(),a()[JSON.stringify(o)])).then(u=>Promise.all([u?u.value:n(),u!==void 0])).then(([u,m])=>Promise.all([u,m||c.miss(u)])).then(([u])=>u)},set(o,n){return Promise.resolve().then(()=>{let c=a();return c[JSON.stringify(o)]={timestamp:new Date().getTime(),value:n},t().setItem(s,JSON.stringify(c)),n})},delete(o){return Promise.resolve().then(()=>{let n=a();delete n[JSON.stringify(o)],t().setItem(s,JSON.stringify(n))})},clear(){return Promise.resolve().then(()=>{t().removeItem(s)})}}}function K(){return{get(r,e,s={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,s.miss(a)])).then(([a])=>a)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function T(r){let e=[...r.caches],s=e.shift();return s===void 0?K():{get(t,a,d={miss:()=>Promise.resolve()}){return s.get(t,a,d).catch(()=>T({caches:e}).get(t,a,d))},set(t,a){return s.set(t,a).catch(()=>T({caches:e}).set(t,a))},delete(t){return s.delete(t).catch(()=>T({caches:e}).delete(t))},clear(){return s.clear().catch(()=>T({caches:e}).clear())}}}function I(r={serializable:!0}){let e={};return{get(s,t,a={miss:()=>Promise.resolve()}){let d=JSON.stringify(s);if(d in e)return Promise.resolve(r.serializable?JSON.parse(e[d]):e[d]);let i=t();return i.then(o=>a.miss(o)).then(()=>i)},set(s,t){return e[JSON.stringify(s)]=r.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete(s){return delete e[JSON.stringify(s)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}function V(r){let e={value:`Algolia for JavaScript (${r})`,add(s){let t=`; ${s.segment}${s.version!==void 0?` (${s.version})`:""}`;return e.value.indexOf(t)===-1&&(e.value=`${e.value}${t}`),e}};return e}function Q(r,e,s="WithinHeaders"){let t={"x-algolia-api-key":e,"x-algolia-application-id":r};return{headers(){return s==="WithinHeaders"?t:{}},queryParameters(){return s==="WithinQueryParameters"?t:{}}}}function $({algoliaAgents:r,client:e,version:s}){let t=V(s).add({segment:e,version:s});return r.forEach(a=>t.add(a)),t}function W(){return{debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var k=120*1e3;function L(r,e="up"){let s=Date.now();function t(){return e==="up"||Date.now()-s>k}function a(){return e==="timed out"&&Date.now()-s<=k}return{...r,status:e,lastUpdate:s,isUp:t,isTimedOut:a}}var j=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e)}};var J=class extends j{stackTrace;constructor(r,e,s){super(r,s),this.stackTrace=e}},Y=class extends J{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",r,"RetryError")}},b=class extends J{status;constructor(r,e,s,t="ApiError"){super(r,s,t),this.status=e}},Z=class extends j{response;constructor(r,e){super(r,"DeserializationError"),this.response=e}},ee=class extends b{error;constructor(r,e,s,t){super(r,e,t,"DetailedApiError"),this.error=s}};function re(r,e,s){let t=te(s),a=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return t.length&&(a+=`?${t}`),a}function te(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replace(/\+/g,"%20")}`).join("&")}function se(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let s=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(s)}function oe(r,e,s){let t={Accept:"application/json",...r,...e,...s},a={};return Object.keys(t).forEach(d=>{let i=t[d];a[d.toLowerCase()]=i}),a}function ne(r){try{return JSON.parse(r.content)}catch(e){throw new Z(e.message,r)}}function ae({content:r,status:e},s){try{let t=JSON.parse(r);return"error"in t?new ee(t.message,e,t.error,s):new b(t.message,e,s)}catch{}return new b(r,e,s)}function ie({isTimedOut:r,status:e}){return!r&&~~e===0}function ce({isTimedOut:r,status:e}){return r||ie({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function ue({status:r}){return~~(r/100)===2}function le(r){return r.map(e=>z(e))}function z(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function F({hosts:r,hostsCache:e,baseHeaders:s,logger:t,baseQueryParameters:a,algoliaAgent:d,timeouts:i,requester:o,requestsCache:n,responsesCache:c}){async function u(l){let p=await Promise.all(l.map(f=>e.get(f,()=>Promise.resolve(L(f))))),E=p.filter(f=>f.isUp()),g=p.filter(f=>f.isTimedOut()),w=[...E,...g];return{hosts:w.length>0?w:l,getTimeout(f,q){return(g.length===0&&f===0?1:g.length+3+f)*q}}}async function m(l,p,E=!0){let g=[],w=se(l,p),y=oe(s,l.headers,p.headers),f=l.method==="GET"?{...l.data,...p.data}:{},q={...a,...l.queryParameters,...f};if(d.value&&(q["x-algolia-agent"]=d.value),p&&p.queryParameters)for(let P of Object.keys(p.queryParameters))!p.queryParameters[P]||Object.prototype.toString.call(p.queryParameters[P])==="[object Object]"?q[P]=p.queryParameters[P]:q[P]=p.queryParameters[P].toString();let v=0,N=async(P,C)=>{let x=P.pop();if(x===void 0)throw new Y(le(g));let A={...i,...p.timeouts},_={data:w,headers:y,method:l.method,url:re(x,l.path,q),connectTimeout:C(v,A.connect),responseTimeout:C(v,E?A.read:A.write)},G=S=>{let U={request:_,response:S,host:x,triesLeft:P.length};return g.push(U),U},R=await o.send(_);if(ce(R)){let S=G(R);return R.isTimedOut&&v++,t.info("Retryable failure",z(S)),await e.set(x,L(x,R.isTimedOut?"timed out":"down")),N(P,C)}if(ue(R))return ne(R);throw G(R),ae(R,g)},X=r.filter(P=>P.accept==="readWrite"||(E?P.accept==="read":P.accept==="write")),D=await u(X);return N([...D.hosts].reverse(),D.getTimeout)}function h(l,p={}){let E=l.useReadTransporter||l.method==="GET";if(!E)return m(l,p,E);let g=()=>m(l,p);if((p.cacheable||l.cacheable)!==!0)return g();let y={request:l,requestOptions:p,transporter:{queryParameters:a,headers:s}};return c.get(y,()=>n.get(y,()=>n.set(y,g()).then(f=>Promise.all([n.delete(y),f]),f=>Promise.all([n.delete(y),Promise.reject(f)])).then(([f,q])=>q)),{miss:f=>c.set(y,f)})}return{hostsCache:e,requester:o,timeouts:i,logger:t,algoliaAgent:d,baseHeaders:s,baseQueryParameters:a,hosts:r,request:h,requestsCache:n,responsesCache:c}}var O="1.40.1";function me(){return[{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function B({appId:r,apiKey:e,authMode:s,algoliaAgents:t,...a}){let d=Q(r,e,s),i=F({hosts:me(),...a,algoliaAgent:$({algoliaAgents:t,client:"Monitoring",version:O}),baseHeaders:{"content-type":"text/plain",...d.headers(),...a.baseHeaders},baseQueryParameters:{...d.queryParameters(),...a.baseQueryParameters}});return{transporter:i,appId:r,apiKey:e,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(o,n){i.algoliaAgent.add({segment:o,version:n})},setClientApiKey({apiKey:o}){!s||s==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=o:i.baseQueryParameters["x-algolia-api-key"]=o},customDelete({path:o,parameters:n},c){if(!o)throw new Error("Parameter `path` is required when calling `customDelete`.");let l={method:"DELETE",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return i.request(l,c)},customGet({path:o,parameters:n},c){if(!o)throw new Error("Parameter `path` is required when calling `customGet`.");let l={method:"GET",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{}};return i.request(l,c)},customPost({path:o,parameters:n,body:c},u){if(!o)throw new Error("Parameter `path` is required when calling `customPost`.");let p={method:"POST",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:c||{}};return i.request(p,u)},customPut({path:o,parameters:n,body:c},u){if(!o)throw new Error("Parameter `path` is required when calling `customPut`.");let p={method:"PUT",path:"/{path}".replace("{path}",o),queryParameters:n||{},headers:{},data:c||{}};return i.request(p,u)},getClusterIncidents({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");let h={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getClusterStatus({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");let h={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getIncidents(o){let m={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return i.request(m,o)},getIndexingTime({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");let h={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getLatency({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getLatency`.");let h={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getMetrics({metric:o,period:n},c){if(!o)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!n)throw new Error("Parameter `period` is required when calling `getMetrics`.");let l={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(o)).replace("{period}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(l,c)},getReachability({clusters:o},n){if(!o)throw new Error("Parameter `clusters` is required when calling `getReachability`.");let h={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(h,n)},getServers(o){let m={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return i.request(m,o)},getStatus(o){let m={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return i.request(m,o)}}}function Ke(r,e,s){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");return B({appId:r,apiKey:e,timeouts:{connect:1e3,read:2e3,write:3e4},logger:W(),requester:H(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:I(),requestsCache:I({serializable:!1}),hostsCache:T({caches:[M({key:`${O}-${r}`}),I()]}),...s})}export{O as apiClientVersion,Ke as monitoringClient};
2
2
  //# sourceMappingURL=browser.min.js.map