@versori/run 0.2.8 → 0.2.10

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 (93) hide show
  1. package/esm/src/context/Context.d.ts +4 -4
  2. package/esm/src/context/Context.d.ts.map +1 -1
  3. package/esm/src/context/ContextProvider.d.ts +3 -3
  4. package/esm/src/context/ContextProvider.d.ts.map +1 -1
  5. package/esm/src/dsl/http/default.d.ts +4 -4
  6. package/esm/src/dsl/http/default.d.ts.map +1 -1
  7. package/esm/src/dsl/http/default.js +3 -3
  8. package/esm/src/dsl/http/types.d.ts +8 -2
  9. package/esm/src/dsl/http/types.d.ts.map +1 -1
  10. package/esm/src/dsl/http/versori/configloader.d.ts +10 -1
  11. package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
  12. package/esm/src/dsl/http/versori/configloader.js +37 -0
  13. package/esm/src/dsl/http/versori/constants.d.ts +1 -0
  14. package/esm/src/dsl/http/versori/constants.d.ts.map +1 -1
  15. package/esm/src/dsl/http/versori/constants.js +2 -0
  16. package/esm/src/dsl/http/versori/contextcredentials.d.ts +0 -4
  17. package/esm/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
  18. package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -1
  19. package/esm/src/dsl/http/versori/cronapi.js +2 -2
  20. package/esm/src/dsl/http/versori/proxyroundtripper.d.ts +5 -7
  21. package/esm/src/dsl/http/versori/proxyroundtripper.d.ts.map +1 -1
  22. package/esm/src/dsl/http/versori/proxyroundtripper.js +10 -24
  23. package/esm/src/dsl/http/versori/roundtripper.d.ts +6 -7
  24. package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  25. package/esm/src/dsl/http/versori/roundtripper.js +32 -28
  26. package/esm/src/dsl/http/versori/webhookmiddleware.d.ts +16 -0
  27. package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -0
  28. package/esm/src/dsl/http/versori/webhookmiddleware.js +197 -0
  29. package/esm/src/dsl/tasks/HttpTask.d.ts +3 -3
  30. package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
  31. package/esm/src/dsl/tasks/HttpTask.js +1 -1
  32. package/esm/src/dsl/triggers/WebhookTrigger.d.ts +1 -0
  33. package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
  34. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +7 -4
  35. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  36. package/esm/src/interpreter/memory/MemoryInterpreter.js +70 -20
  37. package/esm/src/interpreter/memory/ObservableCompiler.d.ts +4 -2
  38. package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
  39. package/esm/src/interpreter/memory/compilers/schedule.js +2 -2
  40. package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  41. package/esm/src/interpreter/memory/compilers/webhook.js +38 -12
  42. package/esm/src/observability/logging/ConsoleLogger.d.ts +1 -0
  43. package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
  44. package/esm/src/observability/logging/ConsoleLogger.js +7 -0
  45. package/esm/src/observability/logging/Logger.d.ts +2 -1
  46. package/esm/src/observability/logging/Logger.d.ts.map +1 -1
  47. package/package.json +1 -1
  48. package/script/src/context/Context.d.ts +4 -4
  49. package/script/src/context/Context.d.ts.map +1 -1
  50. package/script/src/context/ContextProvider.d.ts +3 -3
  51. package/script/src/context/ContextProvider.d.ts.map +1 -1
  52. package/script/src/dsl/http/default.d.ts +4 -4
  53. package/script/src/dsl/http/default.d.ts.map +1 -1
  54. package/script/src/dsl/http/default.js +3 -3
  55. package/script/src/dsl/http/types.d.ts +8 -2
  56. package/script/src/dsl/http/types.d.ts.map +1 -1
  57. package/script/src/dsl/http/versori/configloader.d.ts +10 -1
  58. package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
  59. package/script/src/dsl/http/versori/configloader.js +39 -0
  60. package/script/src/dsl/http/versori/constants.d.ts +1 -0
  61. package/script/src/dsl/http/versori/constants.d.ts.map +1 -1
  62. package/script/src/dsl/http/versori/constants.js +3 -1
  63. package/script/src/dsl/http/versori/contextcredentials.d.ts +0 -4
  64. package/script/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
  65. package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -1
  66. package/script/src/dsl/http/versori/cronapi.js +1 -1
  67. package/script/src/dsl/http/versori/proxyroundtripper.d.ts +5 -7
  68. package/script/src/dsl/http/versori/proxyroundtripper.d.ts.map +1 -1
  69. package/script/src/dsl/http/versori/proxyroundtripper.js +9 -23
  70. package/script/src/dsl/http/versori/roundtripper.d.ts +6 -7
  71. package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  72. package/script/src/dsl/http/versori/roundtripper.js +31 -27
  73. package/script/src/dsl/http/versori/webhookmiddleware.d.ts +16 -0
  74. package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -0
  75. package/script/src/dsl/http/versori/webhookmiddleware.js +202 -0
  76. package/script/src/dsl/tasks/HttpTask.d.ts +3 -3
  77. package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
  78. package/script/src/dsl/tasks/HttpTask.js +1 -1
  79. package/script/src/dsl/triggers/WebhookTrigger.d.ts +1 -0
  80. package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
  81. package/script/src/interpreter/memory/MemoryInterpreter.d.ts +7 -4
  82. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  83. package/script/src/interpreter/memory/MemoryInterpreter.js +70 -20
  84. package/script/src/interpreter/memory/ObservableCompiler.d.ts +4 -2
  85. package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
  86. package/script/src/interpreter/memory/compilers/schedule.js +2 -2
  87. package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  88. package/script/src/interpreter/memory/compilers/webhook.js +38 -12
  89. package/script/src/observability/logging/ConsoleLogger.d.ts +1 -0
  90. package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
  91. package/script/src/observability/logging/ConsoleLogger.js +7 -0
  92. package/script/src/observability/logging/Logger.d.ts +2 -1
  93. package/script/src/observability/logging/Logger.d.ts.map +1 -1
