@chainlink/external-adapter-framework 0.7.1 → 0.8.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 (133) hide show
  1. package/adapter/basic.d.ts +6 -50
  2. package/adapter/basic.js +2 -165
  3. package/adapter/basic.js.map +1 -1
  4. package/adapter/endpoint.d.ts +6 -6
  5. package/adapter/endpoint.js +0 -1
  6. package/adapter/endpoint.js.map +1 -1
  7. package/adapter/price.d.ts +8 -38
  8. package/adapter/price.js +1 -43
  9. package/adapter/price.js.map +1 -1
  10. package/adapter/types.d.ts +14 -37
  11. package/background-executor.js +4 -19
  12. package/background-executor.js.map +1 -1
  13. package/cache/index.d.ts +16 -9
  14. package/cache/index.js +46 -4
  15. package/cache/index.js.map +1 -1
  16. package/config/index.d.ts +1 -19
  17. package/config/index.js +29 -54
  18. package/config/index.js.map +1 -1
  19. package/examples/bank-frick/accounts.d.ts +25 -17
  20. package/examples/bank-frick/accounts.js +13 -23
  21. package/examples/bank-frick/accounts.js.map +1 -1
  22. package/examples/bank-frick/index.d.ts +15 -1
  23. package/examples/bank-frick/index.js +1 -1
  24. package/examples/coingecko/src/crypto-utils.d.ts +4 -18
  25. package/examples/coingecko/src/crypto-utils.js +2 -1
  26. package/examples/coingecko/src/crypto-utils.js.map +1 -1
  27. package/examples/coingecko/src/endpoint/coins.d.ts +3 -20
  28. package/examples/coingecko/src/endpoint/coins.js +2 -2
  29. package/examples/coingecko/src/endpoint/coins.js.map +1 -1
  30. package/examples/coingecko/src/endpoint/crypto-marketcap.d.ts +2 -2
  31. package/examples/coingecko/src/endpoint/crypto-marketcap.js +2 -2
  32. package/examples/coingecko/src/endpoint/crypto-marketcap.js.map +1 -1
  33. package/examples/coingecko/src/endpoint/crypto-volume.d.ts +2 -2
  34. package/examples/coingecko/src/endpoint/crypto-volume.js +2 -2
  35. package/examples/coingecko/src/endpoint/crypto-volume.js.map +1 -1
  36. package/examples/coingecko/src/endpoint/crypto.d.ts +4 -2
  37. package/examples/coingecko/src/endpoint/crypto.js +2 -2
  38. package/examples/coingecko/src/endpoint/crypto.js.map +1 -1
  39. package/examples/coingecko/src/endpoint/dominance.d.ts +2 -2
  40. package/examples/coingecko/src/endpoint/dominance.js +2 -2
  41. package/examples/coingecko/src/endpoint/dominance.js.map +1 -1
  42. package/examples/coingecko/src/endpoint/global-marketcap.d.ts +2 -2
  43. package/examples/coingecko/src/endpoint/global-marketcap.js +2 -2
  44. package/examples/coingecko/src/endpoint/global-marketcap.js.map +1 -1
  45. package/examples/coingecko/src/global-utils.d.ts +3 -18
  46. package/examples/coingecko/src/global-utils.js.map +1 -1
  47. package/examples/coingecko/src/index.js +1 -1
  48. package/examples/coingecko-old/batch-warming.d.ts +7 -0
  49. package/examples/coingecko-old/batch-warming.js +54 -0
  50. package/examples/coingecko-old/batch-warming.js.map +1 -0
  51. package/examples/coingecko-old/index.d.ts +2 -0
  52. package/examples/coingecko-old/index.js +12 -0
  53. package/examples/coingecko-old/index.js.map +1 -0
  54. package/examples/coingecko-old/rest.d.ts +12 -0
  55. package/examples/coingecko-old/rest.js +55 -0
  56. package/examples/coingecko-old/rest.js.map +1 -0
  57. package/examples/cryptocompare/src/endpoints/crypto.d.ts +2 -14
  58. package/examples/cryptocompare/src/endpoints/crypto.js.map +1 -1
  59. package/examples/cryptocompare/src/index.js +1 -1
  60. package/examples/genesis/index.js +1 -1
  61. package/examples/genesis/sseStream.d.ts +2 -13
  62. package/examples/genesis/sseStream.js +1 -4
  63. package/examples/genesis/sseStream.js.map +1 -1
  64. package/examples/ncfx/config/index.d.ts +12 -0
  65. package/examples/ncfx/config/index.js +16 -0
  66. package/examples/ncfx/config/index.js.map +1 -0
  67. package/examples/ncfx/index.d.ts +13 -0
  68. package/examples/ncfx/index.js +12 -0
  69. package/examples/ncfx/index.js.map +1 -0
  70. package/examples/ncfx/websocket.d.ts +47 -0
  71. package/examples/ncfx/websocket.js +74 -0
  72. package/examples/ncfx/websocket.js.map +1 -0
  73. package/index.d.ts +0 -1
  74. package/index.js +6 -4
  75. package/index.js.map +1 -1
  76. package/metrics/index.d.ts +0 -2
  77. package/metrics/index.js +4 -5
  78. package/metrics/index.js.map +1 -1
  79. package/metrics/util.d.ts +5 -5
  80. package/metrics/util.js.map +1 -1
  81. package/package.json +9 -7
  82. package/rate-limiting/background/fixed-frequency.d.ts +3 -2
  83. package/rate-limiting/background/fixed-frequency.js.map +1 -1
  84. package/rate-limiting/index.d.ts +4 -4
  85. package/rate-limiting/index.js +1 -1
  86. package/rate-limiting/index.js.map +1 -1
  87. package/rate-limiting/request/simple-counting.d.ts +3 -2
  88. package/rate-limiting/request/simple-counting.js.map +1 -1
  89. package/transports/batch-warming.d.ts +15 -33
  90. package/transports/batch-warming.js +16 -43
  91. package/transports/batch-warming.js.map +1 -1
  92. package/transports/index.d.ts +31 -65
  93. package/transports/index.js +59 -2
  94. package/transports/index.js.map +1 -1
  95. package/transports/metrics.d.ts +2 -2
  96. package/transports/metrics.js +2 -2
  97. package/transports/metrics.js.map +1 -1
  98. package/transports/rest.d.ts +14 -31
  99. package/transports/rest.js +25 -17
  100. package/transports/rest.js.map +1 -1
  101. package/transports/sse.d.ts +20 -40
  102. package/transports/sse.js +8 -10
  103. package/transports/sse.js.map +1 -1
  104. package/transports/websocket.d.ts +25 -40
  105. package/transports/websocket.js +13 -10
  106. package/transports/websocket.js.map +1 -1
  107. package/util/logger.d.ts +0 -2
  108. package/util/logger.js +7 -4
  109. package/util/logger.js.map +1 -1
  110. package/util/request.d.ts +10 -46
  111. package/util/subscription-set/subscription-set.d.ts +1 -1
  112. package/util/subscription-set/subscription-set.js +1 -1
  113. package/util/subscription-set/subscription-set.js.map +1 -1
  114. package/util/test-payload-loader.d.ts +0 -1
  115. package/util/test-payload-loader.js +1 -2
  116. package/util/test-payload-loader.js.map +1 -1
  117. package/validation/error.d.ts +3 -1
  118. package/validation/error.js +4 -2
  119. package/validation/error.js.map +1 -1
  120. package/validation/index.js +17 -26
  121. package/validation/index.js.map +1 -1
  122. package/validation/input-params.d.ts +1 -0
  123. package/validation/input-params.js +28 -0
  124. package/validation/input-params.js.map +1 -1
  125. package/validation/input-validator.js +2 -1
  126. package/validation/input-validator.js.map +1 -1
  127. package/validation/override-functions.d.ts +3 -0
  128. package/validation/override-functions.js +41 -0
  129. package/validation/override-functions.js.map +1 -0
  130. package/README.md +0 -67
  131. package/transports/routing.d.ts +0 -21
  132. package/transports/routing.js +0 -50
  133. package/transports/routing.js.map +0 -1
