@chainlink/external-adapter-framework 0.3.9 → 0.4.0

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.
Files changed (201) hide show
  1. package/README.md +102 -0
  2. package/package.json +42 -50
  3. package/adapter/basic.d.ts +0 -86
  4. package/adapter/basic.js +0 -325
  5. package/adapter/basic.js.map +0 -1
  6. package/adapter/endpoint.d.ts +0 -17
  7. package/adapter/endpoint.js +0 -19
  8. package/adapter/endpoint.js.map +0 -1
  9. package/adapter/index.d.ts +0 -4
  10. package/adapter/index.js +0 -21
  11. package/adapter/index.js.map +0 -1
  12. package/adapter/price.d.ts +0 -75
  13. package/adapter/price.js +0 -88
  14. package/adapter/price.js.map +0 -1
  15. package/adapter/types.d.ts +0 -118
  16. package/adapter/types.js +0 -3
  17. package/adapter/types.js.map +0 -1
  18. package/background-executor.d.ts +0 -9
  19. package/background-executor.js +0 -97
  20. package/background-executor.js.map +0 -1
  21. package/cache/factory.d.ts +0 -6
  22. package/cache/factory.js +0 -24
  23. package/cache/factory.js.map +0 -1
  24. package/cache/index.d.ts +0 -87
  25. package/cache/index.js +0 -133
  26. package/cache/index.js.map +0 -1
  27. package/cache/local.d.ts +0 -23
  28. package/cache/local.js +0 -84
  29. package/cache/local.js.map +0 -1
  30. package/cache/metrics.d.ts +0 -27
  31. package/cache/metrics.js +0 -121
  32. package/cache/metrics.js.map +0 -1
  33. package/cache/redis.d.ts +0 -16
  34. package/cache/redis.js +0 -101
  35. package/cache/redis.js.map +0 -1
  36. package/config/index.d.ts +0 -298
  37. package/config/index.js +0 -359
  38. package/config/index.js.map +0 -1
  39. package/config/provider-limits.d.ts +0 -27
  40. package/config/provider-limits.js +0 -75
  41. package/config/provider-limits.js.map +0 -1
  42. package/examples/bank-frick/accounts.d.ts +0 -52
  43. package/examples/bank-frick/accounts.js +0 -190
  44. package/examples/bank-frick/accounts.js.map +0 -1
  45. package/examples/bank-frick/config/index.d.ts +0 -17
  46. package/examples/bank-frick/config/index.js +0 -55
  47. package/examples/bank-frick/config/index.js.map +0 -1
  48. package/examples/bank-frick/index.d.ts +0 -16
  49. package/examples/bank-frick/index.js +0 -16
  50. package/examples/bank-frick/index.js.map +0 -1
  51. package/examples/bank-frick/util.d.ts +0 -4
  52. package/examples/bank-frick/util.js +0 -40
  53. package/examples/bank-frick/util.js.map +0 -1
  54. package/examples/coingecko/src/config/index.d.ts +0 -2
  55. package/examples/coingecko/src/config/index.js +0 -6
  56. package/examples/coingecko/src/config/index.js.map +0 -1
  57. package/examples/coingecko/src/config/overrides.json +0 -10825
  58. package/examples/coingecko/src/crypto-utils.d.ts +0 -48
  59. package/examples/coingecko/src/crypto-utils.js +0 -60
  60. package/examples/coingecko/src/crypto-utils.js.map +0 -1
  61. package/examples/coingecko/src/endpoint/coins.d.ts +0 -9
  62. package/examples/coingecko/src/endpoint/coins.js +0 -37
  63. package/examples/coingecko/src/endpoint/coins.js.map +0 -1
  64. package/examples/coingecko/src/endpoint/crypto-marketcap.d.ts +0 -3
  65. package/examples/coingecko/src/endpoint/crypto-marketcap.js +0 -30
  66. package/examples/coingecko/src/endpoint/crypto-marketcap.js.map +0 -1
  67. package/examples/coingecko/src/endpoint/crypto-volume.d.ts +0 -3
  68. package/examples/coingecko/src/endpoint/crypto-volume.js +0 -30
  69. package/examples/coingecko/src/endpoint/crypto-volume.js.map +0 -1
  70. package/examples/coingecko/src/endpoint/crypto.d.ts +0 -2
  71. package/examples/coingecko/src/endpoint/crypto.js +0 -28
  72. package/examples/coingecko/src/endpoint/crypto.js.map +0 -1
  73. package/examples/coingecko/src/endpoint/dominance.d.ts +0 -3
  74. package/examples/coingecko/src/endpoint/dominance.js +0 -28
  75. package/examples/coingecko/src/endpoint/dominance.js.map +0 -1
  76. package/examples/coingecko/src/endpoint/global-marketcap.d.ts +0 -3
  77. package/examples/coingecko/src/endpoint/global-marketcap.js +0 -28
  78. package/examples/coingecko/src/endpoint/global-marketcap.js.map +0 -1
  79. package/examples/coingecko/src/endpoint/index.d.ts +0 -6
  80. package/examples/coingecko/src/endpoint/index.js +0 -16
  81. package/examples/coingecko/src/endpoint/index.js.map +0 -1
  82. package/examples/coingecko/src/global-utils.d.ts +0 -27
  83. package/examples/coingecko/src/global-utils.js +0 -47
  84. package/examples/coingecko/src/global-utils.js.map +0 -1
  85. package/examples/coingecko/src/index.d.ts +0 -4
  86. package/examples/coingecko/src/index.js +0 -19
  87. package/examples/coingecko/src/index.js.map +0 -1
  88. package/examples/coingecko-old/batch-warming.d.ts +0 -7
  89. package/examples/coingecko-old/batch-warming.js +0 -54
  90. package/examples/coingecko-old/batch-warming.js.map +0 -1
  91. package/examples/coingecko-old/index.d.ts +0 -2
  92. package/examples/coingecko-old/index.js +0 -12
  93. package/examples/coingecko-old/index.js.map +0 -1
  94. package/examples/coingecko-old/rest.d.ts +0 -12
  95. package/examples/coingecko-old/rest.js +0 -55
  96. package/examples/coingecko-old/rest.js.map +0 -1
  97. package/examples/cryptocompare/src/config/index.d.ts +0 -2
  98. package/examples/cryptocompare/src/config/index.js +0 -6
  99. package/examples/cryptocompare/src/config/index.js.map +0 -1
  100. package/examples/cryptocompare/src/endpoints/crypto.d.ts +0 -28
  101. package/examples/cryptocompare/src/endpoints/crypto.js +0 -54
  102. package/examples/cryptocompare/src/endpoints/crypto.js.map +0 -1
  103. package/examples/cryptocompare/src/endpoints/index.d.ts +0 -1
  104. package/examples/cryptocompare/src/endpoints/index.js +0 -6
  105. package/examples/cryptocompare/src/endpoints/index.js.map +0 -1
  106. package/examples/cryptocompare/src/index.d.ts +0 -4
  107. package/examples/cryptocompare/src/index.js +0 -14
  108. package/examples/cryptocompare/src/index.js.map +0 -1
  109. package/examples/genesis/config/index.d.ts +0 -7
  110. package/examples/genesis/config/index.js +0 -11
  111. package/examples/genesis/config/index.js.map +0 -1
  112. package/examples/genesis/index.d.ts +0 -2
  113. package/examples/genesis/index.js +0 -13
  114. package/examples/genesis/index.js.map +0 -1
  115. package/examples/genesis/sseStream.d.ts +0 -16
  116. package/examples/genesis/sseStream.js +0 -149
  117. package/examples/genesis/sseStream.js.map +0 -1
  118. package/index.d.ts +0 -17
  119. package/index.js +0 -174
  120. package/index.js.map +0 -1
  121. package/metrics/constants.d.ts +0 -16
  122. package/metrics/constants.js +0 -26
  123. package/metrics/constants.js.map +0 -1
  124. package/metrics/index.d.ts +0 -19
  125. package/metrics/index.js +0 -139
  126. package/metrics/index.js.map +0 -1
  127. package/metrics/util.d.ts +0 -7
  128. package/metrics/util.js +0 -10
  129. package/metrics/util.js.map +0 -1
  130. package/rate-limiting/background/fixed-frequency.d.ts +0 -11
  131. package/rate-limiting/background/fixed-frequency.js +0 -36
  132. package/rate-limiting/background/fixed-frequency.js.map +0 -1
  133. package/rate-limiting/index.d.ts +0 -56
  134. package/rate-limiting/index.js +0 -86
  135. package/rate-limiting/index.js.map +0 -1
  136. package/rate-limiting/metrics.d.ts +0 -3
  137. package/rate-limiting/metrics.js +0 -45
  138. package/rate-limiting/metrics.js.map +0 -1
  139. package/rate-limiting/request/simple-counting.d.ts +0 -21
  140. package/rate-limiting/request/simple-counting.js +0 -63
  141. package/rate-limiting/request/simple-counting.js.map +0 -1
  142. package/transports/batch-warming.d.ts +0 -35
  143. package/transports/batch-warming.js +0 -138
  144. package/transports/batch-warming.js.map +0 -1
  145. package/transports/index.d.ts +0 -87
  146. package/transports/index.js +0 -56
  147. package/transports/index.js.map +0 -1
  148. package/transports/metrics.d.ts +0 -25
  149. package/transports/metrics.js +0 -122
  150. package/transports/metrics.js.map +0 -1
  151. package/transports/rest.d.ts +0 -51
  152. package/transports/rest.js +0 -133
  153. package/transports/rest.js.map +0 -1
  154. package/transports/routing.d.ts +0 -23
  155. package/transports/routing.js +0 -52
  156. package/transports/routing.js.map +0 -1
  157. package/transports/sse.d.ts +0 -40
  158. package/transports/sse.js +0 -92
  159. package/transports/sse.js.map +0 -1
  160. package/transports/util.d.ts +0 -9
  161. package/transports/util.js +0 -87
  162. package/transports/util.js.map +0 -1
  163. package/transports/websocket.d.ts +0 -81
  164. package/transports/websocket.js +0 -165
  165. package/transports/websocket.js.map +0 -1
  166. package/util/censor/censor-list.d.ts +0 -9
  167. package/util/censor/censor-list.js +0 -13
  168. package/util/censor/censor-list.js.map +0 -1
  169. package/util/index.d.ts +0 -13
  170. package/util/index.js +0 -38
  171. package/util/index.js.map +0 -1
  172. package/util/logger.d.ts +0 -49
  173. package/util/logger.js +0 -123
  174. package/util/logger.js.map +0 -1
  175. package/util/request.d.ts +0 -102
  176. package/util/request.js +0 -3
  177. package/util/request.js.map +0 -1
  178. package/util/subscription-set/expiring-sorted-set.d.ts +0 -21
  179. package/util/subscription-set/expiring-sorted-set.js +0 -36
  180. package/util/subscription-set/expiring-sorted-set.js.map +0 -1
  181. package/util/subscription-set/redis-sorted-set.d.ts +0 -9
  182. package/util/subscription-set/redis-sorted-set.js +0 -29
  183. package/util/subscription-set/redis-sorted-set.js.map +0 -1
  184. package/util/subscription-set/subscription-set.d.ts +0 -19
  185. package/util/subscription-set/subscription-set.js +0 -28
  186. package/util/subscription-set/subscription-set.js.map +0 -1
  187. package/util/test-payload-loader.d.ts +0 -26
  188. package/util/test-payload-loader.js +0 -85
  189. package/util/test-payload-loader.js.map +0 -1
  190. package/validation/error.d.ts +0 -48
  191. package/validation/error.js +0 -78
  192. package/validation/error.js.map +0 -1
  193. package/validation/index.d.ts +0 -5
  194. package/validation/index.js +0 -91
  195. package/validation/index.js.map +0 -1
  196. package/validation/input-params.d.ts +0 -14
  197. package/validation/input-params.js +0 -3
  198. package/validation/input-params.js.map +0 -1
  199. package/validation/input-validator.d.ts +0 -16
  200. package/validation/input-validator.js +0 -123
  201. package/validation/input-validator.js.map +0 -1
