Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

symbol-statistics-service-typescript-fetch-client

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

symbol-statistics-service-typescript-fetch-client - npm Package Compare versions

Comparing version 1.1.2-alpha-202111150921 to 1.1.2-alpha-202111170848

dist/models/WebSocketStatus.d.ts

27

dist/apis/NodeApi.d.ts

@@ -6,2 +6,5 @@ import * as runtime from '../runtime';

}
export interface GetNodeByNodePublicKeyRequest {
nodePublicKey: string;
}
export interface GetNodesRequest {

@@ -17,31 +20,39 @@ filter?: NodeListFilter;

/**
* Returns the node information for the given public key.
* Returns information about the node with the given main account.
*/
getNodeRaw(requestParameters: GetNodeRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NodeInfo>>;
/**
* Returns the node information for the given public key.
* Returns information about the node with the given main account.
*/
getNode(publicKey: string, initOverrides?: RequestInit): Promise<NodeInfo>;
/**
* Returns a summary of the number per role over time.
* Returns the node information for the given transport public key.
*/
getNodeByNodePublicKeyRaw(requestParameters: GetNodeByNodePublicKeyRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NodeInfo>>;
/**
* Returns the node information for the given transport public key.
*/
getNodeByNodePublicKey(nodePublicKey: string, initOverrides?: RequestInit): Promise<NodeInfo>;
/**
* Returns the summary of the number of nodes per role over time.
*/
getNodeCountRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<TimeSeriesNodeCount>>>;
/**
* Returns a summary of the number per role over time.
* Returns the summary of the number of nodes per role over time.
*/
getNodeCount(initOverrides?: RequestInit): Promise<Array<TimeSeriesNodeCount>>;
/**
* Returns a summary of the number of nodes per height and finalized height.
* Returns the summary of the number of nodes per height and finalized height.
*/
getNodeHeightStatsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<NodeHeightStats>>;
/**
* Returns a summary of the number of nodes per height and finalized height.
* Returns the summary of the number of nodes per height and finalized height.
*/
getNodeHeightStats(initOverrides?: RequestInit): Promise<NodeHeightStats>;
/**
* Returns a summary of the number of nodes per role type.
* Returns the summary of the number of nodes per role type.
*/
getNodeStatsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<NodeStats>>;
/**
* Returns a summary of the number of nodes per role type.
* Returns the summary of the number of nodes per role type.
*/

@@ -48,0 +59,0 @@ getNodeStats(initOverrides?: RequestInit): Promise<NodeStats>;

@@ -49,3 +49,3 @@ "use strict";

/**
* Returns the node information for the given public key.
* Returns information about the node with the given main account.
*/

@@ -69,3 +69,3 @@ getNodeRaw(requestParameters, initOverrides) {

/**
* Returns the node information for the given public key.
* Returns information about the node with the given main account.
*/

@@ -79,4 +79,32 @@ getNode(publicKey, initOverrides) {

/**
* Returns a summary of the number per role over time.
* Returns the node information for the given transport public key.
*/
getNodeByNodePublicKeyRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.nodePublicKey === null || requestParameters.nodePublicKey === undefined) {
throw new runtime.RequiredError('nodePublicKey', 'Required parameter requestParameters.nodePublicKey was null or undefined when calling getNodeByNodePublicKey.');
}
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/nodes/nodePublicKey/{nodePublicKey}`.replace(`{${"nodePublicKey"}}`, encodeURIComponent(String(requestParameters.nodePublicKey))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => models_1.NodeInfoFromJSON(jsonValue));
});
}
/**
* Returns the node information for the given transport public key.
*/
getNodeByNodePublicKey(nodePublicKey, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.getNodeByNodePublicKeyRaw({ nodePublicKey: nodePublicKey }, initOverrides);
return yield response.value();
});
}
/**
* Returns the summary of the number of nodes per role over time.
*/
getNodeCountRaw(initOverrides) {

@@ -96,3 +124,3 @@ return __awaiter(this, void 0, void 0, function* () {

/**
* Returns a summary of the number per role over time.
* Returns the summary of the number of nodes per role over time.
*/

@@ -106,3 +134,3 @@ getNodeCount(initOverrides) {

/**
* Returns a summary of the number of nodes per height and finalized height.
* Returns the summary of the number of nodes per height and finalized height.
*/

@@ -123,3 +151,3 @@ getNodeHeightStatsRaw(initOverrides) {

/**
* Returns a summary of the number of nodes per height and finalized height.
* Returns the summary of the number of nodes per height and finalized height.
*/

@@ -133,3 +161,3 @@ getNodeHeightStats(initOverrides) {

/**
* Returns a summary of the number of nodes per role type.
* Returns the summary of the number of nodes per role type.
*/

@@ -150,3 +178,3 @@ getNodeStatsRaw(initOverrides) {

/**
* Returns a summary of the number of nodes per role type.
* Returns the summary of the number of nodes per role type.
*/

@@ -153,0 +181,0 @@ getNodeStats(initOverrides) {

@@ -1,4 +0,4 @@

import { Finalization, NodeStatus } from './';
import { Finalization, NodeStatus, WebSocketStatus } from './';
/**
* The status of the api node. Information is from the rest gateway.
* The status of the API node. Information comes from the REST gateway.
* @export

@@ -9,3 +9,9 @@ * @interface ApiStatus

/**
* The rest gateway url ready to be connected.
*
* @type {WebSocketStatus}
* @memberof ApiStatus
*/
webSocket: WebSocketStatus;
/**
* The REST gateway URL ready to be connected to.
* @type {string}

@@ -16,3 +22,3 @@ * @memberof ApiStatus

/**
*
* Whether the API is ready to accept queries.
* @type {boolean}

@@ -23,3 +29,3 @@ * @memberof ApiStatus

/**
*
* When was the API last checked, in milliseconds elapsed since UNIX epoch (January 1, 1970 00:00:00 UTC).
* @type {number}

@@ -36,3 +42,3 @@ * @memberof ApiStatus

/**
*
* Whether the API accepts connections through HTTPS.
* @type {boolean}

@@ -43,3 +49,4 @@ * @memberof ApiStatus

/**
*
* Node's public key used to stablish TLS connections and
* [delegated harvesting](https://docs.symbolplatform.com/guides/harvesting/activating-delegated-harvesting-manual.html), for example.
* @type {string}

@@ -50,3 +57,3 @@ * @memberof ApiStatus

/**
*
* Current chain height as reported by this node.
* @type {number}

@@ -63,3 +70,3 @@ * @memberof ApiStatus

/**
*
* Version of the REST API used by this node.
* @type {string}

@@ -66,0 +73,0 @@ * @memberof ApiStatus

@@ -44,2 +44,3 @@ "use strict";

return {
'webSocket': _1.WebSocketStatusFromJSON(json['webSocket']),
'restGatewayUrl': json['restGatewayUrl'],

@@ -65,2 +66,3 @@ 'isAvailable': json['isAvailable'],

return {
'webSocket': _1.WebSocketStatusToJSON(value.webSocket),
'restGatewayUrl': value.restGatewayUrl,

@@ -67,0 +69,0 @@ 'isAvailable': value.isAvailable,

/**
* The world coordinates of the node based on the ip address.
* The world coordinates of the node based on its IP address.
* @export

@@ -4,0 +4,0 @@ * @interface Coordinates

/**
*
* Status of the [finalization](https://docs.symbolplatform.com/concepts/block.html#finalization) gadget.
* @export

@@ -8,3 +8,4 @@ * @interface Finalization

/**
* The finalized block of the blockchain.
* The latest finalized block of the blockchain.
* This block and all blocks before it are immutable and cannot be rolled back.
* @type {number}

@@ -15,3 +16,3 @@ * @memberof Finalization

/**
*
* Current [finalization epoch](https://docs.symbolplatform.com/concepts/block.html#finalization).
* @type {number}

@@ -22,3 +23,3 @@ * @memberof Finalization

/**
*
* Current [finalization point](https://docs.symbolplatform.com/concepts/block.html#finalization).
* @type {number}

@@ -25,0 +26,0 @@ * @memberof Finalization

import { Coordinates } from './';
/**
* Location detils of the node.
* Location details of the node.
* @export

@@ -21,3 +21,3 @@ * @interface HostDetail

/**
*
* Text description of the host's location.
* @type {string}

@@ -34,3 +34,3 @@ * @memberof HostDetail

/**
*
* Text description of the organization managing this node.
* @type {string}

@@ -41,3 +41,3 @@ * @memberof HostDetail

/**
*
* AS number and organization, separated by space (RIR).
* @type {string}

@@ -44,0 +44,0 @@ * @memberof HostDetail

@@ -16,1 +16,2 @@ export * from './ApiStatus';

export * from './TimeSeriesNodeCountAllOf';
export * from './WebSocketStatus';

@@ -30,1 +30,2 @@ "use strict";

__exportStar(require("./TimeSeriesNodeCountAllOf"), exports);
__exportStar(require("./WebSocketStatus"), exports);
import { NodeHeightStatValue } from './';
/**
* A summary of the number of nodes per height and finalized height.
* The summary of the number of nodes per height and finalized height.
* @export

@@ -9,3 +9,3 @@ * @interface NodeHeightStats

/**
*
* Histogram of chain heights.
* @type {Array<NodeHeightStatValue>}

@@ -16,3 +16,3 @@ * @memberof NodeHeightStats

/**
*
* Histogram of chain [finalization](https://docs.symbolplatform.com/concepts/block.html#finalization) heights.
* @type {Array<NodeHeightStatValue>}

@@ -23,3 +23,3 @@ * @memberof NodeHeightStats

/**
* Date and time when the data was collected
* Date and time when the data was collected.
* @type {string}

@@ -26,0 +26,0 @@ * @memberof NodeHeightStats

/**
* A simple value of the Node Hight Stats.
* A single value of the Node Height Stats.
* @export

@@ -8,3 +8,3 @@ * @interface NodeHeightStatValue

/**
*
* Height, as a string because it represents a 64-bit integer.
* @type {string}

@@ -15,3 +15,3 @@ * @memberof NodeHeightStatValue

/**
*
* Number of nodes currently at that height.
* @type {number}

@@ -18,0 +18,0 @@ * @memberof NodeHeightStatValue

import { ApiStatus, HostDetail, NetworkType, PeerStatus } from './';
/**
* The node information the statitcs service has recolected from the chain.
* Node information gathered from the chain by the statistics service.
* @export

@@ -9,3 +9,3 @@ * @interface NodeInfo

/**
*
* Node's main account's public key.
* @type {string}

@@ -18,3 +18,3 @@ * @memberof NodeInfo

* * 1 - Peer node.
* * 2 - Api node.
* * 2 - API node.
* * 4 - Voting node.

@@ -24,7 +24,7 @@ * * 64 - IPv4 compatible node

*
* The values are bitwise added together, Examples:
* 1 = Just Peer.
* 2 = Just Api.
* 3 = Peer and Api node.
* 7 = Peer, Api and Voting node.
* The values are bitwise added together, for example:
* 1 = Only Peer.
* 2 = Only API.
* 3 = Both Peer and API node.
* 7 = Peer, API and Voting node.
* 65 = IPv4 and Peer node.

@@ -36,3 +36,5 @@ * @type {number}

/**
* The client version. Each pair of digits represent a digit number. E.g. 16777728 is 1.0.2.0
* The version is encoded as a single 4-byte integer, where the Most-Significant Byte
* encodes the Major version, and the rest of bytes are the Minor, the Micro and the Patch version.
* For example, version 16777472 (decimal) is 01000100h (hex), which corresponds to version 1.0.1.0.
* @type {number}

@@ -49,3 +51,5 @@ * @memberof NodeInfo

/**
*
* Hash seed of the network this node is connected to.
* All nodes connected to the same network have the same
* [Hash Seed](https://docs.symbolplatform.com/guides/network/configuring-network-properties.html#network-configuration).
* @type {string}

@@ -52,0 +56,0 @@ * @memberof NodeInfo

/**
* suggested: all available api nodes that have a rest endpoint and are online.
* preferred: all preferred api nodes that have a rest endpoint and are online. Prefered are nodes that match some specific domains.
* `suggested`: All available API nodes that have a REST endpoint and are online.
* `preferred`: Preferred API nodes that have a REST endpoint and are online. Preferred nodes match some specific domains.
* @export

@@ -5,0 +5,0 @@ * @enum {string}

@@ -34,4 +34,4 @@ "use strict";

/**
* suggested: all available api nodes that have a rest endpoint and are online.
* preferred: all preferred api nodes that have a rest endpoint and are online. Prefered are nodes that match some specific domains.
* `suggested`: All available API nodes that have a REST endpoint and are online.
* `preferred`: Preferred API nodes that have a REST endpoint and are online. Preferred nodes match some specific domains.
* @export

@@ -38,0 +38,0 @@ * @enum {string}

/**
* A summary of the number of nodes per role type.
* The summary of the number of nodes per role type.
* @export

@@ -8,3 +8,3 @@ * @interface NodeStats

/**
* The number of nodes indexed by role type
* The number of nodes indexed by role type.
* @type {{ [key: string]: object; }}

@@ -11,0 +11,0 @@ * @memberof NodeStats

/**
* The status of the rest gateway.
* The status of the REST gateway.
* @export

@@ -8,3 +8,3 @@ * @interface NodeStatus

/**
*
* Whether the front-end REST gateway is up and running. Possible values are `up` and `down`. Node needs to be restarted if `down`.
* @type {string}

@@ -15,3 +15,3 @@ * @memberof NodeStatus

/**
*
* Whether the back-end database is up and running. Possible values are `up` and `down`. Node needs to be restarted if `down`.
* @type {string}

@@ -18,0 +18,0 @@ * @memberof NodeStatus

@@ -8,3 +8,3 @@ /**

/**
*
* When was the peer last contacted, in milliseconds elapsed since UNIX epoch (January 1, 1970 00:00:00 UTC).
* @type {number}

@@ -15,3 +15,3 @@ * @memberof PeerStatus

/**
*
* Whether the node is currently available (reachable and answering queries).
* @type {boolean}

@@ -18,0 +18,0 @@ * @memberof PeerStatus

/**
* A summary of the number per role over time.
* Summary of the number of nodes per role over time.
* @export

@@ -8,3 +8,3 @@ * @interface TimeSeriesNodeCount

/**
*
* Total number of nodes
* @type {number}

@@ -14,8 +14,2 @@ * @memberof TimeSeriesNodeCount

total?: number;
/**
*
* @type {number}
* @memberof TimeSeriesNodeCount
*/
rand?: number;
}

@@ -22,0 +16,0 @@ export declare function TimeSeriesNodeCountFromJSON(json: any): TimeSeriesNodeCount;

@@ -44,3 +44,2 @@ "use strict";

'total': !runtime_1.exists(json, 'total') ? undefined : json['total'],
'rand': !runtime_1.exists(json, 'rand') ? undefined : json['rand'],
};

@@ -58,5 +57,4 @@ }

'total': value.total,
'rand': value.rand,
};
}
exports.TimeSeriesNodeCountToJSON = TimeSeriesNodeCountToJSON;

@@ -8,3 +8,3 @@ /**

/**
*
* Total number of nodes
* @type {number}

@@ -14,8 +14,2 @@ * @memberof TimeSeriesNodeCountAllOf

total?: number;
/**
*
* @type {number}
* @memberof TimeSeriesNodeCountAllOf
*/
rand?: number;
}

@@ -22,0 +16,0 @@ export declare function TimeSeriesNodeCountAllOfFromJSON(json: any): TimeSeriesNodeCountAllOf;

@@ -44,3 +44,2 @@ "use strict";

'total': !runtime_1.exists(json, 'total') ? undefined : json['total'],
'rand': !runtime_1.exists(json, 'rand') ? undefined : json['rand'],
};

@@ -58,5 +57,4 @@ }

'total': value.total,
'rand': value.rand,
};
}
exports.TimeSeriesNodeCountAllOfToJSON = TimeSeriesNodeCountAllOfToJSON;

@@ -141,3 +141,3 @@ export declare const BASE_PATH: string;

export declare class RestClientUtils {
static getErrorFromFetchResponse(error: Response | Error): Promise<RestClientCallError>;
static getErrorFromFetchResponse(error: Response): Promise<RestClientCallError>;
}

@@ -284,25 +284,17 @@ "use strict";

return __awaiter(this, void 0, void 0, function* () {
if (error instanceof Error) {
const statusCode = 0;
const message = error.message || 'Unknown Error';
const statusMessage = (error['code'] || 'Unknown Error').toString();
return new RestClientCallError(message, statusCode, statusMessage, '');
}
else {
const statusCode = (error === null || error === void 0 ? void 0 : error.status) || 0;
const statusMessage = ((error === null || error === void 0 ? void 0 : error.statusText) || 'Unknown Error').toString();
const body = (error.text && typeof error.text === 'function' && (yield error.text())) || '';
const getMessage = () => {
var _a;
const defaultMessage = `${statusCode} - ${statusMessage}`;
try {
return ((_a = JSON.parse(body)) === null || _a === void 0 ? void 0 : _a.message) || defaultMessage;
}
catch (e) {
return defaultMessage;
}
};
const message = getMessage();
return new RestClientCallError(message, statusCode, statusMessage, body);
}
const statusCode = (error === null || error === void 0 ? void 0 : error.status) || 0;
const statusMessage = ((error === null || error === void 0 ? void 0 : error.statusText) || 'Unknown Error').toString();
const body = (error.text && typeof error.text === 'function' && (yield error.text())) || '';
const getMessage = () => {
var _a;
const defaultMessage = `${statusCode} - ${statusMessage}`;
try {
return ((_a = JSON.parse(body)) === null || _a === void 0 ? void 0 : _a.message) || defaultMessage;
}
catch (e) {
return defaultMessage;
}
};
const message = getMessage();
return new RestClientCallError(message, statusCode, statusMessage, body);
});

@@ -309,0 +301,0 @@ }

{
"name": "symbol-statistics-service-typescript-fetch-client",
"version": "1.1.2-alpha-202111150921",
"version": "1.1.2-alpha-202111170848",
"description": "OpenAPI client for https://github.com/symbol/statistics-service",

@@ -5,0 +5,0 @@ "repository": {

@@ -1,2 +0,2 @@

## symbol-statistics-service-typescript-fetch-client@1.1.2-alpha-202111150921
## symbol-statistics-service-typescript-fetch-client@1.1.2-alpha-202111170848

@@ -39,3 +39,3 @@ This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:

```
npm install symbol-statistics-service-typescript-fetch-client@1.1.2-alpha-202111150921 --save
npm install symbol-statistics-service-typescript-fetch-client@1.1.2-alpha-202111170848 --save
```

@@ -42,0 +42,0 @@

@@ -58,2 +58,6 @@ /* tslint:disable */

export interface GetNodeByNodePublicKeyRequest {
nodePublicKey: string;
}
export interface GetNodesRequest {

@@ -71,3 +75,3 @@ filter?: NodeListFilter;

/**
* Returns the node information for the given public key.
* Returns information about the node with the given main account.
*/

@@ -94,3 +98,3 @@ async getNodeRaw(requestParameters: GetNodeRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NodeInfo>> {

/**
* Returns the node information for the given public key.
* Returns information about the node with the given main account.
*/

@@ -103,4 +107,34 @@ async getNode(publicKey: string, initOverrides?: RequestInit): Promise<NodeInfo> {

/**
* Returns a summary of the number per role over time.
* Returns the node information for the given transport public key.
*/
async getNodeByNodePublicKeyRaw(requestParameters: GetNodeByNodePublicKeyRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NodeInfo>> {
if (requestParameters.nodePublicKey === null || requestParameters.nodePublicKey === undefined) {
throw new runtime.RequiredError('nodePublicKey','Required parameter requestParameters.nodePublicKey was null or undefined when calling getNodeByNodePublicKey.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/nodes/nodePublicKey/{nodePublicKey}`.replace(`{${"nodePublicKey"}}`, encodeURIComponent(String(requestParameters.nodePublicKey))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => NodeInfoFromJSON(jsonValue));
}
/**
* Returns the node information for the given transport public key.
*/
async getNodeByNodePublicKey(nodePublicKey: string, initOverrides?: RequestInit): Promise<NodeInfo> {
const response = await this.getNodeByNodePublicKeyRaw({ nodePublicKey: nodePublicKey }, initOverrides);
return await response.value();
}
/**
* Returns the summary of the number of nodes per role over time.
*/
async getNodeCountRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<TimeSeriesNodeCount>>> {

@@ -122,3 +156,3 @@ const queryParameters: any = {};

/**
* Returns a summary of the number per role over time.
* Returns the summary of the number of nodes per role over time.
*/

@@ -131,3 +165,3 @@ async getNodeCount(initOverrides?: RequestInit): Promise<Array<TimeSeriesNodeCount>> {

/**
* Returns a summary of the number of nodes per height and finalized height.
* Returns the summary of the number of nodes per height and finalized height.
*/

@@ -150,3 +184,3 @@ async getNodeHeightStatsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<NodeHeightStats>> {

/**
* Returns a summary of the number of nodes per height and finalized height.
* Returns the summary of the number of nodes per height and finalized height.
*/

@@ -159,3 +193,3 @@ async getNodeHeightStats(initOverrides?: RequestInit): Promise<NodeHeightStats> {

/**
* Returns a summary of the number of nodes per role type.
* Returns the summary of the number of nodes per role type.
*/

@@ -178,3 +212,3 @@ async getNodeStatsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<NodeStats>> {

/**
* Returns a summary of the number of nodes per role type.
* Returns the summary of the number of nodes per role type.
*/

@@ -181,0 +215,0 @@ async getNodeStats(initOverrides?: RequestInit): Promise<NodeStats> {

@@ -41,6 +41,10 @@ /* tslint:disable */

NodeStatusToJSON,
WebSocketStatus,
WebSocketStatusFromJSON,
WebSocketStatusFromJSONTyped,
WebSocketStatusToJSON,
} from './';
/**
* The status of the api node. Information is from the rest gateway.
* The status of the API node. Information comes from the REST gateway.
* @export

@@ -51,3 +55,9 @@ * @interface ApiStatus

/**
* The rest gateway url ready to be connected.
*
* @type {WebSocketStatus}
* @memberof ApiStatus
*/
webSocket: WebSocketStatus;
/**
* The REST gateway URL ready to be connected to.
* @type {string}

@@ -58,3 +68,3 @@ * @memberof ApiStatus

/**
*
* Whether the API is ready to accept queries.
* @type {boolean}

@@ -65,3 +75,3 @@ * @memberof ApiStatus

/**
*
* When was the API last checked, in milliseconds elapsed since UNIX epoch (January 1, 1970 00:00:00 UTC).
* @type {number}

@@ -78,3 +88,3 @@ * @memberof ApiStatus

/**
*
* Whether the API accepts connections through HTTPS.
* @type {boolean}

@@ -85,3 +95,4 @@ * @memberof ApiStatus

/**
*
* Node's public key used to stablish TLS connections and
* [delegated harvesting](https://docs.symbolplatform.com/guides/harvesting/activating-delegated-harvesting-manual.html), for example.
* @type {string}

@@ -92,3 +103,3 @@ * @memberof ApiStatus

/**
*
* Current chain height as reported by this node.
* @type {number}

@@ -105,3 +116,3 @@ * @memberof ApiStatus

/**
*
* Version of the REST API used by this node.
* @type {string}

@@ -123,2 +134,3 @@ * @memberof ApiStatus

'webSocket': WebSocketStatusFromJSON(json['webSocket']),
'restGatewayUrl': json['restGatewayUrl'],

@@ -145,2 +157,3 @@ 'isAvailable': json['isAvailable'],

'webSocket': WebSocketStatusToJSON(value.webSocket),
'restGatewayUrl': value.restGatewayUrl,

@@ -147,0 +160,0 @@ 'isAvailable': value.isAvailable,

@@ -33,3 +33,3 @@ /* tslint:disable */

/**
* The world coordinates of the node based on the ip address.
* The world coordinates of the node based on its IP address.
* @export

@@ -36,0 +36,0 @@ * @interface Coordinates

@@ -33,3 +33,3 @@ /* tslint:disable */

/**
*
* Status of the [finalization](https://docs.symbolplatform.com/concepts/block.html#finalization) gadget.
* @export

@@ -40,3 +40,4 @@ * @interface Finalization

/**
* The finalized block of the blockchain.
* The latest finalized block of the blockchain.
* This block and all blocks before it are immutable and cannot be rolled back.
* @type {number}

@@ -47,3 +48,3 @@ * @memberof Finalization

/**
*
* Current [finalization epoch](https://docs.symbolplatform.com/concepts/block.html#finalization).
* @type {number}

@@ -54,3 +55,3 @@ * @memberof Finalization

/**
*
* Current [finalization point](https://docs.symbolplatform.com/concepts/block.html#finalization).
* @type {number}

@@ -57,0 +58,0 @@ * @memberof Finalization

@@ -40,3 +40,3 @@ /* tslint:disable */

/**
* Location detils of the node.
* Location details of the node.
* @export

@@ -59,3 +59,3 @@ * @interface HostDetail

/**
*
* Text description of the host's location.
* @type {string}

@@ -72,3 +72,3 @@ * @memberof HostDetail

/**
*
* Text description of the organization managing this node.
* @type {string}

@@ -79,3 +79,3 @@ * @memberof HostDetail

/**
*
* AS number and organization, separated by space (RIR).
* @type {string}

@@ -82,0 +82,0 @@ * @memberof HostDetail

@@ -18,1 +18,2 @@ /* tslint:disable */

export * from './TimeSeriesNodeCountAllOf';
export * from './WebSocketStatus';

@@ -40,3 +40,3 @@ /* tslint:disable */

/**
* A summary of the number of nodes per height and finalized height.
* The summary of the number of nodes per height and finalized height.
* @export

@@ -47,3 +47,3 @@ * @interface NodeHeightStats

/**
*
* Histogram of chain heights.
* @type {Array<NodeHeightStatValue>}

@@ -54,3 +54,3 @@ * @memberof NodeHeightStats

/**
*
* Histogram of chain [finalization](https://docs.symbolplatform.com/concepts/block.html#finalization) heights.
* @type {Array<NodeHeightStatValue>}

@@ -61,3 +61,3 @@ * @memberof NodeHeightStats

/**
* Date and time when the data was collected
* Date and time when the data was collected.
* @type {string}

@@ -64,0 +64,0 @@ * @memberof NodeHeightStats

@@ -33,3 +33,3 @@ /* tslint:disable */

/**
* A simple value of the Node Hight Stats.
* A single value of the Node Height Stats.
* @export

@@ -40,3 +40,3 @@ * @interface NodeHeightStatValue

/**
*
* Height, as a string because it represents a 64-bit integer.
* @type {string}

@@ -47,3 +47,3 @@ * @memberof NodeHeightStatValue

/**
*
* Number of nodes currently at that height.
* @type {number}

@@ -50,0 +50,0 @@ * @memberof NodeHeightStatValue

@@ -52,3 +52,3 @@ /* tslint:disable */

/**
* The node information the statitcs service has recolected from the chain.
* Node information gathered from the chain by the statistics service.
* @export

@@ -59,3 +59,3 @@ * @interface NodeInfo

/**
*
* Node's main account's public key.
* @type {string}

@@ -68,3 +68,3 @@ * @memberof NodeInfo

* * 1 - Peer node.
* * 2 - Api node.
* * 2 - API node.
* * 4 - Voting node.

@@ -74,7 +74,7 @@ * * 64 - IPv4 compatible node

*
* The values are bitwise added together, Examples:
* 1 = Just Peer.
* 2 = Just Api.
* 3 = Peer and Api node.
* 7 = Peer, Api and Voting node.
* The values are bitwise added together, for example:
* 1 = Only Peer.
* 2 = Only API.
* 3 = Both Peer and API node.
* 7 = Peer, API and Voting node.
* 65 = IPv4 and Peer node.

@@ -86,3 +86,5 @@ * @type {number}

/**
* The client version. Each pair of digits represent a digit number. E.g. 16777728 is 1.0.2.0
* The version is encoded as a single 4-byte integer, where the Most-Significant Byte
* encodes the Major version, and the rest of bytes are the Minor, the Micro and the Patch version.
* For example, version 16777472 (decimal) is 01000100h (hex), which corresponds to version 1.0.1.0.
* @type {number}

@@ -99,3 +101,5 @@ * @memberof NodeInfo

/**
*
* Hash seed of the network this node is connected to.
* All nodes connected to the same network have the same
* [Hash Seed](https://docs.symbolplatform.com/guides/network/configuring-network-properties.html#network-configuration).
* @type {string}

@@ -102,0 +106,0 @@ * @memberof NodeInfo

@@ -32,4 +32,4 @@ /* tslint:disable */

/**
* suggested: all available api nodes that have a rest endpoint and are online.
* preferred: all preferred api nodes that have a rest endpoint and are online. Prefered are nodes that match some specific domains.
* `suggested`: All available API nodes that have a REST endpoint and are online.
* `preferred`: Preferred API nodes that have a REST endpoint and are online. Preferred nodes match some specific domains.
* @export

@@ -36,0 +36,0 @@ * @enum {string}

@@ -33,3 +33,3 @@ /* tslint:disable */

/**
* A summary of the number of nodes per role type.
* The summary of the number of nodes per role type.
* @export

@@ -40,3 +40,3 @@ * @interface NodeStats

/**
* The number of nodes indexed by role type
* The number of nodes indexed by role type.
* @type {{ [key: string]: object; }}

@@ -43,0 +43,0 @@ * @memberof NodeStats

@@ -33,3 +33,3 @@ /* tslint:disable */

/**
* The status of the rest gateway.
* The status of the REST gateway.
* @export

@@ -40,3 +40,3 @@ * @interface NodeStatus

/**
*
* Whether the front-end REST gateway is up and running. Possible values are `up` and `down`. Node needs to be restarted if `down`.
* @type {string}

@@ -47,3 +47,3 @@ * @memberof NodeStatus

/**
*
* Whether the back-end database is up and running. Possible values are `up` and `down`. Node needs to be restarted if `down`.
* @type {string}

@@ -50,0 +50,0 @@ * @memberof NodeStatus

@@ -39,3 +39,3 @@ /* tslint:disable */

/**
*
* When was the peer last contacted, in milliseconds elapsed since UNIX epoch (January 1, 1970 00:00:00 UTC).
* @type {number}

@@ -46,3 +46,3 @@ * @memberof PeerStatus

/**
*
* Whether the node is currently available (reachable and answering queries).
* @type {boolean}

@@ -49,0 +49,0 @@ * @memberof PeerStatus

@@ -40,3 +40,3 @@ /* tslint:disable */

/**
* A summary of the number per role over time.
* Summary of the number of nodes per role over time.
* @export

@@ -47,3 +47,3 @@ * @interface TimeSeriesNodeCount

/**
*
* Total number of nodes
* @type {number}

@@ -53,8 +53,2 @@ * @memberof TimeSeriesNodeCount

total?: number;
/**
*
* @type {number}
* @memberof TimeSeriesNodeCount
*/
rand?: number;
}

@@ -73,3 +67,2 @@

'total': !exists(json, 'total') ? undefined : json['total'],
'rand': !exists(json, 'rand') ? undefined : json['rand'],
};

@@ -88,5 +81,4 @@ }

'total': value.total,
'rand': value.rand,
};
}

@@ -39,3 +39,3 @@ /* tslint:disable */

/**
*
* Total number of nodes
* @type {number}

@@ -45,8 +45,2 @@ * @memberof TimeSeriesNodeCountAllOf

total?: number;
/**
*
* @type {number}
* @memberof TimeSeriesNodeCountAllOf
*/
rand?: number;
}

@@ -65,3 +59,2 @@

'total': !exists(json, 'total') ? undefined : json['total'],
'rand': !exists(json, 'rand') ? undefined : json['rand'],
};

@@ -80,5 +73,4 @@ }

