@chainlink/external-adapter-framework 0.0.55 → 0.0.56
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.d.ts +1 -1
- package/adapter.js +0 -1
- package/background-executor.js +0 -1
- package/cache/factory.js +0 -1
- package/cache/index.js +0 -1
- package/cache/local.js +0 -1
- package/cache/metrics.js +0 -1
- package/cache/redis.js +0 -1
- package/config/index.js +0 -1
- package/config/provider-limits.js +0 -1
- package/examples/bank-frick/accounts.js +0 -1
- package/examples/bank-frick/config/index.js +0 -1
- package/examples/bank-frick/index.js +0 -1
- package/examples/bank-frick/util.js +0 -1
- package/examples/coingecko/src/config/index.js +0 -1
- package/examples/coingecko/src/crypto-utils.js +0 -1
- package/examples/coingecko/src/endpoint/coins.js +0 -1
- package/examples/coingecko/src/endpoint/crypto-marketcap.js +0 -1
- package/examples/coingecko/src/endpoint/crypto-volume.js +0 -1
- package/examples/coingecko/src/endpoint/crypto.js +0 -1
- package/examples/coingecko/src/endpoint/dominance.js +0 -1
- package/examples/coingecko/src/endpoint/global-marketcap.js +0 -1
- package/examples/coingecko/src/endpoint/index.js +0 -1
- package/examples/coingecko/src/global-utils.js +0 -1
- package/examples/coingecko/src/index.js +0 -1
- package/examples/coingecko-old/batch-warming.js +0 -1
- package/examples/coingecko-old/index.js +0 -1
- package/examples/coingecko-old/rest.js +0 -1
- package/examples/genesis/config/index.js +0 -1
- package/examples/genesis/index.js +0 -1
- package/examples/genesis/sseStream.js +0 -1
- package/examples/ncfx/config/index.js +0 -1
- package/examples/ncfx/index.js +0 -1
- package/examples/ncfx/websocket.js +0 -1
- package/index.js +0 -1
- package/metrics/constants.js +0 -1
- package/metrics/index.js +0 -1
- package/metrics/util.js +0 -1
- package/package.json +1 -1
- package/rate-limiting/background/fixed-frequency.js +0 -1
- package/rate-limiting/index.js +0 -1
- package/rate-limiting/metrics.js +0 -1
- package/rate-limiting/request/simple-counting.js +0 -1
- package/transports/batch-warming.js +0 -1
- package/transports/index.js +4 -1
- package/transports/metrics.js +0 -1
- package/transports/rest.js +0 -1
- package/transports/sse.js +0 -1
- package/transports/util.js +0 -1
- package/transports/websocket.js +0 -1
- package/util/censor/censor-list.js +0 -1
- package/util/index.js +0 -1
- package/util/logger.js +0 -1
- package/util/request.js +0 -1
- package/util/subscription-set/expiring-sorted-set.js +0 -1
- package/util/subscription-set/redis-sorted-set.js +0 -1
- package/util/subscription-set/subscription-set.js +0 -1
- package/util/test-payload-loader.js +0 -1
- package/validation/error.js +0 -1
- package/validation/index.js +3 -2
- package/validation/input-params.js +0 -1
- package/validation/input-validator.d.ts +1 -1
- package/validation/input-validator.js +0 -1
- package/validation/override-functions.js +0 -1
package/adapter.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ export declare class AdapterEndpoint<Params, Result, CustomSettings extends Sett
|
|
|
100
100
|
transport: Transport<Params, Result, CustomSettings>;
|
|
101
101
|
inputParameters: InputParameters;
|
|
102
102
|
rateLimiting?: EndpointRateLimitingConfig | undefined;
|
|
103
|
-
validator
|
|
103
|
+
validator?: InputValidator;
|
|
104
104
|
constructor(params: AdapterEndpointParams<Params, Result, CustomSettings>);
|
|
105
105
|
}
|
|
106
106
|
declare type CustomAdapterSettings = SettingsMap & NegatedAdapterSettings;
|
package/adapter.js
CHANGED
package/background-executor.js
CHANGED
package/cache/factory.js
CHANGED
package/cache/index.js
CHANGED
package/cache/local.js
CHANGED
package/cache/metrics.js
CHANGED
package/cache/redis.js
CHANGED
package/config/index.js
CHANGED
|
@@ -3,4 +3,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PRO_API_ENDPOINT = exports.DEFAULT_API_ENDPOINT = void 0;
|
|
4
4
|
exports.DEFAULT_API_ENDPOINT = 'https://api.coingecko.com/api/v3';
|
|
5
5
|
exports.PRO_API_ENDPOINT = 'https://pro-api.coingecko.com/api/v3';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -13,4 +13,3 @@ var dominance_1 = require("./dominance");
|
|
|
13
13
|
Object.defineProperty(exports, "dominance", { enumerable: true, get: function () { return dominance_1.endpoint; } });
|
|
14
14
|
var crypto_volume_1 = require("./crypto-volume");
|
|
15
15
|
Object.defineProperty(exports, "cryptoVolume", { enumerable: true, get: function () { return crypto_volume_1.endpoint; } });
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/examples/ncfx/index.js
CHANGED
package/index.js
CHANGED
package/metrics/constants.js
CHANGED
|
@@ -23,4 +23,3 @@ var HttpRequestType;
|
|
|
23
23
|
exports.MAX_FEED_ID_LENGTH = 300;
|
|
24
24
|
// We should tune these as we collect data, this is the default bucket distribution that prom comes with
|
|
25
25
|
exports.requestDurationBuckets = [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10];
|
|
26
|
-
//# sourceMappingURL=constants.js.map
|
package/metrics/index.js
CHANGED
package/metrics/util.js
CHANGED
package/package.json
CHANGED
package/rate-limiting/index.js
CHANGED
package/rate-limiting/metrics.js
CHANGED
package/transports/index.js
CHANGED
|
@@ -30,6 +30,7 @@ exports.buildTransportHandler = exports.buildCacheEntriesFromResults = void 0;
|
|
|
30
30
|
const cache_1 = require("../cache");
|
|
31
31
|
const util_1 = require("../util");
|
|
32
32
|
const transportMetrics = __importStar(require("./metrics"));
|
|
33
|
+
const client = __importStar(require("prom-client"));
|
|
33
34
|
__exportStar(require("./batch-warming"), exports);
|
|
34
35
|
__exportStar(require("./rest"), exports);
|
|
35
36
|
__exportStar(require("./websocket"), exports);
|
|
@@ -110,4 +111,6 @@ const buildTransportHandler = (adapter) => async (req, reply) => {
|
|
|
110
111
|
return reply.send();
|
|
111
112
|
};
|
|
112
113
|
exports.buildTransportHandler = buildTransportHandler;
|
|
113
|
-
|
|
114
|
+
if (process.env['METRICS_ENABLED'] === 'false') {
|
|
115
|
+
client.register.clear();
|
|
116
|
+
}
|
package/transports/metrics.js
CHANGED
package/transports/rest.js
CHANGED
package/transports/sse.js
CHANGED
package/transports/util.js
CHANGED
package/transports/websocket.js
CHANGED
package/util/index.js
CHANGED
package/util/logger.js
CHANGED
package/util/request.js
CHANGED
package/validation/error.js
CHANGED
package/validation/index.js
CHANGED
|
@@ -40,7 +40,9 @@ const validatorMiddleware = (adapter) => (req, reply, done) => {
|
|
|
40
40
|
statusCode: 404,
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
const validatedData = endpoint.validator
|
|
43
|
+
const validatedData = endpoint.validator
|
|
44
|
+
? endpoint.validator.validateInput(req.body?.['data'])
|
|
45
|
+
: req.body?.['data'];
|
|
44
46
|
req.requestContext = {
|
|
45
47
|
cacheKey: '',
|
|
46
48
|
data: validatedData,
|
|
@@ -90,4 +92,3 @@ const errorCatchingMiddleware = (err, req, res) => {
|
|
|
90
92
|
}
|
|
91
93
|
};
|
|
92
94
|
exports.errorCatchingMiddleware = errorCatchingMiddleware;
|
|
93
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -28,4 +28,3 @@ exports.baseInputParameters = {
|
|
|
28
28
|
// Type: 'string', TODO: Once complex types are supported this could be { from: string, to: string, includes: [{ from: string, to: string, adapters: string[], inverse: boolean, tokens: boolean }] } }[]
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
|
-
//# sourceMappingURL=input-params.js.map
|
|
@@ -4,7 +4,7 @@ export declare class InputValidator {
|
|
|
4
4
|
private readonly inputConfig;
|
|
5
5
|
private aliases;
|
|
6
6
|
constructor(inputConfig: InputParameters);
|
|
7
|
-
validateInput(input:
|
|
7
|
+
validateInput(input: any): NormalizedInput;
|
|
8
8
|
private initializeInputs;
|
|
9
9
|
private validateInputParamsSchema;
|
|
10
10
|
private validateRequiredConfig;
|