@versori/run 0.5.0 → 0.5.2

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
package/esm/mod.d.ts CHANGED
@@ -63,6 +63,6 @@
63
63
  */
64
64
  import "./_dnt.polyfills.js";
65
65
  export * from './src/dsl/mod.js';
66
- export { durable, ExecutionError, MemoryInterpreter, type MemoryInterpreterOptions, } from './src/interpreter/mod.js';
66
+ export { durable, vanilla, ExecutionError, MemoryInterpreter, type MemoryInterpreterOptions, } from './src/interpreter/mod.js';
67
67
  export * from './src/context/mod.js';
68
68
  //# sourceMappingURL=mod.d.ts.map
package/esm/mod.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,OAAO,qBAAqB,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EACH,OAAO,EACP,cAAc,EACd,iBAAiB,EACjB,KAAK,wBAAwB,GAChC,MAAM,0BAA0B,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,OAAO,qBAAqB,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EACH,OAAO,EACP,OAAO,EACP,cAAc,EACd,iBAAiB,EACjB,KAAK,wBAAwB,GAChC,MAAM,0BAA0B,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
package/esm/mod.js CHANGED
@@ -75,5 +75,5 @@
75
75
  */
76
76
  import "./_dnt.polyfills.js";
77
77
  export * from './src/dsl/mod.js';
78
- export { durable, ExecutionError, MemoryInterpreter, } from './src/interpreter/mod.js';
78
+ export { durable, vanilla, ExecutionError, MemoryInterpreter, } from './src/interpreter/mod.js';
79
79
  export * from './src/context/mod.js';
@@ -0,0 +1,16 @@
1
+ import { RequestHandler } from 'express';
2
+ import { Context } from '../context/Context.js';
3
+ import { Connection } from '../services/platform/generated/types.gen.js';
4
+ import { ConnectionFactory, FetchLike, RuntimeConnectionFactory } from './types.js';
5
+ export declare class DefaultConnectionFactory implements ConnectionFactory {
6
+ constructor();
7
+ handler(_: Connection): Promise<RequestHandler>;
8
+ fetcher(_: Connection): Promise<FetchLike>;
9
+ }
10
+ export declare class VanillaFetchFactory implements RuntimeConnectionFactory {
11
+ constructor();
12
+ fetcher(_: Context<unknown>): Promise<FetchLike>;
13
+ baseUrl(_: Context<unknown>): Promise<string>;
14
+ handler(_: Context<unknown>): Promise<RequestHandler>;
15
+ }
16
+ //# sourceMappingURL=VanillaConnectionFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VanillaConnectionFactory.d.ts","sourceRoot":"","sources":["../../../src/src/connection/VanillaConnectionFactory.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEpF,qBAAa,wBAAyB,YAAW,iBAAiB;;IAG9D,OAAO,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IAI/C,OAAO,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;CAG7C;AAGD,qBAAa,mBAAoB,YAAW,wBAAwB;;IAGhE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;IAIhD,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7C,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;CAKxD"}
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright (c) 2025 Versori Group Inc
3
+ *
4
+ * Use of this software is governed by the Business Source License 1.1
5
+ * included in the LICENSE file at the root of this repository.
6
+ *
7
+ * Change Date: 2029-01-01
8
+ * Change License: Apache License, Version 2.0
9
+ *
10
+ * As of the Change Date, in accordance with the Business Source License,
11
+ * use of this software will be governed by the Apache License, Version 2.0.
12
+ */
13
+ export class DefaultConnectionFactory {
14
+ constructor() { }
15
+ handler(_) {
16
+ throw new Error('Method not implemented.');
17
+ }
18
+ fetcher(_) {
19
+ return Promise.resolve(globalThis.fetch);
20
+ }
21
+ }
22
+ export class VanillaFetchFactory {
23
+ constructor() { }
24
+ fetcher(_) {
25
+ return Promise.resolve(globalThis.fetch);
26
+ }
27
+ baseUrl(_) {
28
+ return Promise.resolve('');
29
+ }
30
+ handler(_) {
31
+ return Promise.resolve((_req, _res, next) => {
32
+ next();
33
+ });
34
+ }
35
+ }
@@ -1,6 +1,7 @@
1
+ import { ActivationInterface } from '../dsl/http/types.js';
1
2
  import { Logger } from '../observability/mod.js';