'total': value.total,
'rand': value.rand,
};
}

@@ -349,24 +349,17 @@ /* tslint:disable */

export class RestClientUtils {
public static async getErrorFromFetchResponse(error: Response | Error): Promise<RestClientCallError> {
if (error instanceof Error) {
const statusCode = 0;
const message = error.message || 'Unknown Error';
const statusMessage = (error['code'] || 'Unknown Error').toString();
return new RestClientCallError(message, statusCode, statusMessage, '');
} else {
const statusCode = error?.status || 0;
const statusMessage = (error?.statusText || 'Unknown Error').toString();
const body = (error.text && typeof error.text === 'function' && (await error.text())) || '';
const getMessage = () => {
const defaultMessage = `${statusCode} - ${statusMessage}`;
try {
return JSON.parse(body)?.message || defaultMessage;
} catch (e) {
return defaultMessage;
}
};
const message = getMessage();
return new RestClientCallError(message, statusCode, statusMessage, body);
}
}
public static async getErrorFromFetchResponse(error: Response): Promise<RestClientCallError> {
const statusCode = error?.status || 0;
const statusMessage = (error?.statusText || 'Unknown Error').toString();
const body = (error.text && typeof error.text === 'function' && (await error.text())) || '';
const getMessage = () => {
const defaultMessage = `${statusCode} - ${statusMessage}`;
try {
return JSON.parse(body)?.message || defaultMessage;
} catch (e) {
return defaultMessage;
}
};
const message = getMessage();
return new RestClientCallError(message, statusCode, statusMessage, body);
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc