@versori/run 0.5.0 → 0.5.1

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 (217) hide show
  1. package/esm/mod.d.ts +1 -1
  2. package/esm/mod.d.ts.map +1 -1
  3. package/esm/mod.js +1 -1
  4. package/esm/src/connection/VanillaConnectionFactory.d.ts +16 -0
  5. package/esm/src/connection/VanillaConnectionFactory.d.ts.map +1 -0
  6. package/esm/src/connection/VanillaConnectionFactory.js +35 -0
  7. package/esm/src/context/ActivationImpl.d.ts +2 -1
  8. package/esm/src/context/ActivationImpl.d.ts.map +1 -1
  9. package/esm/src/context/Context.d.ts +2 -1
  10. package/esm/src/context/Context.d.ts.map +1 -1
  11. package/esm/src/context/ContextProvider.d.ts +8 -8
  12. package/esm/src/context/ContextProvider.d.ts.map +1 -1
  13. package/esm/src/context/ContextProvider.js +1 -1
  14. package/esm/src/context/VanillaContext.d.ts +63 -0
  15. package/esm/src/context/VanillaContext.d.ts.map +1 -0
  16. package/esm/src/context/VanillaContext.js +313 -0
  17. package/esm/src/context/WorkflowClient.d.ts +2 -2
  18. package/esm/src/context/WorkflowClient.d.ts.map +1 -1
  19. package/esm/src/dsl/http/mod.d.ts +1 -1
  20. package/esm/src/dsl/http/mod.d.ts.map +1 -1
  21. package/esm/src/dsl/http/types.d.ts +20 -134
  22. package/esm/src/dsl/http/types.d.ts.map +1 -1
  23. package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
  24. package/esm/src/dsl/http/versori/configloader.js +3 -0
  25. package/esm/src/dsl/http/versori/webhookmiddleware.d.ts +1 -1
  26. package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
  27. package/esm/src/dsl/tasks/HttpTask.d.ts +4 -4
  28. package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
  29. package/esm/src/dsl/triggers/ScheduleTrigger.d.ts +2 -2
  30. package/esm/src/dsl/triggers/ScheduleTrigger.d.ts.map +1 -1
  31. package/esm/src/interpreter/durable/DurableInterpreter.d.ts +1 -0
  32. package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
  33. package/esm/src/interpreter/durable/DurableInterpreter.js +24 -7
  34. package/esm/src/interpreter/durable/Queue.d.ts +1 -1
  35. package/esm/src/interpreter/durable/Queue.js +1 -1
  36. package/esm/src/interpreter/durable/compilers/durableworkflow.d.ts.map +1 -1
  37. package/esm/src/interpreter/durable/compilers/durableworkflow.js +2 -1
  38. package/esm/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
  39. package/esm/src/interpreter/durable/compilers/fn.js +7 -4
  40. package/esm/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
  41. package/esm/src/interpreter/durable/compilers/webhook.js +7 -6
  42. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +3 -2
  43. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  44. package/esm/src/interpreter/memory/MemoryInterpreter.js +24 -7
  45. package/esm/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
  46. package/esm/src/interpreter/memory/compilers/fn.js +7 -4
  47. package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  48. package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  49. package/esm/src/interpreter/memory/compilers/webhook.js +7 -6
  50. package/esm/src/interpreter/mod.d.ts +1 -0
  51. package/esm/src/interpreter/mod.d.ts.map +1 -1
  52. package/esm/src/interpreter/mod.js +1 -0
  53. package/esm/src/interpreter/vanilla/ExecutionError.d.ts +25 -0
  54. package/esm/src/interpreter/vanilla/ExecutionError.d.ts.map +1 -0
  55. package/esm/src/interpreter/vanilla/ExecutionError.js +46 -0
  56. package/esm/src/interpreter/vanilla/ObservableCompiler.d.ts +38 -0
  57. package/esm/src/interpreter/vanilla/ObservableCompiler.d.ts.map +1 -0
  58. package/esm/src/interpreter/vanilla/ObservableCompiler.js +95 -0
  59. package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts +96 -0
  60. package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -0
  61. package/esm/src/interpreter/vanilla/VanillaInterpreter.js +435 -0
  62. package/esm/src/interpreter/vanilla/compilers/background.d.ts +4 -0
  63. package/esm/src/interpreter/vanilla/compilers/background.d.ts.map +1 -0
  64. package/esm/src/interpreter/vanilla/compilers/background.js +34 -0
  65. package/esm/src/interpreter/vanilla/compilers/catch.d.ts +4 -0
  66. package/esm/src/interpreter/vanilla/compilers/catch.d.ts.map +1 -0
  67. package/esm/src/interpreter/vanilla/compilers/catch.js +75 -0
  68. package/esm/src/interpreter/vanilla/compilers/chain.d.ts +3 -0
  69. package/esm/src/interpreter/vanilla/compilers/chain.d.ts.map +1 -0
  70. package/esm/src/interpreter/vanilla/compilers/chain.js +21 -0
  71. package/esm/src/interpreter/vanilla/compilers/durableworkflow.d.ts +8 -0
  72. package/esm/src/interpreter/vanilla/compilers/durableworkflow.d.ts.map +1 -0
  73. package/esm/src/interpreter/vanilla/compilers/durableworkflow.js +91 -0
  74. package/esm/src/interpreter/vanilla/compilers/fn.d.ts +4 -0
  75. package/esm/src/interpreter/vanilla/compilers/fn.d.ts.map +1 -0
  76. package/esm/src/interpreter/vanilla/compilers/fn.js +37 -0
  77. package/esm/src/interpreter/vanilla/compilers/http.d.ts +4 -0
  78. package/esm/src/interpreter/vanilla/compilers/http.d.ts.map +1 -0
  79. package/esm/src/interpreter/vanilla/compilers/http.js +54 -0
  80. package/esm/src/interpreter/vanilla/compilers/mod.d.ts +2 -0
  81. package/esm/src/interpreter/vanilla/compilers/mod.d.ts.map +1 -0
  82. package/esm/src/interpreter/vanilla/compilers/mod.js +13 -0
  83. package/esm/src/interpreter/vanilla/compilers/parallel.d.ts +4 -0
  84. package/esm/src/interpreter/vanilla/compilers/parallel.d.ts.map +1 -0
  85. package/esm/src/interpreter/vanilla/compilers/parallel.js +31 -0
  86. package/esm/src/interpreter/vanilla/compilers/schedule.d.ts +4 -0
  87. package/esm/src/interpreter/vanilla/compilers/schedule.d.ts.map +1 -0
  88. package/esm/src/interpreter/vanilla/compilers/schedule.js +76 -0
  89. package/esm/src/interpreter/vanilla/compilers/serial.d.ts +4 -0
  90. package/esm/src/interpreter/vanilla/compilers/serial.d.ts.map +1 -0
  91. package/esm/src/interpreter/vanilla/compilers/serial.js +28 -0
  92. package/esm/src/interpreter/vanilla/compilers/types.d.ts +15 -0
  93. package/esm/src/interpreter/vanilla/compilers/types.d.ts.map +1 -0
  94. package/esm/src/interpreter/vanilla/compilers/types.js +13 -0
  95. package/esm/src/interpreter/vanilla/compilers/unpack.d.ts +4 -0
  96. package/esm/src/interpreter/vanilla/compilers/unpack.d.ts.map +1 -0
  97. package/esm/src/interpreter/vanilla/compilers/unpack.js +34 -0
  98. package/esm/src/interpreter/vanilla/compilers/webhook.d.ts +4 -0
  99. package/esm/src/interpreter/vanilla/compilers/webhook.d.ts.map +1 -0
  100. package/esm/src/interpreter/vanilla/compilers/webhook.js +261 -0
  101. package/esm/src/interpreter/vanilla/mod.d.ts +3 -0
  102. package/esm/src/interpreter/vanilla/mod.d.ts.map +1 -0
  103. package/esm/src/interpreter/vanilla/mod.js +14 -0
  104. package/esm/src/issues/Issues.d.ts.map +1 -1
  105. package/esm/src/observability/logging/ConsoleLogger.d.ts +1 -1
  106. package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
  107. package/esm/src/observability/logging/ConsoleLogger.js +11 -1
  108. package/esm/src/services/platform/generated/core/pathSerializer.gen.d.ts +2 -2
  109. package/package.json +1 -1
  110. package/script/mod.d.ts +1 -1
  111. package/script/mod.d.ts.map +1 -1
  112. package/script/mod.js +2 -1
  113. package/script/src/connection/VanillaConnectionFactory.d.ts +16 -0
  114. package/script/src/connection/VanillaConnectionFactory.d.ts.map +1 -0
  115. package/script/src/connection/VanillaConnectionFactory.js +40 -0
  116. package/script/src/context/ActivationImpl.d.ts +2 -1
  117. package/script/src/context/ActivationImpl.d.ts.map +1 -1
  118. package/script/src/context/Context.d.ts +2 -1
  119. package/script/src/context/Context.d.ts.map +1 -1
  120. package/script/src/context/ContextProvider.d.ts +8 -8
  121. package/script/src/context/ContextProvider.d.ts.map +1 -1
  122. package/script/src/context/ContextProvider.js +1 -1
  123. package/script/src/context/VanillaContext.d.ts +63 -0
  124. package/script/src/context/VanillaContext.d.ts.map +1 -0
  125. package/script/src/context/VanillaContext.js +319 -0
  126. package/script/src/context/WorkflowClient.d.ts +2 -2
  127. package/script/src/context/WorkflowClient.d.ts.map +1 -1
  128. package/script/src/dsl/http/mod.d.ts +1 -1
  129. package/script/src/dsl/http/mod.d.ts.map +1 -1
  130. package/script/src/dsl/http/types.d.ts +20 -134
  131. package/script/src/dsl/http/types.d.ts.map +1 -1
  132. package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
  133. package/script/src/dsl/http/versori/configloader.js +3 -0
  134. package/script/src/dsl/http/versori/webhookmiddleware.d.ts +1 -1
  135. package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
  136. package/script/src/dsl/tasks/HttpTask.d.ts +4 -4
  137. package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
  138. package/script/src/dsl/triggers/ScheduleTrigger.d.ts +2 -2
  139. package/script/src/dsl/triggers/ScheduleTrigger.d.ts.map +1 -1
  140. package/script/src/interpreter/durable/DurableInterpreter.d.ts +1 -0
  141. package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
  142. package/script/src/interpreter/durable/DurableInterpreter.js +24 -7
  143. package/script/src/interpreter/durable/Queue.d.ts +1 -1
  144. package/script/src/interpreter/durable/Queue.js +1 -1
  145. package/script/src/interpreter/durable/compilers/durableworkflow.d.ts.map +1 -1
  146. package/script/src/interpreter/durable/compilers/durableworkflow.js +2 -1
  147. package/script/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
  148. package/script/src/interpreter/durable/compilers/fn.js +7 -4
  149. package/script/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
  150. package/script/src/interpreter/durable/compilers/webhook.js +7 -6
  151. package/script/src/interpreter/memory/MemoryInterpreter.d.ts +3 -2
  152. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  153. package/script/src/interpreter/memory/MemoryInterpreter.js +24 -7
  154. package/script/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
  155. package/script/src/interpreter/memory/compilers/fn.js +7 -4
  156. package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  157. package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  158. package/script/src/interpreter/memory/compilers/webhook.js +7 -6
  159. package/script/src/interpreter/mod.d.ts +1 -0
  160. package/script/src/interpreter/mod.d.ts.map +1 -1
  161. package/script/src/interpreter/mod.js +2 -1
  162. package/script/src/interpreter/vanilla/ExecutionError.d.ts +25 -0
  163. package/script/src/interpreter/vanilla/ExecutionError.d.ts.map +1 -0
  164. package/script/src/interpreter/vanilla/ExecutionError.js +50 -0
  165. package/script/src/interpreter/vanilla/ObservableCompiler.d.ts +38 -0
  166. package/script/src/interpreter/vanilla/ObservableCompiler.d.ts.map +1 -0
  167. package/script/src/interpreter/vanilla/ObservableCompiler.js +99 -0
  168. package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts +96 -0
  169. package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -0
  170. package/script/src/interpreter/vanilla/VanillaInterpreter.js +442 -0
  171. package/script/src/interpreter/vanilla/compilers/background.d.ts +4 -0
  172. package/script/src/interpreter/vanilla/compilers/background.d.ts.map +1 -0
  173. package/script/src/interpreter/vanilla/compilers/background.js +37 -0
  174. package/script/src/interpreter/vanilla/compilers/catch.d.ts +4 -0
  175. package/script/src/interpreter/vanilla/compilers/catch.d.ts.map +1 -0
  176. package/script/src/interpreter/vanilla/compilers/catch.js +78 -0
  177. package/script/src/interpreter/vanilla/compilers/chain.d.ts +3 -0
  178. package/script/src/interpreter/vanilla/compilers/chain.d.ts.map +1 -0
  179. package/script/src/interpreter/vanilla/compilers/chain.js +24 -0
  180. package/script/src/interpreter/vanilla/compilers/durableworkflow.d.ts +8 -0
  181. package/script/src/interpreter/vanilla/compilers/durableworkflow.d.ts.map +1 -0
  182. package/script/src/interpreter/vanilla/compilers/durableworkflow.js +95 -0
  183. package/script/src/interpreter/vanilla/compilers/fn.d.ts +4 -0
  184. package/script/src/interpreter/vanilla/compilers/fn.d.ts.map +1 -0
  185. package/script/src/interpreter/vanilla/compilers/fn.js +40 -0
  186. package/script/src/interpreter/vanilla/compilers/http.d.ts +4 -0
  187. package/script/src/interpreter/vanilla/compilers/http.d.ts.map +1 -0
  188. package/script/src/interpreter/vanilla/compilers/http.js +57 -0
  189. package/script/src/interpreter/vanilla/compilers/mod.d.ts +2 -0
  190. package/script/src/interpreter/vanilla/compilers/mod.d.ts.map +1 -0
  191. package/script/src/interpreter/vanilla/compilers/mod.js +14 -0
  192. package/script/src/interpreter/vanilla/compilers/parallel.d.ts +4 -0
  193. package/script/src/interpreter/vanilla/compilers/parallel.d.ts.map +1 -0
  194. package/script/src/interpreter/vanilla/compilers/parallel.js +34 -0
  195. package/script/src/interpreter/vanilla/compilers/schedule.d.ts +4 -0
  196. package/script/src/interpreter/vanilla/compilers/schedule.d.ts.map +1 -0
  197. package/script/src/interpreter/vanilla/compilers/schedule.js +79 -0
  198. package/script/src/interpreter/vanilla/compilers/serial.d.ts +4 -0
  199. package/script/src/interpreter/vanilla/compilers/serial.d.ts.map +1 -0
  200. package/script/src/interpreter/vanilla/compilers/serial.js +31 -0
  201. package/script/src/interpreter/vanilla/compilers/types.d.ts +15 -0
  202. package/script/src/interpreter/vanilla/compilers/types.d.ts.map +1 -0
  203. package/script/src/interpreter/vanilla/compilers/types.js +14 -0
  204. package/script/src/interpreter/vanilla/compilers/unpack.d.ts +4 -0
  205. package/script/src/interpreter/vanilla/compilers/unpack.d.ts.map +1 -0
  206. package/script/src/interpreter/vanilla/compilers/unpack.js +37 -0
  207. package/script/src/interpreter/vanilla/compilers/webhook.d.ts +4 -0
  208. package/script/src/interpreter/vanilla/compilers/webhook.d.ts.map +1 -0
  209. package/script/src/interpreter/vanilla/compilers/webhook.js +267 -0
  210. package/script/src/interpreter/vanilla/mod.d.ts +3 -0
  211. package/script/src/interpreter/vanilla/mod.d.ts.map +1 -0
  212. package/script/src/interpreter/vanilla/mod.js +30 -0
  213. package/script/src/issues/Issues.d.ts.map +1 -1
  214. package/script/src/observability/logging/ConsoleLogger.d.ts +1 -1
  215. package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
  216. package/script/src/observability/logging/ConsoleLogger.js +11 -1
  217. package/script/src/services/platform/generated/core/pathSerializer.gen.d.ts +2 -2
