devstar插件
This commit is contained in:
21
node_modules/@algolia/monitoring/LICENSE
generated
vendored
Normal file
21
node_modules/@algolia/monitoring/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2013-Present Algolia
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
77
node_modules/@algolia/monitoring/README.md
generated
vendored
Normal file
77
node_modules/@algolia/monitoring/README.md
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
<p align="center">
|
||||
<a href="https://www.algolia.com">
|
||||
<img alt="Algolia for JavaScript" src="https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/banners/javascript.png" >
|
||||
</a>
|
||||
|
||||
<h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your JavaScript project</h4>
|
||||
|
||||
<p align="center">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.algolia.com/doc/libraries/javascript/" target="_blank">Documentation</a> •
|
||||
<a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> •
|
||||
<a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
|
||||
<a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
|
||||
<a href="https://github.com/algolia/algoliasearch-client-javascript/issues" target="_blank">Report a bug</a> •
|
||||
<a href="https://www.algolia.com/doc/libraries/javascript/v5/" target="_blank">FAQ</a> •
|
||||
<a href="https://alg.li/support" target="_blank">Support</a>
|
||||
</p>
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- Thin & **minimal low-level HTTP client** to interact with Algolia's API
|
||||
- Works both on the **browser** and **node.js**
|
||||
- **UMD and ESM compatible**, you can use it with any module loader
|
||||
- Built with TypeScript
|
||||
|
||||
## 💡 Getting Started
|
||||
|
||||
> [!TIP]
|
||||
> This API client is already a dependency of [the algoliasearch client](https://www.npmjs.com/package/algoliasearch), you don't need to manually install `@algolia/monitoring` if you already have `algoliasearch` installed.
|
||||
|
||||
To get started, you first need to install @algolia/monitoring (or any other available API client package).
|
||||
All of our clients comes with type definition, and are available for both browser and node environments.
|
||||
|
||||
### With a package manager
|
||||
|
||||
```bash
|
||||
yarn add @algolia/monitoring@1.34.1
|
||||
# or
|
||||
npm install @algolia/monitoring@1.34.1
|
||||
# or
|
||||
pnpm add @algolia/monitoring@1.34.1
|
||||
```
|
||||
|
||||
### Without a package manager
|
||||
|
||||
Add the following JavaScript snippet to the <head> of your website:
|
||||
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/@algolia/monitoring@1.34.1/dist/builds/browser.umd.js"></script>
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
You can now import the Algolia API client in your project and play with it.
|
||||
|
||||
```js
|
||||
import { monitoringClient } from '@algolia/monitoring';
|
||||
|
||||
const client = monitoringClient('YOUR_APP_ID', 'YOUR_API_KEY');
|
||||
```
|
||||
|
||||
For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/v5/methods/monitoring/)**.
|
||||
|
||||
## ❓ Troubleshooting
|
||||
|
||||
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)
|
||||
|
||||
## 📄 License
|
||||
|
||||
The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE).
|
440
node_modules/@algolia/monitoring/dist/browser.d.ts
generated
vendored
Normal file
440
node_modules/@algolia/monitoring/dist/browser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,440 @@
|
||||
import * as _algolia_client_common from '@algolia/client-common';
|
||||
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
||||
|
||||
/**
|
||||
* Status of the cluster.
|
||||
*/
|
||||
type Status = 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage';
|
||||
|
||||
/**
|
||||
* Incident details.
|
||||
*/
|
||||
type Incident = {
|
||||
/**
|
||||
* Description of the incident.
|
||||
*/
|
||||
title?: string | undefined;
|
||||
status?: Status | undefined;
|
||||
};
|
||||
|
||||
type IncidentEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
v?: Incident | undefined;
|
||||
};
|
||||
|
||||
type IncidentsResponse = {
|
||||
incidents?: {
|
||||
[key: string]: Array<IncidentEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type TimeEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Time in ms.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type IndexingMetric = {
|
||||
indexing?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type IndexingTimeResponse = {
|
||||
metrics?: IndexingMetric | undefined;
|
||||
};
|
||||
|
||||
type ProbesMetric = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Value of the metric.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type Metrics = {
|
||||
/**
|
||||
* CPU idleness in %.
|
||||
*/
|
||||
cpu_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for indexing in MB.
|
||||
*/
|
||||
ram_indexing_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for search in MB.
|
||||
*/
|
||||
ram_search_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Solid-state disk (SSD) usage expressed as % of RAM. 0% means no SSD usage. A value of 50% indicates 32 GB SSD usage for a machine with 64 RAM.
|
||||
*/
|
||||
ssd_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Average build time of the indices in seconds.
|
||||
*/
|
||||
avg_build_time?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type InfrastructureResponse = {
|
||||
metrics?: Metrics | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Region where the cluster is located.
|
||||
*/
|
||||
type Region = 'au' | 'br' | 'ca' | 'de' | 'eu' | 'hk' | 'in' | 'jp' | 'sg' | 'uae' | 'uk' | 'usc' | 'use' | 'usw' | 'za';
|
||||
|
||||
type ServerStatus = 'PRODUCTION';
|
||||
|
||||
type Type = 'cluster';
|
||||
|
||||
type Server = {
|
||||
/**
|
||||
* Server name.
|
||||
*/
|
||||
name?: string | undefined;
|
||||
region?: Region | undefined;
|
||||
/**
|
||||
* Included to support legacy applications. Use `is_replica` instead.
|
||||
*/
|
||||
is_slave?: boolean | undefined;
|
||||
/**
|
||||
* Whether this server is a replica of another server.
|
||||
*/
|
||||
is_replica?: boolean | undefined;
|
||||
/**
|
||||
* Name of the cluster to which this server belongs.
|
||||
*/
|
||||
cluster?: string | undefined;
|
||||
status?: ServerStatus | undefined;
|
||||
type?: Type | undefined;
|
||||
};
|
||||
|
||||
type InventoryResponse = {
|
||||
inventory?: Array<Server> | undefined;
|
||||
};
|
||||
|
||||
type LatencyMetric = {
|
||||
latency?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type LatencyResponse = {
|
||||
metrics?: LatencyMetric | undefined;
|
||||
};
|
||||
|
||||
type StatusResponse = {
|
||||
status?: {
|
||||
[key: string]: Status;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type Metric = 'avg_build_time' | 'ssd_usage' | 'ram_search_usage' | 'ram_indexing_usage' | 'cpu_usage' | '*';
|
||||
|
||||
type Period = 'minute' | 'hour' | 'day' | 'week' | 'month';
|
||||
|
||||
/**
|
||||
* Properties for the `customDelete` method.
|
||||
*/
|
||||
type CustomDeleteProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customGet` method.
|
||||
*/
|
||||
type CustomGetProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPost` method.
|
||||
*/
|
||||
type CustomPostProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPut` method.
|
||||
*/
|
||||
type CustomPutProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterIncidents` method.
|
||||
*/
|
||||
type GetClusterIncidentsProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterStatus` method.
|
||||
*/
|
||||
type GetClusterStatusProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getIndexingTime` method.
|
||||
*/
|
||||
type GetIndexingTimeProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getLatency` method.
|
||||
*/
|
||||
type GetLatencyProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getMetrics` method.
|
||||
*/
|
||||
type GetMetricsProps = {
|
||||
/**
|
||||
* Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
|
||||
*/
|
||||
metric: Metric;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
period: Period;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getReachability` method.
|
||||
*/
|
||||
type GetReachabilityProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
|
||||
declare const apiClientVersion = "1.34.1";
|
||||
declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
||||
transporter: _algolia_client_common.Transporter;
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: string;
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache(): Promise<void>;
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
readonly _ua: string;
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment: string, version?: string | undefined): void;
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }: {
|
||||
apiKey: string;
|
||||
}): void;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }: GetClusterIncidentsProps, requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse>;
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions?: RequestOptions | undefined): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }: GetIndexingTimeProps, requestOptions?: RequestOptions): Promise<IndexingTimeResponse>;
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse>;
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse>;
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }: GetReachabilityProps, requestOptions?: RequestOptions): Promise<{
|
||||
[key: string]: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
}>;
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions?: RequestOptions | undefined): Promise<InventoryResponse>;
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions?: RequestOptions | undefined): Promise<StatusResponse>;
|
||||
};
|
||||
|
||||
type BadRequest = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Error.
|
||||
*/
|
||||
type ErrorBase = Record<string, any> & {
|
||||
message?: string | undefined;
|
||||
};
|
||||
|
||||
type Forbidden = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type Unauthorized = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
declare function monitoringClient(appId: string, apiKey: string, options?: ClientOptions | undefined): MonitoringClient;
|
||||
type MonitoringClient = ReturnType<typeof createMonitoringClient>;
|
||||
|
||||
export { type BadRequest, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type ErrorBase, type Forbidden, type GetClusterIncidentsProps, type GetClusterStatusProps, type GetIndexingTimeProps, type GetLatencyProps, type GetMetricsProps, type GetReachabilityProps, type Incident, type IncidentEntry, type IncidentsResponse, type IndexingMetric, type IndexingTimeResponse, type InfrastructureResponse, type InventoryResponse, type LatencyMetric, type LatencyResponse, type Metric, type Metrics, type MonitoringClient, type Period, type ProbesMetric, type Region, type Server, type ServerStatus, type Status, type StatusResponse, type TimeEntry, type Type, type Unauthorized, apiClientVersion, monitoringClient };
|
391
node_modules/@algolia/monitoring/dist/builds/browser.js
generated
vendored
Normal file
391
node_modules/@algolia/monitoring/dist/builds/browser.js
generated
vendored
Normal file
@@ -0,0 +1,391 @@
|
||||
// builds/browser.ts
|
||||
import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
||||
import {
|
||||
createBrowserLocalStorageCache,
|
||||
createFallbackableCache,
|
||||
createMemoryCache,
|
||||
createNullLogger
|
||||
} from "@algolia/client-common";
|
||||
|
||||
// src/monitoringClient.ts
|
||||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
||||
var apiClientVersion = "1.34.1";
|
||||
function getDefaultHosts() {
|
||||
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
||||
}
|
||||
function createMonitoringClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = createTransporter({
|
||||
hosts: getDefaultHosts(),
|
||||
...options,
|
||||
algoliaAgent: getAlgoliaAgent({
|
||||
algoliaAgents,
|
||||
client: "Monitoring",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customDelete`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "DELETE",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customGet`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPut`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "PUT",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");
|
||||
}
|
||||
const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");
|
||||
}
|
||||
const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions) {
|
||||
const requestPath = "/1/incidents";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");
|
||||
}
|
||||
const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getLatency`.");
|
||||
}
|
||||
const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }, requestOptions) {
|
||||
if (!metric) {
|
||||
throw new Error("Parameter `metric` is required when calling `getMetrics`.");
|
||||
}
|
||||
if (!period) {
|
||||
throw new Error("Parameter `period` is required when calling `getMetrics`.");
|
||||
}
|
||||
const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getReachability`.");
|
||||
}
|
||||
const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions) {
|
||||
const requestPath = "/1/inventory/servers";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions) {
|
||||
const requestPath = "/1/status";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// builds/browser.ts
|
||||
function monitoringClient(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
return createMonitoringClient({
|
||||
appId,
|
||||
apiKey,
|
||||
timeouts: {
|
||||
connect: 1e3,
|
||||
read: 2e3,
|
||||
write: 3e4
|
||||
},
|
||||
logger: createNullLogger(),
|
||||
requester: createXhrRequester(),
|
||||
algoliaAgents: [{ segment: "Browser" }],
|
||||
authMode: "WithinQueryParameters",
|
||||
responsesCache: createMemoryCache(),
|
||||
requestsCache: createMemoryCache({ serializable: false }),
|
||||
hostsCache: createFallbackableCache({
|
||||
caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()]
|
||||
}),
|
||||
...options
|
||||
});
|
||||
}
|
||||
export {
|
||||
apiClientVersion,
|
||||
monitoringClient
|
||||
};
|
||||
//# sourceMappingURL=browser.js.map
|
1
node_modules/@algolia/monitoring/dist/builds/browser.js.map
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/dist/builds/browser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/@algolia/monitoring/dist/builds/browser.min.js
generated
vendored
Normal file
2
node_modules/@algolia/monitoring/dist/builds/browser.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/@algolia/monitoring/dist/builds/browser.min.js.map
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/dist/builds/browser.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/@algolia/monitoring/dist/builds/browser.umd.js
generated
vendored
Normal file
12
node_modules/@algolia/monitoring/dist/builds/browser.umd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
385
node_modules/@algolia/monitoring/dist/builds/fetch.js
generated
vendored
Normal file
385
node_modules/@algolia/monitoring/dist/builds/fetch.js
generated
vendored
Normal file
@@ -0,0 +1,385 @@
|
||||
// builds/fetch.ts
|
||||
import { createMemoryCache, createNullCache, createNullLogger } from "@algolia/client-common";
|
||||
import { createFetchRequester } from "@algolia/requester-fetch";
|
||||
|
||||
// src/monitoringClient.ts
|
||||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
||||
var apiClientVersion = "1.34.1";
|
||||
function getDefaultHosts() {
|
||||
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
||||
}
|
||||
function createMonitoringClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = createTransporter({
|
||||
hosts: getDefaultHosts(),
|
||||
...options,
|
||||
algoliaAgent: getAlgoliaAgent({
|
||||
algoliaAgents,
|
||||
client: "Monitoring",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customDelete`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "DELETE",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customGet`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPut`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "PUT",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");
|
||||
}
|
||||
const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");
|
||||
}
|
||||
const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions) {
|
||||
const requestPath = "/1/incidents";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");
|
||||
}
|
||||
const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getLatency`.");
|
||||
}
|
||||
const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }, requestOptions) {
|
||||
if (!metric) {
|
||||
throw new Error("Parameter `metric` is required when calling `getMetrics`.");
|
||||
}
|
||||
if (!period) {
|
||||
throw new Error("Parameter `period` is required when calling `getMetrics`.");
|
||||
}
|
||||
const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getReachability`.");
|
||||
}
|
||||
const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions) {
|
||||
const requestPath = "/1/inventory/servers";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions) {
|
||||
const requestPath = "/1/status";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// builds/fetch.ts
|
||||
function monitoringClient(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
return {
|
||||
...createMonitoringClient({
|
||||
appId,
|
||||
apiKey,
|
||||
timeouts: {
|
||||
connect: 2e3,
|
||||
read: 5e3,
|
||||
write: 3e4
|
||||
},
|
||||
logger: createNullLogger(),
|
||||
requester: createFetchRequester(),
|
||||
algoliaAgents: [{ segment: "Fetch" }],
|
||||
responsesCache: createNullCache(),
|
||||
requestsCache: createNullCache(),
|
||||
hostsCache: createMemoryCache(),
|
||||
...options
|
||||
})
|
||||
};
|
||||
}
|
||||
export {
|
||||
apiClientVersion,
|
||||
monitoringClient
|
||||
};
|
||||
//# sourceMappingURL=fetch.js.map
|
1
node_modules/@algolia/monitoring/dist/builds/fetch.js.map
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/dist/builds/fetch.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
411
node_modules/@algolia/monitoring/dist/builds/node.cjs
generated
vendored
Normal file
411
node_modules/@algolia/monitoring/dist/builds/node.cjs
generated
vendored
Normal file
@@ -0,0 +1,411 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// builds/node.ts
|
||||
var node_exports = {};
|
||||
__export(node_exports, {
|
||||
apiClientVersion: () => apiClientVersion,
|
||||
monitoringClient: () => monitoringClient
|
||||
});
|
||||
module.exports = __toCommonJS(node_exports);
|
||||
var import_requester_node_http = require("@algolia/requester-node-http");
|
||||
var import_client_common2 = require("@algolia/client-common");
|
||||
|
||||
// src/monitoringClient.ts
|
||||
var import_client_common = require("@algolia/client-common");
|
||||
var apiClientVersion = "1.34.1";
|
||||
function getDefaultHosts() {
|
||||
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
||||
}
|
||||
function createMonitoringClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = (0, import_client_common.createTransporter)({
|
||||
hosts: getDefaultHosts(),
|
||||
...options,
|
||||
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
|
||||
algoliaAgents,
|
||||
client: "Monitoring",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customDelete`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "DELETE",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customGet`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPut`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "PUT",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");
|
||||
}
|
||||
const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");
|
||||
}
|
||||
const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions) {
|
||||
const requestPath = "/1/incidents";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");
|
||||
}
|
||||
const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getLatency`.");
|
||||
}
|
||||
const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }, requestOptions) {
|
||||
if (!metric) {
|
||||
throw new Error("Parameter `metric` is required when calling `getMetrics`.");
|
||||
}
|
||||
if (!period) {
|
||||
throw new Error("Parameter `period` is required when calling `getMetrics`.");
|
||||
}
|
||||
const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getReachability`.");
|
||||
}
|
||||
const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions) {
|
||||
const requestPath = "/1/inventory/servers";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions) {
|
||||
const requestPath = "/1/status";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// builds/node.ts
|
||||
function monitoringClient(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
return {
|
||||
...createMonitoringClient({
|
||||
appId,
|
||||
apiKey,
|
||||
timeouts: {
|
||||
connect: 2e3,
|
||||
read: 5e3,
|
||||
write: 3e4
|
||||
},
|
||||
logger: (0, import_client_common2.createNullLogger)(),
|
||||
requester: (0, import_requester_node_http.createHttpRequester)(),
|
||||
algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
|
||||
responsesCache: (0, import_client_common2.createNullCache)(),
|
||||
requestsCache: (0, import_client_common2.createNullCache)(),
|
||||
hostsCache: (0, import_client_common2.createMemoryCache)(),
|
||||
...options
|
||||
})
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
apiClientVersion,
|
||||
monitoringClient
|
||||
});
|
||||
//# sourceMappingURL=node.cjs.map
|
1
node_modules/@algolia/monitoring/dist/builds/node.cjs.map
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/dist/builds/node.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
385
node_modules/@algolia/monitoring/dist/builds/node.js
generated
vendored
Normal file
385
node_modules/@algolia/monitoring/dist/builds/node.js
generated
vendored
Normal file
@@ -0,0 +1,385 @@
|
||||
// builds/node.ts
|
||||
import { createHttpRequester } from "@algolia/requester-node-http";
|
||||
import { createMemoryCache, createNullCache, createNullLogger } from "@algolia/client-common";
|
||||
|
||||
// src/monitoringClient.ts
|
||||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
||||
var apiClientVersion = "1.34.1";
|
||||
function getDefaultHosts() {
|
||||
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
||||
}
|
||||
function createMonitoringClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = createTransporter({
|
||||
hosts: getDefaultHosts(),
|
||||
...options,
|
||||
algoliaAgent: getAlgoliaAgent({
|
||||
algoliaAgents,
|
||||
client: "Monitoring",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customDelete`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "DELETE",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customGet`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPut`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "PUT",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");
|
||||
}
|
||||
const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");
|
||||
}
|
||||
const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions) {
|
||||
const requestPath = "/1/incidents";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");
|
||||
}
|
||||
const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getLatency`.");
|
||||
}
|
||||
const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }, requestOptions) {
|
||||
if (!metric) {
|
||||
throw new Error("Parameter `metric` is required when calling `getMetrics`.");
|
||||
}
|
||||
if (!period) {
|
||||
throw new Error("Parameter `period` is required when calling `getMetrics`.");
|
||||
}
|
||||
const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getReachability`.");
|
||||
}
|
||||
const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions) {
|
||||
const requestPath = "/1/inventory/servers";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions) {
|
||||
const requestPath = "/1/status";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// builds/node.ts
|
||||
function monitoringClient(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
return {
|
||||
...createMonitoringClient({
|
||||
appId,
|
||||
apiKey,
|
||||
timeouts: {
|
||||
connect: 2e3,
|
||||
read: 5e3,
|
||||
write: 3e4
|
||||
},
|
||||
logger: createNullLogger(),
|
||||
requester: createHttpRequester(),
|
||||
algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
|
||||
responsesCache: createNullCache(),
|
||||
requestsCache: createNullCache(),
|
||||
hostsCache: createMemoryCache(),
|
||||
...options
|
||||
})
|
||||
};
|
||||
}
|
||||
export {
|
||||
apiClientVersion,
|
||||
monitoringClient
|
||||
};
|
||||
//# sourceMappingURL=node.js.map
|
1
node_modules/@algolia/monitoring/dist/builds/node.js.map
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/dist/builds/node.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
385
node_modules/@algolia/monitoring/dist/builds/worker.js
generated
vendored
Normal file
385
node_modules/@algolia/monitoring/dist/builds/worker.js
generated
vendored
Normal file
@@ -0,0 +1,385 @@
|
||||
// builds/worker.ts
|
||||
import { createMemoryCache, createNullCache, createNullLogger } from "@algolia/client-common";
|
||||
import { createFetchRequester } from "@algolia/requester-fetch";
|
||||
|
||||
// src/monitoringClient.ts
|
||||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
||||
var apiClientVersion = "1.34.1";
|
||||
function getDefaultHosts() {
|
||||
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
||||
}
|
||||
function createMonitoringClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = createTransporter({
|
||||
hosts: getDefaultHosts(),
|
||||
...options,
|
||||
algoliaAgent: getAlgoliaAgent({
|
||||
algoliaAgents,
|
||||
client: "Monitoring",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customDelete`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "DELETE",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customGet`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPut`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "PUT",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");
|
||||
}
|
||||
const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");
|
||||
}
|
||||
const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions) {
|
||||
const requestPath = "/1/incidents";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");
|
||||
}
|
||||
const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getLatency`.");
|
||||
}
|
||||
const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }, requestOptions) {
|
||||
if (!metric) {
|
||||
throw new Error("Parameter `metric` is required when calling `getMetrics`.");
|
||||
}
|
||||
if (!period) {
|
||||
throw new Error("Parameter `period` is required when calling `getMetrics`.");
|
||||
}
|
||||
const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getReachability`.");
|
||||
}
|
||||
const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions) {
|
||||
const requestPath = "/1/inventory/servers";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions) {
|
||||
const requestPath = "/1/status";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// builds/worker.ts
|
||||
function monitoringClient(appId, apiKey, options) {
|
||||
if (!appId || typeof appId !== "string") {
|
||||
throw new Error("`appId` is missing.");
|
||||
}
|
||||
if (!apiKey || typeof apiKey !== "string") {
|
||||
throw new Error("`apiKey` is missing.");
|
||||
}
|
||||
return {
|
||||
...createMonitoringClient({
|
||||
appId,
|
||||
apiKey,
|
||||
timeouts: {
|
||||
connect: 2e3,
|
||||
read: 5e3,
|
||||
write: 3e4
|
||||
},
|
||||
logger: createNullLogger(),
|
||||
requester: createFetchRequester(),
|
||||
algoliaAgents: [{ segment: "Worker" }],
|
||||
responsesCache: createNullCache(),
|
||||
requestsCache: createNullCache(),
|
||||
hostsCache: createMemoryCache(),
|
||||
...options
|
||||
})
|
||||
};
|
||||
}
|
||||
export {
|
||||
apiClientVersion,
|
||||
monitoringClient
|
||||
};
|
||||
//# sourceMappingURL=worker.js.map
|
1
node_modules/@algolia/monitoring/dist/builds/worker.js.map
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/dist/builds/worker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
441
node_modules/@algolia/monitoring/dist/fetch.d.ts
generated
vendored
Normal file
441
node_modules/@algolia/monitoring/dist/fetch.d.ts
generated
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
import * as _algolia_client_common from '@algolia/client-common';
|
||||
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
||||
|
||||
/**
|
||||
* Status of the cluster.
|
||||
*/
|
||||
type Status = 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage';
|
||||
|
||||
/**
|
||||
* Incident details.
|
||||
*/
|
||||
type Incident = {
|
||||
/**
|
||||
* Description of the incident.
|
||||
*/
|
||||
title?: string | undefined;
|
||||
status?: Status | undefined;
|
||||
};
|
||||
|
||||
type IncidentEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
v?: Incident | undefined;
|
||||
};
|
||||
|
||||
type IncidentsResponse = {
|
||||
incidents?: {
|
||||
[key: string]: Array<IncidentEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type TimeEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Time in ms.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type IndexingMetric = {
|
||||
indexing?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type IndexingTimeResponse = {
|
||||
metrics?: IndexingMetric | undefined;
|
||||
};
|
||||
|
||||
type ProbesMetric = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Value of the metric.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type Metrics = {
|
||||
/**
|
||||
* CPU idleness in %.
|
||||
*/
|
||||
cpu_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for indexing in MB.
|
||||
*/
|
||||
ram_indexing_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for search in MB.
|
||||
*/
|
||||
ram_search_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Solid-state disk (SSD) usage expressed as % of RAM. 0% means no SSD usage. A value of 50% indicates 32 GB SSD usage for a machine with 64 RAM.
|
||||
*/
|
||||
ssd_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Average build time of the indices in seconds.
|
||||
*/
|
||||
avg_build_time?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type InfrastructureResponse = {
|
||||
metrics?: Metrics | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Region where the cluster is located.
|
||||
*/
|
||||
type Region = 'au' | 'br' | 'ca' | 'de' | 'eu' | 'hk' | 'in' | 'jp' | 'sg' | 'uae' | 'uk' | 'usc' | 'use' | 'usw' | 'za';
|
||||
|
||||
type ServerStatus = 'PRODUCTION';
|
||||
|
||||
type Type = 'cluster';
|
||||
|
||||
type Server = {
|
||||
/**
|
||||
* Server name.
|
||||
*/
|
||||
name?: string | undefined;
|
||||
region?: Region | undefined;
|
||||
/**
|
||||
* Included to support legacy applications. Use `is_replica` instead.
|
||||
*/
|
||||
is_slave?: boolean | undefined;
|
||||
/**
|
||||
* Whether this server is a replica of another server.
|
||||
*/
|
||||
is_replica?: boolean | undefined;
|
||||
/**
|
||||
* Name of the cluster to which this server belongs.
|
||||
*/
|
||||
cluster?: string | undefined;
|
||||
status?: ServerStatus | undefined;
|
||||
type?: Type | undefined;
|
||||
};
|
||||
|
||||
type InventoryResponse = {
|
||||
inventory?: Array<Server> | undefined;
|
||||
};
|
||||
|
||||
type LatencyMetric = {
|
||||
latency?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type LatencyResponse = {
|
||||
metrics?: LatencyMetric | undefined;
|
||||
};
|
||||
|
||||
type StatusResponse = {
|
||||
status?: {
|
||||
[key: string]: Status;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type Metric = 'avg_build_time' | 'ssd_usage' | 'ram_search_usage' | 'ram_indexing_usage' | 'cpu_usage' | '*';
|
||||
|
||||
type Period = 'minute' | 'hour' | 'day' | 'week' | 'month';
|
||||
|
||||
/**
|
||||
* Properties for the `customDelete` method.
|
||||
*/
|
||||
type CustomDeleteProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customGet` method.
|
||||
*/
|
||||
type CustomGetProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPost` method.
|
||||
*/
|
||||
type CustomPostProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPut` method.
|
||||
*/
|
||||
type CustomPutProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterIncidents` method.
|
||||
*/
|
||||
type GetClusterIncidentsProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterStatus` method.
|
||||
*/
|
||||
type GetClusterStatusProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getIndexingTime` method.
|
||||
*/
|
||||
type GetIndexingTimeProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getLatency` method.
|
||||
*/
|
||||
type GetLatencyProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getMetrics` method.
|
||||
*/
|
||||
type GetMetricsProps = {
|
||||
/**
|
||||
* Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
|
||||
*/
|
||||
metric: Metric;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
period: Period;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getReachability` method.
|
||||
*/
|
||||
type GetReachabilityProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
|
||||
declare const apiClientVersion = "1.34.1";
|
||||
declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
||||
transporter: _algolia_client_common.Transporter;
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: string;
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache(): Promise<void>;
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
readonly _ua: string;
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment: string, version?: string | undefined): void;
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }: {
|
||||
apiKey: string;
|
||||
}): void;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }: GetClusterIncidentsProps, requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse>;
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions?: RequestOptions | undefined): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }: GetIndexingTimeProps, requestOptions?: RequestOptions): Promise<IndexingTimeResponse>;
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse>;
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse>;
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }: GetReachabilityProps, requestOptions?: RequestOptions): Promise<{
|
||||
[key: string]: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
}>;
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions?: RequestOptions | undefined): Promise<InventoryResponse>;
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions?: RequestOptions | undefined): Promise<StatusResponse>;
|
||||
};
|
||||
|
||||
type BadRequest = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Error.
|
||||
*/
|
||||
type ErrorBase = Record<string, any> & {
|
||||
message?: string | undefined;
|
||||
};
|
||||
|
||||
type Forbidden = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type Unauthorized = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type MonitoringClient = ReturnType<typeof createMonitoringClient>;
|
||||
|
||||
declare function monitoringClient(appId: string, apiKey: string, options?: ClientOptions | undefined): MonitoringClient;
|
||||
|
||||
export { type BadRequest, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type ErrorBase, type Forbidden, type GetClusterIncidentsProps, type GetClusterStatusProps, type GetIndexingTimeProps, type GetLatencyProps, type GetMetricsProps, type GetReachabilityProps, type Incident, type IncidentEntry, type IncidentsResponse, type IndexingMetric, type IndexingTimeResponse, type InfrastructureResponse, type InventoryResponse, type LatencyMetric, type LatencyResponse, type Metric, type Metrics, type MonitoringClient, type Period, type ProbesMetric, type Region, type Server, type ServerStatus, type Status, type StatusResponse, type TimeEntry, type Type, type Unauthorized, apiClientVersion, monitoringClient };
|
441
node_modules/@algolia/monitoring/dist/node.d.cts
generated
vendored
Normal file
441
node_modules/@algolia/monitoring/dist/node.d.cts
generated
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
import * as _algolia_client_common from '@algolia/client-common';
|
||||
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
||||
|
||||
/**
|
||||
* Status of the cluster.
|
||||
*/
|
||||
type Status = 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage';
|
||||
|
||||
/**
|
||||
* Incident details.
|
||||
*/
|
||||
type Incident = {
|
||||
/**
|
||||
* Description of the incident.
|
||||
*/
|
||||
title?: string | undefined;
|
||||
status?: Status | undefined;
|
||||
};
|
||||
|
||||
type IncidentEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
v?: Incident | undefined;
|
||||
};
|
||||
|
||||
type IncidentsResponse = {
|
||||
incidents?: {
|
||||
[key: string]: Array<IncidentEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type TimeEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Time in ms.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type IndexingMetric = {
|
||||
indexing?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type IndexingTimeResponse = {
|
||||
metrics?: IndexingMetric | undefined;
|
||||
};
|
||||
|
||||
type ProbesMetric = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Value of the metric.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type Metrics = {
|
||||
/**
|
||||
* CPU idleness in %.
|
||||
*/
|
||||
cpu_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for indexing in MB.
|
||||
*/
|
||||
ram_indexing_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for search in MB.
|
||||
*/
|
||||
ram_search_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Solid-state disk (SSD) usage expressed as % of RAM. 0% means no SSD usage. A value of 50% indicates 32 GB SSD usage for a machine with 64 RAM.
|
||||
*/
|
||||
ssd_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Average build time of the indices in seconds.
|
||||
*/
|
||||
avg_build_time?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type InfrastructureResponse = {
|
||||
metrics?: Metrics | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Region where the cluster is located.
|
||||
*/
|
||||
type Region = 'au' | 'br' | 'ca' | 'de' | 'eu' | 'hk' | 'in' | 'jp' | 'sg' | 'uae' | 'uk' | 'usc' | 'use' | 'usw' | 'za';
|
||||
|
||||
type ServerStatus = 'PRODUCTION';
|
||||
|
||||
type Type = 'cluster';
|
||||
|
||||
type Server = {
|
||||
/**
|
||||
* Server name.
|
||||
*/
|
||||
name?: string | undefined;
|
||||
region?: Region | undefined;
|
||||
/**
|
||||
* Included to support legacy applications. Use `is_replica` instead.
|
||||
*/
|
||||
is_slave?: boolean | undefined;
|
||||
/**
|
||||
* Whether this server is a replica of another server.
|
||||
*/
|
||||
is_replica?: boolean | undefined;
|
||||
/**
|
||||
* Name of the cluster to which this server belongs.
|
||||
*/
|
||||
cluster?: string | undefined;
|
||||
status?: ServerStatus | undefined;
|
||||
type?: Type | undefined;
|
||||
};
|
||||
|
||||
type InventoryResponse = {
|
||||
inventory?: Array<Server> | undefined;
|
||||
};
|
||||
|
||||
type LatencyMetric = {
|
||||
latency?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type LatencyResponse = {
|
||||
metrics?: LatencyMetric | undefined;
|
||||
};
|
||||
|
||||
type StatusResponse = {
|
||||
status?: {
|
||||
[key: string]: Status;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type Metric = 'avg_build_time' | 'ssd_usage' | 'ram_search_usage' | 'ram_indexing_usage' | 'cpu_usage' | '*';
|
||||
|
||||
type Period = 'minute' | 'hour' | 'day' | 'week' | 'month';
|
||||
|
||||
/**
|
||||
* Properties for the `customDelete` method.
|
||||
*/
|
||||
type CustomDeleteProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customGet` method.
|
||||
*/
|
||||
type CustomGetProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPost` method.
|
||||
*/
|
||||
type CustomPostProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPut` method.
|
||||
*/
|
||||
type CustomPutProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterIncidents` method.
|
||||
*/
|
||||
type GetClusterIncidentsProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterStatus` method.
|
||||
*/
|
||||
type GetClusterStatusProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getIndexingTime` method.
|
||||
*/
|
||||
type GetIndexingTimeProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getLatency` method.
|
||||
*/
|
||||
type GetLatencyProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getMetrics` method.
|
||||
*/
|
||||
type GetMetricsProps = {
|
||||
/**
|
||||
* Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
|
||||
*/
|
||||
metric: Metric;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
period: Period;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getReachability` method.
|
||||
*/
|
||||
type GetReachabilityProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
|
||||
declare const apiClientVersion = "1.34.1";
|
||||
declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
||||
transporter: _algolia_client_common.Transporter;
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: string;
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache(): Promise<void>;
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
readonly _ua: string;
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment: string, version?: string | undefined): void;
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }: {
|
||||
apiKey: string;
|
||||
}): void;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }: GetClusterIncidentsProps, requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse>;
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions?: RequestOptions | undefined): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }: GetIndexingTimeProps, requestOptions?: RequestOptions): Promise<IndexingTimeResponse>;
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse>;
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse>;
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }: GetReachabilityProps, requestOptions?: RequestOptions): Promise<{
|
||||
[key: string]: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
}>;
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions?: RequestOptions | undefined): Promise<InventoryResponse>;
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions?: RequestOptions | undefined): Promise<StatusResponse>;
|
||||
};
|
||||
|
||||
type BadRequest = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Error.
|
||||
*/
|
||||
type ErrorBase = Record<string, any> & {
|
||||
message?: string | undefined;
|
||||
};
|
||||
|
||||
type Forbidden = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type Unauthorized = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type MonitoringClient = ReturnType<typeof createMonitoringClient>;
|
||||
|
||||
declare function monitoringClient(appId: string, apiKey: string, options?: ClientOptions | undefined): MonitoringClient;
|
||||
|
||||
export { type BadRequest, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type ErrorBase, type Forbidden, type GetClusterIncidentsProps, type GetClusterStatusProps, type GetIndexingTimeProps, type GetLatencyProps, type GetMetricsProps, type GetReachabilityProps, type Incident, type IncidentEntry, type IncidentsResponse, type IndexingMetric, type IndexingTimeResponse, type InfrastructureResponse, type InventoryResponse, type LatencyMetric, type LatencyResponse, type Metric, type Metrics, type MonitoringClient, type Period, type ProbesMetric, type Region, type Server, type ServerStatus, type Status, type StatusResponse, type TimeEntry, type Type, type Unauthorized, apiClientVersion, monitoringClient };
|
441
node_modules/@algolia/monitoring/dist/node.d.ts
generated
vendored
Normal file
441
node_modules/@algolia/monitoring/dist/node.d.ts
generated
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
import * as _algolia_client_common from '@algolia/client-common';
|
||||
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
||||
|
||||
/**
|
||||
* Status of the cluster.
|
||||
*/
|
||||
type Status = 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage';
|
||||
|
||||
/**
|
||||
* Incident details.
|
||||
*/
|
||||
type Incident = {
|
||||
/**
|
||||
* Description of the incident.
|
||||
*/
|
||||
title?: string | undefined;
|
||||
status?: Status | undefined;
|
||||
};
|
||||
|
||||
type IncidentEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
v?: Incident | undefined;
|
||||
};
|
||||
|
||||
type IncidentsResponse = {
|
||||
incidents?: {
|
||||
[key: string]: Array<IncidentEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type TimeEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Time in ms.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type IndexingMetric = {
|
||||
indexing?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type IndexingTimeResponse = {
|
||||
metrics?: IndexingMetric | undefined;
|
||||
};
|
||||
|
||||
type ProbesMetric = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Value of the metric.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type Metrics = {
|
||||
/**
|
||||
* CPU idleness in %.
|
||||
*/
|
||||
cpu_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for indexing in MB.
|
||||
*/
|
||||
ram_indexing_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for search in MB.
|
||||
*/
|
||||
ram_search_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Solid-state disk (SSD) usage expressed as % of RAM. 0% means no SSD usage. A value of 50% indicates 32 GB SSD usage for a machine with 64 RAM.
|
||||
*/
|
||||
ssd_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Average build time of the indices in seconds.
|
||||
*/
|
||||
avg_build_time?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type InfrastructureResponse = {
|
||||
metrics?: Metrics | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Region where the cluster is located.
|
||||
*/
|
||||
type Region = 'au' | 'br' | 'ca' | 'de' | 'eu' | 'hk' | 'in' | 'jp' | 'sg' | 'uae' | 'uk' | 'usc' | 'use' | 'usw' | 'za';
|
||||
|
||||
type ServerStatus = 'PRODUCTION';
|
||||
|
||||
type Type = 'cluster';
|
||||
|
||||
type Server = {
|
||||
/**
|
||||
* Server name.
|
||||
*/
|
||||
name?: string | undefined;
|
||||
region?: Region | undefined;
|
||||
/**
|
||||
* Included to support legacy applications. Use `is_replica` instead.
|
||||
*/
|
||||
is_slave?: boolean | undefined;
|
||||
/**
|
||||
* Whether this server is a replica of another server.
|
||||
*/
|
||||
is_replica?: boolean | undefined;
|
||||
/**
|
||||
* Name of the cluster to which this server belongs.
|
||||
*/
|
||||
cluster?: string | undefined;
|
||||
status?: ServerStatus | undefined;
|
||||
type?: Type | undefined;
|
||||
};
|
||||
|
||||
type InventoryResponse = {
|
||||
inventory?: Array<Server> | undefined;
|
||||
};
|
||||
|
||||
type LatencyMetric = {
|
||||
latency?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type LatencyResponse = {
|
||||
metrics?: LatencyMetric | undefined;
|
||||
};
|
||||
|
||||
type StatusResponse = {
|
||||
status?: {
|
||||
[key: string]: Status;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type Metric = 'avg_build_time' | 'ssd_usage' | 'ram_search_usage' | 'ram_indexing_usage' | 'cpu_usage' | '*';
|
||||
|
||||
type Period = 'minute' | 'hour' | 'day' | 'week' | 'month';
|
||||
|
||||
/**
|
||||
* Properties for the `customDelete` method.
|
||||
*/
|
||||
type CustomDeleteProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customGet` method.
|
||||
*/
|
||||
type CustomGetProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPost` method.
|
||||
*/
|
||||
type CustomPostProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPut` method.
|
||||
*/
|
||||
type CustomPutProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterIncidents` method.
|
||||
*/
|
||||
type GetClusterIncidentsProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterStatus` method.
|
||||
*/
|
||||
type GetClusterStatusProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getIndexingTime` method.
|
||||
*/
|
||||
type GetIndexingTimeProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getLatency` method.
|
||||
*/
|
||||
type GetLatencyProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getMetrics` method.
|
||||
*/
|
||||
type GetMetricsProps = {
|
||||
/**
|
||||
* Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
|
||||
*/
|
||||
metric: Metric;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
period: Period;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getReachability` method.
|
||||
*/
|
||||
type GetReachabilityProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
|
||||
declare const apiClientVersion = "1.34.1";
|
||||
declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
||||
transporter: _algolia_client_common.Transporter;
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: string;
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache(): Promise<void>;
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
readonly _ua: string;
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment: string, version?: string | undefined): void;
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }: {
|
||||
apiKey: string;
|
||||
}): void;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }: GetClusterIncidentsProps, requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse>;
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions?: RequestOptions | undefined): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }: GetIndexingTimeProps, requestOptions?: RequestOptions): Promise<IndexingTimeResponse>;
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse>;
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse>;
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }: GetReachabilityProps, requestOptions?: RequestOptions): Promise<{
|
||||
[key: string]: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
}>;
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions?: RequestOptions | undefined): Promise<InventoryResponse>;
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions?: RequestOptions | undefined): Promise<StatusResponse>;
|
||||
};
|
||||
|
||||
type BadRequest = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Error.
|
||||
*/
|
||||
type ErrorBase = Record<string, any> & {
|
||||
message?: string | undefined;
|
||||
};
|
||||
|
||||
type Forbidden = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type Unauthorized = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type MonitoringClient = ReturnType<typeof createMonitoringClient>;
|
||||
|
||||
declare function monitoringClient(appId: string, apiKey: string, options?: ClientOptions | undefined): MonitoringClient;
|
||||
|
||||
export { type BadRequest, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type ErrorBase, type Forbidden, type GetClusterIncidentsProps, type GetClusterStatusProps, type GetIndexingTimeProps, type GetLatencyProps, type GetMetricsProps, type GetReachabilityProps, type Incident, type IncidentEntry, type IncidentsResponse, type IndexingMetric, type IndexingTimeResponse, type InfrastructureResponse, type InventoryResponse, type LatencyMetric, type LatencyResponse, type Metric, type Metrics, type MonitoringClient, type Period, type ProbesMetric, type Region, type Server, type ServerStatus, type Status, type StatusResponse, type TimeEntry, type Type, type Unauthorized, apiClientVersion, monitoringClient };
|
379
node_modules/@algolia/monitoring/dist/src/monitoringClient.cjs
generated
vendored
Normal file
379
node_modules/@algolia/monitoring/dist/src/monitoringClient.cjs
generated
vendored
Normal file
@@ -0,0 +1,379 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/monitoringClient.ts
|
||||
var monitoringClient_exports = {};
|
||||
__export(monitoringClient_exports, {
|
||||
apiClientVersion: () => apiClientVersion,
|
||||
createMonitoringClient: () => createMonitoringClient
|
||||
});
|
||||
module.exports = __toCommonJS(monitoringClient_exports);
|
||||
var import_client_common = require("@algolia/client-common");
|
||||
var apiClientVersion = "1.34.1";
|
||||
function getDefaultHosts() {
|
||||
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
||||
}
|
||||
function createMonitoringClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = (0, import_client_common.createTransporter)({
|
||||
hosts: getDefaultHosts(),
|
||||
...options,
|
||||
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
|
||||
algoliaAgents,
|
||||
client: "Monitoring",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customDelete`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "DELETE",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customGet`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPut`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "PUT",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");
|
||||
}
|
||||
const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");
|
||||
}
|
||||
const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions) {
|
||||
const requestPath = "/1/incidents";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");
|
||||
}
|
||||
const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getLatency`.");
|
||||
}
|
||||
const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }, requestOptions) {
|
||||
if (!metric) {
|
||||
throw new Error("Parameter `metric` is required when calling `getMetrics`.");
|
||||
}
|
||||
if (!period) {
|
||||
throw new Error("Parameter `period` is required when calling `getMetrics`.");
|
||||
}
|
||||
const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getReachability`.");
|
||||
}
|
||||
const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions) {
|
||||
const requestPath = "/1/inventory/servers";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions) {
|
||||
const requestPath = "/1/status";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
apiClientVersion,
|
||||
createMonitoringClient
|
||||
});
|
||||
//# sourceMappingURL=monitoringClient.cjs.map
|
1
node_modules/@algolia/monitoring/dist/src/monitoringClient.cjs.map
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/dist/src/monitoringClient.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
353
node_modules/@algolia/monitoring/dist/src/monitoringClient.js
generated
vendored
Normal file
353
node_modules/@algolia/monitoring/dist/src/monitoringClient.js
generated
vendored
Normal file
@@ -0,0 +1,353 @@
|
||||
// src/monitoringClient.ts
|
||||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
||||
var apiClientVersion = "1.34.1";
|
||||
function getDefaultHosts() {
|
||||
return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
|
||||
}
|
||||
function createMonitoringClient({
|
||||
appId: appIdOption,
|
||||
apiKey: apiKeyOption,
|
||||
authMode,
|
||||
algoliaAgents,
|
||||
...options
|
||||
}) {
|
||||
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
||||
const transporter = createTransporter({
|
||||
hosts: getDefaultHosts(),
|
||||
...options,
|
||||
algoliaAgent: getAlgoliaAgent({
|
||||
algoliaAgents,
|
||||
client: "Monitoring",
|
||||
version: apiClientVersion
|
||||
}),
|
||||
baseHeaders: {
|
||||
"content-type": "text/plain",
|
||||
...auth.headers(),
|
||||
...options.baseHeaders
|
||||
},
|
||||
baseQueryParameters: {
|
||||
...auth.queryParameters(),
|
||||
...options.baseQueryParameters
|
||||
}
|
||||
});
|
||||
return {
|
||||
transporter,
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: appIdOption,
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: apiKeyOption,
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache() {
|
||||
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
||||
},
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
get _ua() {
|
||||
return transporter.algoliaAgent.value;
|
||||
},
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment, version) {
|
||||
transporter.algoliaAgent.add({ segment, version });
|
||||
},
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }) {
|
||||
if (!authMode || authMode === "WithinHeaders") {
|
||||
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
||||
} else {
|
||||
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customDelete`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "DELETE",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customGet`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPost`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "POST",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }, requestOptions) {
|
||||
if (!path) {
|
||||
throw new Error("Parameter `path` is required when calling `customPut`.");
|
||||
}
|
||||
const requestPath = "/{path}".replace("{path}", path);
|
||||
const headers = {};
|
||||
const queryParameters = parameters ? parameters : {};
|
||||
const request = {
|
||||
method: "PUT",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers,
|
||||
data: body ? body : {}
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");
|
||||
}
|
||||
const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");
|
||||
}
|
||||
const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions) {
|
||||
const requestPath = "/1/incidents";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");
|
||||
}
|
||||
const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getLatency`.");
|
||||
}
|
||||
const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }, requestOptions) {
|
||||
if (!metric) {
|
||||
throw new Error("Parameter `metric` is required when calling `getMetrics`.");
|
||||
}
|
||||
if (!period) {
|
||||
throw new Error("Parameter `period` is required when calling `getMetrics`.");
|
||||
}
|
||||
const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }, requestOptions) {
|
||||
if (!clusters) {
|
||||
throw new Error("Parameter `clusters` is required when calling `getReachability`.");
|
||||
}
|
||||
const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions) {
|
||||
const requestPath = "/1/inventory/servers";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
},
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions) {
|
||||
const requestPath = "/1/status";
|
||||
const headers = {};
|
||||
const queryParameters = {};
|
||||
const request = {
|
||||
method: "GET",
|
||||
path: requestPath,
|
||||
queryParameters,
|
||||
headers
|
||||
};
|
||||
return transporter.request(request, requestOptions);
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
apiClientVersion,
|
||||
createMonitoringClient
|
||||
};
|
||||
//# sourceMappingURL=monitoringClient.js.map
|
1
node_modules/@algolia/monitoring/dist/src/monitoringClient.js.map
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/dist/src/monitoringClient.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
441
node_modules/@algolia/monitoring/dist/worker.d.ts
generated
vendored
Normal file
441
node_modules/@algolia/monitoring/dist/worker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
import * as _algolia_client_common from '@algolia/client-common';
|
||||
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
||||
|
||||
/**
|
||||
* Status of the cluster.
|
||||
*/
|
||||
type Status = 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage';
|
||||
|
||||
/**
|
||||
* Incident details.
|
||||
*/
|
||||
type Incident = {
|
||||
/**
|
||||
* Description of the incident.
|
||||
*/
|
||||
title?: string | undefined;
|
||||
status?: Status | undefined;
|
||||
};
|
||||
|
||||
type IncidentEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
v?: Incident | undefined;
|
||||
};
|
||||
|
||||
type IncidentsResponse = {
|
||||
incidents?: {
|
||||
[key: string]: Array<IncidentEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type TimeEntry = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Time in ms.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type IndexingMetric = {
|
||||
indexing?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type IndexingTimeResponse = {
|
||||
metrics?: IndexingMetric | undefined;
|
||||
};
|
||||
|
||||
type ProbesMetric = {
|
||||
/**
|
||||
* Timestamp, measured in milliseconds since the Unix epoch.
|
||||
*/
|
||||
t?: number | undefined;
|
||||
/**
|
||||
* Value of the metric.
|
||||
*/
|
||||
v?: number | undefined;
|
||||
};
|
||||
|
||||
type Metrics = {
|
||||
/**
|
||||
* CPU idleness in %.
|
||||
*/
|
||||
cpu_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for indexing in MB.
|
||||
*/
|
||||
ram_indexing_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* RAM used for search in MB.
|
||||
*/
|
||||
ram_search_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Solid-state disk (SSD) usage expressed as % of RAM. 0% means no SSD usage. A value of 50% indicates 32 GB SSD usage for a machine with 64 RAM.
|
||||
*/
|
||||
ssd_usage?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
/**
|
||||
* Average build time of the indices in seconds.
|
||||
*/
|
||||
avg_build_time?: {
|
||||
[key: string]: Array<ProbesMetric>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type InfrastructureResponse = {
|
||||
metrics?: Metrics | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Region where the cluster is located.
|
||||
*/
|
||||
type Region = 'au' | 'br' | 'ca' | 'de' | 'eu' | 'hk' | 'in' | 'jp' | 'sg' | 'uae' | 'uk' | 'usc' | 'use' | 'usw' | 'za';
|
||||
|
||||
type ServerStatus = 'PRODUCTION';
|
||||
|
||||
type Type = 'cluster';
|
||||
|
||||
type Server = {
|
||||
/**
|
||||
* Server name.
|
||||
*/
|
||||
name?: string | undefined;
|
||||
region?: Region | undefined;
|
||||
/**
|
||||
* Included to support legacy applications. Use `is_replica` instead.
|
||||
*/
|
||||
is_slave?: boolean | undefined;
|
||||
/**
|
||||
* Whether this server is a replica of another server.
|
||||
*/
|
||||
is_replica?: boolean | undefined;
|
||||
/**
|
||||
* Name of the cluster to which this server belongs.
|
||||
*/
|
||||
cluster?: string | undefined;
|
||||
status?: ServerStatus | undefined;
|
||||
type?: Type | undefined;
|
||||
};
|
||||
|
||||
type InventoryResponse = {
|
||||
inventory?: Array<Server> | undefined;
|
||||
};
|
||||
|
||||
type LatencyMetric = {
|
||||
latency?: {
|
||||
[key: string]: Array<TimeEntry>;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type LatencyResponse = {
|
||||
metrics?: LatencyMetric | undefined;
|
||||
};
|
||||
|
||||
type StatusResponse = {
|
||||
status?: {
|
||||
[key: string]: Status;
|
||||
} | undefined;
|
||||
};
|
||||
|
||||
type Metric = 'avg_build_time' | 'ssd_usage' | 'ram_search_usage' | 'ram_indexing_usage' | 'cpu_usage' | '*';
|
||||
|
||||
type Period = 'minute' | 'hour' | 'day' | 'week' | 'month';
|
||||
|
||||
/**
|
||||
* Properties for the `customDelete` method.
|
||||
*/
|
||||
type CustomDeleteProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customGet` method.
|
||||
*/
|
||||
type CustomGetProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPost` method.
|
||||
*/
|
||||
type CustomPostProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `customPut` method.
|
||||
*/
|
||||
type CustomPutProps = {
|
||||
/**
|
||||
* Path of the endpoint, for example `1/newFeature`.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Query parameters to apply to the current query.
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
/**
|
||||
* Parameters to send with the custom request.
|
||||
*/
|
||||
body?: Record<string, unknown> | undefined;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterIncidents` method.
|
||||
*/
|
||||
type GetClusterIncidentsProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getClusterStatus` method.
|
||||
*/
|
||||
type GetClusterStatusProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getIndexingTime` method.
|
||||
*/
|
||||
type GetIndexingTimeProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getLatency` method.
|
||||
*/
|
||||
type GetLatencyProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getMetrics` method.
|
||||
*/
|
||||
type GetMetricsProps = {
|
||||
/**
|
||||
* Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
|
||||
*/
|
||||
metric: Metric;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
period: Period;
|
||||
};
|
||||
/**
|
||||
* Properties for the `getReachability` method.
|
||||
*/
|
||||
type GetReachabilityProps = {
|
||||
/**
|
||||
* Subset of clusters, separated by commas.
|
||||
*/
|
||||
clusters: string;
|
||||
};
|
||||
|
||||
declare const apiClientVersion = "1.34.1";
|
||||
declare function createMonitoringClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
||||
transporter: _algolia_client_common.Transporter;
|
||||
/**
|
||||
* The `appId` currently in use.
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* The `apiKey` currently in use.
|
||||
*/
|
||||
apiKey: string;
|
||||
/**
|
||||
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
||||
*/
|
||||
clearCache(): Promise<void>;
|
||||
/**
|
||||
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
||||
*/
|
||||
readonly _ua: string;
|
||||
/**
|
||||
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
||||
*
|
||||
* @param segment - The algolia agent (user-agent) segment to add.
|
||||
* @param version - The version of the agent.
|
||||
*/
|
||||
addAlgoliaAgent(segment: string, version?: string | undefined): void;
|
||||
/**
|
||||
* Helper method to switch the API key used to authenticate the requests.
|
||||
*
|
||||
* @param params - Method params.
|
||||
* @param params.apiKey - The new API Key to use.
|
||||
*/
|
||||
setClientApiKey({ apiKey }: {
|
||||
apiKey: string;
|
||||
}): void;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customDelete - The customDelete object.
|
||||
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customDelete.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customGet - The customGet object.
|
||||
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customGet.parameters - Query parameters to apply to the current query.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPost - The customPost object.
|
||||
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPost.parameters - Query parameters to apply to the current query.
|
||||
* @param customPost.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* This method lets you send requests to the Algolia REST API.
|
||||
* @param customPut - The customPut object.
|
||||
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
||||
* @param customPut.parameters - Query parameters to apply to the current query.
|
||||
* @param customPut.body - Parameters to send with the custom request.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
||||
/**
|
||||
* Retrieves known incidents for the selected clusters.
|
||||
* @param getClusterIncidents - The getClusterIncidents object.
|
||||
* @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterIncidents({ clusters }: GetClusterIncidentsProps, requestOptions?: RequestOptions): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves the status of selected clusters.
|
||||
* @param getClusterStatus - The getClusterStatus object.
|
||||
* @param getClusterStatus.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getClusterStatus({ clusters }: GetClusterStatusProps, requestOptions?: RequestOptions): Promise<StatusResponse>;
|
||||
/**
|
||||
* Retrieves known incidents for all clusters.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIncidents(requestOptions?: RequestOptions | undefined): Promise<IncidentsResponse>;
|
||||
/**
|
||||
* Retrieves average times for indexing operations for selected clusters.
|
||||
* @param getIndexingTime - The getIndexingTime object.
|
||||
* @param getIndexingTime.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getIndexingTime({ clusters }: GetIndexingTimeProps, requestOptions?: RequestOptions): Promise<IndexingTimeResponse>;
|
||||
/**
|
||||
* Retrieves the average latency for search requests for selected clusters.
|
||||
* @param getLatency - The getLatency object.
|
||||
* @param getLatency.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getLatency({ clusters }: GetLatencyProps, requestOptions?: RequestOptions): Promise<LatencyResponse>;
|
||||
/**
|
||||
* 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).
|
||||
* @param getMetrics - The getMetrics object.
|
||||
* @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 `*`.
|
||||
* @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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getMetrics({ metric, period }: GetMetricsProps, requestOptions?: RequestOptions): Promise<InfrastructureResponse>;
|
||||
/**
|
||||
* Test whether clusters are reachable or not.
|
||||
* @param getReachability - The getReachability object.
|
||||
* @param getReachability.clusters - Subset of clusters, separated by commas.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getReachability({ clusters }: GetReachabilityProps, requestOptions?: RequestOptions): Promise<{
|
||||
[key: string]: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
}>;
|
||||
/**
|
||||
* 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.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getServers(requestOptions?: RequestOptions | undefined): Promise<InventoryResponse>;
|
||||
/**
|
||||
* Retrieves the status of all Algolia clusters and instances.
|
||||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
||||
*/
|
||||
getStatus(requestOptions?: RequestOptions | undefined): Promise<StatusResponse>;
|
||||
};
|
||||
|
||||
type BadRequest = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Error.
|
||||
*/
|
||||
type ErrorBase = Record<string, any> & {
|
||||
message?: string | undefined;
|
||||
};
|
||||
|
||||
type Forbidden = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type Unauthorized = {
|
||||
reason?: string | undefined;
|
||||
};
|
||||
|
||||
type MonitoringClient = ReturnType<typeof createMonitoringClient>;
|
||||
|
||||
declare function monitoringClient(appId: string, apiKey: string, options?: ClientOptions | undefined): MonitoringClient;
|
||||
|
||||
export { type BadRequest, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type ErrorBase, type Forbidden, type GetClusterIncidentsProps, type GetClusterStatusProps, type GetIndexingTimeProps, type GetLatencyProps, type GetMetricsProps, type GetReachabilityProps, type Incident, type IncidentEntry, type IncidentsResponse, type IndexingMetric, type IndexingTimeResponse, type InfrastructureResponse, type InventoryResponse, type LatencyMetric, type LatencyResponse, type Metric, type Metrics, type MonitoringClient, type Period, type ProbesMetric, type Region, type Server, type ServerStatus, type Status, type StatusResponse, type TimeEntry, type Type, type Unauthorized, apiClientVersion, monitoringClient };
|
1
node_modules/@algolia/monitoring/index.d.ts
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/node';
|
1
node_modules/@algolia/monitoring/index.js
generated
vendored
Normal file
1
node_modules/@algolia/monitoring/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./dist/builds/node.cjs');
|
68
node_modules/@algolia/monitoring/package.json
generated
vendored
Normal file
68
node_modules/@algolia/monitoring/package.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"version": "1.34.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
|
||||
},
|
||||
"homepage": "https://github.com/algolia/algoliasearch-client-javascript/tree/main/packages/monitoring#readme",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": "Algolia",
|
||||
"scripts": {
|
||||
"build": "yarn clean && yarn tsup && yarn rollup -c rollup.config.js",
|
||||
"clean": "rm -rf ./dist || true",
|
||||
"test:bundle": "publint . && attw --pack ."
|
||||
},
|
||||
"name": "@algolia/monitoring",
|
||||
"description": "JavaScript client for monitoring",
|
||||
"exports": {
|
||||
".": {
|
||||
"node": {
|
||||
"types": {
|
||||
"import": "./dist/node.d.ts",
|
||||
"module": "./dist/node.d.ts",
|
||||
"require": "./dist/node.d.cts"
|
||||
},
|
||||
"import": "./dist/builds/node.js",
|
||||
"module": "./dist/builds/node.js",
|
||||
"require": "./dist/builds/node.cjs"
|
||||
},
|
||||
"worker": {
|
||||
"types": "./dist/worker.d.ts",
|
||||
"default": "./dist/builds/worker.js"
|
||||
},
|
||||
"default": {
|
||||
"types": "./dist/browser.d.ts",
|
||||
"module": "./dist/builds/browser.js",
|
||||
"import": "./dist/builds/browser.js",
|
||||
"default": "./dist/builds/browser.umd.js"
|
||||
}
|
||||
},
|
||||
"./dist/builds/*": "./dist/builds/*.js"
|
||||
},
|
||||
"jsdelivr": "./dist/builds/browser.umd.js",
|
||||
"unpkg": "./dist/builds/browser.umd.js",
|
||||
"react-native": "./dist/builds/browser.js",
|
||||
"files": [
|
||||
"dist",
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"@algolia/client-common": "5.34.1",
|
||||
"@algolia/requester-browser-xhr": "5.34.1",
|
||||
"@algolia/requester-fetch": "5.34.1",
|
||||
"@algolia/requester-node-http": "5.34.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@arethetypeswrong/cli": "0.18.2",
|
||||
"@types/node": "22.16.5",
|
||||
"publint": "0.3.12",
|
||||
"rollup": "4.41.0",
|
||||
"tsup": "8.5.0",
|
||||
"typescript": "5.8.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.0.0"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user