@bavenir/spade-node-js-client
Version:
A client-side JavaScript library that can be used to iteract with Data Broker's API.
94 lines (93 loc) • 2.71 kB
TypeScript
/**
* Copyright (C) 2024 bAvenir
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
/**
* Represents the health check status of the Data Broker instance.
*
* @interface Healthcheck
*
* @property {DB} DB - Information about the Data Broker that you are connecting to.
* @property {Postgres} POSTGRES - Status information about the internal database of the Data Broker.
*
* @example
* const healthcheck: Healthcheck = {
* DB: {
* nodeId: 'node-123',
* status: 'online',
* security: true,
* online: true,
* pubkey: 'public-key-here',
* uptime: 123456,
* version: '1.0.0',
* buildTime: '2024-10-07T12:00:00Z'
* },
* POSTGRES: {
* status: 'online',
* security: true
* }
* };
*/
export interface Healthcheck {
DB: DB;
POSTGRES: Postgres;
}
/**
* Represents the information about the Data Broker node.
*
* @interface DB
*
* @property {string} nodeId - The unique identifier of the Data Broker node.
* @property {string} status - The status of the Data Broker node (e.g., 'online', 'offline').
* @property {boolean} security - Indicates whether security features are enabled for the Data Broker.
* @property {boolean} online - Indicates if the Data Broker node is currently online.
* @property {string} pubkey - The public key associated with the Data Broker node.
* @property {number} uptime - The amount of time (in seconds) the Data Broker node has been online.
* @property {string} version - The version of the Data Broker software.
* @property {string} buildTime - The build time of the Data Broker software (ISO format).
*
* @example
* const db: DB = {
* nodeId: 'node-123',
* status: 'online',
* security: true,
* online: true,
* pubkey: 'public-key-here',
* uptime: 123456,
* version: '1.0.0',
* buildTime: '2024-10-07T12:00:00Z'
* };
*/
export interface DB {
nodeId: string;
status: string;
security: boolean;
online: boolean;
pubkey: string;
uptime: number;
version: string;
buildTime: string;
}
/**
* Represents the status of the internal Postgres database.
*
* @interface Postgres
*
* @property {string} status - The current status of the Postgres database (e.g., 'online', 'offline').
* @property {boolean} security - Indicates whether security features are enabled for the Postgres database.
*
* @example
* const postgres: Postgres = {
* status: 'online',
* security: true
* };
*/
export interface Postgres {
status: string;
security: boolean;
}