@@ -1,33 +1,24 @@
1
1
  import { SettingsMap, BaseAdapterConfig, AdapterConfig } from '../config';
2
- import { AdapterRequest, AdapterResponse, Merge } from '../util';
3
2
  import { AdapterEndpoint } from './endpoint';
4
- import { AdapterDependencies, AdapterParams, AdapterRateLimitingConfig, CustomAdapterSettings, EndpointGenerics, RequestTransform } from './types';
3
+ import { AdapterDependencies, AdapterParams, AdapterRateLimitingConfig, CustomAdapterSettings } from './types';
5
4
  /**
6
5
  * Main class to represent an External Adapter
7
6
  */
8
- export declare class Adapter<CustomSettings extends CustomAdapterSettings = SettingsMap> implements Omit<AdapterParams<CustomSettings>, 'bootstrap'> {
9
- name: Uppercase<string>;
7
+ export declare class Adapter<CustomSettings extends CustomAdapterSettings = SettingsMap> implements AdapterParams<CustomSettings> {
8
+ name: string;
10
9
  defaultEndpoint?: string | undefined;
11
- endpoints: AdapterEndpoint<Merge<EndpointGenerics, {
12
- CustomSettings: CustomSettings;
13
- }>>[];
10
+ endpoints: AdapterEndpoint<unknown, unknown, CustomSettings>[];
14
11
  envDefaultOverrides?: Partial<BaseAdapterConfig> | undefined;
15
12
  customSettings?: SettingsMap | undefined;
16
13
  rateLimiting?: AdapterRateLimitingConfig | undefined;
17
14
  overrides?: Record<string, string> | undefined;
18
- requestTransforms?: RequestTransform[];
19
- envVarsPrefix?: string;
20
15
  initialized: boolean;
21
16
  /** Object containing alias translations for all endpoints */
22
- endpointsMap: Record<string, AdapterEndpoint<Merge<EndpointGenerics, {
23
- CustomSettings: CustomSettings;
24
- }>>>;
17
+ endpointsMap: Record<string, AdapterEndpoint<unknown, unknown, CustomSettings>>;
25
18
  /** Initialized dependencies that the adapter will use */
26
19
  dependencies: AdapterDependencies;
27
20
  /** Configuration params for various adapter properties */
28
- config: AdapterConfig<CustomSettings>;
29
- /** Bootstrap function that will run when initializing the adapter */
30
- private readonly bootstrap?;
21
+ config: AdapterConfig;
31
22
  constructor(params: AdapterParams<CustomSettings>);
32
23
  /**
33
24
  * Initializes all of the [[Transport]]s in the adapter, passing along any [[AdapterDependencies]] and [[AdapterConfig]].
@@ -50,11 +41,6 @@ export declare class Adapter<CustomSettings extends CustomAdapterSettings = Sett
50
41
  * using the sensitive flag in the adapter config
51
42
  */
52
43
  private buildCensorList;
53
- /**
54
- * Logs a warning for certain configs if set to particular values.
55
- * Used to warn stakeholders of potential risks.
56
- */
57
- private logConfigWarnings;
58
44
  /**
59
45
  * This function will process dependencies for an adapter, such as caches or rate limiters,
60
46
  * in order to inject them into transports and other relevant places later in the lifecycle.
@@ -63,34 +49,4 @@ export declare class Adapter<CustomSettings extends CustomAdapterSettings = Sett
63
49
  * @returns a set of AdapterDependencies all initialized
64
50
  */
65
51
  initializeDependencies(inputDependencies?: Partial<AdapterDependencies>): AdapterDependencies;
66
- /**
67
- * Attempts to find a value from the Cache and return that if found.
68
- *
69
- * @param req - the incoming request to this adapter
70
- * @returns the cached value if exists
71
- */
72
- findResponseInCache(req: AdapterRequest): Promise<AdapterResponse | undefined>;
73
- /**
74
- * Default request transform that takes requests and manipulates
75
- *
76
- * @param adapter - the current adapter
77
- * @param req - the current adapter request
78
- * @returns the modified (or new) request
79
- */
80
- symbolOverrider(req: AdapterRequest): AdapterRequest<import("../util").RequestGenerics>;
81
- /**
82
- * Takes the incoming request and applies all request transforms in the adapter
83
- *
84
- * @param req - the current adapter request
85
- * @returns the request after passing through all request transforms
86
- */
87
- runRequestTransforms(req: AdapterRequest): void;
88
- /**
89
- * Function to serve as middleware to pass along the AdapterRequest to the appropriate Transport (acc. to the endpoint in the req.)
90
- *
91
- * @param req - the incoming request to this adapter
92
- * @param replySent - a promise that resolves when the reply has already been sent
93
- * @returns a simple Promise when it's done
94
- */
95
- handleRequest(req: AdapterRequest, replySent: Promise<unknown>): Promise<AdapterResponse>;
96
52
  }
package/adapter/basic.js CHANGED
@@ -31,11 +31,9 @@ const ioredis_1 = __importDefault(require("ioredis"));
31
31
  const cache_1 = require("../cache");
32
32
  const cacheMetrics = __importStar(require("../cache/metrics"));
33
33
  const config_1 = require("../config");
34
- const transportMetrics = __importStar(require("../transports/metrics"));
35
34
  const rate_limiting_1 = require("../rate-limiting");
36
35
  const util_1 = require("../util");
37
36
  const censor_list_1 = __importDefault(require("../util/censor/censor-list"));
38
- const error_1 = require("../validation/error");
39
37
  const logger = (0, util_1.makeLogger)('Adapter');
40
38
  /**
41
39
  * Main class to represent an External Adapter
@@ -54,12 +52,9 @@ class Adapter {
54
52
  this.customSettings = params.customSettings;
55
53
  this.rateLimiting = params.rateLimiting;
56
54
  this.overrides = params.overrides;
57
- this.requestTransforms = [this.symbolOverrider.bind(this), ...(params.requestTransforms || [])];
58
- this.bootstrap = params.bootstrap;
59
55
  this.config = (0, config_1.buildAdapterConfig)({
60
56
  overrides: this.envDefaultOverrides,
61
57
  customSettings: this.customSettings,
62
- envVarsPrefix: this.envVarsPrefix,
63
58
  });
64
59
  this.normalizeEndpointNames();
65
60
  this.calculateRateLimitAllocations();
@@ -72,13 +67,6 @@ class Adapter {
72
67
  if (this.initialized) {
73
68
  throw new Error('This adapter has already been initialized!');
74
69
  }
75
- // Building configs during initialization to avoid validation errors during construction
76
- (0, config_1.validateAdapterConfig)(this.config, this.customSettings);
77
- // Log warnings for risks associated with certain configs and values
78
- this.logConfigWarnings();
79
- if (this.bootstrap) {
80
- await this.bootstrap(this);
81
- }
82
70
  this.dependencies = this.initializeDependencies(dependencies);
83
71
  for (const endpoint of this.endpoints) {
84
72
  // Add aliases to map to use in validation
@@ -144,10 +132,7 @@ class Adapter {
144
132
  buildCensorList() {
145
133
  const censorList = Object.entries(config_1.BaseSettings)
146
134
  .concat(Object.entries(this.customSettings || {}))
147
- .filter(([name, setting]) => setting &&
148
- setting.type === 'string' &&
149
- setting.sensitive &&
150
- this.config[name])
135
+ .filter(([name, setting]) => setting && setting.type === 'string' && setting.sensitive && this.config[name])
151
136
  .map(([name]) => ({
152
137
  key: name,
153
138
  // Escaping potential special characters in values before creating regex
@@ -157,19 +142,6 @@ class Adapter {
157
142
  }));
158
143
  censor_list_1.default.set(censorList);
159
144
  }
160
- /**
161
- * Logs a warning for certain configs if set to particular values.
162
- * Used to warn stakeholders of potential risks.
163
- */
164
- logConfigWarnings() {
165
- if (this.config.LOG_LEVEL.toUpperCase() === 'DEBUG' ||
166
- this.config.LOG_LEVEL.toUpperCase() === 'TRACE') {
167
- logger.warn(`LOG_LEVEL has been set to ${this.config.LOG_LEVEL.toUpperCase()}. Setting higher log levels results in increased memory usage and potentially slower performance.`);
168
- }
169
- if (this.config.DEBUG === true) {
170
- logger.warn(`The adapter is running with DEBUG mode on.`);
171
- }
172
- }
173
145
  /**
174
146
  * This function will process dependencies for an adapter, such as caches or rate limiters,
175
147
  * in order to inject them into transports and other relevant places later in the lifecycle.
@@ -181,7 +153,6 @@ class Adapter {
181
153
  const dependencies = inputDependencies || {};
182
154
  if (!dependencies.redisClient) {
183
155
  if (this.config.CACHE_TYPE === 'redis') {
184
- const maxCooldown = this.config.CACHE_REDIS_MAX_RECONNECT_COOLDOWN;
185
156
  dependencies.redisClient = new ioredis_1.default({
186
157
  enableAutoPipelining: true,
187
158
  host: this.config.CACHE_REDIS_HOST,
@@ -189,13 +160,6 @@ class Adapter {
189
160
  password: this.config.CACHE_REDIS_PASSWORD,
190
161
  path: this.config.CACHE_REDIS_PATH,
191
162
  timeout: this.config.CACHE_REDIS_TIMEOUT,
192
- retryStrategy(times) {
193
- cacheMetrics.redisRetriesCount.inc();
194
- logger.warn(`Redis reconnect attempt #${times}`);
195
- return Math.min(times * 100, maxCooldown); // Next reconnect attempt time
196
- },
197
- connectTimeout: this.config.CACHE_REDIS_CONNECTION_TIMEOUT,
198
- maxRetriesPerRequest: 30, // Limits the number of retries before the adapter shuts down
199
163
  });
200
164
  dependencies.redisClient.on('connect', () => {
201
165
  cacheMetrics.redisConnectionsOpen.inc();
@@ -213,137 +177,10 @@ class Adapter {
213
177
  dependencies.backgroundExecuteRateLimiter = new rate_limiting_1.FixedFrequencyRateLimiter().initialize(this.endpoints, rateLimitingTier);
214
178
  }
215
179
  if (!dependencies.subscriptionSetFactory) {
216
- dependencies.subscriptionSetFactory = new util_1.SubscriptionSetFactory(this.config, this.name, dependencies.redisClient);
180
+ dependencies.subscriptionSetFactory = new util_1.SubscriptionSetFactory(this.config, dependencies.redisClient, this.name);
217
181
  }
218
182
  return dependencies;
219
183
  }
220
- /**
221
- * Attempts to find a value from the Cache and return that if found.
222
- *
223
- * @param req - the incoming request to this adapter
224
- * @returns the cached value if exists
225
- */
226
- async findResponseInCache(req) {
227
- const response = await this.dependencies.cache.get(req.requestContext.cacheKey);
228
- if (response) {
229
- if (this.config.METRICS_ENABLED && this.config.EXPERIMENTAL_METRICS_ENABLED) {
230
- const label = cacheMetrics.cacheMetricsLabel(req.requestContext.cacheKey, req.requestContext.meta?.metrics?.feedId || 'N/A', this.config.CACHE_TYPE);
231
- // Record cache staleness and cache get count and value
232
- const staleness = (0, cache_1.calculateStaleness)(response.maxAge, this.config.CACHE_MAX_AGE);
233
- cacheMetrics.cacheGet(label, response.result, staleness);
234
- req.requestContext.meta = {
235
- ...req.requestContext.meta,
236
- metrics: { ...req.requestContext.meta?.metrics, cacheHit: true },
237
- };
238
- }
239
- return response;
240
- }
241
- }
242
- /**
243
- * Default request transform that takes requests and manipulates
244
- *
245
- * @param adapter - the current adapter
246
- * @param req - the current adapter request
247
- * @returns the modified (or new) request
248
- */
249
- symbolOverrider(req) {
250
- const rawRequestBody = req.body;
251
- const requestOverrides = rawRequestBody.data?.overrides?.[this.name.toLowerCase()];
252
- const base = req.requestContext.data['base'];
253
- if (requestOverrides?.[base]) {
254
- // Perform overrides specified in the request payload
255
- req.requestContext.data['base'] = requestOverrides[base];
256
- }
257
- else if (this.overrides?.[base]) {
258
- // Perform hardcoded adapter overrides
259
- req.requestContext.data['base'] = this.overrides[base];
260
- }
261
- return req;
262
- }
263
- /**
264
- * Takes the incoming request and applies all request transforms in the adapter
265
- *
266
- * @param req - the current adapter request
267
- * @returns the request after passing through all request transforms
268
- */
269
- runRequestTransforms(req) {
270
- if (!this.requestTransforms) {
271
- return;
272
- }
273
- for (const transform of this.requestTransforms) {
274
- transform(req);
275
- }
276
- }
277
- /**
278
- * Function to serve as middleware to pass along the AdapterRequest to the appropriate Transport (acc. to the endpoint in the req.)
279
- *
280
- * @param req - the incoming request to this adapter
281
- * @param replySent - a promise that resolves when the reply has already been sent
282
- * @returns a simple Promise when it's done
283
- */
284
- async handleRequest(req, replySent) {
285
- // Get transport, must be here because it's already checked in the validator
286
- const transport = this.endpointsMap[req.requestContext.endpointName].transport;
287
- // First try to find the response in our cache, keep it ready
288
- const cachedResponse = await this.findResponseInCache(req);
289
- // Next we fire off the transport's registration of the request if defined, regardless of if we already have a cached response.
290
- // This is necessary to ensure things like subscription sets are updated each time we get a request
291
- let requestRegistrationPromise;
292
- if (transport.registerRequest) {
293
- const handler = async () => {
294
- // If we already have a cached response, wait for it to be sent back before continuing with registration
295
- // This way we respond to incoming requests from the cache as fast as possible
296
- if (cachedResponse) {
297
- await replySent;
298
- }
299
- // Disable the non-null assertion error, since we're checking this exists in the if above
300
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
301
- return transport.registerRequest(req, this.config);
302
- };
303
- // Execute the registration handler without blocking
304
- logger.debug(`Firing request registration handler${cachedResponse ? ' (cached response already sent)' : ''}`);
305
- requestRegistrationPromise = handler();
306
- }
307
- // Now that we have dealt with request registration, we can return the cached response if present
308
- if (cachedResponse) {
309
- logger.debug('Found response from cache, sending that');
310
- return cachedResponse;
311
- }
312
- // If there was no cached response, execute the foregroundExecute if defined
313
- const immediateResponse = transport.foregroundExecute && (await transport.foregroundExecute(req, this.config));
314
- if (immediateResponse) {
315
- logger.debug('Got immediate response from transport, sending as response');
316
- return immediateResponse;
317
- }
318
- // Finally, either because there was no synchronous execute or because it returned an empty response,
319
- // we wait for the cache to be filled (either from background work started in the sync execute, or the backgroundExecute).
320
- // We can wait for the request registration to have finished here, since we're going to be sleeping for the cache anyways,
321
- // and it's useful in case the registration throws a promise so that it doesn't go unhandled.
322
- await requestRegistrationPromise;
323
- // Observe the idle time taken for polling response
324
- const metricsTimer = transportMetrics.transportPollingDurationSeconds
325
- .labels({ endpoint: req.requestContext.endpointName })
326
- .startTimer();
327
- logger.debug('Transport is set up, polling cache for response...');
328
- const response = await (0, cache_1.pollResponseFromCache)(this.dependencies.cache, req.requestContext.cacheKey, {
329
- maxRetries: this.config.CACHE_POLLING_MAX_RETRIES,
330
- sleep: this.config.CACHE_POLLING_SLEEP_MS,
331
- });
332
- metricsTimer({ succeeded: String(!!response) });
333
- if (response) {
334
- logger.debug('Got a response from polling the cache, sending that back');
335
- return response;
336
- }
337
- // Record polling mechanism failure to return response
338
- transportMetrics.transportPollingFailureCount
339
- .labels({ endpoint: req.requestContext.endpointName })
340
- .inc();
341
- logger.debug('Ran out of polling attempts, returning timeout');
342
- throw new error_1.AdapterTimeoutError({
343
- message: 'Timed out waiting for provider result.',
344
- statusCode: 504,
345
- });
346
- }
347
184
  }