@@ -17,6 +17,7 @@ import { NatsKeyValueProvider } from '../../kv/nats/NatsKeyValueProvider.js';
17
17
  import { ConsoleLogger } from '../../observability/logging/ConsoleLogger.js';
18
18
  import { ObservableCompiler } from './ObservableCompiler.js';
19
19
  import { ProxyRoundTripper } from '../../dsl/http/versori/proxyroundtripper.js';
20
+ import { VersoriConfigReader } from '../../dsl/http/versori/configloader.js';
20
21
  function getKVProvider(runLocal) {
21
22
  if (runLocal) {
22
23
  return Promise.resolve(new MemoryKeyValueProvider());
@@ -35,7 +36,7 @@ function getRoundTripperFactory(log, tracer, opts) {
35
36
  return new DefaultRoundTripperFactory();
36
37
  }
37
38
  export class MemoryInterpreter {
38
- constructor(log, compiler, contextProvider, roundTripperFactory, router, cronRegistry, connectionProvider, cronProvider, tracer, otelSDK) {
39
+ constructor(log, compiler, contextProvider, roundTripperFactory, webhookRouter, cronRouter, cronRegistry, connectionProvider, cronProvider, tracer, cfgReader, otelSDK) {
39
40
  Object.defineProperty(this, "log", {
40
41
  enumerable: true,
41
42
  configurable: true,
@@ -60,11 +61,17 @@ export class MemoryInterpreter {
60
61
  writable: true,
61
62
  value: roundTripperFactory
62
63
  });
63
- Object.defineProperty(this, "router", {
64
+ Object.defineProperty(this, "webhookRouter", {
64
65
  enumerable: true,
65
66
  configurable: true,
66
67
  writable: true,
67
- value: router
68
+ value: webhookRouter
69
+ });
70
+ Object.defineProperty(this, "cronRouter", {
71
+ enumerable: true,
72
+ configurable: true,
73
+ writable: true,
74
+ value: cronRouter
68
75
  });
69
76
  Object.defineProperty(this, "cronRegistry", {
70
77
  enumerable: true,
@@ -90,6 +97,12 @@ export class MemoryInterpreter {
90
97
  writable: true,
91
98
  value: tracer
92
99
  });
100
+ Object.defineProperty(this, "cfgReader", {
101
+ enumerable: true,
102
+ configurable: true,
103
+ writable: true,
104
+ value: cfgReader
105
+ });
93
106
  Object.defineProperty(this, "otelSDK", {
94
107
  enumerable: true,
95
108
  configurable: true,
@@ -102,7 +115,13 @@ export class MemoryInterpreter {
102
115
  writable: true,
103
116
  value: []
104
117
  });
105
- Object.defineProperty(this, "server", {
118
+ Object.defineProperty(this, "webhookServer", {
119
+ enumerable: true,
120
+ configurable: true,
121
+ writable: true,
122
+ value: void 0
123
+ });
124
+ Object.defineProperty(this, "cronServer", {
106
125
  enumerable: true,
107
126
  configurable: true,
108
127
  writable: true,
@@ -137,6 +156,7 @@ export class MemoryInterpreter {
137
156
  const orgSlug = Deno.env.get(envVarOrgSlug) || 'development';
138
157
  const otelTracesURL = Deno.env.get(envVarOtelTracesURL);
139
158
  let otelSDK;
159
+ const configReader = VersoriConfigReader.fromEnv(log);
140
160
  const runLocal = Deno.env.get(envVarLocalRun) === 'true';
141
161
  await waitForReady(log);
142
162
  // Do NOT change those attributes, they are used by the API to filter on
@@ -167,10 +187,10 @@ export class MemoryInterpreter {
167
187
  if (options.contextProvider) {
168
188
  // no need to set up a key-value provider if options.contextProvider is already
169
189
  // initialised.
170
- return new MemoryInterpreter(log, compiler, options.contextProvider, roundTripperFactory, express.Router(), new Map(), PlatformAPIClient.fromEnv(), CronAPIClient.fromEnv(), tracer, otelSDK);
190
+ return new MemoryInterpreter(log, compiler, options.contextProvider, roundTripperFactory, express.Router(), express.Router(), new Map(), PlatformAPIClient.fromEnv(), CronAPIClient.fromEnv(), tracer, configReader, otelSDK);
171
191
  }
172
192
  const kvp = await getKVProvider(runLocal);
173
- return new MemoryInterpreter(log, compiler, new ContextProviderImpl(log, kvp, roundTripperFactory.credentials()), roundTripperFactory, express.Router(), new Map(), PlatformAPIClient.fromEnv(), CronAPIClient.fromEnv(), tracer, otelSDK);
193
+ return new MemoryInterpreter(log, compiler, new ContextProviderImpl(log, kvp, roundTripperFactory.credentials()), roundTripperFactory, express.Router(), express.Router(), new Map(), PlatformAPIClient.fromEnv(), CronAPIClient.fromEnv(), tracer, configReader, otelSDK);
174
194
  }
175
195
  register(workflow, options) {
176
196
  const localAbortController = new AbortController();
@@ -187,9 +207,11 @@ export class MemoryInterpreter {
187
207
  tracer: this.tracer,
188
208
  contextProvider: this.contextProvider,
189
209
  roundTripperFactory: this.roundTripperFactory,
190
- router: this.router,
210
+ webhookRouter: this.webhookRouter,
211
+ cronRouter: this.cronRouter,
191
212
  cronRegistry: this.cronRegistry,
192
213
  connectionProvider: this.connectionProvider,
214
+ configReader: this.cfgReader,
193
215
  };
194
216
  const trigger$ = this.compiler.compileTrigger(compilerContext, workflow.trigger, combinedSignal);
195
217
  const task$ = this.compiler.compileTask(compilerContext, workflow.task);
@@ -207,21 +229,28 @@ export class MemoryInterpreter {
207
229
  }
208
230
  async start() {
209
231
  const port = Deno.env.get('PORT') || 3000;
210
- const app = express();
211
- app.use(express.json()); // Add JSON body parser middleware
232
+ const cronPort = Deno.env.get('CRON_PORT') || 3001;
233
+ const webhookApp = express();
234
+ webhookApp.use(express.json()); // Add JSON body parser middleware
235
+ const cronApp = express();
236
+ cronApp.use(express.json());
212
237
  const xml2jsDefaults = {
213
238
  explicitArray: false,
214
239
  normalize: false,
215
240
  normalizeTags: false,
216
241
  trim: true,
217
242
  };
218
- app.use(xmlparser(xml2jsDefaults));
243
+ webhookApp.use(xmlparser(xml2jsDefaults));
219
244
  // Add health check route
220
- this.router.get('/health', (_req, res) => {
245
+ this.webhookRouter.get('/health', (_req, res) => {
246
+ res.json({ status: 'healthy' });
247
+ });
248
+ this.cronRouter.get('/health', (_req, res) => {
221
249
  res.json({ status: 'healthy' });
222
250
  });
223
- // Add router to the application
224
- app.use(this.router);
251
+ // Add router to the webhookApplication
252
+ webhookApp.use(this.webhookRouter);
253
+ cronApp.use(this.cronRouter);
225
254
  // Start all registered workflows
226
255
  for (const registration of this.registeredWorkflows) {
227
256
  Deno.addSignalListener('SIGINT', registration.sigintListener);
@@ -287,9 +316,12 @@ export class MemoryInterpreter {
287
316
  });
288
317
  throw new Error('Unable to register scheduler tasks with central cron provider');
289
318
  }
290
- this.server = app.listen(port, () => {
319
+ this.webhookServer = webhookApp.listen(port, () => {
291
320
  this.log.info(`Express server listening on http://localhost:${port}`);
292
321
  });
322
+ this.cronServer = cronApp.listen(cronPort, () => {
323
+ this.log.info(`Cron server listening on http://localhost:${cronPort}`);
324
+ });
293
325
  this.shutdownServer = () => {
294
326
  if (this.isShuttingDown) {
295
327
  return;
@@ -297,8 +329,11 @@ export class MemoryInterpreter {
297
329
  this.isShuttingDown = true;
298
330
  this.log.info('Shutting down server');
299
331
  // Close the server
300
- if (this.server) {
301
- this.server.close();
332
+ if (this.webhookServer) {
333
+ this.webhookServer.close();
334
+ }
335
+ if (this.cronServer) {
336
+ this.cronServer.close();
302
337
  }
303
338
  // Remove all signal listeners
304
339
  for (const registration of this.registeredWorkflows) {
@@ -317,13 +352,28 @@ export class MemoryInterpreter {
317
352
  };
318
353
  Deno.addSignalListener('SIGINT', this.shutdownServer);
319
354
  return new Promise((resolve) => {
320
- if (this.server) {
321
- this.server.on('close', () => {
322
- this.log.info('Server closed');
355
+ let serversClosed = 0;
356
+ const totalServers = [this.webhookServer, this.cronServer].filter(Boolean).length;
357
+ const checkResolve = () => {
358
+ serversClosed++;
359
+ if (serversClosed === totalServers) {
360
+ this.log.info('All servers closed');
323
361
  resolve();
362
+ }
363
+ };
364
+ if (this.webhookServer) {
365
+ this.webhookServer.on('close', () => {
366
+ this.log.info('Webhook server closed');
367
+ checkResolve();
368
+ });
369
+ }
370
+ if (this.cronServer) {
371
+ this.cronServer.on('close', () => {
372
+ this.log.info('Cron server closed');
373
+ checkResolve();
324
374
  });
325
375
  }
326
- else {
376
+ if (!this.webhookServer && !this.cronServer) {
327
377
  resolve();
328
378
  }
329
379
  });
@@ -5,7 +5,7 @@ import { ContextOperatorFunction, TaskCompiler, TriggerCompiler } from './compil
5
5
  import { Trigger } from '../../dsl/Trigger.js';
6
6
  import { ContextProvider } from '../../context/ContextProvider.js';
7
7
  import { ContextImpl } from '../../context/Context.js';
8
- import { ConnectionProvider, RoundTripperFactory } from '../../dsl/http/types.js';
8
+ import { ConfigReader, ConnectionProvider, RoundTripperFactory } from '../../dsl/http/types.js';
9
9
  import { Router } from 'express';
10
10
  import { Tracer } from '@opentelemetry/api';
11
11
  export type CompilerContext = {
@@ -15,7 +15,9 @@ export type CompilerContext = {
15
15
  contextProvider: ContextProvider;
16
16
  roundTripperFactory: RoundTripperFactory;
17
17
  connectionProvider: ConnectionProvider;
18
- router: Router;
18
+ webhookRouter: Router;
19
+ cronRouter: Router;
20
+ configReader: ConfigReader;
19
21
  cronRegistry: Map<string, string>;
20
22
  };
21
23
  export type CompilerFunc<In = any, Out = any, T extends Task<In, Out> = Task<In, Out>> = (ctx: CompilerContext, task: T) => OperatorFunction<In, Out>;
@@ -1 +1 @@
1
- {"version":3,"file":"ObservableCompiler.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/ObservableCompiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,IAAI,EAAY,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAO/D,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,EAAE,OAAO,EAAe,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG;IA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subscriber) => {
6
6
  // Add HTTP endpoint for manual triggering
7
- if (!ctx.router) {
7
+ if (!ctx.cronRouter) {
8
8
  throw new Error('Router not available in compiler context');
9
9
  }
10
10
  const projectId = Deno.env.get(envVarProjectId) || 'example-service';
@@ -65,7 +65,7 @@ function compileSchedule(ctx, trigger, signal) {
65
65
  res.status(500).json({ error: 'Failed to trigger schedule' });
66
66
  }
67
67
  }
68
- ctx.router.post(`/cron/${trigger.id}`, async (req, res) => {
68
+ ctx.cronRouter.post(`/cron/${trigger.id}`, async (req, res) => {
69
69
  await ctx.tracer.startActiveSpan(`schedule-${trigger.id}`, async (span) => {
70
70
  span.setAttribute('task.id', trigger.id);
71
71
  span.setAttribute('task.type', 'schedule');
@@ -1 +1 @@
1
- {"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/webhook.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAgD7C,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,WAAW,EAAE,cAAc,CA+PxE,CAAC"}
1
+ {"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/webhook.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkD7C,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,WAAW,EAAE,cAAc,CAuRxE,CAAC"}
@@ -2,6 +2,7 @@ import cors from 'cors';
2
2
  import { pipeline } from 'node:stream/promises';
3
3
  import { Observable } from 'rxjs';
4
4
  import { WebhookTrigger } from '../../../dsl/triggers/WebhookTrigger.js';
5
+ import { createActIdDynamicWebhookMiddleware, createStaticWebhookMiddleware, createUserIdDynamicWebhookMiddleware } from '../../../dsl/http/versori/webhookmiddleware.js';
5
6
  const DEFAULT_SYNC_ON_SUCCESS = (ctx) => new Response(JSON.stringify(ctx.data), {
6
7
  status: 200,
7
8
  headers: {
@@ -66,28 +67,35 @@ export const webhookCompiler = {
66
67
  },
67
68
  });
68
69
  return new Observable((subscriber) => {
69
- if (!ctx.router) {
70
+ if (!ctx.webhookRouter) {
70
71
  throw new Error('Router not available in compiler context');
71
72
  }
72
73
  // add the webhook endpoint to the router
73
74
  ctx.log.info('webhook endpoint added:', { trigger });
74
75
  if (corsOptions) {
75
76
  if (typeof corsOptions === 'boolean') {
76
- ctx.router.use(cors());
77
+ ctx.webhookRouter.use(cors());
77
78
  }
78
79
  else {
79
- ctx.router.use(cors(corsOptions));
80
+ ctx.webhookRouter.use(cors(corsOptions));
80
81
  }
81
82
  }
82
83
  // endpoint for sans user because I'm not quite sure how the dynamic routing works
83
- ctx.router.post(`/${trigger.id}`, async (req, res) => {
84
+ ctx.webhookRouter.post(`/${trigger.id}`, createStaticWebhookMiddleware({
85
+ id: trigger.id,
86
+ connName: trigger.options.connection,
87
+ credentials: ctx.roundTripperFactory.credentials(),
88
+ cnxProvider: ctx.connectionProvider,
89
+ cfgReader: ctx.configReader,
90
+ log: ctx.log,
91
+ }), async (req, res) => {
84
92
  await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`, async (span) => {
85
93
  span.setAttribute('task.id', trigger.id);
86
94
  span.setAttribute('task.type', 'webhook');
87
95
  let executionCtx = ctx.contextProvider.create(req.body, ctxOptionsFn(res));
88
- const activation = await ctx.connectionProvider.getStaticActivation();
89
- if (activation) {
90
- executionCtx = executionCtx.withActivation(activation);
96
+ const staticActivation = res.locals.activation;
97
+ if (staticActivation) {
98
+ executionCtx = executionCtx.withActivation(staticActivation);
91
99
  }
92
100
  span.setAttribute('execution.id', executionCtx.executionId);
93
101
  try {
@@ -110,13 +118,24 @@ export const webhookCompiler = {
110
118
  });
111
119
  });
112
120
  // this endpoint will trigger the workflow for each activation given by the external user ID
113
- ctx.router.post(`/${trigger.id}/users/:userId`, async (req, res) => {
121
+ ctx.webhookRouter.post(`/${trigger.id}/users/:userId`, createUserIdDynamicWebhookMiddleware({
122
+ id: trigger.id,
123
+ connName: trigger.options.connection,
124
+ credentials: ctx.roundTripperFactory.credentials(),
125
+ cnxProvider: ctx.connectionProvider,
126
+ cfgReader: ctx.configReader,
127
+ log: ctx.log,
128
+ }), async (req, res) => {
114
129
  await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`, async (span) => {
115
130
  span.setAttribute('task.id', trigger.id);
116
131
  span.setAttribute('task.type', 'webhook');
117
132
  span.setAttribute('user.id', req.params.userId);
118
133
  const userId = req.params.userId;
119
- const activations = await ctx.connectionProvider.getUserActivations(userId);
134
+ const activation = res.locals.activation;
135
+ const activations = [activation];
136
+ // Right now we only support a user having one activation
137
+ // so this will need changing when we support multiple activations per user
138
+ // as will the middleware
120
139
  if (!activations || activations.length === 0) {
121
140
  res.status(404).json({
122
141
  status: 'error',
@@ -157,13 +176,20 @@ export const webhookCompiler = {
157
176
  });
158
177
  });
159
178
  // this endpoint will trigger the workflow only for the activation given by its ID
160
- ctx.router.post(`/${trigger.id}/activations/:activationId`, async (req, res) => {
179
+ ctx.webhookRouter.post(`/${trigger.id}/activations/:activationId`, createActIdDynamicWebhookMiddleware({
180
+ id: trigger.id,
181
+ connName: trigger.options.connection,
182
+ credentials: ctx.roundTripperFactory.credentials(),
183
+ cnxProvider: ctx.connectionProvider,
184
+ cfgReader: ctx.configReader,
185
+ log: ctx.log,
186
+ }), async (req, res) => {
161
187
  await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`, async (span) => {
162
188
  span.setAttribute('task.id', trigger.id);
163
189
  span.setAttribute('task.type', 'webhook');
164
190
  span.setAttribute('activation.id', req.params.activationId);
165
- const activationId = req.params.activationId;
166
- const activation = await ctx.connectionProvider.getActivation(activationId);
191
+ const activation = res.locals.activation;
192
+ const activationId = activation.id || req.params.activationId;
167
193
  if (!activation) {
168
194
  // TODO report back actual errors
169
195
  res.status(404).json({
@@ -9,6 +9,7 @@ export declare class ConsoleLogger implements Logger {
9
9
  fields: Record<string, unknown>;
10
10
  constructor(level: LogLevel, fields?: Record<string, unknown>);
11
11
  debug(message: string, fields?: Record<string, unknown>): void;
12
+ warn(message: string, fields?: Record<string, unknown>): void;
12
13
  info(message: string, fields?: Record<string, unknown>): void;
13
14
  error(message: string, err?: Error, fields?: Record<string, unknown>): void;
14
15
  error(message: string, fields?: Record<string, unknown>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ConsoleLogger.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/logging/ConsoleLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,+CAA+C,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAoM/C;;GAEG;AACH,qBAAa,aAAc,YAAW,MAAM;IACxC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;IAEhB,KAAK,EAAE,QAAQ,CAAC;IAEhB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAEpB,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;IAOjE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAO9D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAO7D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAC3E,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAA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I;IAsB9D,KAAK,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,aAAa;IAOvD,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;CAGlC"}
@@ -155,6 +155,7 @@ log.setup({
155
155
  });
156
156
  const levelMap = {
157
157
  debug: log.getLevelByName('DEBUG'),
158
+ warn: log.getLevelByName('WARN'),
158
159
  info: log.getLevelByName('INFO'),
159
160
  error: log.getLevelByName('ERROR'),
160
161
  };
@@ -192,6 +193,12 @@ export class ConsoleLogger {
192
193
  ...fields,
193
194
  });
194
195
  }
196
+ warn(message, fields) {
197
+ this.log.warn(message, {
198
+ ...this.fields,
199
+ ...fields,
200
+ });
201
+ }
195
202
  info(message, fields) {
196
203
  this.log.info(message, {
197
204
  ...this.fields,
@@ -1,7 +1,8 @@
1
- export type LogLevel = 'debug' | 'info' | 'error';
1
+ export type LogLevel = 'debug' | 'warn' | 'info' | 'error';
2
2
  export interface Logger {
3
3
  level: LogLevel;
4
4
  debug(message: string, fields?: Record<string, unknown>): void;
5
+ warn(message: string, fields?: Record<string, unknown>): void;
5
6
  info(message: string, fields?: Record<string, unknown>): void;
6
7
  error(message: string, fields?: Record<string, unknown>): void;
7
8
  child(fields: {
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/logging/Logger.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,MAAM,WAAW,MAAM;IACnB,KAAK,EAAE,QAAQ,CAAC;IAEhB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE/D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE9D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE/D,KAAK,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IAEjD,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CACnC"}
1
+ {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/logging/Logger.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,MAAM;IACnB,KAAK,EAAE,QAAQ,CAAC;IAEhB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE/D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE9D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE9D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE/D,KAAK,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IAEjD,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CACnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versori/run",
3
- "version": "v0.2.8",
3
+ "version": "v0.2.10",
4
4
  "description": "Versori Run",
5
5
  "homepage": "https://github.com/versori/versori-run#readme",
6
6
  "repository": {
@@ -1,5 +1,5 @@
1
1
  import { Activation } from '../dsl/http/types.js';
2
- import { Credentials } from '../dsl/http/versori/contextcredentials.js';
2
+ import { CredentialsProvider } from '../dsl/http/versori/contextcredentials.js';
3
3
  import { KeyValue, KeyValueProvider, KeyValueScope } from '../kv/KeyValue.js';
4
4
  import { Logger } from '../observability/logging/Logger.js';
5
5
  export type OnSuccessFn = (ctx: Context<any>) => void;
@@ -20,7 +20,7 @@ export interface Context<D> {
20
20
  * @param scope
21
21
  */
22
22
  openKv(scope?: KeyValueScope): KeyValue;
23
- credentials(): Credentials;
23
+ credentials(): CredentialsProvider;
24
24
  }
25
25
  export declare class ContextImpl<D, Index = void> implements Context<D> {
26
26
  #private;
@@ -31,13 +31,13 @@ export declare class ContextImpl<D, Index = void> implements Context<D> {
31
31
  idx: Index;
32
32
  readonly kvp: KeyValueProvider;
33
33
  readonly options: ContextOptions;
34
- constructor(log: Logger, kvp: KeyValueProvider, creds: Credentials, executionId: string, startTime: Date, data: D, options?: ContextOptions);
34
+ constructor(log: Logger, kvp: KeyValueProvider, creds: CredentialsProvider, executionId: string, startTime: Date, data: D, options?: ContextOptions);
35
35
  get activation(): Activation | undefined;
36
36
  setIndex(idx: number): ContextImpl<D, number>;
37
37
  withActivation(activation: Activation): ContextImpl<D, Index>;
38
38
  withData<D2>(data: D2): ContextImpl<D2, Index>;
39
39
  openKv(scope?: KeyValueScope): KeyValue;
40
- credentials(): Credentials;
40
+ credentials(): CredentialsProvider;
41
41
  destroy(scope: KeyValueScope): Promise<void>;
42
42
  [Symbol.toPrimitive](): Record<string, unknown>;
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/src/context/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAA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AAW,CAAC,CAAC,EAAE,KAAK,CAAC;IAoB7D,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC;IAY9C,MAAM,CAAC,KAAK,GAAE,aAA2B,GAAG,QAAQ;IAepD,WAAW,IAAI,mBAAmB;IAQlC,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5C,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlD"}
@@ -1,7 +1,7 @@
1
1
  import { KeyValueProvider } from '../kv/KeyValue.js';
2
2
  import { Logger } from '../observability/logging/Logger.js';
3
3
  import { Context, ContextImpl, ContextOptions } from './Context.js';
4
- import { Credentials } from '../dsl/http/versori/contextcredentials.js';
4
+ import { CredentialsProvider } from '../dsl/http/versori/contextcredentials.js';
5
5
  export interface ContextProvider {
6
6
  create<D>(data: D, options?: ContextOptions): ContextImpl<D, void>;
7
7
  destroy(ctx: Context<any>): Promise<void>;
@@ -9,8 +9,8 @@ export interface ContextProvider {
9
9
  export declare class ContextProviderImpl implements ContextProvider {
10
10
  log: Logger;
11
11
  kvp: KeyValueProvider;
12
- creds: Credentials;
13
- constructor(log: Logger, kvp: KeyValueProvider, creds: Credentials);
12
+ creds: CredentialsProvider;
13
+ constructor(log: Logger, kvp: KeyValueProvider, creds: CredentialsProvider);
14
14
  create<D>(data: D, options?: ContextOptions): ContextImpl<D>;
15
15
  destroy(ctx: Context<any>): Promise<void>;
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../../../src/src/context/ContextProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,E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AG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,qBAAa,mBAAoB,YAAW,eAAe;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,gBAAgB,CAAC;IACtB,KAAK,EAAE,mBAAmB,CAAC;gBAEf,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,mBAAmB;IAM1E,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,WAAW,CAAC,CAAC,CAAC;IAehE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAM5C"}
@@ -1,5 +1,5 @@
1
1
  import { DynamicFetcher, RoundTripperFactory } from './types.js';
2
- import { Credentials } from './versori/contextcredentials.js';
2
+ import { CredentialsProvider } from './versori/contextcredentials.js';
3
3
  /**
4
4
  * A factory class for creating a default round tripper.
5
5
  * This class is used to provide a default implementation for initializing
@@ -18,8 +18,8 @@ export declare class DefaultRoundTripperFactory implements RoundTripperFactory {
18
18
  * @param fn - The fetch function to be used. Defaults to the global fetch function.
19
19
  * @returns A promise that resolves to the fetch function.
20
20
  */
21
- create(connName: string): Promise<typeof fetch>;
22
- createDynamic(templateName: string): Promise<DynamicFetcher>;
23
- credentials(): Credentials;
21
+ create(_connName: string): Promise<typeof fetch>;
22
+ createDynamic(_templateName: string): Promise<DynamicFetcher>;
23
+ credentials(): CredentialsProvider;
24
24
  }
25
25
  //# sourceMappingURL=default.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAClE;;OAEG;;IAIH;;;;;;;OAOG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,KAAK,CAAC;IAI/C,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMlE,WAAW,IAAI,WAAW;CAU7B"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAClE;;OAEG;;IAIH;;;;;;;OAOG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,KAAK,CAAC;IAIhD,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMnE,WAAW,IAAI,mBAAmB;CAUrC"}
@@ -20,11 +20,11 @@ class DefaultRoundTripperFactory {
20
20
  * @param fn - The fetch function to be used. Defaults to the global fetch function.
21
21
  * @returns A promise that resolves to the fetch function.
22
22
  */
23
- async create(connName) {
23
+ async create(_connName) {
24
24
  return globalThis.fetch;
25
25
  }
26
- async createDynamic(templateName) {
27
- return async (activation, input, init) => {
26
+ async createDynamic(_templateName) {
27
+ return async (_activation, input, init) => {
28
28
  return globalThis.fetch(input, init);
29
29
  };
30
30
  }
@@ -1,11 +1,16 @@
1
- import { Credentials } from './versori/contextcredentials.js';
1
+ import { CredentialsProvider } from './versori/contextcredentials.js';
2
2
  export type DynamicFetcher = (activation: Activation, input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
3
3
  export interface RoundTripperFactory {
4
4
  create(connName: string): Promise<typeof fetch | undefined>;
5
5
  createDynamic(templateName: string): Promise<DynamicFetcher | undefined>;
6
- credentials(): Credentials;
6
+ credentials(): CredentialsProvider;
7
7
  }
8
8
  export declare function wrapDynamicFetcher(fetcher: DynamicFetcher, activation: Activation): typeof fetch;
9
+ export interface ConfigReader {
10
+ getCnxMapping(name: string): CnxMap | undefined;
11
+ getConnectionID(connName: string): string;
12
+ getTemplateID(templateName: string): string;
13
+ }
9
14
  export interface ConnectionProvider {
10
15
  getStaticConnection(cnxId: string): Promise<Connection | undefined>;
11
16
  getUserActivations(userId: string): Promise<Activation[]>;
@@ -105,6 +110,7 @@ export type AuthSchemeConfigHMAC = AuthSchemeConfigBase & {
105
110
  in: 'query' | 'header' | 'cookie';
106
111
  algorithm: 'sha1' | 'sha256' | 'sha512';
107
112
  digestInputs: DigestInput[];
113
+ encoding: 'hex' | 'base64' | 'base64url';
108
114
  };
109
115
  type ParameterConfig = {
110
116
  parameterName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEzH,MAAM,WAAW,mBAAmB;IAChC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,KAAK,GAAG,SAAS,CAAC,CAAC;IAC5D,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IACzE,WAAW,IAAI,WAAW,CAAC;CAC9B;AAGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,KAAK,CAIhG;AAED,MAAM,WAAW,kBAAkB;IAC/B,mBAAmB,CAAC,KAAK,EAAE,MAAM,GA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AAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC"}
@@ -1,4 +1,5 @@
1
- import { VersoriSDKConfig } from '../types.js';
1
+ import { Logger } from '../../../observability/mod.js';
2
+ import { CnxMap, ConfigReader, VersoriSDKConfig } from '../types.js';
2
3
  /**
3
4
  * Loads the Versori SDK configuration from a JSON file.
4
5
  *
@@ -9,4 +10,12 @@ import { VersoriSDKConfig } from '../types.js';
9
10
  * @returns {VersoriSDKConfig} The parsed configuration object.
10
11
  */
11
12
  export declare function LoadConfigFromFile(): VersoriSDKConfig;
13
+ export declare class VersoriConfigReader implements ConfigReader {
14
+ private versoriCfg;
15
+ constructor(cfg: VersoriSDKConfig);
16
+ static fromEnv(log: Logger): VersoriConfigReader;
17
+ getCnxMapping(name: string): CnxMap | undefined;
18
+ getConnectionID(connName: string): string;
19
+ getTemplateID(templateName: string): string;
20
+ }
12
21
  //# sourceMappingURL=configloader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAUrD"}
1
+ {"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIrE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAUrD;AAED,qBAAa,mBAAoB,YAAW,YAAY;IACpD,OAAO,CAAC,UAAU,CAAmB;gBAEzB,GAAG,EAAE,gBAAgB;IAIjC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB;IAShD,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI/C,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAczC,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;CAW9C"}