@chainlink/external-adapter-framework 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapter.js +114 -101
- package/cache/factory.js +3 -0
- package/chainlink-external-adapter-framework-v0.0.6.tgz +0 -0
- package/config/index.js +69 -83
- package/config/provider-limits.js +10 -15
- package/examples/bank-frick/accounts.js +3 -2
- package/examples/bank-frick/index.js +3 -2
- package/examples/coingecko/src/config/index.js +13 -0
- package/examples/coingecko/src/config/overrides.json +10826 -0
- package/examples/coingecko/src/cryptoUtils.js +41 -0
- package/examples/coingecko/src/endpoint/coins.js +33 -0
- package/examples/coingecko/src/endpoint/crypto-marketcap.js +46 -0
- package/examples/coingecko/src/endpoint/crypto-volume.js +46 -0
- package/examples/coingecko/src/endpoint/crypto.js +47 -0
- package/examples/coingecko/src/endpoint/dominance.js +26 -0
- package/examples/coingecko/src/endpoint/global-marketcap.js +26 -0
- package/examples/coingecko/src/endpoint/index.js +15 -0
- package/examples/coingecko/src/globalUtils.js +48 -0
- package/examples/coingecko/src/index.js +14 -0
- package/examples/coingecko/test/e2e/adapter.test.js +262 -0
- package/examples/coingecko/test/integration/adapter.test.js +264 -0
- package/examples/coingecko/test/integration/capturedRequests.json +1 -0
- package/examples/coingecko/test/integration/fixtures.js +41 -0
- package/{package/examples/coingecko → examples/coingecko-old}/batch-warming.js +4 -3
- package/examples/{coingecko → coingecko-old}/index.js +3 -2
- package/{package/examples/coingecko → examples/coingecko-old}/rest.js +3 -2
- package/examples/ncfx/index.js +3 -2
- package/examples/ncfx/websocket.js +3 -2
- package/index.js +17 -23
- package/package.json +5 -4
- package/rate-limiting/index.js +23 -2
- package/transports/batch-warming.js +1 -1
- package/transports/rest.js +9 -2
- package/transports/util.js +2 -1
- package/transports/websocket.js +4 -6
- package/util/recordRequests.js +45 -0
- package/{package/validation/override-functions.js → validation/overrideFunctions.js} +0 -0
- package/adapter.d.ts +0 -107
- package/background-executor.d.ts +0 -11
- package/cache/factory.d.ts +0 -6
- package/cache/index.d.ts +0 -94
- package/cache/local.d.ts +0 -23
- package/cache/metrics.d.ts +0 -27
- package/cache/redis.d.ts +0 -16
- package/chainlink-external-adapter-framework-0.0.6.tgz +0 -0
- package/config/index.d.ts +0 -209
- package/config/provider-limits.d.ts +0 -31
- package/examples/bank-frick/accounts.d.ts +0 -39
- package/examples/bank-frick/config/index.d.ts +0 -4
- package/examples/bank-frick/index.d.ts +0 -2
- package/examples/bank-frick/util.d.ts +0 -4
- package/examples/coingecko/batch-warming.d.ts +0 -2
- package/examples/coingecko/batch-warming.js +0 -52
- package/examples/coingecko/index.d.ts +0 -2
- package/examples/coingecko/rest.d.ts +0 -2
- package/examples/coingecko/rest.js +0 -50
- package/examples/ncfx/config/index.d.ts +0 -12
- package/examples/ncfx/index.d.ts +0 -2
- package/examples/ncfx/websocket.d.ts +0 -36
- package/index.d.ts +0 -11
- package/metrics/constants.d.ts +0 -16
- package/metrics/index.d.ts +0 -15
- package/metrics/util.d.ts +0 -7
- package/package/adapter.d.ts +0 -88
- package/package/adapter.js +0 -112
- package/package/background-executor.d.ts +0 -11
- package/package/background-executor.js +0 -45
- package/package/cache/factory.d.ts +0 -6
- package/package/cache/factory.js +0 -57
- package/package/cache/index.d.ts +0 -90
- package/package/cache/index.js +0 -169
- package/package/cache/local.d.ts +0 -23
- package/package/cache/local.js +0 -83
- package/package/cache/metrics.d.ts +0 -27
- package/package/cache/metrics.js +0 -120
- package/package/cache/redis.d.ts +0 -16
- package/package/cache/redis.js +0 -100
- package/package/config/index.d.ts +0 -195
- package/package/config/index.js +0 -365
- package/package/config/provider-limits.d.ts +0 -31
- package/package/config/provider-limits.js +0 -76
- package/package/examples/coingecko/batch-warming.d.ts +0 -2
- package/package/examples/coingecko/index.d.ts +0 -2
- package/package/examples/coingecko/index.js +0 -10
- package/package/examples/coingecko/rest.d.ts +0 -2
- package/package/examples/ncfx/config/index.d.ts +0 -12
- package/package/examples/ncfx/config/index.js +0 -15
- package/package/examples/ncfx/index.d.ts +0 -2
- package/package/examples/ncfx/index.js +0 -10
- package/package/examples/ncfx/websocket.d.ts +0 -36
- package/package/examples/ncfx/websocket.js +0 -72
- package/package/index.d.ts +0 -12
- package/package/index.js +0 -92
- package/package/metrics/constants.d.ts +0 -16
- package/package/metrics/constants.js +0 -25
- package/package/metrics/index.d.ts +0 -15
- package/package/metrics/index.js +0 -123
- package/package/metrics/util.d.ts +0 -3
- package/package/metrics/util.js +0 -9
- package/package/package.json +0 -72
- package/package/rate-limiting/background/fixed-frequency.d.ts +0 -10
- package/package/rate-limiting/background/fixed-frequency.js +0 -37
- package/package/rate-limiting/index.d.ts +0 -54
- package/package/rate-limiting/index.js +0 -63
- package/package/rate-limiting/metrics.d.ts +0 -3
- package/package/rate-limiting/metrics.js +0 -44
- package/package/rate-limiting/request/simple-counting.d.ts +0 -20
- package/package/rate-limiting/request/simple-counting.js +0 -62
- package/package/test.d.ts +0 -1
- package/package/test.js +0 -6
- package/package/transports/batch-warming.d.ts +0 -34
- package/package/transports/batch-warming.js +0 -101
- package/package/transports/index.d.ts +0 -87
- package/package/transports/index.js +0 -87
- package/package/transports/metrics.d.ts +0 -21
- package/package/transports/metrics.js +0 -105
- package/package/transports/rest.d.ts +0 -43
- package/package/transports/rest.js +0 -129
- package/package/transports/util.d.ts +0 -8
- package/package/transports/util.js +0 -85
- package/package/transports/websocket.d.ts +0 -80
- package/package/transports/websocket.js +0 -169
- package/package/util/expiring-sorted-set.d.ts +0 -21
- package/package/util/expiring-sorted-set.js +0 -47
- package/package/util/index.d.ts +0 -11
- package/package/util/index.js +0 -35
- package/package/util/logger.d.ts +0 -42
- package/package/util/logger.js +0 -62
- package/package/util/request.d.ts +0 -55
- package/package/util/request.js +0 -2
- package/package/validation/error.d.ts +0 -50
- package/package/validation/error.js +0 -79
- package/package/validation/index.d.ts +0 -5
- package/package/validation/index.js +0 -86
- package/package/validation/input-params.d.ts +0 -15
- package/package/validation/input-params.js +0 -30
- package/package/validation/override-functions.d.ts +0 -3
- package/package/validation/preset-tokens.json +0 -23
- package/package/validation/validator.d.ts +0 -47
- package/package/validation/validator.js +0 -303
- package/rate-limiting/background/fixed-frequency.d.ts +0 -10
- package/rate-limiting/index.d.ts +0 -54
- package/rate-limiting/metrics.d.ts +0 -3
- package/rate-limiting/request/simple-counting.d.ts +0 -20
- package/test.d.ts +0 -1
- package/transports/batch-warming.d.ts +0 -35
- package/transports/index.d.ts +0 -70
- package/transports/metrics.d.ts +0 -21
- package/transports/rest.d.ts +0 -44
- package/transports/util.d.ts +0 -8
- package/transports/websocket.d.ts +0 -81
- package/util/expiring-sorted-set.d.ts +0 -21
- package/util/expiring-sorted-set.js +0 -47
- package/util/index.d.ts +0 -12
- package/util/logger.d.ts +0 -42
- package/util/request.d.ts +0 -57
- package/util/subscription-set/expiring-sorted-set.d.ts +0 -22
- package/util/subscription-set/subscription-set.d.ts +0 -18
- package/util/test-payload-loader.d.ts +0 -25
- package/validation/error.d.ts +0 -50
- package/validation/index.d.ts +0 -5
- package/validation/input-params.d.ts +0 -15
- package/validation/override-functions.d.ts +0 -3
- package/validation/validator.d.ts +0 -47
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.axiosRequest = void 0;
|
|
30
|
-
const axios_1 = __importDefault(require("axios"));
|
|
31
|
-
const error_1 = require("../validation/error");
|
|
32
|
-
const transportMetrics = __importStar(require("./metrics"));
|
|
33
|
-
/**
|
|
34
|
-
* Performs axios request along with metrics recording and error handling
|
|
35
|
-
*
|
|
36
|
-
* @param request - axios request config
|
|
37
|
-
* @returns axios response for the request
|
|
38
|
-
*/
|
|
39
|
-
async function axiosRequest(request) {
|
|
40
|
-
const responseTimer = transportMetrics.dataProviderRequestDurationSeconds.startTimer();
|
|
41
|
-
let providerResponse;
|
|
42
|
-
try {
|
|
43
|
-
providerResponse = await axios_1.default.request(request);
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
const error = e;
|
|
47
|
-
// Request error
|
|
48
|
-
let providerStatusCode;
|
|
49
|
-
let adapterError;
|
|
50
|
-
if (error.code === 'ECONNABORTED') {
|
|
51
|
-
adapterError = new error_1.AdapterTimeoutError({});
|
|
52
|
-
providerStatusCode = error?.response?.status ?? 504;
|
|
53
|
-
adapterError.name = 'Data Provider Request Timeout error';
|
|
54
|
-
}
|
|
55
|
-
else if (error?.response?.status) {
|
|
56
|
-
adapterError = new error_1.AdapterDataProviderError({});
|
|
57
|
-
providerStatusCode = error?.response?.status;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
adapterError = new error_1.AdapterConnectionError({});
|
|
61
|
-
providerStatusCode = 0; // 0 -> connection error
|
|
62
|
-
}
|
|
63
|
-
// Record count of failed data provider request
|
|
64
|
-
transportMetrics.dataProviderRequests
|
|
65
|
-
.labels(transportMetrics.dataProviderMetricsLabel(providerStatusCode, request.method))
|
|
66
|
-
.inc();
|
|
67
|
-
adapterError.statusCode = 200;
|
|
68
|
-
adapterError.providerStatusCode = providerStatusCode;
|
|
69
|
-
adapterError.message = error?.message;
|
|
70
|
-
adapterError.cause = error;
|
|
71
|
-
adapterError.errorResponse = error?.response?.data;
|
|
72
|
-
adapterError.url = request.url;
|
|
73
|
-
throw adapterError;
|
|
74
|
-
}
|
|
75
|
-
finally {
|
|
76
|
-
// Record time taken for data provider request for success or failure
|
|
77
|
-
responseTimer();
|
|
78
|
-
}
|
|
79
|
-
// Record count of successful data provider requests
|
|
80
|
-
transportMetrics.dataProviderRequests
|
|
81
|
-
.labels(transportMetrics.dataProviderMetricsLabel(providerResponse.status, request.method))
|
|
82
|
-
.inc();
|
|
83
|
-
return providerResponse;
|
|
84
|
-
}
|
|
85
|
-
exports.axiosRequest = axiosRequest;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import WebSocket from 'ws';
|
|
2
|
-
import { Cache } from '../cache';
|
|
3
|
-
import { SettingsMap } from '../config';
|
|
4
|
-
import { BackgroundExecuteRateLimiter } from '../rate-limiting';
|
|
5
|
-
import { ExpiringSortedSet } from '../util';
|
|
6
|
-
import { AdapterRequest, ProviderResult } from '../util/request';
|
|
7
|
-
import { AdapterContext, AdapterDependencies, Transport } from './';
|
|
8
|
-
export declare const DEFAULT_WS_TTL = 10000;
|
|
9
|
-
declare type WebSocketClass = new (url: string, protocols?: string | string[] | undefined) => WebSocket;
|
|
10
|
-
export declare class WebSocketClassProvider {
|
|
11
|
-
static ctor: WebSocketClass;
|
|
12
|
-
static set(ctor: WebSocketClass): void;
|
|
13
|
-
static get(): WebSocketClass;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Config object that is provided to the WebSocketTransport constructor.
|
|
17
|
-
*/
|
|
18
|
-
export interface WebSocketTransportConfig<AdapterParams, ProviderDataMessage, CustomSettings extends SettingsMap> {
|
|
19
|
-
/** Endpoint to which to open the WS connection*/
|
|
20
|
-
url: string;
|
|
21
|
-
/** Map of handlers for different WS lifecycle events */
|
|
22
|
-
handlers: {
|
|
23
|
-
/**
|
|
24
|
-
* Handles when the WS is successfully opened
|
|
25
|
-
*
|
|
26
|
-
* @param wsConnection - the WebSocket with an established connection
|
|
27
|
-
* @returns an empty Promise, or void
|
|
28
|
-
*/
|
|
29
|
-
open: (wsConnection: WebSocket, context: AdapterContext<CustomSettings>) => Promise<void> | void;
|
|
30
|
-
/**
|
|
31
|
-
* Handles when the WS receives a message
|
|
32
|
-
*
|
|
33
|
-
* @param message - the message received by the WS
|
|
34
|
-
* @param context - the background context for the Adapter
|
|
35
|
-
* @returns a list of cache entries of adapter responses to set in the cache
|
|
36
|
-
*/
|
|
37
|
-
message: (message: ProviderDataMessage, context: AdapterContext<CustomSettings>) => ProviderResult<AdapterParams>[];
|
|
38
|
-
};
|
|
39
|
-
/** Map of "builders", functions that will be used to prepare specific WS messages */
|
|
40
|
-
builders: {
|
|
41
|
-
/**
|
|
42
|
-
* Builds a WS message that will be sent to subscribe to a specific feed
|
|
43
|
-
*
|
|
44
|
-
* @param params - the body of the adapter request
|
|
45
|
-
* @returns the WS message (can be any type as long as the [[WebSocket]] doesn't complain)
|
|
46
|
-
*/
|
|
47
|
-
subscribeMessage: (params: AdapterParams) => unknown;
|
|
48
|
-
/**
|
|
49
|
-
* Builds a WS message that will be sent to unsubscribe to a specific feed
|
|
50
|
-
*
|
|
51
|
-
* @param params - the body of the adapter request
|
|
52
|
-
* @returns the WS message (can be any type as long as the [[WebSocket]] doesn't complain)
|
|
53
|
-
*/
|
|
54
|
-
unsubscribeMessage: (params: AdapterParams) => unknown;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Transport implementation that takes incoming requests, adds them to an [[ExpiringSortedSet]] and,
|
|
59
|
-
* through a WebSocket connection, subscribes to the relevant feeds to populate the cache.
|
|
60
|
-
*
|
|
61
|
-
* @typeParam AdapterParams - interface for the adapter request body
|
|
62
|
-
* @typeParam ProviderDataMessage - interface for a WS message containing processable data (i.e. not part of open/close/login/etc)
|
|
63
|
-
*/
|
|
64
|
-
export declare class WebSocketTransport<AdapterParams, ProviderDataMessage, CustomSettings extends SettingsMap> implements Transport<AdapterParams, null, CustomSettings> {
|
|
65
|
-
private config;
|
|
66
|
-
cache: Cache;
|
|
67
|
-
rateLimiter: BackgroundExecuteRateLimiter;
|
|
68
|
-
expiringSortedSet: ExpiringSortedSet<AdapterParams>;
|
|
69
|
-
localSubscriptions: AdapterParams[];
|
|
70
|
-
wsConnection: WebSocket;
|
|
71
|
-
constructor(config: WebSocketTransportConfig<AdapterParams, ProviderDataMessage, CustomSettings>);
|
|
72
|
-
initialize(dependencies: AdapterDependencies): Promise<void>;
|
|
73
|
-
hasBeenSetUp(req: AdapterRequest<AdapterParams>): Promise<boolean>;
|
|
74
|
-
setup(req: AdapterRequest<AdapterParams>): Promise<void>;
|
|
75
|
-
serializeMessage(payload: unknown): string;
|
|
76
|
-
deserializeMessage(data: WebSocket.Data): ProviderDataMessage;
|
|
77
|
-
establishWsConnection(context: AdapterContext<CustomSettings>): Promise<unknown>;
|
|
78
|
-
backgroundExecute(context: AdapterContext<CustomSettings>): Promise<number>;
|
|
79
|
-
}
|
|
80
|
-
export {};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.WebSocketTransport = exports.WebSocketClassProvider = exports.DEFAULT_WS_TTL = void 0;
|
|
30
|
-
const ws_1 = __importDefault(require("ws"));
|
|
31
|
-
const util_1 = require("../util");
|
|
32
|
-
const _1 = require("./");
|
|
33
|
-
const transportMetrics = __importStar(require("./metrics"));
|
|
34
|
-
// TODO: Config
|
|
35
|
-
exports.DEFAULT_WS_TTL = 10000;
|
|
36
|
-
const logger = (0, util_1.makeLogger)('WebSocketTransport');
|
|
37
|
-
class WebSocketClassProvider {
|
|
38
|
-
static set(ctor) {
|
|
39
|
-
this.ctor = ctor;
|
|
40
|
-
}
|
|
41
|
-
static get() {
|
|
42
|
-
return this.ctor;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.WebSocketClassProvider = WebSocketClassProvider;
|
|
46
|
-
WebSocketClassProvider.ctor = ws_1.default;
|
|
47
|
-
/**
|
|
48
|
-
* Transport implementation that takes incoming requests, adds them to an [[ExpiringSortedSet]] and,
|
|
49
|
-
* through a WebSocket connection, subscribes to the relevant feeds to populate the cache.
|
|
50
|
-
*
|
|
51
|
-
* @typeParam AdapterParams - interface for the adapter request body
|
|
52
|
-
* @typeParam ProviderDataMessage - interface for a WS message containing processable data (i.e. not part of open/close/login/etc)
|
|
53
|
-
*/
|
|
54
|
-
class WebSocketTransport {
|
|
55
|
-
constructor(config) {
|
|
56
|
-
this.config = config;
|
|
57
|
-
// The double sets serve to create a simple polling mechanism instead of needing a subscription
|
|
58
|
-
// This one would be either local, redis, etc
|
|
59
|
-
this.expiringSortedSet = new util_1.ExpiringSortedSet(); // TODO: Move to dependencies, inject
|
|
60
|
-
// This one would not; this is always local state
|
|
61
|
-
this.localSubscriptions = [];
|
|
62
|
-
}
|
|
63
|
-
async initialize(dependencies) {
|
|
64
|
-
this.cache = dependencies.cache;
|
|
65
|
-
this.rateLimiter = dependencies.backgroundExecuteRateLimiter;
|
|
66
|
-
}
|
|
67
|
-
async hasBeenSetUp(req) {
|
|
68
|
-
return !!this.expiringSortedSet.get(req.requestContext.cacheKey);
|
|
69
|
-
}
|
|
70
|
-
async setup(req) {
|
|
71
|
-
logger.debug(`Adding entry to subscription set: [${req.requestContext.cacheKey}] = ${req.requestContext.data}`);
|
|
72
|
-
this.expiringSortedSet.add(req.requestContext.cacheKey, req.requestContext.data, exports.DEFAULT_WS_TTL);
|
|
73
|
-
}
|
|
74
|
-
// TODO: Maybe we don't do this, and leave the preparation on the adapter's side?
|
|
75
|
-
// TODO: Maybe we store adapter params pre-prepared? That would be more efficient
|
|
76
|
-
// Assuming always JSON payloads for now, makes it all cleaner
|
|
77
|
-
serializeMessage(payload) {
|
|
78
|
-
return typeof payload === 'string' ? payload : JSON.stringify(payload);
|
|
79
|
-
}
|
|
80
|
-
deserializeMessage(data) {
|
|
81
|
-
return JSON.parse(data.toString());
|
|
82
|
-
}
|
|
83
|
-
establishWsConnection(context) {
|
|
84
|
-
return new Promise((resolve) => {
|
|
85
|
-
const ctor = WebSocketClassProvider.get();
|
|
86
|
-
this.wsConnection = new ctor(this.config.url);
|
|
87
|
-
this.wsConnection.addEventListener('open', async (event) => {
|
|
88
|
-
logger.debug(`Opened websocket connection.`);
|
|
89
|
-
await this.config.handlers.open(this.wsConnection, context);
|
|
90
|
-
logger.debug('Successfully executed connection opened handler');
|
|
91
|
-
// Record active ws connections by incrementing count on open
|
|
92
|
-
// Using URL in label since connection_key is removed from v3
|
|
93
|
-
transportMetrics.wsConnectionActive.inc();
|
|
94
|
-
resolve(true);
|
|
95
|
-
});
|
|
96
|
-
this.wsConnection.addEventListener('message', async (event) => {
|
|
97
|
-
// TODO: Assuming JSON always, maybe use BSON also?
|
|
98
|
-
const parsed = this.deserializeMessage(event.data);
|
|
99
|
-
logger.trace(`Got ws message: ${parsed}`);
|
|
100
|
-
const results = this.config.handlers.message(parsed, context);
|
|
101
|
-
if (Array.isArray(results)) {
|
|
102
|
-
const responses = (0, _1.buildCacheEntriesFromResults)(results, context);
|
|
103
|
-
logger.trace(`Writing ${responses.length} responses to cache`);
|
|
104
|
-
await this.cache.setMany(responses, context.adapterConfig.CACHE_MAX_AGE);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
this.wsConnection.addEventListener('error', async (event) => {
|
|
108
|
-
// Record connection error count
|
|
109
|
-
transportMetrics.wsConnectionErrors
|
|
110
|
-
.labels(transportMetrics.connectionErrorLabels(event.message))
|
|
111
|
-
.inc();
|
|
112
|
-
});
|
|
113
|
-
this.wsConnection.addEventListener('close', (event) => {
|
|
114
|
-
logger.debug(`Closed websocket connection. Code: ${event.code} ; reason: ${event.reason?.toString()}`);
|
|
115
|
-
// Record active ws connections by decrementing count on close
|
|
116
|
-
// Using URL in label since connection_key is removed from v3
|
|
117
|
-
transportMetrics.wsConnectionActive.dec();
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
// Unlike cache warming, this execute will manage subscriptions
|
|
122
|
-
async backgroundExecute(context) {
|
|
123
|
-
logger.debug('Starting background execute, getting subscriptions from sorted set');
|
|
124
|
-
const desiredSubs = this.expiringSortedSet.getAll();
|
|
125
|
-
logger.debug('Generating delta (subscribes & unsubscribes)');
|
|
126
|
-
// TODO: More efficient algorithm, this is really easy to read, but high(er) time complexity
|
|
127
|
-
const subscribeParams = desiredSubs.filter((s) => !this.localSubscriptions.includes(s));
|
|
128
|
-
const subscribes = subscribeParams
|
|
129
|
-
.map(this.config.builders.subscribeMessage)
|
|
130
|
-
.map(this.serializeMessage);
|
|
131
|
-
const unsubscribeParams = this.localSubscriptions.filter((s) => !desiredSubs.includes(s));
|
|
132
|
-
const unsubscribes = unsubscribeParams
|
|
133
|
-
.map(this.config.builders.unsubscribeMessage)
|
|
134
|
-
.map(this.serializeMessage);
|
|
135
|
-
logger.debug(`${subscribes.length} new subscriptions; ${unsubscribes.length} to unsubscribe`);
|
|
136
|
-
if (subscribes.length) {
|
|
137
|
-
logger.trace(`Will subscribe to: ${subscribes}`);
|
|
138
|
-
}
|
|
139
|
-
if (unsubscribes.length) {
|
|
140
|
-
logger.trace(`Will unsubscribe to: ${unsubscribes}`);
|
|
141
|
-
}
|
|
142
|
-
// New subs && no connection -> connect -> add subs
|
|
143
|
-
// No new subs && no connection -> skip
|
|
144
|
-
// New subs && connection -> add subs
|
|
145
|
-
// No new subs && connection -> unsubs only
|
|
146
|
-
if (!subscribes.length && !this.wsConnection) {
|
|
147
|
-
logger.debug('No entries in subscription set and no established connection, skipping');
|
|
148
|
-
return this.rateLimiter.msUntilNextExecution(context.adapterEndpoint.name);
|
|
149
|
-
}
|
|
150
|
-
if (!this.wsConnection && subscribes.length) {
|
|
151
|
-
logger.debug('No established connection and new subscriptions available, connecting to WS');
|
|
152
|
-
await this.establishWsConnection(context);
|
|
153
|
-
}
|
|
154
|
-
// TODO: Close connection at some point?
|
|
155
|
-
logger.debug('Sending subs/unsubs if there are any');
|
|
156
|
-
const messages = unsubscribes.concat(subscribes);
|
|
157
|
-
for (const message of messages) {
|
|
158
|
-
logger.trace(`Sending message: ${JSON.stringify(message)}`);
|
|
159
|
-
this.wsConnection.send(message);
|
|
160
|
-
}
|
|
161
|
-
// Record WS message and subscription metrics
|
|
162
|
-
transportMetrics.recordWsMessageMetrics(context, subscribeParams, unsubscribeParams);
|
|
163
|
-
logger.debug('Setting local state to cache value');
|
|
164
|
-
this.localSubscriptions = desiredSubs;
|
|
165
|
-
logger.debug('Background execute complete');
|
|
166
|
-
return this.rateLimiter.msUntilNextExecution(context.adapterEndpoint.name);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
exports.WebSocketTransport = WebSocketTransport;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An object describing an entry in the expiring sorted set.
|
|
3
|
-
* @typeParam T - the type of the entry's value
|
|
4
|
-
*/
|
|
5
|
-
interface ExpiringSortedSetEntry<T> {
|
|
6
|
-
value: T;
|
|
7
|
-
expirationTimestamp: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* This class implements a set of unique items, each of which has an expiration timestamp.
|
|
11
|
-
* On reads, items that have expired will be deleted from the set and not returned.
|
|
12
|
-
*
|
|
13
|
-
* @typeParam T - the type of the set entries' values
|
|
14
|
-
*/
|
|
15
|
-
export declare class ExpiringSortedSet<T> {
|
|
16
|
-
map: Map<string, ExpiringSortedSetEntry<T>>;
|
|
17
|
-
add(key: string, value: T, ttl: number): void;
|
|
18
|
-
get(key: string): T | undefined;
|
|
19
|
-
getAll(): T[];
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExpiringSortedSet = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* This class implements a set of unique items, each of which has an expiration timestamp.
|
|
6
|
-
* On reads, items that have expired will be deleted from the set and not returned.
|
|
7
|
-
*
|
|
8
|
-
* @typeParam T - the type of the set entries' values
|
|
9
|
-
*/
|
|
10
|
-
class ExpiringSortedSet {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.map = new Map();
|
|
13
|
-
}
|
|
14
|
-
add(key, value, ttl) {
|
|
15
|
-
this.map.set(key, {
|
|
16
|
-
value,
|
|
17
|
-
expirationTimestamp: Date.now() + ttl,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
get(key) {
|
|
21
|
-
const entry = this.map.get(key);
|
|
22
|
-
if (!entry) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
else if (entry.expirationTimestamp < Date.now()) {
|
|
26
|
-
return entry.value;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.map.delete(key);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
getAll() {
|
|
33
|
-
const results = [];
|
|
34
|
-
const now = Date.now();
|
|
35
|
-
// Since we're iterating, might as well prune here
|
|
36
|
-
for (const [key, entry] of this.map.entries()) {
|
|
37
|
-
if (entry.expirationTimestamp < now) {
|
|
38
|
-
this.map.delete(key); // In theory, this shouldn't happen frequently for feeds
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
results.push(entry.value);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return results;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.ExpiringSortedSet = ExpiringSortedSet;
|
package/package/util/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './request';
|
|
2
|
-
export * from './logger';
|
|
3
|
-
export * from './expiring-sorted-set';
|
|
4
|
-
/**
|
|
5
|
-
* Sleeps for the provided number of milliseconds
|
|
6
|
-
* @param ms - The number of milliseconds to sleep for
|
|
7
|
-
* @returns a Promise that resolves once the specified time passes
|
|
8
|
-
*/
|
|
9
|
-
export declare const sleep: (ms: number) => Promise<void>;
|
|
10
|
-
export declare const isObject: (o: unknown) => boolean;
|
|
11
|
-
export declare const isArray: (o: unknown) => boolean;
|
package/package/util/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.isArray = exports.isObject = exports.sleep = void 0;
|
|
18
|
-
__exportStar(require("./request"), exports);
|
|
19
|
-
__exportStar(require("./logger"), exports);
|
|
20
|
-
__exportStar(require("./expiring-sorted-set"), exports);
|
|
21
|
-
/**
|
|
22
|
-
* Sleeps for the provided number of milliseconds
|
|
23
|
-
* @param ms - The number of milliseconds to sleep for
|
|
24
|
-
* @returns a Promise that resolves once the specified time passes
|
|
25
|
-
*/
|
|
26
|
-
const sleep = (ms) => {
|
|
27
|
-
return new Promise((resolve) => {
|
|
28
|
-
setTimeout(resolve, ms);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
exports.sleep = sleep;
|
|
32
|
-
const isObject = (o) => o !== null && typeof o === 'object' && Array.isArray(o) === false;
|
|
33
|
-
exports.isObject = isObject;
|
|
34
|
-
const isArray = (o) => o !== null && typeof o === 'object' && Array.isArray(o);
|
|
35
|
-
exports.isArray = isArray;
|
package/package/util/logger.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import pino from 'pino';
|
|
3
|
-
import { AdapterRequest } from './request';
|
|
4
|
-
import { FastifyReply, HookHandlerDoneFunction } from 'fastify';
|
|
5
|
-
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
6
|
-
export declare const asyncLocalStorage: AsyncLocalStorage<unknown>;
|
|
7
|
-
export declare type Store = {
|
|
8
|
-
correlationId: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Instead of using a global logger instance, we want to force using a child logger
|
|
12
|
-
* with a specific layer set in it, so that we can filter logs by where they're output from.
|
|
13
|
-
*
|
|
14
|
-
* Details on what each log level represents:
|
|
15
|
-
* "trace": Forensic debugging of issues on a local machine.
|
|
16
|
-
* "debug": Detailed logging level to get more context from users on their environments.
|
|
17
|
-
* "info": High-level informational messages, to describe at a glance the high level state of the system.
|
|
18
|
-
* "warn": A mild error occurred that might require non-urgent action.
|
|
19
|
-
* "error": An unexpected error occurred during the regular operation of a well-maintained EA.
|
|
20
|
-
* "fatal": The EA encountered an unrecoverable problem and had to exit.
|
|
21
|
-
*
|
|
22
|
-
* Full reference this is based on can be found at
|
|
23
|
-
* https://github.com/smartcontractkit/documentation/blob/main/docs/Node%20Operators/configuration-variables.md#log_level
|
|
24
|
-
*
|
|
25
|
-
* @param layer - the layer name to include in the logs (e.g. "SomeMiddleware", "RedisCache", etc.)
|
|
26
|
-
* @returns a layer specific logger
|
|
27
|
-
*/
|
|
28
|
-
export declare const makeLogger: (layer: string) => pino.Logger<{
|
|
29
|
-
level: string;
|
|
30
|
-
mixin(): {};
|
|
31
|
-
transport: {
|
|
32
|
-
target: string;
|
|
33
|
-
options: {
|
|
34
|
-
levelFirst: boolean;
|
|
35
|
-
levelLabel: string;
|
|
36
|
-
ignore: string;
|
|
37
|
-
messageFormat: string;
|
|
38
|
-
translateTime: string;
|
|
39
|
-
};
|
|
40
|
-
} | undefined;
|
|
41
|
-
} & pino.ChildLoggerOptions>;
|
|
42
|
-
export declare const loggingContextMiddleware: (req: AdapterRequest, res: FastifyReply, done: HookHandlerDoneFunction) => void;
|
package/package/util/logger.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.loggingContextMiddleware = exports.makeLogger = exports.asyncLocalStorage = void 0;
|
|
7
|
-
const pino_1 = __importDefault(require("pino"));
|
|
8
|
-
const config_1 = require("../config");
|
|
9
|
-
const crypto_1 = require("crypto");
|
|
10
|
-
const node_async_hooks_1 = require("node:async_hooks");
|
|
11
|
-
exports.asyncLocalStorage = new node_async_hooks_1.AsyncLocalStorage();
|
|
12
|
-
const debugTransport = {
|
|
13
|
-
target: 'pino-pretty',
|
|
14
|
-
options: {
|
|
15
|
-
levelFirst: true,
|
|
16
|
-
levelLabel: 'level',
|
|
17
|
-
ignore: 'layer,pid,hostname',
|
|
18
|
-
messageFormat: '[{correlationId}][{layer}] {msg}',
|
|
19
|
-
translateTime: 'yyyy-mm-dd HH:MM:ss.l',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
// Base logger, shouldn't be used because we want layers to be specified
|
|
23
|
-
const baseLogger = (0, pino_1.default)({
|
|
24
|
-
level: process.env['LOG_LEVEL']?.toLowerCase() || config_1.BaseSettings.LOG_LEVEL.default,
|
|
25
|
-
mixin() {
|
|
26
|
-
if (process.env['CORRELATION_ID_ENABLED'] === 'true') {
|
|
27
|
-
const store = exports.asyncLocalStorage.getStore();
|
|
28
|
-
if (store) {
|
|
29
|
-
return store;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return {};
|
|
33
|
-
},
|
|
34
|
-
transport: process.env['DEBUG'] === 'true' ? debugTransport : undefined,
|
|
35
|
-
});
|
|
36
|
-
/**
|
|
37
|
-
* Instead of using a global logger instance, we want to force using a child logger
|
|
38
|
-
* with a specific layer set in it, so that we can filter logs by where they're output from.
|
|
39
|
-
*
|
|
40
|
-
* Details on what each log level represents:
|
|
41
|
-
* "trace": Forensic debugging of issues on a local machine.
|
|
42
|
-
* "debug": Detailed logging level to get more context from users on their environments.
|
|
43
|
-
* "info": High-level informational messages, to describe at a glance the high level state of the system.
|
|
44
|
-
* "warn": A mild error occurred that might require non-urgent action.
|
|
45
|
-
* "error": An unexpected error occurred during the regular operation of a well-maintained EA.
|
|
46
|
-
* "fatal": The EA encountered an unrecoverable problem and had to exit.
|
|
47
|
-
*
|
|
48
|
-
* Full reference this is based on can be found at
|
|
49
|
-
* https://github.com/smartcontractkit/documentation/blob/main/docs/Node%20Operators/configuration-variables.md#log_level
|
|
50
|
-
*
|
|
51
|
-
* @param layer - the layer name to include in the logs (e.g. "SomeMiddleware", "RedisCache", etc.)
|
|
52
|
-
* @returns a layer specific logger
|
|
53
|
-
*/
|
|
54
|
-
const makeLogger = (layer) => baseLogger.child({ layer });
|
|
55
|
-
exports.makeLogger = makeLogger;
|
|
56
|
-
const loggingContextMiddleware = (req, res, done) => {
|
|
57
|
-
const correlationId = req.headers['x-correlation-id'] || (0, crypto_1.randomUUID)();
|
|
58
|
-
exports.asyncLocalStorage.run({ correlationId: correlationId }, () => {
|
|
59
|
-
done();
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
exports.loggingContextMiddleware = loggingContextMiddleware;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { FastifyReply, FastifyRequest, HookHandlerDoneFunction } from 'fastify';
|
|
2
|
-
import { InitializedAdapter } from '../adapter';
|
|
3
|
-
import { AdapterError } from '../validation/error';
|
|
4
|
-
declare module 'fastify' {
|
|
5
|
-
interface FastifyRequest {
|
|
6
|
-
requestContext: AdapterRequestContext;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export interface AdapterRequestBody<T = AdapterRequestData> {
|
|
10
|
-
endpoint?: string;
|
|
11
|
-
data: T;
|
|
12
|
-
id?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare type AdapterRequestContext<T = AdapterRequestData> = {
|
|
15
|
-
id: string;
|
|
16
|
-
endpointName: string;
|
|
17
|
-
cacheKey: string;
|
|
18
|
-
data: T;
|
|
19
|
-
meta?: AdapterRequestMeta;
|
|
20
|
-
};
|
|
21
|
-
export declare type AdapterRouteGeneric<T = AdapterRequestData> = {
|
|
22
|
-
Body: AdapterRequestBody<T>;
|
|
23
|
-
};
|
|
24
|
-
export declare type AdapterRequest<T = AdapterRequestData> = FastifyRequest<AdapterRouteGeneric<T>> & {
|
|
25
|
-
requestContext: AdapterRequestContext<T>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Meta info that pertains to exposing metrics
|
|
29
|
-
*/
|
|
30
|
-
export interface AdapterRequestMeta {
|
|
31
|
-
metrics?: AdapterMetricsMeta;
|
|
32
|
-
error?: AdapterError | Error;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Meta info that pertains to exposing metrics
|
|
36
|
-
*/
|
|
37
|
-
export interface AdapterMetricsMeta {
|
|
38
|
-
feedId?: string;
|
|
39
|
-
cacheHit?: boolean;
|
|
40
|
-
}
|
|
41
|
-
export declare type AdapterRequestData = Record<string, unknown>;
|
|
42
|
-
export interface ProviderResult<Params> {
|
|
43
|
-
params: Params;
|
|
44
|
-
value: unknown;
|
|
45
|
-
}
|
|
46
|
-
export declare type AdapterResponse<T = unknown> = {
|
|
47
|
-
statusCode: number;
|
|
48
|
-
data: T;
|
|
49
|
-
result: unknown;
|
|
50
|
-
maxAge?: number;
|
|
51
|
-
meta?: AdapterRequestMeta;
|
|
52
|
-
providerStatusCode?: number;
|
|
53
|
-
};
|
|
54
|
-
export declare type Middleware = ((req: AdapterRequest, reply: FastifyReply, done: HookHandlerDoneFunction) => FastifyReply | void) | ((req: AdapterRequest, reply: FastifyReply) => Promise<FastifyReply | void>);
|
|
55
|
-
export declare type AdapterMiddlewareBuilder = (adapter: InitializedAdapter) => Middleware;
|
package/package/util/request.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { HttpRequestType } from "../metrics/constants";
|
|
2
|
-
declare type ErrorBasic = {
|
|
3
|
-
name: string;
|
|
4
|
-
message: string;
|
|
5
|
-
};
|
|
6
|
-
declare type ErrorFull = ErrorBasic & {
|
|
7
|
-
stack: string;
|
|
8
|
-
cause: string;
|
|
9
|
-
};
|
|
10
|
-
export declare type AdapterErrorResponse = {
|
|
11
|
-
jobRunID: string;
|
|
12
|
-
status: string;
|
|
13
|
-
statusCode: number;
|
|
14
|
-
providerStatusCode?: number;
|
|
15
|
-
error: ErrorBasic | ErrorFull;
|
|
16
|
-
};
|
|
17
|
-
export declare class AdapterError extends Error {
|
|
18
|
-
jobRunID: string;
|
|
19
|
-
status: string;
|
|
20
|
-
statusCode: number;
|
|
21
|
-
cause: any;
|
|
22
|
-
url?: string;
|
|
23
|
-
errorResponse: any;
|
|
24
|
-
feedID?: string;
|
|
25
|
-
providerStatusCode?: number;
|
|
26
|
-
metricsLabel?: HttpRequestType;
|
|
27
|
-
name: string;
|
|
28
|
-
message: string;
|
|
29
|
-
constructor({ jobRunID, status, statusCode, name, message, cause, url, errorResponse, feedID, providerStatusCode, metricsLabel }: Partial<AdapterError>);
|
|
30
|
-
toJSONResponse(): AdapterErrorResponse;
|
|
31
|
-
}
|
|
32
|
-
export declare class AdapterInputError extends AdapterError {
|
|
33
|
-
constructor(input: Partial<AdapterError>);
|
|
34
|
-
}
|
|
35
|
-
export declare class AdapterRateLimitError extends AdapterError {
|
|
36
|
-
constructor(input: Partial<AdapterError>);
|
|
37
|
-
}
|
|
38
|
-
export declare class AdapterTimeoutError extends AdapterError {
|
|
39
|
-
constructor(input: Partial<AdapterError>);
|
|
40
|
-
}
|
|
41
|
-
export declare class AdapterDataProviderError extends AdapterError {
|
|
42
|
-
constructor(input: Partial<AdapterError>);
|
|
43
|
-
}
|
|
44
|
-
export declare class AdapterConnectionError extends AdapterError {
|
|
45
|
-
constructor(input: Partial<AdapterError>);
|
|
46
|
-
}
|
|
47
|
-
export declare class AdapterCustomError extends AdapterError {
|
|
48
|
-
constructor(input: Partial<AdapterError>);
|
|
49
|
-
}
|
|
50
|
-
export {};
|