348
185
  exports.Adapter = Adapter;
349
186
  //# sourceMappingURL=basic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/adapter/basic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA2B;AAC3B,oCAAyF;AACzF,+DAAgD;AAChD,sCAOkB;AAClB,wEAAyD;AACzD,oDAIyB;AACzB,kCAAoG;AACpG,6EAAuE;AAWvE,+CAAyD;AAE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AY,CAAC,KAAK,EAAE;YACvB,YAAY,CAAC,KAAK,GAAG,oBAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;SAC/F;QAED,MAAM,gBAAgB,GAAG,IAAA,mCAAmB,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;QACnF,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE;YACpC,YAAY,CAAC,kBAAkB,GAAG,IAAI,yCAAyB,EAAE,CAAC,UAAU,CAC1E,IAAI,CAAC,SAAS,EACd,gBAAgB,CACjB,CAAA;SACF;QACD,IAAI,CAAC,YAAY,CAAC,4BAA4B,EAAE;YAC9C,YAAY,CAAC,4BAA4B,GAAG,IAAI,yCAAyB,EAAE,CAAC,UAAU,CACpF,IAAI,CAAC,SAAS,EACd,gBAAgB,CACjB,CAAA;SACF;QACD,IAAI,CAAC,YAAY,CAAC,sBAAsB,EAAE;YACxC,YAAY,CAAC,sBAAsB,GAAG,IAAI,6BAAsB,CAC9D,IAAI,CAAC,MAAM,EACX,YAAY,CAAC,WAAW,EACxB,IAAI,CAAC,IAAI,CACV,CAAA;SACF;QAED,OAAO,YAAmC,CAAA;IAC5C,CAAC;CACF;AA5MD,0BA4MC"}