@@ -0,0 +1,38 @@
1
+ import { Tracer } from '@opentelemetry/api';
2
+ import { Activation } from '../../services/platform/mod.js';
3
+ import { Router } from 'express';
4
+ import { Observable, OperatorFunction } from 'rxjs';
5
+ import { ConnectionFactory } from '../../connection/types.js';
6
+ import { ContextProvider } from '../../context/ContextProvider.js';
7
+ import { VanillaContext } from '../../context/VanillaContext.js';
8
+ import { ConfigReader } from '../../dsl/http/types.js';
9
+ import { Task } from '../../dsl/Task.js';
10
+ import { Trigger } from '../../dsl/Trigger.js';
11
+ import { Logger } from '../../observability/logging/Logger.js';
12
+ import { QueueAPI } from '../durable/Queue.js';
13
+ import { ContextOperatorFunction, TaskCompiler, TriggerCompiler } from './compilers/types.js';
14
+ export type VanillaCompilerContext = {
15
+ compiler: ObservableCompiler;
16
+ log: Logger;
17
+ tracer: Tracer;
18
+ contextProvider: ContextProvider;
19
+ cnxFactory: ConnectionFactory;
20
+ queueProvider: QueueAPI;
21
+ webhookRouter: Router;
22
+ cronRouter: Router;
23
+ configReader: ConfigReader;
24
+ cronRegistry: Map<string, string>;
25
+ organisationId: string;
26
+ };
27
+ export declare const VanillaActivation: Activation;
28
+ export type CompilerFunc<In = any, Out = any, T extends Task<In, Out> = Task<In, Out>> = (ctx: VanillaCompilerContext, task: T) => OperatorFunction<In, Out>;
29
+ export declare class ObservableCompiler {
30
+ private taskCompilers;
31
+ private triggerCompilers;
32
+ constructor();
33
+ compileTask<In = any, Out = any, Index = void>(ctx: VanillaCompilerContext, task: Task<In, Out>): ContextOperatorFunction<In, Out, Index>;
34
+ compileTrigger<Out = any, T extends Trigger<Out> = Trigger<Out>>(ctx: VanillaCompilerContext, trigger: T, signal: AbortSignal): Observable<VanillaContext<Out, void>>;
35
+ registerTask<In, Out, T extends Task<In, Out>>(compiler: TaskCompiler<In, Out, T>): void;
36
+ registerTrigger<Out, T extends Trigger<Out>>(compiler: TriggerCompiler<Out, T>): void;
37
+ }
38
+ //# sourceMappingURL=ObservableCompiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObservableCompiler.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/vanilla/ObservableCompiler.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAY,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAe,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAU/C,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI9F,MAAM,MAAM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,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAexC,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAKjF,eAAe,CAAC,GAAG,EAAE,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;CAIjF"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2025 Versori Group Inc
4
+ *
5
+ * Use of this software is governed by the Business Source License 1.1
6
+ * included in the LICENSE file at the root of this repository.
7
+ *
8
+ * Change Date: 2029-01-01
9
+ * Change License: Apache License, Version 2.0
10
+ *
11
+ * As of the Change Date, in accordance with the Business Source License,
12
+ * use of this software will be governed by the Apache License, Version 2.0.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ObservableCompiler = exports.VanillaActivation = void 0;
16
+ const Task_js_1 = require("../../dsl/Task.js");
17
+ const Trigger_js_1 = require("../../dsl/Trigger.js");
18
+ const background_js_1 = require("./compilers/background.js");
19
+ const catch_js_1 = require("./compilers/catch.js");
20
+ const chain_js_1 = require("./compilers/chain.js");
21
+ const durableworkflow_js_1 = require("./compilers/durableworkflow.js");
22
+ const fn_js_1 = require("./compilers/fn.js");
23
+ const http_js_1 = require("./compilers/http.js");
24
+ const parallel_js_1 = require("./compilers/parallel.js");
25
+ const schedule_js_1 = require("./compilers/schedule.js");
26
+ const serial_js_1 = require("./compilers/serial.js");
27
+ const unpack_js_1 = require("./compilers/unpack.js");
28
+ const webhook_js_1 = require("./compilers/webhook.js");
29
+ exports.VanillaActivation = {
30
+ id: 'vanilla-webhook-activation',
31
+ user: {
32
+ id: 'vanilla-user-id',
33
+ externalId: 'vanilla-user-external-id',
34
+ displayName: 'Vanilla User',
35
+ organisationId: 'vanilla-org-id',
36
+ createdAt: new Date().toISOString(),
37
+ updatedAt: new Date().toISOString(),
38
+ },
39
+ connections: [],
40
+ dynamicVariables: {},
41
+ environment: undefined,
42
+ };
43
+ class ObservableCompiler {
44
+ constructor() {
45
+ Object.defineProperty(this, "taskCompilers", {
46
+ enumerable: true,
47
+ configurable: true,
48
+ writable: true,
49
+ value: new Map()
50
+ });
51
+ Object.defineProperty(this, "triggerCompilers", {
52
+ enumerable: true,
53
+ configurable: true,
54
+ writable: true,
55
+ value: new Map()
56
+ });
57
+ // Register all available compilers
58
+ this.registerTask(parallel_js_1.parallelCompiler);
59
+ this.registerTask(serial_js_1.serialCompiler);
60
+ this.registerTask(catch_js_1.catchCompiler);
61
+ this.registerTask(chain_js_1.chainCompiler);
62
+ this.registerTask(fn_js_1.fnCompiler);
63
+ this.registerTask(background_js_1.backgroundCompiler);
64
+ this.registerTask(unpack_js_1.unpackCompiler);
65
+ this.registerTask(http_js_1.httpCompiler);
66
+ this.registerTrigger(schedule_js_1.scheduleCompiler);
67
+ this.registerTrigger(webhook_js_1.webhookCompiler);
68
+ this.registerTrigger(durableworkflow_js_1.durableWorkflowCompiler);
69
+ }
70
+ compileTask(ctx, task) {
71
+ const compiler = this.taskCompilers.get(task[Task_js_1.TaskType]);
72
+ if (!compiler) {
73
+ throw new Error(`No compiler registered for task type: ${task[Task_js_1.TaskType]}`);
74
+ }
75
+ if (!(task instanceof compiler.ctor)) {
76
+ throw new Error(`Task type mismatch: expected ${compiler.ctor.name}, got ${task.constructor.name}`);
77
+ }
78
+ return compiler.compile(ctx, task);
79
+ }
80
+ compileTrigger(ctx, trigger, signal) {
81
+ const compiler = this.triggerCompilers.get(trigger[Trigger_js_1.TriggerType]);
82
+ if (!compiler) {
83
+ throw new Error(`No compiler registered for trigger type: ${trigger[Trigger_js_1.TriggerType]}`);
84
+ }
85
+ if (!(trigger instanceof compiler.ctor)) {
86
+ throw new Error(`Trigger type mismatch: expected ${compiler.ctor.name}, got ${trigger.constructor.name}`);
87
+ }
88
+ return compiler.compile(ctx, trigger, signal);
89
+ }
90
+ registerTask(compiler) {
91
+ const task = new compiler.ctor();
92
+ this.taskCompilers.set(task[Task_js_1.TaskType], compiler);
93
+ }
94
+ registerTrigger(compiler) {
95
+ const trigger = new compiler.ctor();
96
+ this.triggerCompilers.set(trigger[Trigger_js_1.TriggerType], compiler);
97
+ }
98
+ }
99
+ exports.ObservableCompiler = ObservableCompiler;
@@ -0,0 +1,96 @@
1
+ import { Tracer } from '@opentelemetry/api';
2
+ import { NodeSDK } from '@opentelemetry/sdk-node';
3
+ import { Router } from 'express';
4
+ import { Observable, Subscription } from 'rxjs';
5
+ import { DefaultConnectionFactory } from '../../connection/VanillaConnectionFactory.js';
6
+ import { ContextProvider } from '../../context/ContextProvider.js';
7
+ import { VanillaContext, VanillaContextProvider } from '../../context/VanillaContext.js';
8
+ import { ConfigReader, CronProvider } from '../../dsl/http/types.js';
9
+ import { Workflow } from '../../dsl/Workflow.js';
10
+ import { Logger } from '../../observability/logging/Logger.js';
11
+ import { QueueAPI } from '../durable/Queue.js';
12
+ import { ContextOperatorFunction } from './compilers/types.js';
13
+ import { ObservableCompiler } from './ObservableCompiler.js';
14
+ /**
15
+ * VanillaInterpreterOptions
16
+ * configures the behavior of the {@link VanillaInterpreter}.
17
+ */
18
+ export type VanillaInterpreterOptions = {
19
+ /**
20
+ * Custom logger instance. Defaults to ConsoleLogger.
21
+ */
22
+ logger?: Logger;
23
+ /**
24
+ * Custom compiler for workflow execution. Advanced use only.
25
+ */
26
+ compiler?: ObservableCompiler;
27
+ /**
28
+ * Custom context provider. Advanced use only.
29
+ */
30
+ contextProvider?: VanillaContextProvider;
31
+ /**
32
+ * Abort signal to cancel workflow execution.
33
+ */
34
+ signal?: AbortSignal;
35
+ /**
36
+ * Skip loading Versori credentials. Useful for local development.
37
+ */
38
+ skipVersoriCredentials?: boolean;
39
+ };
40
+ type Registration = {
41
+ triggerName: string;
42
+ trigger$: Observable<VanillaContext<any, void>>;
43
+ task$: ContextOperatorFunction<any, any, any>;
44
+ localAbortController: AbortController;
45
+ sigintListener: () => void;
46
+ subscription?: Subscription;
47
+ };
48
+ /**
49
+ * VanillaInterpreter is an interpreter for executing Versori workflows with support for durable, queue-based workflow
50
+ * execution. It supports all trigger types including the {@link workflow} trigger which allows workflows to be started
51
+ * programmatically.
52
+ *
53
+ * Unlike {@link DurableInterpreter}, this interpreter is incapable of using connections. Therefore, all fetch requests will need
54
+ * to use fully qualified URLs and authentication must be handled manually within the workflow.
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * import { VanillaInterpreter, workflow, fn } from '@versori/run';
59
+ *
60
+ * const processJob = workflow('process-job', { maxAttempts: 3 })
61
+ * .then(fn('task', async (ctx) => {
62
+ * ctx.log.info('Processing job', { data: ctx.data });
63
+ * // ... long-running process
64
+ * }));
65
+ *
66
+ * const interpreter = new VanillaInterpreter();
67
+ * interpreter.register(processJob);
68
+ * await interpreter.start();
69
+ * ```
70
+ */
71
+ export declare class VanillaInterpreter {
72
+ private readonly log;
73
+ private readonly compiler;
74
+ private readonly contextProvider;
75
+ private readonly webhookRouter;
76
+ private readonly cronRouter;
77
+ private readonly cronRegistry;
78
+ private readonly cnxFetchFactory;
79
+ private readonly cronProvider;
80
+ private readonly tracer;
81
+ private readonly cfgReader;
82
+ private readonly queueProvider;
83
+ private readonly otelSDK?;
84
+ private registeredWorkflows;
85
+ private webhookServer?;
86
+ private cronServer?;
87
+ private shutdownServer?;
88
+ private isShuttingDown;
89
+ constructor(log: Logger, compiler: ObservableCompiler, contextProvider: ContextProvider, webhookRouter: Router, cronRouter: Router, cronRegistry: Map<string, string>, cnxFetchFactory: DefaultConnectionFactory, cronProvider: CronProvider, tracer: Tracer, cfgReader: ConfigReader, queueProvider: QueueAPI, otelSDK?: NodeSDK | undefined);
90
+ static newInstance(options?: VanillaInterpreterOptions): Promise<VanillaInterpreter>;
91
+ register<O>(workflow: Workflow<O>, options?: VanillaInterpreterOptions): Registration;
92
+ start(): Promise<void>;
93
+ stop(): Promise<void>;
94
+ }
95
+ export {};
96
+ //# sourceMappingURL=VanillaInterpreter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VanillaInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/vanilla/VanillaInterpreter.ts"],"names":[],"mappings":"AAaA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAarE,OAAO,EAAE,QAAQ,EAAgB,MAAM,uBAAuB,CAAC;AAM/D,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAa,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAA0B,MAAM,yBAAyB,CAAC;AAErF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC;IAEzC;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,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