@@ -1,48 +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
- status: string;
12
- statusCode: number;
13
- providerStatusCode?: number;
14
- error: ErrorBasic | ErrorFull;
15
- };
16
- export declare class AdapterError extends Error {
17
- status: string;
18
- statusCode: number;
19
- cause: unknown;
20
- url?: string;
21
- errorResponse: unknown;
22
- feedID?: string;
23
- providerStatusCode?: number;
24
- metricsLabel?: HttpRequestType;
25
- name: string;
26
- message: string;
27
- constructor({ status, statusCode, name, message, cause, url, errorResponse, feedID, providerStatusCode, metricsLabel, }: Partial<AdapterError>);
28
- toJSONResponse(): AdapterErrorResponse;
29
- }
30
- export declare class AdapterInputError extends AdapterError {
31
- constructor(input: Partial<AdapterError>);
32
- }
33
- export declare class AdapterRateLimitError extends AdapterError {
34
- constructor(input: Partial<AdapterError>);
35
- }
36
- export declare class AdapterTimeoutError extends AdapterError {
37
- constructor(input: Partial<AdapterError>);
38
- }
39
- export declare class AdapterDataProviderError extends AdapterError {
40
- constructor(input: Partial<AdapterError>);
41
- }
42
- export declare class AdapterConnectionError extends AdapterError {
43
- constructor(input: Partial<AdapterError>);
44
- }
45
- export declare class AdapterCustomError extends AdapterError {
46
- constructor(input: Partial<AdapterError>);
47
- }
48
- export {};
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdapterCustomError = exports.AdapterConnectionError = exports.AdapterDataProviderError = exports.AdapterTimeoutError = exports.AdapterRateLimitError = exports.AdapterInputError = exports.AdapterError = void 0;
4
- const constants_1 = require("../metrics/constants");
5
- class AdapterError extends Error {
6
- constructor({ status = 'errored', statusCode = 500, name = 'AdapterError', message = 'There was an unexpected error in the adapter.', cause, url, errorResponse, feedID, providerStatusCode, metricsLabel = constants_1.HttpRequestType.ADAPTER_ERROR, }) {
7
- super(message);
8
- this.status = status;
9
- this.statusCode = statusCode;
10
- this.name = name;
11
- this.message = message;
12
- this.cause = cause;
13
- if (url) {
14
- this.url = url;
15
- }
16
- if (feedID) {
17
- this.feedID = feedID;
18
- }
19
- this.errorResponse = errorResponse;
20
- this.providerStatusCode = providerStatusCode;
21
- this.metricsLabel = metricsLabel;
22
- }
23
- toJSONResponse() {
24
- const showDebugInfo = process.env['NODE_ENV'] === 'development' || process.env['DEBUG'] === 'true';
25
- const errorBasic = {
26
- name: this.name,
27
- message: this.message,
28
- url: this.url,
29
- errorResponse: this.errorResponse,
30
- feedID: this.feedID,
31
- };
32
- const errorFull = { ...errorBasic, stack: this.stack, cause: this.cause };
33
- return {
34
- status: this.status,
35
- statusCode: this.statusCode,
36
- providerStatusCode: this.providerStatusCode,
37
- error: showDebugInfo ? errorFull : errorBasic,
38
- };
39
- }
40
- }
41
- exports.AdapterError = AdapterError;
42
- class AdapterInputError extends AdapterError {
43
- constructor(input) {
44
- super({ ...input, metricsLabel: constants_1.HttpRequestType.INPUT_ERROR });
45
- }
46
- }
47
- exports.AdapterInputError = AdapterInputError;
48
- class AdapterRateLimitError extends AdapterError {
49
- constructor(input) {
50
- super({ ...input, metricsLabel: constants_1.HttpRequestType.RATE_LIMIT_ERROR });
51
- }
52
- }
53
- exports.AdapterRateLimitError = AdapterRateLimitError;
54
- class AdapterTimeoutError extends AdapterError {
55
- constructor(input) {
56
- super({ ...input, metricsLabel: constants_1.HttpRequestType.TIMEOUT_ERROR });
57
- }
58
- }
59
- exports.AdapterTimeoutError = AdapterTimeoutError;
60
- class AdapterDataProviderError extends AdapterError {
61
- constructor(input) {
62
- super({ ...input, metricsLabel: constants_1.HttpRequestType.DP_ERROR });
63
- }
64
- }
65
- exports.AdapterDataProviderError = AdapterDataProviderError;
66
- class AdapterConnectionError extends AdapterError {
67
- constructor(input) {
68
- super({ ...input, metricsLabel: constants_1.HttpRequestType.CONNECTION_ERROR });
69
- }
70
- }
71
- exports.AdapterConnectionError = AdapterConnectionError;
72
- class AdapterCustomError extends AdapterError {
73
- constructor(input) {
74
- super({ ...input, metricsLabel: constants_1.HttpRequestType.CUSTOM_ERROR });
75
- }
76
- }
77
- exports.AdapterCustomError = AdapterCustomError;
78
- //# sourceMappingURL=error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/validation/error.ts"],"names":[],"mappings":";;;AAAA,oDAAsD;AAkBtD,MAAa,YAAa,SAAQ,KAAK;IAarC,YAAY,EACV,MAAM,GAAG,SAAS,EAClB,UAAU,GAAG,GAAG,EAChB,IAAI,GAAG,cAAc,EACrB,OAAO,GAAG,+CAA+C,EACzD,KAAK,EACL,GAAG,EACH,aAAa,EACb,MAAM,EACN,kBAAkB,EAClB,YAAY,GAAG,2BAAe,CAAC,aAAa,GACtB;QACtB,KAAK,CAAC,OAAO,CAAC,CAAA;QAEd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;SACf;QACD,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;SACrB;QACD,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;QAC5C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,cAAc;QACZ,MAAM,aAAa,GACjB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,MAAM,CAAA;QAC9E,MAAM,UAAU,GAAG;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,MAAM,EAAE,IAAI,CAAC,MA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,CAAC;CACF;AAJD,wDAIC;AACD,MAAa,kBAAmB,SAAQ,YAAY;IAClD,YAAY,KAA4B;QACtC,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,2BAAe,CAAC,YAAY,EAAE,CAAC,CAAA;IACjE,CAAC;CACF;AAJD,gDAIC"}
@@ -1,5 +0,0 @@
1
- import { FastifyReply, FastifyRequest } from 'fastify';
2
- import { AdapterMiddlewareBuilder } from '../util/request';
3
- export { InputParameters } from './input-params';
4
- export declare const validatorMiddleware: AdapterMiddlewareBuilder;
5
- export declare const errorCatchingMiddleware: (err: Error, req: FastifyRequest, res: FastifyReply) => void;
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errorCatchingMiddleware = exports.validatorMiddleware = void 0;
4
- const cache_1 = require("../cache");
5
- const util_1 = require("../metrics/util");
6
- const util_2 = require("../util");
7
- const error_1 = require("./error");
8
- const errorCatcherLogger = (0, util_2.makeLogger)('ErrorCatchingMiddleware');
9
- const validatorMiddleware = (adapter) => (req, reply, done) => {
10
- if (req.headers['content-type'] !== 'application/json') {
11
- throw new error_1.AdapterInputError({
12
- message: 'Content type not "application/json", returning 400',
13
- statusCode: 400,
14
- });
15
- }
16
- if (!req.body) {
17
- throw new error_1.AdapterInputError({
18
- message: 'Body not present in adapter request, returning 400',
19
- statusCode: 400,
20
- });
21
- }
22
- // We can restrict usage of the raw request body everywhere in the framework
23
- // by setting its type to EmptyBody, and we cast here (and only here)
24
- const requestBody = req.body;
25
- // Make endpoints case insensitive
26
- const endpointParam = requestBody.endpoint?.toLowerCase() ||
27
- requestBody.data?.endpoint?.toLowerCase() ||
28
- adapter.defaultEndpoint;
29
- if (!endpointParam) {
30
- throw new error_1.AdapterInputError({
31
- message: `Request body does not specify an endpoint, and there is no default endpoint configured for this adapter.`,
32
- statusCode: 400,
33
- });
34
- }
35
- const endpoint = adapter.endpointsMap[endpointParam];
36
- if (!endpoint) {
37
- throw new error_1.AdapterInputError({
38
- message: `Adapter does not have a "${endpointParam}" endpoint.`,
39
- statusCode: 404,
40
- });
41
- }
42
- const validatedData = endpoint.validator.validateInput(req.body?.['data']);
43
- req.requestContext = {
44
- cacheKey: '',
45
- data: validatedData,
46
- endpointName: endpoint.name,
47
- };
48
- if (adapter.config.METRICS_ENABLED && adapter.config.EXPERIMENTAL_METRICS_ENABLED) {
49
- // Add metrics meta which includes feedId to the request
50
- // Perform prior to overrides to maintain consistent Feed IDs across adapters
51
- const metrics = (0, util_1.getMetricsMeta)({
52
- adapterEndpoint: endpoint,
53
- adapterConfig: adapter.config,
54
- }, validatedData);
55
- req.requestContext = { ...req.requestContext, meta: { metrics } };
56
- }
57
- // Run any request transforms that might have been defined in the adapter.
58
- // This is the last time modifications are supposed to happen to the request.
59
- adapter.runRequestTransforms(req);
60
- // Now that all the transformations have been applied, all that's left is calculating the cache key
61
- req.requestContext.cacheKey = (0, cache_1.calculateCacheKey)({
62
- adapterEndpoint: endpoint,
63
- adapterConfig: adapter.config,
64
- }, req.requestContext.data);
65
- done();
66
- };
67
- exports.validatorMiddleware = validatorMiddleware;
68
- const errorCatchingMiddleware = (err, req, res) => {
69
- // Add adapter or generic error to request meta for metrics use
70
- // There's a chance we have no request context if there was an error during input validation
71
- if (req.requestContext) {
72
- req.requestContext.meta = { ...req.requestContext?.meta, error: err };
73
- }
74
- // Add the request context to the error so that we can check things like incoming params, endpoint, etc
75
- const errorWithContext = {
76
- requestContext: req.requestContext,
77
- ...err,
78
- };
79
- if (err instanceof error_1.AdapterError) {
80
- // We want to log these as warn, because although they are to be expected, NOPs should
81
- // Only use "correct" job specs and therefore not hit adapters with invalid requests.
82
- errorCatcherLogger.warn(errorWithContext);
83
- res.status(err.statusCode).send(err.toJSONResponse());
84
- }
85
- else {
86
- errorCatcherLogger.error(errorWithContext);
87
- res.status(500).send(err.message || 'There was an unexpected error in the adapter.');
88
- }
89
- };
90
- exports.errorCatchingMiddleware = errorCatchingMiddleware;
91
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":";;;AAEA,oCAA4C;AAC5C,0CAAgD;AAChD,kCAAoC;AAEpC,mCAAyD;AAGzD,MAAM,kBAAkB,GAAG,IAAA,iBAAU,EAAC,yBAAyB,CAAC,CAAA;AAEzD,MAAM,mBAAmB,GAC9B,CAAC,OAAgB,EAAE,EAAE,CACrB,CAAC,GAAmB,EAAE,KAAmB,EAAE,IAA6B,EAAE,EAAE;IAC1E,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,kBAAkB,EAAE;QACtD,MAAM,IAAI,yBAAiB,CAAC;YAC1B,OAAO,EAAE,oDAAoD;YAC7D,UAAU,EAAE,GAAG;SAChB,CAAC,CAAA;KACH;IAED,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;QACb,MAAM,IAAI,yBAAiB,CAAC;YAC1B,OAAO,EAAE,oDAAoD;YAC7D,UAAU,EAAE,GAAG;SAChB,CAAC,CAAA;KACH;IAED,4EAA4E;IAC5E,qEAAqE;IACrE,MAAM,WAAW,GAAG,GAAG,CAAC,IAAqC,CAAA;IAE7D,kCAAkC;IAClC,MAAM,aAAa,GACjB,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE;QACnC,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE;QACzC,OAAO,CAAC,eAAe,CAAA;IACzB,IAAI,CAAC,aAAa,EAAE;QAClB,MAAM,IAAI,yBAAiB,CAAC;YAC1B,OAAO,EAAE,0GAA0G;YACnH,UAAU,EAAE,GAAG;SAChB,CAAC,CAAA;KACH;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;IACpD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,yBAAiB,CAAC;YAC1B,OAAO,EAAE,4BAA4B,aAAa,aAAa;YAC/D,UAA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,EAAE,GAAG,EAAE,CAAA;KACtE;IAED,uGAAuG;IACvG,MAAM,gBAAgB,GAAG;QACvB,cAAc,EAAE,GAAG,CAAC,cAAc;QAClC,GAAG,GAAG;KACP,CAAA;IAED,IAAI,GAAG,YAAY,oBAAY,EAAE;QAC/B,sFAAsF;QACtF,qFAAqF;QACrF,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACzC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAA;KACtD;SAAM;QACL,kBAAkB,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;QAC1C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,+CAA+C,CAAC,CAAA;KACrF;AACH,CAAC,CAAA;AAtBY,QAAA,uBAAuB,2BAsBnC"}
@@ -1,14 +0,0 @@
1
- export declare type Override = Map<string, Map<string, string>>;
2
- export declare type InputParameter = {
3
- aliases?: readonly string[];
4
- description?: string;
5
- type?: 'bigint' | 'boolean' | 'array' | 'number' | 'object' | 'string';
6
- required?: boolean;
7
- options?: unknown[];
8
- default?: unknown;
9
- dependsOn?: readonly string[];
10
- exclusive?: readonly string[];
11
- };
12
- export declare type InputParameters = {
13
- [name: string]: InputParameter;
14
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=input-params.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-params.js","sourceRoot":"","sources":["../../../src/validation/input-params.ts"],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- import { InputParameters } from './input-params';
2
- export declare type NormalizedInput = Record<string, unknown>;
3
- export declare class InputValidator {
4
- private readonly inputConfig;
5
- private aliases;
6
- constructor(inputConfig: InputParameters);
7
- validateInput(input: Record<string, unknown>): NormalizedInput;
8
- private initializeInputs;
9
- private validateInputParamsSchema;
10
- private validateRequiredConfig;
11
- private validateOptions;
12
- private validateTypes;
13
- private validateDeps;
14
- private getUsedKey;
15
- private throwInvalid;
16
- }
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InputValidator = void 0;
4
- const error_1 = require("./error");
5
- const util_1 = require("../util");
6
- class InputValidator {
7
- constructor(inputConfig) {
8
- this.inputConfig = inputConfig;
9
- this.aliases = {};
10
- this.getUsedKey = (allKeys, input) => allKeys.find((k) => input && !(0, util_1.isEmpty)(input[k])) || '';
11
- this.throwInvalid = (message) => {
12
- throw new error_1.AdapterInputError({ statusCode: 400, message });
13
- };
14
- this.inputConfig = { ...inputConfig };
15
- this.validateInputParamsSchema();
16
- }
17
- validateInput(input) {
18
- const normalized = this.initializeInputs(input);
19
- for (const configKey in this.inputConfig) {
20
- this.validateRequiredConfig(configKey, normalized);
21
- if (!(0, util_1.isEmpty)(normalized[configKey])) {
22
- this.validateTypes(configKey, normalized);
23
- this.validateOptions(configKey, normalized);
24
- this.validateDeps(configKey, normalized);
25
- }
26
- }
27
- return normalized;
28
- }
29
- initializeInputs(input) {
30
- const normalized = {};
31
- for (const paramName in this.inputConfig) {
32
- const usedKey = this.getUsedKey(this.aliases[paramName], input);
33
- normalized[paramName] =
34
- !usedKey || (0, util_1.isEmpty)(input[usedKey]) ? this.inputConfig[paramName].default : input[usedKey];
35
- }
36
- return normalized;
37
- }
38
- validateInputParamsSchema() {
39
- for (const configKey in this.inputConfig) {
40
- const config = this.inputConfig[configKey];
41
- if (config.required && config.default) {
42
- throw new error_1.AdapterInputError({
43
- statusCode: 400,
44
- message: `${configKey} can't be required and have default value`,
45
- });
46
- }
47
- const aliases = [configKey, ...(config.aliases ?? [])];
48
- if (aliases.length !== new Set(aliases).size) {
49
- throw new error_1.AdapterInputError({
50
- statusCode: 400,
51
- message: `Duplicate aliases`,
52
- });
53
- }
54
- this.aliases[configKey] = aliases;
55
- const deps = [...(config.dependsOn ?? []), ...(config.exclusive ?? [])];
56
- if (!deps || !deps.length) {
57
- continue;
58
- }
59
- deps.forEach((inputDepKey) => {
60
- if (!this.inputConfig[inputDepKey]) {
61
- throw new error_1.AdapterInputError({
62
- statusCode: 400,
63
- message: `Input dependency/exclusive '${inputDepKey}' is missing in input schema`,
64
- });
65
- }
66
- });
67
- }
68
- }
69
- validateRequiredConfig(configKey, normalized) {
70
- if (!this.inputConfig[configKey].required) {
71
- return;
72
- }
73
- if ((0, util_1.isEmpty)(normalized[configKey])) {
74
- this.throwInvalid(`Required parameter ${configKey} must be non-null and non-empty`);
75
- }
76
- }
77
- validateOptions(key, normalized) {
78
- if (!this.inputConfig[key].options?.length) {
79
- return;
80
- }
81
- if (!this.inputConfig[key].options?.includes(normalized[key])) {
82
- this.throwInvalid(`${key} parameter must be one of following options: ${this.inputConfig[key].options?.join(',')}`);
83
- }
84
- }
85
- validateTypes(key, normalized) {
86
- const type = this.inputConfig[key].type;
87
- if (!type) {
88
- return;
89
- }
90
- if (['array', 'object'].includes(type)) {
91
- if (type === 'array' &&
92
- (!Array.isArray(normalized[key]) || normalized[key].length === 0)) {
93
- this.throwInvalid(`${key} parameter must be a non-empty array`);
94
- }
95
- if (type === 'object' &&
96
- normalized[key] &&
97
- (Object.getPrototypeOf(normalized[key]) !== Object.prototype ||
98
- Object.keys(normalized[key]).length === 0)) {
99
- this.throwInvalid(`${key} parameter must be an object with at least one property`);
100
- }
101
- return;
102
- }
103
- else if (typeof normalized[key] !== type) {
104
- this.throwInvalid(`${key} parameter must be of type ${type}`);
105
- }
106
- }
107
- validateDeps(key, normalized) {
108
- for (const dependency of this.inputConfig[key].dependsOn ?? []) {
109
- const value = normalized[dependency];
110
- if ((0, util_1.isEmpty)(value)) {
111
- this.throwInvalid(`${key} dependency ${dependency} not supplied`);
112
- }
113
- }
114
- for (const exclusive of this.inputConfig[key].exclusive ?? []) {
115
- const value = normalized[exclusive];
116
- if (!(0, util_1.isEmpty)(value)) {
117
- this.throwInvalid(`${key} cannot be supplied concurrently with ${exclusive}`);
118
- }
119
- }
120
- }
121
- }
122
- exports.InputValidator = InputValidator;
123
- //# sourceMappingURL=input-validator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-validator.js","sourceRoot":"","sources":["../../../src/validation/input-validator.ts"],"names":[],"mappings":";;;AACA,mCAA2C;AAC3C,kCAAiC;AAIjC,MAAa,cAAc;IAEzB,YAA6B,WAA4B;QAA5B,gBAAW,GAAX,WAAW,CAAiB;QADjD,YAAO,GAAgC,EAAE,CAAA;QAqIzC,eAAU,GAAG,CAAC,OAAiB,EAAE,KAA8B,EAAU,EAAE,CACjF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,IAAA,cAAO,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAEhD,iBAAY,GAAG,CAAC,OAAe,EAAQ,EAAE;YAC/C,MAAM,IAAI,yBAAiB,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAA;QAC3D,CAAC,CAAA;QAxIC,IAAI,CAAC,WAAW,GAAG,EAAE,GAAG,WAAW,EAAE,CAAA;QACrC,IAAI,CAAC,yBAAyB,EAAE,CAAA;IAClC,CAAC;IAED,aAAa,CAAC,KAA8B;QAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;QAE/C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,WAAW,EAAE;YACxC,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;YAClD,IAAI,CAAC,IAAA,cAAO,EAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE;gBACnC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;gBACzC,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;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