@chainlink/external-adapter-framework 0.14.1 → 0.14.3
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/README.md +2 -2
- package/adapter/basic.js +4 -1
- package/adapter/basic.js.map +1 -1
- package/adapter/endpoint.d.ts +2 -1
- package/adapter/endpoint.js +1 -0
- package/adapter/endpoint.js.map +1 -1
- package/adapter/price.d.ts +7 -7
- package/adapter/types.d.ts +9 -5
- package/cache/local.js +1 -1
- package/cache/local.js.map +1 -1
- package/config/index.d.ts +64 -16
- package/config/index.js +55 -10
- package/config/index.js.map +1 -1
- package/config/provider-limits.d.ts +3 -3
- package/index.d.ts +21 -1
- package/index.js +25 -2
- package/index.js.map +1 -1
- package/metrics/index.js +3 -0
- package/metrics/index.js.map +1 -1
- package/package.json +1 -1
- package/transports/abstract/streaming.d.ts +1 -1
- package/transports/batch-warming.d.ts +1 -1
- package/transports/index.d.ts +2 -2
- package/transports/metrics.d.ts +1 -1
- package/transports/rest.d.ts +1 -1
- package/transports/sse.d.ts +1 -1
- package/transports/websocket.d.ts +2 -2
- package/util/index.d.ts +1 -1
- package/util/logger.d.ts +6 -1
- package/util/logger.js +5 -0
- package/util/logger.js.map +1 -1
- package/util/request.d.ts +25 -25
- package/util/test-payload-loader.d.ts +1 -1
- package/validation/error.d.ts +3 -3
- package/validation/index.js +13 -1
- package/validation/index.js.map +1 -1
- package/validation/input-params.d.ts +3 -3
- package/validation/input-validator.d.ts +1 -1
- package/validation/utils.d.ts +14 -0
- package/validation/utils.js +89 -0
- package/validation/utils.js.map +1 -0
package/README.md
CHANGED
|
@@ -53,9 +53,9 @@ yarn test
|
|
|
53
53
|
The normal flow for publishing a release is through a series o GitHub actions that are triggered when a PR is closed by merging with the base branch. Full details about our workflows can be found in [./.github/WORKFLOW-README.MD]. A summary of our publish workflow follows:
|
|
54
54
|
|
|
55
55
|
1. Close a PR containing your changes
|
|
56
|
-
2. If the PR was merged and if it contains a version label instruction (patch, minor, major, none), a new PR will be created that contains the result of running `npm version LABEL` on
|
|
56
|
+
2. If the PR was merged and if it contains a version label instruction (patch, minor, major, none), a new PR will be created that contains the result of running `npm version LABEL` on main with the original PR author assigned as a reviewer.
|
|
57
57
|
3. A link to the newly created version bump PR will be added to your original PR. Click on that link, and approve it to be merged.
|
|
58
58
|
4. Close the version bump PR. If merged, the package will be published to npm.
|
|
59
59
|
5. When the publish workflow finishes, a comment will be added to the version bump PR that tells you if it ran successfully
|
|
60
60
|
|
|
61
|
-
This adds an extra step (approving a version bump PR) that has to be taken every time a PR is merged. This is annoying, but it is an effective workaround for permissions issues when running against protected branches, and eliminates the need for the PR author to manually update their branch's version by referring to
|
|
61
|
+
This adds an extra step (approving a version bump PR) that has to be taken every time a PR is merged. This is annoying, but it is an effective workaround for permissions issues when running against protected branches, and eliminates the need for the PR author to manually update their branch's version by referring to main.
|
package/adapter/basic.js
CHANGED
|
@@ -172,6 +172,9 @@ class Adapter {
|
|
|
172
172
|
if (this.config.METRICS_ENABLED === false) {
|
|
173
173
|
logger.warn(`METRICS_ENABLED has been set to false. Metrics should not be disabled in a production environment.`);
|
|
174
174
|
}
|
|
175
|
+
if (this.config.MAX_PAYLOAD_SIZE_LIMIT !== config_1.BaseSettings.MAX_PAYLOAD_SIZE_LIMIT.default) {
|
|
176
|
+
logger.warn(`MAX_PAYLOAD_SIZE_LIMIT has been set to ${this.config.MAX_PAYLOAD_SIZE_LIMIT}. This setting should only be set when absolutely necessary.`);
|
|
177
|
+
}
|
|
175
178
|
}
|
|
176
179
|
/**
|
|
177
180
|
* This function will process dependencies for an adapter, such as caches or rate limiters,
|
|
@@ -378,7 +381,7 @@ class Adapter {
|
|
|
378
381
|
.inc();
|
|
379
382
|
logger.debug('Ran out of polling attempts, returning timeout');
|
|
380
383
|
throw new error_1.AdapterTimeoutError({
|
|
381
|
-
message: '
|
|
384
|
+
message: 'The EA has not received any values from the Data Provider for the requested data yet. Retry after a short delay, and if the problem persists raise this issue in the relevant channels.',
|
|
382
385
|
statusCode: 504,
|
|
383
386
|
});
|
|
384
387
|
}
|
package/adapter/basic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/adapter/basic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA2B;AAC3B,oCAAqE;AACrE,+DAAgD;AAChD,sCAOkB;AAClB,wEAAyD;AACzD,oDAMyB;AACzB,kCAAoG;AACpG,6EAAuE;AAWvE,+CAAyD;AAEzD,MAAM,MAAM,GAAG,IAAA,iBAAU,EAAC,SAAS,CAAC,CAAA;AAEpC;;GAEG;AACH,MAAa,OAAO;IAgClB,YAAY,MAAqC;QAlBjD,uBAAuB;QACvB,gBAAW,GAAG,KAAK,CAAA;QAEnB,6DAA6D;QAC7D,iBAAY,GAGR,EAAE,CAAA;QAYJ,mBAAmB;QACnB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QACvB,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,EAAE,WAAW,EAAE,CAAA;QAC5D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAA;QACrD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAA;QAC3C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAA;QACvC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,iBAAiB,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,CAAA;QAC/F,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QAEjC,IAAI,CAAC,MAAM,GAAG,IAAA,2BAA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UAAU,EAAE,CAAA;QAEf,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAA;QAClE,MAAM,QAAQ,GAAG,MAAM,IAAA,6BAAqB,EAC1C,IAAI,CAAC,YAAY,CAAC,KAA+B,EACjD,GAAG,CAAC,cAAc,CAAC,QAAQ,EAC3B;YACE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,yBAAyB;YACjD,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,sBAAsB;SAC1C,CACF,CAAA;QAED,YAAY,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAE/C,IAAI,QAAQ,EAAE;YACZ,MAAM,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAA;YACxE,OAAO,QAAQ,CAAA;SAChB;QAED,sDAAsD;QACtD,gBAAgB,CAAC,4BAA4B;aAC1C,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;aACrD,GAAG,EAAE,CAAA;QAER,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAA;QAC9D,MAAM,IAAI,2BAAmB,CAAC;YAC5B,OAAO,EACL,yLAAyL;YAC3L,UAAU,EAAE,GAAG;SAChB,CAAC,CAAA;IACJ,CAAC;CACF;AA9dD,0BA8dC"}
|
package/adapter/endpoint.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AdapterConfig } from '../config';
|
|
|
2
2
|
import { MetaTransport, Transport } from '../transports';
|
|
3
3
|
import { InputParameters } from '../validation';
|
|
4
4
|
import { InputValidator } from '../validation/input-validator';
|
|
5
|
-
import { AdapterDependencies, AdapterEndpointParams, EndpointGenerics, EndpointRateLimitingConfig } from './types';
|
|
5
|
+
import { AdapterDependencies, AdapterEndpointParams, CustomInputValidator, EndpointGenerics, EndpointRateLimitingConfig } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* Main class to represent an endpoint within an External Adapter
|
|
8
8
|
*/
|
|
@@ -14,6 +14,7 @@ export declare class AdapterEndpoint<T extends EndpointGenerics> implements Adap
|
|
|
14
14
|
rateLimiting?: EndpointRateLimitingConfig | undefined;
|
|
15
15
|
validator: InputValidator;
|
|
16
16
|
cacheKeyGenerator?: (data: Record<string, unknown>) => string;
|
|
17
|
+
customInputValidation?: CustomInputValidator<T>;
|
|
17
18
|
constructor(params: AdapterEndpointParams<T>);
|
|
18
19
|
/**
|
|
19
20
|
* Performs all necessary initialization processes that are async or need async initialized dependencies
|
package/adapter/endpoint.js
CHANGED
|
@@ -17,6 +17,7 @@ class AdapterEndpoint {
|
|
|
17
17
|
this.rateLimiting = params.rateLimiting;
|
|
18
18
|
this.validator = new input_validator_1.InputValidator(this.inputParameters);
|
|
19
19
|
this.cacheKeyGenerator = params.cacheKeyGenerator;
|
|
20
|
+
this.customInputValidation = params.customInputValidation;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Performs all necessary initialization processes that are async or need async initialized dependencies
|
package/adapter/endpoint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../../src/adapter/endpoint.ts"],"names":[],"mappings":";;;AAAA,gDAAiD;AAGjD,kCAAoC;AAEpC,mEAA8D;
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../../src/adapter/endpoint.ts"],"names":[],"mappings":";;;AAAA,gDAAiD;AAGjD,kCAAoC;AAEpC,mEAA8D;AAS9D,MAAM,MAAM,GAAG,IAAA,iBAAU,EAAC,iBAAiB,CAAC,CAAA;AAE5C;;GAEG;AACH,MAAa,eAAe;IAU1B,YAAY,MAAgC;QAC1C,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAA;QAC7C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAA;QACvC,IAAI,CAAC,SAAS,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACzD,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAA;QACjD,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAA;IAC3D,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CACd,YAAiC,EACjC,MAA0C;QAE1C,MAAM,aAAa,GAAG,IAAI,wBAAa,CAAC;YACtC,YAAY;YACZ,MAAM,EAAE,MAAuB;YAC/B,YAAY,EAAE,IAAI,CAAC,IAAI;YACvB,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC,CAAA;QAEF,MAAM,qBAAqB,GAAG;YAC5B,GAAG,YAAY;YACf,aAAa;SACd,CAAA;QAED,MAAM,CAAC,KAAK,CAAC,wCAAwC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAA;QACrE,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,qBAAqB,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3E,CAAC;CACF;AA9CD,0CA8CC"}
|
package/adapter/price.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Adapter, AdapterEndpointParams, AdapterParams, EndpointGenerics } from
|
|
|
5
5
|
/**
|
|
6
6
|
* Type for the base input parameter config that any [[PriceEndpoint]] must extend
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type PriceEndpointInputParameters = {
|
|
9
9
|
base: {
|
|
10
10
|
aliases: readonly ['from', 'coin', ...string[]];
|
|
11
11
|
type: 'string';
|
|
@@ -26,7 +26,7 @@ export declare const priceEndpointInputParameters: PriceEndpointInputParameters;
|
|
|
26
26
|
/**
|
|
27
27
|
* Type for base input params for a PriceEndpoint
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export type PriceEndpointParams = {
|
|
30
30
|
base: string;
|
|
31
31
|
quote: string;
|
|
32
32
|
};
|
|
@@ -34,18 +34,18 @@ export declare type PriceEndpointParams = {
|
|
|
34
34
|
* Structure of an "includes" file.
|
|
35
35
|
* Include pairs describe an incoming price feed request, and the details specify
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
38
|
-
|
|
37
|
+
export type IncludesFile = IncludePair[];
|
|
38
|
+
type IncludeDetails = {
|
|
39
39
|
from: string;
|
|
40
40
|
to: string;
|
|
41
41
|
inverse: boolean;
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
type IncludePair = {
|
|
44
44
|
from: string;
|
|
45
45
|
to: string;
|
|
46
46
|
includes: IncludeDetails[];
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
type IncludesMap = Record<string, Record<string, IncludeDetails>>;
|
|
49
49
|
/**
|
|
50
50
|
* A PriceEndpoint is a specific type of AdapterEndpoint. Meant to comply with standard practices for
|
|
51
51
|
* Data Feeds, its InputParameters must extend the basic ones (base/quote).
|
|
@@ -55,7 +55,7 @@ export declare class PriceEndpoint<T extends EndpointGenerics> extends AdapterEn
|
|
|
55
55
|
inputParameters: PriceEndpointInputParameters;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
type PriceAdapterRequest<T extends RequestGenerics> = AdapterRequest<T> & {
|
|
59
59
|
requestContext: AdapterRequestContext<T> & {
|
|
60
60
|
priceMeta: {
|
|
61
61
|
inverse: boolean;
|
package/adapter/types.d.ts
CHANGED
|
@@ -6,10 +6,11 @@ import { AdapterRateLimitTier, BackgroundExecuteRateLimiter, RequestRateLimiter
|
|
|
6
6
|
import { Transport, TransportGenerics } from '../transports';
|
|
7
7
|
import { AdapterRequest, RequestGenerics, SubscriptionSetFactory } from '../util';
|
|
8
8
|
import { InputParameters } from '../validation';
|
|
9
|
+
import { AdapterError } from '../validation/error';
|
|
9
10
|
import { Adapter } from './basic';
|
|
10
11
|
import { AdapterEndpoint } from './endpoint';
|
|
11
|
-
export
|
|
12
|
-
|
|
12
|
+
export type CustomAdapterSettings = SettingsMap & NegatedAdapterSettings;
|
|
13
|
+
type NegatedAdapterSettings = {
|
|
13
14
|
[K in keyof BaseAdapterConfig]?: never;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
@@ -51,11 +52,11 @@ export interface AdapterRateLimitingConfig {
|
|
|
51
52
|
/**
|
|
52
53
|
* Type to perform arbitrary modifications on an adapter request
|
|
53
54
|
*/
|
|
54
|
-
export
|
|
55
|
+
export type RequestTransform<T extends RequestGenerics = RequestGenerics> = (req: AdapterRequest<T>) => void;
|
|
55
56
|
/**
|
|
56
57
|
* Map of overrides objects (symbol -\> symbol) per adapter name
|
|
57
58
|
*/
|
|
58
|
-
export
|
|
59
|
+
export type Overrides = {
|
|
59
60
|
[adapterName: string]: {
|
|
60
61
|
[symbol: string]: string;
|
|
61
62
|
};
|
|
@@ -105,7 +106,8 @@ export interface EndpointRateLimitingConfig {
|
|
|
105
106
|
/**
|
|
106
107
|
* Helper type structure that contains the different types passed to the generic parameters of an AdapterEndpoint
|
|
107
108
|
*/
|
|
108
|
-
export
|
|
109
|
+
export type EndpointGenerics = TransportGenerics;
|
|
110
|
+
export type CustomInputValidator<T extends EndpointGenerics> = (input: T['Request']['Params'], config: AdapterConfig<T['CustomSettings']>) => AdapterError | undefined;
|
|
109
111
|
/**
|
|
110
112
|
* Structure to describe a specific endpoint in an [[Adapter]]
|
|
111
113
|
*/
|
|
@@ -122,5 +124,7 @@ export interface AdapterEndpointParams<T extends EndpointGenerics> {
|
|
|
122
124
|
rateLimiting?: EndpointRateLimitingConfig;
|
|
123
125
|
/** Custom function that generates cache keys */
|
|
124
126
|
cacheKeyGenerator?: (data: Record<string, unknown>) => string;
|
|
127
|
+
/** Custom input validation. Void function that should throw AdapterInputError on validation errors */
|
|
128
|
+
customInputValidation?: CustomInputValidator<T>;
|
|
125
129
|
}
|
|
126
130
|
export {};
|
package/cache/local.js
CHANGED
package/cache/local.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../src/cache/local.ts"],"names":[],"mappings":";;;AAAA,kCAAoC;AAEpC,uCAAsC;AAEtC,MAAM,MAAM,GAAG,IAAA,iBAAU,EAAC,YAAY,CAAC,CAAA;AAYvC;;;;;GAKG;AACH,MAAa,UAAU;IAAvB;QACE,SAAI,GAAG,oBAAU,CAAC,KAAK,CAAA;QAEvB,UAAK,GAAuC,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../src/cache/local.ts"],"names":[],"mappings":";;;AAAA,kCAAoC;AAEpC,uCAAsC;AAEtC,MAAM,MAAM,GAAG,IAAA,iBAAU,EAAC,YAAY,CAAC,CAAA;AAYvC;;;;;GAKG;AACH,MAAa,UAAU;IAAvB;QACE,SAAI,GAAG,oBAAU,CAAC,KAAK,CAAA;QAEvB,UAAK,GAAuC,EAAE,CAAA;IAyChD,CAAC;IAvCC,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,MAAM,CAAC,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC,CAAA;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAE7B,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,oCAAoC,GAAG,wBAAwB,CAAC,CAAA;YAC7E,OAAO,SAAS,CAAA;SACjB;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC,GAAG,EAAE,CAAA;QACvD,IAAI,OAAO,EAAE;YACX,MAAM,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAA;YAC9E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAChB,OAAO,SAAS,CAAA;SACjB;aAAM;YACL,MAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAA;YACjE,OAAO,KAAK,CAAC,KAAK,CAAA;SACnB;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,MAAM,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAA;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,wDAAwD;IACjF,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAQ,EAAE,GAAW;QAC1C,MAAM,CAAC,KAAK,CAAC,eAAe,GAAG,aAAa,GAAG,EAAE,CAAC,CAAA;QAClD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG;YAChB,KAAK;YACL,mBAAmB,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG;SACtC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAwB,EAAE,GAAW;QACjD,MAAM,CAAC,KAAK,CAAC,oCAAoC,GAAG,EAAE,CAAC,CAAA;QACvD,KAAK,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,OAAO,EAAE;YACpC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;SAC1B;IACH,CAAC;CACF;AA5CD,gCA4CC"}
|
package/config/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const BaseSettings: {
|
|
|
3
3
|
readonly description: "The number of milliseconds a request can be pending before returning a timeout error for data provider request";
|
|
4
4
|
readonly type: "number";
|
|
5
5
|
readonly default: 30000;
|
|
6
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
6
7
|
};
|
|
7
8
|
readonly API_VERBOSE: {
|
|
8
9
|
readonly description: "Toggle whether the response from the EA should contain just the results or also include the full response body from the queried API.";
|
|
@@ -23,21 +24,25 @@ export declare const BaseSettings: {
|
|
|
23
24
|
readonly description: "Maximum amount of time (in ms) that a response will stay cached";
|
|
24
25
|
readonly type: "number";
|
|
25
26
|
readonly default: 90000;
|
|
27
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
26
28
|
};
|
|
27
29
|
readonly CACHE_REDIS_CONNECTION_TIMEOUT: {
|
|
28
30
|
readonly description: "Connection timeout for redis client";
|
|
29
31
|
readonly type: "number";
|
|
30
32
|
readonly default: 15000;
|
|
33
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
31
34
|
};
|
|
32
35
|
readonly CACHE_REDIS_HOST: {
|
|
33
36
|
readonly description: "Hostname for the Redis instance to be used";
|
|
34
37
|
readonly type: "string";
|
|
35
38
|
readonly default: "127.0.0.1";
|
|
39
|
+
readonly validate: import("../validation/utils").Validator<string>;
|
|
36
40
|
};
|
|
37
41
|
readonly CACHE_REDIS_MAX_RECONNECT_COOLDOWN: {
|
|
38
42
|
readonly description: "Max cooldown (in ms) before attempting redis reconnection";
|
|
39
43
|
readonly type: "number";
|
|
40
44
|
readonly default: 3000;
|
|
45
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
41
46
|
};
|
|
42
47
|
readonly CACHE_REDIS_PASSWORD: {
|
|
43
48
|
readonly description: "The password required for redis auth";
|
|
@@ -52,15 +57,18 @@ export declare const BaseSettings: {
|
|
|
52
57
|
readonly description: "Port for the Redis instance to be used";
|
|
53
58
|
readonly type: "number";
|
|
54
59
|
readonly default: 6379;
|
|
60
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
55
61
|
};
|
|
56
62
|
readonly CACHE_REDIS_TIMEOUT: {
|
|
57
63
|
readonly description: "Timeout to fail a Redis server request if no response (ms)";
|
|
58
64
|
readonly type: "number";
|
|
59
65
|
readonly default: 500;
|
|
66
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
60
67
|
};
|
|
61
68
|
readonly CACHE_REDIS_URL: {
|
|
62
69
|
readonly description: "The URL of the Redis server. Format: [redis[s]:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]";
|
|
63
70
|
readonly type: "string";
|
|
71
|
+
readonly validate: import("../validation/utils").Validator<string>;
|
|
64
72
|
};
|
|
65
73
|
readonly CACHE_TYPE: {
|
|
66
74
|
readonly description: "The type of cache to use throughout the EA";
|
|
@@ -82,6 +90,7 @@ export declare const BaseSettings: {
|
|
|
82
90
|
readonly description: "Port through which the EA will listen for REST requests (if mode is set to \"reader\" or \"reader-writer\")";
|
|
83
91
|
readonly type: "number";
|
|
84
92
|
readonly default: 8080;
|
|
93
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
85
94
|
};
|
|
86
95
|
readonly EXPERIMENTAL_METRICS_ENABLED: {
|
|
87
96
|
readonly description: "Flag to specify whether or not to collect metrics. Used as fallback for METRICS_ENABLED";
|
|
@@ -93,6 +102,12 @@ export declare const BaseSettings: {
|
|
|
93
102
|
readonly type: "string";
|
|
94
103
|
readonly default: "info";
|
|
95
104
|
};
|
|
105
|
+
readonly MAX_PAYLOAD_SIZE_LIMIT: {
|
|
106
|
+
readonly description: "Max payload size limit for the Fastify server";
|
|
107
|
+
readonly type: "number";
|
|
108
|
+
readonly default: 1048576;
|
|
109
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
110
|
+
};
|
|
96
111
|
readonly METRICS_ENABLED: {
|
|
97
112
|
readonly description: "Flag to specify whether or not to startup the metrics server";
|
|
98
113
|
readonly type: "boolean";
|
|
@@ -102,6 +117,7 @@ export declare const BaseSettings: {
|
|
|
102
117
|
readonly description: "Port metrics will be exposed to";
|
|
103
118
|
readonly type: "number";
|
|
104
119
|
readonly default: 9080;
|
|
120
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
105
121
|
};
|
|
106
122
|
readonly METRICS_USE_BASE_URL: {
|
|
107
123
|
readonly description: "Flag to specify whether or not to prepend the BASE_URL to the metrics endpoint";
|
|
@@ -114,14 +130,17 @@ export declare const BaseSettings: {
|
|
|
114
130
|
readonly RATE_LIMIT_CAPACITY: {
|
|
115
131
|
readonly description: "Used as rate limit capacity per minute and ignores tier settings if defined";
|
|
116
132
|
readonly type: "number";
|
|
133
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
117
134
|
};
|
|
118
135
|
readonly RATE_LIMIT_CAPACITY_MINUTE: {
|
|
119
136
|
readonly description: "Used as rate limit capacity per minute and ignores tier settings if defined. Supercedes RATE_LIMIT_CAPACITY if both vars are set";
|
|
120
137
|
readonly type: "number";
|
|
138
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
121
139
|
};
|
|
122
140
|
readonly RATE_LIMIT_CAPACITY_SECOND: {
|
|
123
141
|
readonly description: "Used as rate limit capacity per second and ignores tier settings if defined";
|
|
124
142
|
readonly type: "number";
|
|
143
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
125
144
|
};
|
|
126
145
|
readonly REQUEST_COALESCING_ENABLED: {
|
|
127
146
|
readonly description: "Enable request coalescing";
|
|
@@ -132,46 +151,55 @@ export declare const BaseSettings: {
|
|
|
132
151
|
readonly description: "Amount of random delay (entropy) in milliseconds that will be added to requests. Avoids issue where the request coalescing key will not be set before multiple other instances in a burst try to access the same key";
|
|
133
152
|
readonly type: "number";
|
|
134
153
|
readonly default: 0;
|
|
154
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
135
155
|
};
|
|
136
156
|
readonly RETRY: {
|
|
137
157
|
readonly type: "number";
|
|
138
158
|
readonly description: "Retry count for failed HTTP requests";
|
|
139
159
|
readonly default: 1;
|
|
160
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
140
161
|
};
|
|
141
162
|
readonly SSE_KEEPALIVE_SLEEP: {
|
|
142
163
|
readonly description: "Maximum amount of time (in ms) between each SSE keepalive request";
|
|
143
164
|
readonly type: "number";
|
|
144
165
|
readonly default: 60000;
|
|
166
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
145
167
|
};
|
|
146
168
|
readonly SSE_SUBSCRIPTION_TTL: {
|
|
147
169
|
readonly description: "Maximum amount of time (in ms) an SSE subscription will be cached before being unsubscribed";
|
|
148
170
|
readonly type: "number";
|
|
149
171
|
readonly default: 300000;
|
|
172
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
150
173
|
};
|
|
151
174
|
readonly WARMUP_SUBSCRIPTION_TTL: {
|
|
152
175
|
readonly type: "number";
|
|
153
176
|
readonly description: "TTL for batch warmer subscriptions";
|
|
154
177
|
readonly default: 300000;
|
|
178
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
155
179
|
};
|
|
156
180
|
readonly WS_SUBSCRIPTION_TTL: {
|
|
157
181
|
readonly description: "The time in ms a request will live in the subscription set before becoming stale";
|
|
158
182
|
readonly type: "number";
|
|
159
183
|
readonly default: 120000;
|
|
184
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
160
185
|
};
|
|
161
186
|
readonly WS_SUBSCRIPTION_UNRESPONSIVE_TTL: {
|
|
162
187
|
readonly description: "The maximum acceptable time (in milliseconds) since the last message received on a WebSocket connection before it is considered unresponsive, causing the adapter to close and attempt to reopen it.";
|
|
163
188
|
readonly type: "number";
|
|
164
189
|
readonly default: 120000;
|
|
190
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
165
191
|
};
|
|
166
192
|
readonly CACHE_POLLING_MAX_RETRIES: {
|
|
167
193
|
readonly description: "Max amount of times to attempt to find EA response in the cache after the Transport has been set up";
|
|
168
194
|
readonly type: "number";
|
|
169
195
|
readonly default: 10;
|
|
196
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
170
197
|
};
|
|
171
198
|
readonly CACHE_POLLING_SLEEP_MS: {
|
|
172
199
|
readonly description: "The number of ms to sleep between each retry to fetch the EA response in the cache";
|
|
173
200
|
readonly type: "number";
|
|
174
201
|
readonly default: 200;
|
|
202
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
175
203
|
};
|
|
176
204
|
readonly DEFAULT_CACHE_KEY: {
|
|
177
205
|
readonly description: "Default key to be used when one cannot be determined from request parameters";
|
|
@@ -182,6 +210,7 @@ export declare const BaseSettings: {
|
|
|
182
210
|
readonly description: "Host this EA will listen for REST requests on (if mode is set to \"reader\" or \"reader-writer\")";
|
|
183
211
|
readonly type: "string";
|
|
184
212
|
readonly default: "::";
|
|
213
|
+
readonly validate: import("../validation/utils").Validator<string>;
|
|
185
214
|
};
|
|
186
215
|
readonly EA_MODE: {
|
|
187
216
|
readonly description: "Port this EA will listen for REST requests on (if mode is set to \"reader\" or \"reader-writer\")";
|
|
@@ -193,26 +222,45 @@ export declare const BaseSettings: {
|
|
|
193
222
|
readonly description: "Maximum amount of characters that the common part of the cache key or feed ID can have";
|
|
194
223
|
readonly type: "number";
|
|
195
224
|
readonly default: 300;
|
|
196
|
-
readonly validate: (
|
|
225
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
197
226
|
};
|
|
198
227
|
readonly REST_TRANSPORT_MAX_RATE_LIMIT_RETRIES: {
|
|
199
228
|
readonly description: "Maximum amount of times the Rest Transport will attempt to set up a request when blocked by the rate limiter";
|
|
200
229
|
readonly type: "number";
|
|
201
230
|
readonly default: 3;
|
|
231
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
202
232
|
};
|
|
203
233
|
readonly REST_TRANSPORT_MS_BETWEEN_RATE_LIMIT_RETRIES: {
|
|
204
234
|
readonly description: "Time that the Rest Transport will wait between retries when blocked by the rate limiter";
|
|
205
235
|
readonly type: "number";
|
|
206
236
|
readonly default: 400;
|
|
237
|
+
readonly validate: import("../validation/utils").Validator<string | number>;
|
|
207
238
|
};
|
|
208
239
|
readonly SMOKE_TEST_PAYLOAD_FILE_NAME: {
|
|
209
240
|
readonly description: "Name of the test payload file used for the smoke endpoint";
|
|
210
241
|
readonly type: "string";
|
|
211
242
|
};
|
|
212
|
-
readonly
|
|
213
|
-
readonly description: "
|
|
214
|
-
readonly type: "
|
|
215
|
-
readonly default:
|
|
243
|
+
readonly MTLS_ENABLED: {
|
|
244
|
+
readonly description: "Flag to specify whether mutual TLS/SSL is enabled or not";
|
|
245
|
+
readonly type: "boolean";
|
|
246
|
+
readonly default: false;
|
|
247
|
+
};
|
|
248
|
+
readonly TLS_PRIVATE_KEY: {
|
|
249
|
+
readonly description: "Base64 Private Key of TSL/SSL certificate";
|
|
250
|
+
readonly type: "string";
|
|
251
|
+
};
|
|
252
|
+
readonly TLS_PUBLIC_KEY: {
|
|
253
|
+
readonly description: "Base64 Public Key of TSL/SSL certificate";
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
};
|
|
256
|
+
readonly TLS_PASSPHRASE: {
|
|
257
|
+
readonly description: "Password to be used to generate an encryption key";
|
|
258
|
+
readonly type: "string";
|
|
259
|
+
readonly default: "";
|
|
260
|
+
};
|
|
261
|
+
readonly TLS_CA: {
|
|
262
|
+
readonly description: "CA certificate to use for authenticating client certificates";
|
|
263
|
+
readonly type: "string";
|
|
216
264
|
};
|
|
217
265
|
};
|
|
218
266
|
export declare const buildAdapterConfig: <CustomSettings extends CustomSettingsType<CustomSettings> = EmptySettings>({ overrides, customSettings, envVarsPrefix, }: {
|
|
@@ -222,10 +270,10 @@ export declare const buildAdapterConfig: <CustomSettings extends CustomSettingsT
|
|
|
222
270
|
}) => AdapterConfig<CustomSettings>;
|
|
223
271
|
export declare const validateAdapterConfig: <CustomSettings extends CustomSettingsType<CustomSettings> = EmptySettings>(adapterConfig: AdapterConfig<CustomSettings>, customSettings?: SettingsMap) => void;
|
|
224
272
|
export declare const getEnv: (name: string, config: Setting, prefix?: string) => SettingValueType | null;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
export
|
|
273
|
+
type SettingValueType = string | number | boolean;
|
|
274
|
+
type SettingType<C extends Setting> = C['type'] extends 'string' ? string : C['type'] extends 'number' ? number : C['type'] extends 'boolean' ? boolean : C['type'] extends 'enum' ? C['options'] extends readonly string[] ? C['options'][number] : never : never;
|
|
275
|
+
type BaseSettingsType = typeof BaseSettings;
|
|
276
|
+
export type Setting = {
|
|
229
277
|
type: 'string';
|
|
230
278
|
description: string;
|
|
231
279
|
options?: never;
|
|
@@ -284,7 +332,7 @@ export declare type Setting = {
|
|
|
284
332
|
validate?: (value: string) => ValidationErrorMessage;
|
|
285
333
|
required: true;
|
|
286
334
|
};
|
|
287
|
-
export
|
|
335
|
+
export type AdapterConfigFromSettings<T extends SettingsMap> = {
|
|
288
336
|
-readonly [K in keyof T as T[K] extends {
|
|
289
337
|
default: SettingValueType;
|
|
290
338
|
} ? K : T[K]['required'] extends true ? K : never]: SettingType<T[K]>;
|
|
@@ -293,10 +341,10 @@ export declare type AdapterConfigFromSettings<T extends SettingsMap> = {
|
|
|
293
341
|
default: SettingValueType;
|
|
294
342
|
} ? never : T[K]['required'] extends true ? never : K]?: SettingType<T[K]> | undefined;
|
|
295
343
|
};
|
|
296
|
-
export
|
|
297
|
-
export
|
|
298
|
-
export
|
|
299
|
-
export
|
|
300
|
-
export
|
|
301
|
-
export
|
|
344
|
+
export type BaseAdapterConfig = AdapterConfigFromSettings<BaseSettingsType>;
|
|
345
|
+
export type AdapterConfig<T extends CustomSettingsType<T> = SettingsMap> = AdapterConfigFromSettings<T> & BaseAdapterConfig;
|
|
346
|
+
export type CustomSettingsType<T = SettingsMap> = Record<keyof T, Setting>;
|
|
347
|
+
export type EmptySettings = Record<string, never>;
|
|
348
|
+
export type SettingsMap = Record<string, Setting>;
|
|
349
|
+
export type ValidationErrorMessage = string | undefined;
|
|
302
350
|
export {};
|