@@ -1,17 +1,17 @@
1
- import { MetaTransport, Transport } from '../transports';
1
+ import { SettingsMap } from '../config';
2
+ import { Transport } from '../transports';
2
3
  import { InputParameters } from '../validation';
4
+ import { AdapterEndpointParams, EndpointRateLimitingConfig } from './types';
3
5
  import { InputValidator } from '../validation/input-validator';
4
- import { AdapterEndpointParams, EndpointGenerics, EndpointRateLimitingConfig } from './types';
5
6
  /**
6
7
  * Main class to represent an endpoint within an External Adapter
7
8
  */
8
- export declare class AdapterEndpoint<T extends EndpointGenerics> implements AdapterEndpointParams<T> {
9
+ export declare class AdapterEndpoint<Params, Result, CustomSettings extends SettingsMap> implements AdapterEndpointParams<Params, Result, CustomSettings> {
9
10
  name: string;
10
11
  aliases?: string[] | undefined;
11
- transport: Transport<T> | MetaTransport<T>;
12
+ transport: Transport<Params, Result, CustomSettings>;
12
13
  inputParameters: InputParameters;
13
14
  rateLimiting?: EndpointRateLimitingConfig | undefined;
14
15
  validator: InputValidator;
15
- cacheKeyGenerator?: (data: Record<string, unknown>) => string;
16
- constructor(params: AdapterEndpointParams<T>);
16
+ constructor(params: AdapterEndpointParams<Params, Result, CustomSettings>);
17
17
  }
@@ -13,7 +13,6 @@ class AdapterEndpoint {
13
13
  this.inputParameters = params.inputParameters;
14
14
  this.rateLimiting = params.rateLimiting;
15
15
  this.validator = new input_validator_1.InputValidator(this.inputParameters);
16
- this.cacheKeyGenerator = params.cacheKeyGenerator;
17
16
  }
18
17
  }
