UNPKG

@openzeppelin/relayer-sdk

Version:
188 lines (187 loc) 15.9 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * OpenZeppelin Relayer API * OpenZeppelin Relayer API * * The version of the OpenAPI document: 1.3.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = void 0; const axios_1 = require("axios"); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * HealthApi - axios parameter creator * @export */ const HealthApiAxiosParamCreator = function (configuration) { return { /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. This endpoint is used for liveness probes in container orchestration platforms. * @summary Health routes implementation * @param {*} [options] Override http request option. * @throws {RequiredError} */ health: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { const localVarPath = `/api/v1/health`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Returns 200 OK if the service is ready to accept traffic, or 503 Service Unavailable if not. This endpoint is used for readiness probes in container orchestration platforms like AWS ECS or Kubernetes. ## Health Check Components - **System**: File descriptor usage, CLOSE_WAIT socket count - **Redis**: Primary and reader pool connectivity - **Queue**: Queue\'s Redis connections (separate from app\'s Redis) - **Plugins**: Plugin pool health, circuit breaker state, and connection metrics (if enabled) ## Status Levels - `healthy`: All components operational - `degraded`: Some components degraded but service can function (e.g., reader pool down) - `unhealthy`: Critical components failed, service unavailable ## Plugin Connection Metrics When plugins are enabled, the following connection metrics are exposed: - `shared_socket_available_slots`: Number of additional concurrent plugin executions that can start - `shared_socket_active_connections`: Current number of active plugin execution connections - `shared_socket_registered_executions`: Number of plugin executions currently registered (awaiting response) - `connection_pool_available_slots`: Available connections to the pool server - `connection_pool_active_connections`: Active connections to the pool server These metrics help diagnose connection pool exhaustion and plugin capacity issues. ## Caching Health check results are cached for 10 seconds to prevent excessive load from frequent health checks. Multiple requests within the TTL return the same cached response. * @summary Readiness endpoint that checks system resources, Redis, Queue, and plugins. * @param {*} [options] Override http request option. * @throws {RequiredError} */ readiness: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { const localVarPath = `/api/v1/ready`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator; /** * HealthApi - functional programming interface * @export */ const HealthApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.HealthApiAxiosParamCreator)(configuration); return { /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. This endpoint is used for liveness probes in container orchestration platforms. * @summary Health routes implementation * @param {*} [options] Override http request option. * @throws {RequiredError} */ health(options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.health(options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['HealthApi.health']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, /** * Returns 200 OK if the service is ready to accept traffic, or 503 Service Unavailable if not. This endpoint is used for readiness probes in container orchestration platforms like AWS ECS or Kubernetes. ## Health Check Components - **System**: File descriptor usage, CLOSE_WAIT socket count - **Redis**: Primary and reader pool connectivity - **Queue**: Queue\'s Redis connections (separate from app\'s Redis) - **Plugins**: Plugin pool health, circuit breaker state, and connection metrics (if enabled) ## Status Levels - `healthy`: All components operational - `degraded`: Some components degraded but service can function (e.g., reader pool down) - `unhealthy`: Critical components failed, service unavailable ## Plugin Connection Metrics When plugins are enabled, the following connection metrics are exposed: - `shared_socket_available_slots`: Number of additional concurrent plugin executions that can start - `shared_socket_active_connections`: Current number of active plugin execution connections - `shared_socket_registered_executions`: Number of plugin executions currently registered (awaiting response) - `connection_pool_available_slots`: Available connections to the pool server - `connection_pool_active_connections`: Active connections to the pool server These metrics help diagnose connection pool exhaustion and plugin capacity issues. ## Caching Health check results are cached for 10 seconds to prevent excessive load from frequent health checks. Multiple requests within the TTL return the same cached response. * @summary Readiness endpoint that checks system resources, Redis, Queue, and plugins. * @param {*} [options] Override http request option. * @throws {RequiredError} */ readiness(options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.readiness(options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['HealthApi.readiness']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, }; }; exports.HealthApiFp = HealthApiFp; /** * HealthApi - factory interface * @export */ const HealthApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.HealthApiFp)(configuration); return { /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. This endpoint is used for liveness probes in container orchestration platforms. * @summary Health routes implementation * @param {*} [options] Override http request option. * @throws {RequiredError} */ health(options) { return localVarFp.health(options).then((request) => request(axios, basePath)); }, /** * Returns 200 OK if the service is ready to accept traffic, or 503 Service Unavailable if not. This endpoint is used for readiness probes in container orchestration platforms like AWS ECS or Kubernetes. ## Health Check Components - **System**: File descriptor usage, CLOSE_WAIT socket count - **Redis**: Primary and reader pool connectivity - **Queue**: Queue\'s Redis connections (separate from app\'s Redis) - **Plugins**: Plugin pool health, circuit breaker state, and connection metrics (if enabled) ## Status Levels - `healthy`: All components operational - `degraded`: Some components degraded but service can function (e.g., reader pool down) - `unhealthy`: Critical components failed, service unavailable ## Plugin Connection Metrics When plugins are enabled, the following connection metrics are exposed: - `shared_socket_available_slots`: Number of additional concurrent plugin executions that can start - `shared_socket_active_connections`: Current number of active plugin execution connections - `shared_socket_registered_executions`: Number of plugin executions currently registered (awaiting response) - `connection_pool_available_slots`: Available connections to the pool server - `connection_pool_active_connections`: Active connections to the pool server These metrics help diagnose connection pool exhaustion and plugin capacity issues. ## Caching Health check results are cached for 10 seconds to prevent excessive load from frequent health checks. Multiple requests within the TTL return the same cached response. * @summary Readiness endpoint that checks system resources, Redis, Queue, and plugins. * @param {*} [options] Override http request option. * @throws {RequiredError} */ readiness(options) { return localVarFp.readiness(options).then((request) => request(axios, basePath)); }, }; }; exports.HealthApiFactory = HealthApiFactory; /** * HealthApi - object-oriented interface * @export * @class HealthApi * @extends {BaseAPI} */ class HealthApi extends base_1.BaseAPI { /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. This endpoint is used for liveness probes in container orchestration platforms. * @summary Health routes implementation * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof HealthApi */ health(options) { return (0, exports.HealthApiFp)(this.configuration).health(options).then((request) => request(this.axios, this.basePath)); } /** * Returns 200 OK if the service is ready to accept traffic, or 503 Service Unavailable if not. This endpoint is used for readiness probes in container orchestration platforms like AWS ECS or Kubernetes. ## Health Check Components - **System**: File descriptor usage, CLOSE_WAIT socket count - **Redis**: Primary and reader pool connectivity - **Queue**: Queue\'s Redis connections (separate from app\'s Redis) - **Plugins**: Plugin pool health, circuit breaker state, and connection metrics (if enabled) ## Status Levels - `healthy`: All components operational - `degraded`: Some components degraded but service can function (e.g., reader pool down) - `unhealthy`: Critical components failed, service unavailable ## Plugin Connection Metrics When plugins are enabled, the following connection metrics are exposed: - `shared_socket_available_slots`: Number of additional concurrent plugin executions that can start - `shared_socket_active_connections`: Current number of active plugin execution connections - `shared_socket_registered_executions`: Number of plugin executions currently registered (awaiting response) - `connection_pool_available_slots`: Available connections to the pool server - `connection_pool_active_connections`: Active connections to the pool server These metrics help diagnose connection pool exhaustion and plugin capacity issues. ## Caching Health check results are cached for 10 seconds to prevent excessive load from frequent health checks. Multiple requests within the TTL return the same cached response. * @summary Readiness endpoint that checks system resources, Redis, Queue, and plugins. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof HealthApi */ readiness(options) { return (0, exports.HealthApiFp)(this.configuration).readiness(options).then((request) => request(this.axios, this.basePath)); } } exports.HealthApi = HealthApi;