2
3
  import { Activation, Connection, DynamicVariables, EndUser, PlatformApi, ProjectEnvironment } from '../services/platform/mod.js';
3
- export declare class ActivationImpl implements Activation {
4
+ export declare class ActivationImpl implements ActivationInterface {
4
5
  private readonly activation;
5
6
  private readonly platformApi;
6
7
  private readonly organisationId;
@@ -1 +1 @@
1
- {"version":3,"file":"ActivationImpl.d.ts","sourceRoot":"","sources":["../../../src/src/context/ActivationImpl.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EACH,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,kBAAkB,EACrB,MAAM,6BAA6B,CAAC;AAErC,qBAAa,cAAe,YAAW,UAAU;IAEzC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAJH,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM;IAGhC,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,IAAI,WAAW,IAAI,kBAAkB,GAAG,SAAS,CAEhD;IAED,IAAI,WAAW,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,SAAS,CAE/C;IAED,IAAI,gBAAgB,IAAI,gBAAgB,GAAG,SAAS,CAEnD;IAED,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAQ/C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CA6BjE"}
1
+ {"version":3,"file":"ActivationImpl.d.ts","sourceRoot":"","sources":["../../../src/src/context/ActivationImpl.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EACH,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,kBAAkB,EACrB,MAAM,6BAA6B,CAAC;AAErC,qBAAa,cAAe,YAAW,mBAAmB;IAElD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAJH,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM;IAGhC,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,IAAI,WAAW,IAAI,kBAAkB,GAAG,SAAS,CAEhD;IAED,IAAI,WAAW,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,SAAS,CAE/C;IAED,IAAI,gBAAgB,IAAI,gBAAgB,GAAG,SAAS,CAEnD;IAED,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAQ/C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CA6BjE"}
@@ -1,4 +1,5 @@
1
1
  import type * as express from 'express';
2
+ import { ActivationInterface } from '../dsl/http/types.js';
2
3
  import { CredentialsProvider } from '../dsl/http/versori/contextcredentials.js';
3
4
  import { QueueAPI, Workflow } from '../interpreter/durable/Queue.js';
4
5
  import { Issue, IssueAPI } from '../issues/Issues.js';
@@ -45,7 +46,7 @@ export interface Context<D> {
45
46
  readonly executionId: string;
46
47
  readonly startTime: Date;
47
48
  readonly data: D;
48
- activation: ActivationImpl;
49
+ activation: ActivationInterface;
49
50
  workflow?: Workflow;
50
51
  /**
51
52
  * Opens a key value store for the given scope, defaulting to ':project:' if not provided.
@@ -1 +1 @@
1
- {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/src/context/Context.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAgB,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEpF,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IA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,CAAC,KAAK,GAAG,IAAI,CAAC;IAYpH,WAAW,IAAI,mBAAmB;IAUlC,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,24 +1,24 @@
1
+ import { Activation, PlatformApi } from '../services/platform/mod.js';
1
2
  import { CredentialsProvider } from '../dsl/http/versori/contextcredentials.js';
2
3
  import { QueueAPI } from '../interpreter/durable/Queue.js';
3
4
  import { IssueAPI } from '../issues/Issues.js';
4
5
  import { KeyValueProvider } from '../kv/KeyValue.js';
5
6
  import { Logger } from '../observability/logging/Logger.js';
6
7
  import { Context, ContextImpl, ContextOptions } from './Context.js';
7
- import { Activation, PlatformApi } from '../services/platform/mod.js';
8
8
  export interface ContextProvider {
9
- create<D>(activation: Activation, data: D, options?: ContextOptions): ContextImpl<D, void>;
10
- createWithExecutionId<D>(activation: Activation, data: D, executionId: string, options?: ContextOptions): ContextImpl<D, void>;
9
+ create<D>(activation: Activation, data: D, options?: ContextOptions): Context<D>;
10
+ createWithExecutionId<D>(activation: Activation, data: D, executionId: string, options?: ContextOptions): Context<D>;
11
11
  destroy(ctx: Context<any>): Promise<void>;
12
12
  }
13
13
  export declare class ContextProviderImpl implements ContextProvider {
14
14
  private readonly platformApi;
15
15
  private readonly organisationId;
16
16
  private readonly environmentId;
17
- log: Logger;
18
- kvp: KeyValueProvider;
19
- creds: CredentialsProvider;
20
- issues: IssueAPI;
21
- queue?: QueueAPI;
17
+ private log;
18
+ private kvp;
19
+ private creds;
20
+ private issues;
21
+ private queue?;
22
22
  constructor(log: Logger, kvp: KeyValueProvider, creds: CredentialsProvider, platformApi: PlatformApi, organisationId: string, environmentId: string, issues: IssueAPI, queue?: QueueAPI | undefined);
23
23
  createWithExecutionId<D>(activation: Activation, data: D, executionId: string, options?: ContextOptions): ContextImpl<D, void>;
24
24
  create<D>(activation: Activation, data: D, options?: ContextOptions): ContextImpl<D>;
@@ -1 +1 @@
1
- {"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../../../src/src/context/ContextProvider.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAGtE,MAAM,WAAW,eAAe;IAC5B,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3F,qBAAqB,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC/H,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,qBAAa,mBAAoB,YAAW,eAAe;IAWnD,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAZlC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,gBAAgB,CAAC;IACtB,KAAK,EAAE,mBAAmB,CA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AG,OAAO,CAAC,IAAI,CAAC;CAG1C"}
@@ -11,8 +11,8 @@
11
11
  * use of this software will be governed by the Apache License, Version 2.0.
12
12
  */
13
13
  import { ulid } from '../../deps/jsr.io/@std/ulid/1.0.0/mod.js';
14
- import { ContextImpl } from './Context.js';
15
14
  import { ActivationImpl } from './ActivationImpl.js';
15
+ import { ContextImpl } from './Context.js';
16
16
  export class ContextProviderImpl {
17
17
  constructor(log, kvp, creds, platformApi, organisationId, environmentId, issues, queue = undefined) {
18
18
  Object.defineProperty(this, "platformApi", {
@@ -0,0 +1,63 @@
1
+ import { Activation, Connection, DynamicVariables, EndUser, ProjectEnvironment } from '../services/platform/mod.js';
2
+ import type * as express from 'express';
3
+ import { ActivationInterface } from '../dsl/http/types.js';
4
+ import { QueueAPI, Workflow } from '../interpreter/durable/Queue.js';
5
+ import { Issue, IssueAPI } from '../issues/Issues.js';
6
+ import { CredentialsProvider, KeyValue, KeyValueProvider, KeyValueScope, Logger } from '../mod.js';
7
+ import { AsyncWorkflow } from './AsyncWorkflow.js';
8
+ import { Context, ContextOptions, CreateIssue } from './Context.js';
9
+ import { ContextProvider } from './ContextProvider.js';
10
+ import { WorkflowInterface, WorkflowOpts } from './WorkflowClient.js';
11
+ export declare class VanillaActivation implements ActivationInterface {
12
+ private readonly activation;
13
+ private readonly organisationId;
14
+ private readonly environmentId;
15
+ private readonly log;
16
+ constructor(activation: Activation, organisationId: string, environmentId: string, log: Logger);
17
+ get id(): string;
18
+ get user(): EndUser;
19
+ get environment(): ProjectEnvironment | undefined;
20
+ get connections(): Array<Connection> | undefined;
21
+ get dynamicVariables(): DynamicVariables | undefined;
22
+ getVariable<T = unknown>(name: string): T | undefined;
23
+ setVariable(_: string, __: unknown): Promise<void>;
24
+ }
25
+ export declare class VanillaContext<D, Index = void> implements Context<D> {
26
+ #private;
27
+ readonly log: Logger;
28
+ readonly executionId: string;
29
+ readonly startTime: Date;
30
+ readonly data: D;
31
+ idx: Index;
32
+ readonly kvp: KeyValueProvider;
33
+ readonly queue?: QueueAPI;
34
+ readonly options: ContextOptions;
35
+ constructor(log: Logger, kvp: KeyValueProvider, executionId: string, startTime: Date, data: D, activation: VanillaActivation, issues: IssueAPI, queue?: QueueAPI, options?: ContextOptions);
36
+ get activation(): ActivationInterface;
37
+ get workflow(): Workflow | undefined;
38
+ setIndex(idx: number): VanillaContext<D, number>;
39
+ withData<D2>(data: D2): VanillaContext<D2, Index>;
40
+ openKv(scope?: KeyValueScope): KeyValue;
41
+ request(): express.Request | undefined;
42
+ workflowClient(): WorkflowInterface;
43
+ start(group: string, opts: WorkflowOpts): Promise<AsyncWorkflow>;
44
+ createIssue(issue: CreateIssue, options?: {
45
+ deduplicate?: boolean;
46
+ }): Promise<Issue | null>;
47
+ credentials(): CredentialsProvider;
48
+ destroy(scope: KeyValueScope): Promise<void>;
49
+ [Symbol.toPrimitive](): Record<string, unknown>;
50
+ }
51
+ export declare class VanillaContextProvider implements ContextProvider {
52
+ private readonly organisationId;
53
+ private readonly environmentId;
54
+ log: Logger;
55
+ kvp: KeyValueProvider;
56
+ issues: IssueAPI;
57
+ queue?: QueueAPI;
58
+ constructor(log: Logger, kvp: KeyValueProvider, organisationId: string, environmentId: string, issues: IssueAPI, queue?: QueueAPI | undefined);
59
+ create<D>(activation: Activation, data: D, options?: ContextOptions): VanillaContext<D>;
60
+ createWithExecutionId<D>(activation: Activation, data: D, executionId: string, options?: ContextOptions): VanillaContext<D>;
61
+ destroy(_: Context<any>): Promise<void>;
62
+ }
63
+ //# sourceMappingURL=VanillaContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VanillaContext.d.ts","sourceRoot":"","sources":["../../../src/src/context/VanillaContext.ts"],"names":[],"mappings":"AAcA,OAAO,EACH,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,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,CAAA;KAAE,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAU3F,WAAW,IAAI,mBAAmB;IAIlC,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5C,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlD;AAED,qBAAa,sBAAuB,YAAW,eAAe;IAStD,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IATlC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,gBAAgB,CAAC;IACtB,MAAM,EAAE,QAAQ,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,CAAC;gBAGb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,gBAAgB,EACJ,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACtC,MAAM,EAAE,QAAQ,EAChB,KAAK,GAAE,QAAQ,GAAG,SAAqB;IAQ3C,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,cAAc,CAAC,CAAC,CAAC;IA6B3F,qBAAqB,CAAC,CAAC,EACnB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,CAAC,EACP,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,cAAmB,GAC7B,cAAc,CAAC,CAAC,CAAC;IA2BpB,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1C"}
@@ -0,0 +1,313 @@
1
+ /*
2
+ * Copyright (c) 2025 Versori Group Inc
3
+ *
4
+ * Use of this software is governed by the Business Source License 1.1
5
+ * included in the LICENSE file at the root of this repository.
6
+ *
7
+ * Change Date: 2029-01-01
8
+ * Change License: Apache License, Version 2.0
9
+ *
10
+ * As of the Change Date, in accordance with the Business Source License,
11
+ * use of this software will be governed by the Apache License, Version 2.0.
12
+ */
13
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14
+ if (kind === "m") throw new TypeError("Private method is not writable");
15
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
16
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
17
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
18
+ };
19
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
20
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
21
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
22
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
23
+ };
24
+ var _VanillaContext_activation, _VanillaContext_issues;
25
+ import { ulid } from '../../deps/jsr.io/@std/ulid/1.0.0/ulid.js';
26
+ import { AsyncWorkflow } from './AsyncWorkflow.js';
27
+ import { WorkflowImpl } from './WorkflowClient.js';
28
+ export class VanillaActivation {
29
+ constructor(activation, organisationId, environmentId, log) {
30
+ Object.defineProperty(this, "activation", {
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true,
34
+ value: activation
35
+ });
36
+ Object.defineProperty(this, "organisationId", {
37
+ enumerable: true,
38
+ configurable: true,
39
+ writable: true,
40
+ value: organisationId
41
+ });
42
+ Object.defineProperty(this, "environmentId", {
43
+ enumerable: true,
44
+ configurable: true,
45
+ writable: true,
46
+ value: environmentId
47
+ });
48
+ Object.defineProperty(this, "log", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: log
53
+ });
54
+ }
55
+ get id() {
56
+ return this.activation.id;
57
+ }
58
+ get user() {
59
+ return this.activation.user;
60
+ }
61
+ get environment() {
62
+ return this.activation.environment;
63
+ }
64
+ get connections() {
65
+ return this.activation.connections;
66
+ }
67
+ get dynamicVariables() {
68
+ return this.activation.dynamicVariables;
69
+ }
70
+ getVariable(name) {
71
+ if (!this.activation.dynamicVariables) {
72
+ return undefined;
73
+ }
74
+ return this.activation.dynamicVariables[name];
75
+ }
76
+ setVariable(_, __) {
77
+ return Promise.resolve();
78
+ }
79
+ }
80
+ export class VanillaContext {
81
+ constructor(log, kvp, executionId, startTime, data, activation, issues, queue, options = {}) {
82
+ Object.defineProperty(this, "log", {
83
+ enumerable: true,
84
+ configurable: true,
85
+ writable: true,
86
+ value: void 0
87
+ });
88
+ Object.defineProperty(this, "executionId", {
89
+ enumerable: true,
90
+ configurable: true,
91
+ writable: true,
92
+ value: void 0
93
+ });
94
+ Object.defineProperty(this, "startTime", {
95
+ enumerable: true,
96
+ configurable: true,
97
+ writable: true,
98
+ value: void 0
99
+ });
100
+ Object.defineProperty(this, "data", {
101
+ enumerable: true,
102
+ configurable: true,
103
+ writable: true,
104
+ value: void 0
105
+ });
106
+ _VanillaContext_activation.set(this, void 0);
107
+ Object.defineProperty(this, "idx", {
108
+ enumerable: true,
109
+ configurable: true,
110
+ writable: true,
111
+ value: void 0
112
+ });
113
+ Object.defineProperty(this, "kvp", {
114
+ enumerable: true,
115
+ configurable: true,
116
+ writable: true,
117
+ value: void 0
118
+ });
119
+ Object.defineProperty(this, "queue", {
120
+ enumerable: true,
121
+ configurable: true,
122
+ writable: true,
123
+ value: void 0
124
+ }); // Optional, can be used for durable workflows
125
+ _VanillaContext_issues.set(this, void 0);
126
+ Object.defineProperty(this, "options", {
127
+ enumerable: true,
128
+ configurable: true,
129
+ writable: true,
130
+ value: void 0
131
+ });
132
+ this.log = log;
133
+ this.executionId = executionId;
134
+ this.startTime = startTime;
135
+ this.data = data;
136
+ __classPrivateFieldSet(this, _VanillaContext_activation, activation, "f");
137
+ this.idx = void 0;
138
+ __classPrivateFieldSet(this, _VanillaContext_issues, issues, "f");
139
+ this.kvp = kvp;
140
+ this.options = options;
141
+ this.queue = queue;
142
+ // all methods on ContextImpl which are exposed via the Context interface need to be bound
143
+ // so that destructuring the context object doesn't break the binding of the methods to the
144
+ // correct instance.
145
+ this.openKv = this.openKv.bind(this);
146
+ this.credentials = this.credentials.bind(this);
147
+ this.start = this.start.bind(this);
148
+ this.request = this.request.bind(this);
149
+ this.createIssue = this.createIssue.bind(this);
150
+ this.destroy = this.destroy.bind(this);
151
+ this.workflowClient = this.workflowClient.bind(this);
152
+ }
153
+ get activation() {
154
+ return __classPrivateFieldGet(this, _VanillaContext_activation, "f");
155
+ }
156
+ get workflow() {
157
+ return this.options.workflow;
158
+ }
159
+ setIndex(idx) {
160
+ const next = new VanillaContext(this.log, this.kvp, this.executionId, this.startTime, this.data, __classPrivateFieldGet(this, _VanillaContext_activation, "f"), __classPrivateFieldGet(this, _VanillaContext_issues, "f"), this.queue, this.options);
161
+ next.idx = idx;
162
+ return next;
163
+ }
164
+ withData(data) {
165
+ return new VanillaContext(this.log, this.kvp, this.executionId, this.startTime, data, __classPrivateFieldGet(this, _VanillaContext_activation, "f"), __classPrivateFieldGet(this, _VanillaContext_issues, "f"), this.queue, this.options);
166
+ }
167
+ openKv(scope = ':project:') {
168
+ if (scope === ':execution:') {
169
+ return this.kvp.kv({
170
+ scope,
171
+ executionId: this.executionId,
172
+ activationId: this.activation?.id,
173
+ });
174
+ }
175
+ return this.kvp.kv({
176
+ scope,
177
+ activationId: this.activation?.id,
178
+ });
179
+ }
180
+ request() {
181
+ return this.options.request;
182
+ }
183
+ workflowClient() {
184
+ if (!this.queue) {
185
+ throw new Error('Queue is not available for this context, cannot start workflow');
186
+ }
187
+ return new WorkflowImpl(this.queue, this.executionId, this.activation);
188
+ }
189
+ async start(group, opts) {
190
+ // this makes a post request to the endpoint sending a message and schedule the workflow to run
191
+ if (!this.queue) {
192
+ throw new Error('Queue is not available for this context, cannot start workflow');
193
+ }
194
+ let payload;
195
+ if (opts.data) {
196
+ payload = btoa(JSON.stringify(opts.data));
197
+ }
198
+ else if (opts.dataRaw) {
199
+ payload = opts.dataRaw; // Assume this is already base64 encoded
200
+ }
201
+ const resp = await this.queue.submit({
202
+ workflows: [
203
+ {
204
+ group,
205
+ metadata: {
206
+ executionId: this.executionId,
207
+ activationId: this.activation?.id,
208
+ userId: this.activation?.user?.externalId,
209
+ },
210
+ payload: payload ?? btoa('{}'),
211
+ maxAttempts: opts.maxAttempts,
212
+ },
213
+ ],
214
+ });
215
+ return new AsyncWorkflow(this.queue, resp.workflows[0].id ?? 'unknown');
216
+ }
217
+ createIssue(issue, options) {
218
+ return __classPrivateFieldGet(this, _VanillaContext_issues, "f").createIssue({
219
+ reason: 'manual',
220
+ ...issue,
221
+ }, { deduplicate: true, ...options });
222
+ }
223
+ credentials() {
224
+ throw new Error('Credentials are not available in VanillaContext');
225
+ }
226
+ destroy(scope) {
227
+ if (scope === ':execution:') {
228
+ return this.kvp.destroy({
229
+ scope,
230
+ executionId: this.executionId,
231
+ activationId: this.activation?.id,
232
+ });
233
+ }
234
+ return this.kvp.destroy({
235
+ scope,
236
+ activationId: this.activation?.id,
237
+ });
238
+ }
239
+ [(_VanillaContext_activation = new WeakMap(), _VanillaContext_issues = new WeakMap(), Symbol.toPrimitive)]() {
240
+ return {
241
+ startTime: this.startTime,
242
+ executionId: this.executionId,
243
+ activation: this.activation,
244
+ data: this.data,
245
+ };
246
+ }
247
+ }
248
+ export class VanillaContextProvider {
249
+ constructor(log, kvp, organisationId, environmentId, issues, queue = undefined) {
250
+ Object.defineProperty(this, "organisationId", {
251
+ enumerable: true,
252
+ configurable: true,
253
+ writable: true,
254
+ value: organisationId
255
+ });
256
+ Object.defineProperty(this, "environmentId", {
257
+ enumerable: true,
258
+ configurable: true,
259
+ writable: true,
260
+ value: environmentId
261
+ });
262
+ Object.defineProperty(this, "log", {
263
+ enumerable: true,
264
+ configurable: true,
265
+ writable: true,
266
+ value: void 0
267
+ });
268
+ Object.defineProperty(this, "kvp", {
269
+ enumerable: true,
270
+ configurable: true,
271
+ writable: true,
272
+ value: void 0
273
+ });
274
+ Object.defineProperty(this, "issues", {
275
+ enumerable: true,
276
+ configurable: true,
277
+ writable: true,
278
+ value: void 0
279
+ });
280
+ Object.defineProperty(this, "queue", {
281
+ enumerable: true,
282
+ configurable: true,
283
+ writable: true,
284
+ value: void 0
285
+ });
286
+ this.log = log;
287
+ this.kvp = kvp;
288
+ this.issues = issues;
289
+ this.queue = queue;
290
+ }
291
+ create(activation, data, options = {}) {
292
+ const executionId = ulid();
293
+ const logger = this.log.child({
294
+ executionId,
295
+ activationId: activation.id,
296
+ externalUserId: activation.user.externalId,
297
+ });
298
+ const activationImpl = new VanillaActivation(activation, this.organisationId, this.environmentId, logger);
299
+ return new VanillaContext(logger, this.kvp, executionId, new Date(), data, activationImpl, this.issues, this.queue, options);
300
+ }
301
+ createWithExecutionId(activation, data, executionId, options = {}) {
302
+ const logger = this.log.child({
303
+ executionId,
304
+ activationId: activation.id,
305
+ externalUserId: activation.user.externalId,
306
+ });
307
+ const activationImpl = new VanillaActivation(activation, this.organisationId, this.environmentId, logger);
308
+ return new VanillaContext(logger, this.kvp, executionId, new Date(), data, activationImpl, this.issues, this.queue, options);
309
+ }
310
+ destroy(_) {
311
+ return Promise.resolve();
312
+ }
313
+ }
@@ -1,5 +1,5 @@
1
1
  import { QueueAPI, Workflow } from '../interpreter/durable/Queue.js';
2
- import { ActivationImpl } from './ActivationImpl.js';
2
+ import { ActivationInterface } from '../dsl/http/types.js';
3
3
  export type WorkflowOpts = {
4
4
  maxAttempts?: number;
5
5
  data?: unknown;
@@ -17,7 +17,7 @@ export declare class WorkflowImpl implements WorkflowInterface {
17
17
  private queue;
18
18
  private executionId;
19
19
  private activation;
20
- constructor(queue: QueueAPI, executionId: string, activation: ActivationImpl);
20
+ constructor(queue: QueueAPI, executionId: string, activation: ActivationInterface);
21
21
  startWorkflow(group: string, opts: WorkflowOpts): Promise<Workflow>;
22
22
  getWorkflow(wf: Workflow): Promise<Workflow>;
23
23
  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,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/F;AAED,qBAAa,YAAa,YAAW,iBAAiB;IAClD,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAsB;gBAE5B,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB;IAc3E,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmBnE,WAAW,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI5C,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI9C,iBAAiB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IASlD,kBAAkB,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B9D,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAYpG"}
@@ -1,3 +1,3 @@
1
- export type { Activation, User } from './types.js';
1
+ export type { ActivationInterface, User } from './types.js';
2
2
  export type { CredentialsProvider, Token } from './versori/contextcredentials.js';
3
3
  //# sourceMappingURL=mod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/mod.ts"],"names":[],"mappings":"AAaA,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/mod.ts"],"names":[],"mappings":"AAaA,YAAY,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC"}