19
18
  exports.AdapterEndpoint = AdapterEndpoint;
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../../src/adapter/endpoint.ts"],"names":[],"mappings":";;;AAEA,mEAA8D;AAG9D;;GAEG;AACH,MAAa,eAAe;IAS1B,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;IACnD,CAAC;CACF;AAlBD,0CAkBC"}
1
+ {"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../../src/adapter/endpoint.ts"],"names":[],"mappings":";;;AAIA,mEAA8D;AAE9D;;GAEG;AACH,MAAa,eAAe;IAU1B,YAAY,MAA6D;QACvE,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;IAC3D,CAAC;CACF;AAlBD,0CAkBC"}
@@ -1,7 +1,6 @@
1
- import { SettingsMap } from '../config';
2
- import { AdapterRequest, AdapterRequestContext, AdapterResponse, RequestGenerics } from '../util';
1
+ import { Adapter, AdapterEndpointParams, AdapterParams } from './index';
3
2
  import { AdapterEndpoint } from './endpoint';
4
- import { Adapter, AdapterEndpointParams, AdapterParams, EndpointGenerics } from './index';
3
+ import { SettingsMap } from '../config';
5
4
  /**
6
5
  * Type for the base input parameter config that any [[PriceEndpoint]] must extend
7
6
  */
@@ -10,13 +9,13 @@ export declare type PriceEndpointInputParameters = {
10
9
  aliases: readonly ['from', 'coin', ...string[]];
11
10
  type: 'string';
12
11
  description: 'The symbol of symbols of the currency to query';
13
- required: boolean;
12
+ required: true;
14
13
  };
15
14
  quote: {
16
15
  aliases: readonly ['to', 'market', ...string[]];
17
16
  type: 'string';
18
17
  description: 'The symbol of the currency to convert to';
19
- required: boolean;
18
+ required: true;
20
19
  };
21
20
  };
22
21
  /**
@@ -26,52 +25,23 @@ export declare const priceEndpointInputParameters: PriceEndpointInputParameters;
26
25
  /**
27
26
  * Type for base input params for a PriceEndpoint
28
27
  */
29
- export declare type PriceEndpointParams = {
28
+ declare type PriceEndpointParams = {
30
29
  base: string;
31
30
  quote: string;
32
31
  };
33
- /**
34
- * Structure of an "includes" file.
35
- * Include pairs describe an incoming price feed request, and the details specify
36
- */
37
- export declare type IncludesFile = IncludePair[];
38
- declare type IncludeDetails = {
39
- from: string;
40
- to: string;
41
- inverse: boolean;
42
- };
43
- declare type IncludePair = {
44
- from: string;
45
- to: string;
46
- includes: IncludeDetails[];
47
- };
48
- declare type IncludesMap = Record<string, Record<string, IncludeDetails>>;
49
32
  /**
50
33
  * A PriceEndpoint is a specific type of AdapterEndpoint. Meant to comply with standard practices for
51
34
  * Data Feeds, its InputParameters must extend the basic ones (base/quote).
52
35
  */
53
- export declare class PriceEndpoint<T extends EndpointGenerics> extends AdapterEndpoint<T> {
54
- constructor(params: AdapterEndpointParams<T> & {
36
+ export declare class PriceEndpoint<Params extends PriceEndpointParams, ProviderResponseBody, CustomSettings extends SettingsMap> extends AdapterEndpoint<Params, ProviderResponseBody, CustomSettings> {
37
+ constructor(params: AdapterEndpointParams<Params, ProviderResponseBody, CustomSettings> & {
55
38
  inputParameters: PriceEndpointInputParameters;
56
39
  });
57
40
  }
58
- declare type PriceAdapterRequest<T extends RequestGenerics> = AdapterRequest<T> & {
59
- requestContext: AdapterRequestContext<T> & {
60
- priceMeta: {
61
- inverse: boolean;
62
- };
63
- };
64
- };
65
41
  /**
66
42
  * A PriceAdapter is a specific kind of Adapter that includes at least one PriceEnpoint.
67
43
  */
68
44
  export declare class PriceAdapter<CustomSettings extends SettingsMap> extends Adapter<CustomSettings> {
69
- includesMap?: IncludesMap;
70
- constructor(params: AdapterParams<CustomSettings> & {
71
- includes?: IncludesFile;
72
- });
73
- handleRequest(req: PriceAdapterRequest<{
74
- Params: PriceEndpointParams;
75
- }>, replySent: Promise<unknown>): Promise<AdapterResponse>;
45
+ constructor(params: AdapterParams<CustomSettings>);
76
46
  }
77
47
  export {};
package/adapter/price.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PriceAdapter = exports.PriceEndpoint = exports.priceEndpointInputParameters = void 0;
4
- const endpoint_1 = require("./endpoint");
5
4
  const index_1 = require("./index");
5
+ const endpoint_1 = require("./endpoint");
6
6
  /**
7
7
  * Base input parameter config that any [[PriceEndpoint]] must extend
8
8
  */
@@ -30,16 +30,6 @@ class PriceEndpoint extends endpoint_1.AdapterEndpoint {
30
30
  }
31
31
  }
32
32
  exports.PriceEndpoint = PriceEndpoint;
33
- const buildIncludesMap = (includesFile) => {
34
- const includesMap = {};
35
- for (const { from, to, includes } of includesFile) {
36
- if (!includesMap[from]) {
37
- includesMap[from] = {};
38
- }
39
- includesMap[from][to] = includes[0];
40
- }
41
- return includesMap;
42
- };
43
33
  /**
44
34
  * A PriceAdapter is a specific kind of Adapter that includes at least one PriceEnpoint.
45
35
  */
@@ -50,38 +40,6 @@ class PriceAdapter extends index_1.Adapter {
50
40
  throw new Error(`This PriceAdapter's list of endpoints does not contain a valid PriceEndpoint`);
51
41
  }
52
42
  super(params);
53
- if (params.includes) {
54
- // Build includes map for constant lookups
55
- this.includesMap = buildIncludesMap(params.includes);
56
- const requestTransform = (req) => {
57
- const priceRequest = req;
58
- const requestData = priceRequest.requestContext.data;
59
- const includesDetails = this.includesMap?.[requestData.base]?.[requestData.quote];
60
- if (includesDetails) {
61
- requestData.base = includesDetails.from || requestData.base;
62
- requestData.quote = includesDetails.to || requestData.quote;
63
- }
64
- const inverse = includesDetails?.inverse || false;
65
- priceRequest.requestContext.priceMeta = {
66
- inverse,
67
- };
68
- };
69
- this.requestTransforms?.push(requestTransform);
70
- }
71
- }
72
- async handleRequest(req, replySent) {
73
- const response = await super.handleRequest(req, replySent);
74
- if (this.includesMap && req.requestContext.priceMeta.inverse) {
75
- // We need to search in the reverse order (quote -> base) because the request transform will have inverted the pair
76
- const inverseResult = 1 / response.result;
77
- response.result = inverseResult;
78
- // Check if response data has a result within it
79
- const data = response.data;
80
- if (data?.result) {
81
- data.result = inverseResult;
82
- }
83
- }
84
- return response;
85
43
  }
86
44
  }
87
45
  exports.PriceAdapter = PriceAdapter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