@versori/run 0.7.0-alpha.3 → 0.7.0-alpha.5

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 (169) hide show
  1. package/esm/src/connection/VanillaConnectionFactory.d.ts +16 -0
  2. package/esm/src/connection/VanillaConnectionFactory.d.ts.map +1 -0
  3. package/esm/src/connection/VanillaConnectionFactory.js +23 -0
  4. package/esm/src/context/ActivationImpl.d.ts +2 -1
  5. package/esm/src/context/ActivationImpl.d.ts.map +1 -1
  6. package/esm/src/context/Context.d.ts +4 -2
  7. package/esm/src/context/Context.d.ts.map +1 -1
  8. package/esm/src/context/ContextProvider.d.ts +6 -6
  9. package/esm/src/context/ContextProvider.d.ts.map +1 -1
  10. package/esm/src/context/VanillaContext.d.ts +60 -0
  11. package/esm/src/context/VanillaContext.d.ts.map +1 -0
  12. package/esm/src/context/VanillaContext.js +296 -0
  13. package/esm/src/dsl/http/mod.d.ts +1 -1
  14. package/esm/src/dsl/http/mod.d.ts.map +1 -1
  15. package/esm/src/dsl/http/types.d.ts +19 -134
  16. package/esm/src/dsl/http/types.d.ts.map +1 -1
  17. package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
  18. package/esm/src/dsl/http/versori/configloader.js +3 -0
  19. package/esm/src/dsl/tasks/HttpTask.d.ts +5 -5
  20. package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
  21. package/esm/src/dsl/triggers/ScheduleTrigger.d.ts +2 -2
  22. package/esm/src/dsl/triggers/ScheduleTrigger.d.ts.map +1 -1
  23. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +2 -2
  24. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  25. package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  26. package/esm/src/interpreter/mod.d.ts +1 -0
  27. package/esm/src/interpreter/mod.d.ts.map +1 -1
  28. package/esm/src/interpreter/mod.js +1 -0
  29. package/esm/src/interpreter/vanilla/ExecutionError.d.ts +27 -0
  30. package/esm/src/interpreter/vanilla/ExecutionError.d.ts.map +1 -0
  31. package/esm/src/interpreter/vanilla/ExecutionError.js +48 -0
  32. package/esm/src/interpreter/vanilla/ObservableCompiler.d.ts +38 -0
  33. package/esm/src/interpreter/vanilla/ObservableCompiler.d.ts.map +1 -0
  34. package/esm/src/interpreter/vanilla/ObservableCompiler.js +95 -0
  35. package/esm/src/interpreter/vanilla/Queue.d.ts +72 -0
  36. package/esm/src/interpreter/vanilla/Queue.d.ts.map +1 -0
  37. package/esm/src/interpreter/vanilla/Queue.js +176 -0
  38. package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts +95 -0
  39. package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -0
  40. package/esm/src/interpreter/vanilla/VanillaInterpreter.js +428 -0
  41. package/esm/src/interpreter/vanilla/compilers/background.d.ts +4 -0
  42. package/esm/src/interpreter/vanilla/compilers/background.d.ts.map +1 -0
  43. package/esm/src/interpreter/vanilla/compilers/background.js +34 -0
  44. package/esm/src/interpreter/vanilla/compilers/catch.d.ts +4 -0
  45. package/esm/src/interpreter/vanilla/compilers/catch.d.ts.map +1 -0
  46. package/esm/src/interpreter/vanilla/compilers/catch.js +75 -0
  47. package/esm/src/interpreter/vanilla/compilers/chain.d.ts +3 -0
  48. package/esm/src/interpreter/vanilla/compilers/chain.d.ts.map +1 -0
  49. package/esm/src/interpreter/vanilla/compilers/chain.js +21 -0
  50. package/esm/src/interpreter/vanilla/compilers/durableworkflow.d.ts +8 -0
  51. package/esm/src/interpreter/vanilla/compilers/durableworkflow.d.ts.map +1 -0
  52. package/esm/src/interpreter/vanilla/compilers/durableworkflow.js +90 -0
  53. package/esm/src/interpreter/vanilla/compilers/fn.d.ts +4 -0
  54. package/esm/src/interpreter/vanilla/compilers/fn.d.ts.map +1 -0
  55. package/esm/src/interpreter/vanilla/compilers/fn.js +34 -0
  56. package/esm/src/interpreter/vanilla/compilers/http.d.ts +4 -0
  57. package/esm/src/interpreter/vanilla/compilers/http.d.ts.map +1 -0
  58. package/esm/src/interpreter/vanilla/compilers/http.js +54 -0
  59. package/esm/src/interpreter/vanilla/compilers/mod.d.ts +2 -0
  60. package/esm/src/interpreter/vanilla/compilers/mod.d.ts.map +1 -0
  61. package/esm/src/interpreter/vanilla/compilers/mod.js +13 -0
  62. package/esm/src/interpreter/vanilla/compilers/parallel.d.ts +4 -0
  63. package/esm/src/interpreter/vanilla/compilers/parallel.d.ts.map +1 -0
  64. package/esm/src/interpreter/vanilla/compilers/parallel.js +31 -0
  65. package/esm/src/interpreter/vanilla/compilers/schedule.d.ts +4 -0
  66. package/esm/src/interpreter/vanilla/compilers/schedule.d.ts.map +1 -0
  67. package/esm/src/interpreter/vanilla/compilers/schedule.js +76 -0
  68. package/esm/src/interpreter/vanilla/compilers/serial.d.ts +4 -0
  69. package/esm/src/interpreter/vanilla/compilers/serial.d.ts.map +1 -0
  70. package/esm/src/interpreter/vanilla/compilers/serial.js +28 -0
  71. package/esm/src/interpreter/vanilla/compilers/types.d.ts +15 -0
  72. package/esm/src/interpreter/vanilla/compilers/types.d.ts.map +1 -0
  73. package/esm/src/interpreter/vanilla/compilers/types.js +13 -0
  74. package/esm/src/interpreter/vanilla/compilers/unpack.d.ts +4 -0
  75. package/esm/src/interpreter/vanilla/compilers/unpack.d.ts.map +1 -0
  76. package/esm/src/interpreter/vanilla/compilers/unpack.js +34 -0
  77. package/esm/src/interpreter/vanilla/compilers/webhook.d.ts +4 -0
  78. package/esm/src/interpreter/vanilla/compilers/webhook.d.ts.map +1 -0
  79. package/esm/src/interpreter/vanilla/compilers/webhook.js +259 -0
  80. package/esm/src/interpreter/vanilla/mod.d.ts +3 -0
  81. package/esm/src/interpreter/vanilla/mod.d.ts.map +1 -0
  82. package/esm/src/interpreter/vanilla/mod.js +14 -0
  83. package/esm/src/issues/Issues.d.ts +1 -18
  84. package/esm/src/issues/Issues.d.ts.map +1 -1
  85. package/package.json +1 -1
  86. package/script/src/connection/VanillaConnectionFactory.d.ts +16 -0
  87. package/script/src/connection/VanillaConnectionFactory.d.ts.map +1 -0
  88. package/script/src/connection/VanillaConnectionFactory.js +28 -0
  89. package/script/src/context/ActivationImpl.d.ts +2 -1
  90. package/script/src/context/ActivationImpl.d.ts.map +1 -1
  91. package/script/src/context/Context.d.ts +4 -2
  92. package/script/src/context/Context.d.ts.map +1 -1
  93. package/script/src/context/ContextProvider.d.ts +6 -6
  94. package/script/src/context/ContextProvider.d.ts.map +1 -1
  95. package/script/src/context/VanillaContext.d.ts +60 -0
  96. package/script/src/context/VanillaContext.d.ts.map +1 -0
  97. package/script/src/context/VanillaContext.js +302 -0
  98. package/script/src/dsl/http/mod.d.ts +1 -1
  99. package/script/src/dsl/http/mod.d.ts.map +1 -1
  100. package/script/src/dsl/http/types.d.ts +19 -134
  101. package/script/src/dsl/http/types.d.ts.map +1 -1
  102. package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
  103. package/script/src/dsl/http/versori/configloader.js +3 -0
  104. package/script/src/dsl/tasks/HttpTask.d.ts +5 -5
  105. package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
  106. package/script/src/dsl/triggers/ScheduleTrigger.d.ts +2 -2
  107. package/script/src/dsl/triggers/ScheduleTrigger.d.ts.map +1 -1
  108. package/script/src/interpreter/memory/MemoryInterpreter.d.ts +2 -2
  109. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  110. package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  111. package/script/src/interpreter/mod.d.ts +1 -0
  112. package/script/src/interpreter/mod.d.ts.map +1 -1
  113. package/script/src/interpreter/mod.js +2 -1
  114. package/script/src/interpreter/vanilla/ExecutionError.d.ts +27 -0
  115. package/script/src/interpreter/vanilla/ExecutionError.d.ts.map +1 -0
  116. package/script/src/interpreter/vanilla/ExecutionError.js +52 -0
  117. package/script/src/interpreter/vanilla/ObservableCompiler.d.ts +38 -0
  118. package/script/src/interpreter/vanilla/ObservableCompiler.d.ts.map +1 -0
  119. package/script/src/interpreter/vanilla/ObservableCompiler.js +99 -0
  120. package/script/src/interpreter/vanilla/Queue.d.ts +72 -0
  121. package/script/src/interpreter/vanilla/Queue.d.ts.map +1 -0
  122. package/script/src/interpreter/vanilla/Queue.js +181 -0
  123. package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts +95 -0
  124. package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -0
  125. package/script/src/interpreter/vanilla/VanillaInterpreter.js +435 -0
  126. package/script/src/interpreter/vanilla/compilers/background.d.ts +4 -0
  127. package/script/src/interpreter/vanilla/compilers/background.d.ts.map +1 -0
  128. package/script/src/interpreter/vanilla/compilers/background.js +37 -0
  129. package/script/src/interpreter/vanilla/compilers/catch.d.ts +4 -0
  130. package/script/src/interpreter/vanilla/compilers/catch.d.ts.map +1 -0
  131. package/script/src/interpreter/vanilla/compilers/catch.js +78 -0
  132. package/script/src/interpreter/vanilla/compilers/chain.d.ts +3 -0
  133. package/script/src/interpreter/vanilla/compilers/chain.d.ts.map +1 -0
  134. package/script/src/interpreter/vanilla/compilers/chain.js +24 -0
  135. package/script/src/interpreter/vanilla/compilers/durableworkflow.d.ts +8 -0
  136. package/script/src/interpreter/vanilla/compilers/durableworkflow.d.ts.map +1 -0
  137. package/script/src/interpreter/vanilla/compilers/durableworkflow.js +94 -0
  138. package/script/src/interpreter/vanilla/compilers/fn.d.ts +4 -0
  139. package/script/src/interpreter/vanilla/compilers/fn.d.ts.map +1 -0
  140. package/script/src/interpreter/vanilla/compilers/fn.js +37 -0
  141. package/script/src/interpreter/vanilla/compilers/http.d.ts +4 -0
  142. package/script/src/interpreter/vanilla/compilers/http.d.ts.map +1 -0
  143. package/script/src/interpreter/vanilla/compilers/http.js +57 -0
  144. package/script/src/interpreter/vanilla/compilers/mod.d.ts +2 -0
  145. package/script/src/interpreter/vanilla/compilers/mod.d.ts.map +1 -0
  146. package/script/src/interpreter/vanilla/compilers/mod.js +14 -0
  147. package/script/src/interpreter/vanilla/compilers/parallel.d.ts +4 -0
  148. package/script/src/interpreter/vanilla/compilers/parallel.d.ts.map +1 -0
  149. package/script/src/interpreter/vanilla/compilers/parallel.js +34 -0
  150. package/script/src/interpreter/vanilla/compilers/schedule.d.ts +4 -0
  151. package/script/src/interpreter/vanilla/compilers/schedule.d.ts.map +1 -0
  152. package/script/src/interpreter/vanilla/compilers/schedule.js +79 -0
  153. package/script/src/interpreter/vanilla/compilers/serial.d.ts +4 -0
  154. package/script/src/interpreter/vanilla/compilers/serial.d.ts.map +1 -0
  155. package/script/src/interpreter/vanilla/compilers/serial.js +31 -0
  156. package/script/src/interpreter/vanilla/compilers/types.d.ts +15 -0
  157. package/script/src/interpreter/vanilla/compilers/types.d.ts.map +1 -0
  158. package/script/src/interpreter/vanilla/compilers/types.js +14 -0
  159. package/script/src/interpreter/vanilla/compilers/unpack.d.ts +4 -0
  160. package/script/src/interpreter/vanilla/compilers/unpack.d.ts.map +1 -0
  161. package/script/src/interpreter/vanilla/compilers/unpack.js +37 -0
  162. package/script/src/interpreter/vanilla/compilers/webhook.d.ts +4 -0
  163. package/script/src/interpreter/vanilla/compilers/webhook.d.ts.map +1 -0
  164. package/script/src/interpreter/vanilla/compilers/webhook.js +265 -0
  165. package/script/src/interpreter/vanilla/mod.d.ts +3 -0
  166. package/script/src/interpreter/vanilla/mod.d.ts.map +1 -0
  167. package/script/src/interpreter/vanilla/mod.js +30 -0
  168. package/script/src/issues/Issues.d.ts +1 -18
  169. package/script/src/issues/Issues.d.ts.map +1 -1
@@ -0,0 +1,16 @@
1
+ import { RequestHandler } from 'express';
2
+ import { Connection } from '../services/platform/generated/types.gen.js';
3
+ import { ConnectionFactory, FetchLike, RuntimeConnectionFactory } from './types.js';
4
+ import { Context } from '../context/Context.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,UAAU,EAAE,MAAM,6CAA6C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,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;;IAG1D,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;CAK9D"}
@@ -0,0 +1,23 @@
1
+ export class DefaultConnectionFactory {
2
+ constructor() { }
3
+ handler(_) {
4
+ throw new Error('Method not implemented.');
5
+ }
6
+ fetcher(_) {
7
+ return Promise.resolve(globalThis.fetch);
8
+ }
9
+ }
10
+ export class VanillaFetchFactory {
11
+ constructor() { }
12
+ async fetcher(_) {
13
+ return globalThis.fetch;
14
+ }
15
+ async baseUrl(_) {
16
+ return '';
17
+ }
18
+ async handler(_) {
19
+ return async (_req, _res, next) => {
20
+ next();
21
+ };
22
+ }
23
+ }
@@ -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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AG,OAAO,CAAC,IAAI,CAAC;CA6BjE"}
@@ -1,11 +1,13 @@
1
1
  import type * as express from 'express';
2
2
  import { CredentialsProvider } from '../dsl/http/versori/contextcredentials.js';
3
3
  import { QueueAPI } from '../interpreter/durable/Queue.js';
4
- import { Issue, IssueAPI } from '../issues/Issues.js';
4
+ import { IssueAPI } from '../issues/Issues.js';
5
5
  import { KeyValue, KeyValueProvider, KeyValueScope } from '../kv/KeyValue.js';
6
6
  import { Logger } from '../observability/logging/Logger.js';
7
7
  import { ActivationImpl } from './ActivationImpl.js';
8
8
  import { AsyncWorkflow } from './AsyncWorkflow.js';
9
+ import { ActivationInterface } from '../dsl/http/types.js';
10
+ import { Issue } from '@versori/run/services/platform';
9
11
  export type OnSuccessFn = (ctx: Context<any>) => void;
10
12
  export type OnErrorFn = (ctx: Context<any>) => void;
11
13
  export type ContextOptions = {
@@ -65,7 +67,7 @@ export interface Context<D> {
65
67
  readonly executionId: string;
66
68
  readonly startTime: Date;
67
69
  readonly data: D;
68
- activation: ActivationImpl;
70
+ activation: ActivationInterface;
69
71
  /**
70
72
  * Opens a key value store for the given scope, defaulting to ':project:' if not provided.
71
73
  * @param scope The scope of the key value store to open, 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;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,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,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,EAC1B,MAAM,EAAE,QAAQ,EAChB,KAAK,CAAC,EAAE,QAAQ,EAChB,OAAO,GAAE,cAAmB;IA0BhC,IAAI,UAAU,IAAI,cAAc,CAE/B;IAED,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAEnC;IAED,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC;IAkB7C,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC;IAe9C,MAAM,CAAC,KAAK,GAAE,aAA2B,GAAG,QAAQ;IAepD,OAAO,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS;IAIhC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAgCtE,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAO3F,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"}
@@ -6,18 +6,18 @@ import { Logger } from '../observability/logging/Logger.js';
6
6
  import { Context, ContextImpl, ContextOptions } from './Context.js';
7
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>;
9
+ create<D>(activation: Activation, data: D, options?: ContextOptions): Context<D>;
10
10
  destroy(ctx: Context<any>): Promise<void>;
11
11
  }
12
12
  export declare class ContextProviderImpl implements ContextProvider {
13
13
  private readonly platformApi;
14
14
  private readonly organisationId;
15
15
  private readonly environmentId;
16
- log: Logger;
17
- kvp: KeyValueProvider;
18
- creds: CredentialsProvider;
19
- issues: IssueAPI;
20
- queue?: QueueAPI;
16
+ private log;
17
+ private kvp;
18
+ private creds;
19
+ private issues;
20
+ private queue?;
21
21
  constructor(log: Logger, kvp: KeyValueProvider, creds: CredentialsProvider, platformApi: PlatformApi, organisationId: string, environmentId: string, issues: IssueAPI, queue?: QueueAPI | undefined);
22
22
  create<D>(activation: Activation, data: D, options?: ContextOptions): ContextImpl<D>;
23
23
  destroy(_: Context<any>): Promise<void>;
@@ -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,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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c,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACjF,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,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,GAAG,CAAmB;IAC9B,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,KAAK,CAAC,CAAW;gBAGrB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,mBAAmB,EACT,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACtC,MAAM,EAAE,QAAQ,EAChB,KAAK,GAAE,QAAQ,GAAG,SAAqB;IAS3C,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,WAAW,CAAC,CAAC,CAAC;IA+BxF,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1C"}
@@ -0,0 +1,60 @@
1
+ import type * as express from 'express';
2
+ import { Context, ContextOptions, CreateIssue, WorkflowOpts } from './Context.js';
3
+ import { ContextProvider } from './ContextProvider.js';
4
+ import { ActivationInterface } from '../dsl/http/types.js';
5
+ import { Activation, Connection, DynamicVariables, EndUser, Issue, ProjectEnvironment } from '@versori/run/services/platform';
6
+ import { IssueAPI } from '../issues/Issues.js';
7
+ import { QueueAPI } from '../interpreter/vanilla/Queue.js';
8
+ import { Logger, KeyValueProvider, CredentialsProvider, KeyValueScope, KeyValue } from '../mod.js';
9
+ import { AsyncWorkflow } from './AsyncWorkflow.js';
10
+ export declare class VanillaActivation implements ActivationInterface {
11
+ private readonly activation;
12
+ private readonly organisationId;
13
+ private readonly environmentId;
14
+ private readonly log;
15
+ constructor(activation: Activation, organisationId: string, environmentId: string, log: Logger);
16
+ get id(): string;
17
+ get user(): EndUser;
18
+ get environment(): ProjectEnvironment | undefined;
19
+ get connections(): Array<Connection> | undefined;
20
+ get dynamicVariables(): DynamicVariables | undefined;
21
+ getVariable<T = unknown>(name: string): T | undefined;
22
+ setVariable(_: string, __: unknown): Promise<void>;
23
+ }
24
+ export declare class VanillaContext<D, Index = void> implements Context<D> {
25
+ #private;
26
+ readonly log: Logger;
27
+ readonly executionId: string;
28
+ readonly startTime: Date;
29
+ readonly data: D;
30
+ idx: Index;
31
+ readonly kvp: KeyValueProvider;
32
+ readonly queue?: QueueAPI;
33
+ readonly options: ContextOptions;
34
+ constructor(log: Logger, kvp: KeyValueProvider, executionId: string, startTime: Date, data: D, activation: VanillaActivation, issues: IssueAPI, queue?: QueueAPI, options?: ContextOptions);
35
+ get activation(): ActivationInterface;
36
+ get workflowId(): string | undefined;
37
+ setIndex(idx: number): VanillaContext<D, number>;
38
+ withData<D2>(data: D2): VanillaContext<D2, Index>;
39
+ openKv(scope?: KeyValueScope): KeyValue;
40
+ request(): express.Request | undefined;
41
+ start(group: string, opts: WorkflowOpts): Promise<AsyncWorkflow>;
42
+ createIssue(issue: CreateIssue, options?: {
43
+ deduplicate?: boolean;
44
+ }): Promise<Issue | null>;
45
+ credentials(): CredentialsProvider;
46
+ destroy(scope: KeyValueScope): Promise<void>;
47
+ [Symbol.toPrimitive](): Record<string, unknown>;
48
+ }
49
+ export declare class VanillaContextProvider implements ContextProvider {
50
+ private readonly organisationId;
51
+ private readonly environmentId;
52
+ log: Logger;
53
+ kvp: KeyValueProvider;
54
+ issues: IssueAPI;
55
+ queue?: QueueAPI;
56
+ constructor(log: Logger, kvp: KeyValueProvider, organisationId: string, environmentId: string, issues: IssueAPI, queue?: QueueAPI | undefined);
57
+ create<D>(activation: Activation, data: D, options?: ContextOptions): VanillaContext<D>;
58
+ destroy(_: Context<any>): Promise<void>;
59
+ }
60
+ //# sourceMappingURL=VanillaContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VanillaContext.d.ts","sourceRoot":"","sources":["../../../src/src/context/VanillaContext.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAE9H,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAa,iBAAkB,YAAW,mBAAmB;IAErD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAHH,UAAU,EAAE,UAAU,EACtB,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,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) 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
+ export class VanillaActivation {
28
+ constructor(activation, organisationId, environmentId, log) {
29
+ Object.defineProperty(this, "activation", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: activation
34
+ });
35
+ Object.defineProperty(this, "organisationId", {
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true,
39
+ value: organisationId
40
+ });
41
+ Object.defineProperty(this, "environmentId", {
42
+ enumerable: true,
43
+ configurable: true,
44
+ writable: true,
45
+ value: environmentId
46
+ });
47
+ Object.defineProperty(this, "log", {
48
+ enumerable: true,
49
+ configurable: true,
50
+ writable: true,
51
+ value: log
52
+ });
53
+ }
54
+ get id() {
55
+ return this.activation.id;
56
+ }
57
+ get user() {
58
+ return this.activation.user;
59
+ }
60
+ get environment() {
61
+ return this.activation.environment;
62
+ }
63
+ get connections() {
64
+ return this.activation.connections;
65
+ }
66
+ get dynamicVariables() {
67
+ return this.activation.dynamicVariables;
68
+ }
69
+ getVariable(name) {
70
+ if (!this.activation.dynamicVariables) {
71
+ return undefined;
72
+ }
73
+ return this.activation.dynamicVariables[name];
74
+ }
75
+ async setVariable(_, __) {
76
+ return Promise.resolve();
77
+ }
78
+ }
79
+ export class VanillaContext {
80
+ constructor(log, kvp, executionId, startTime, data, activation, issues, queue, options = {}) {
81
+ Object.defineProperty(this, "log", {
82
+ enumerable: true,
83
+ configurable: true,
84
+ writable: true,
85
+ value: void 0
86
+ });
87
+ Object.defineProperty(this, "executionId", {
88
+ enumerable: true,
89
+ configurable: true,
90
+ writable: true,
91
+ value: void 0
92
+ });
93
+ Object.defineProperty(this, "startTime", {
94
+ enumerable: true,
95
+ configurable: true,
96
+ writable: true,
97
+ value: void 0
98
+ });
99
+ Object.defineProperty(this, "data", {
100
+ enumerable: true,
101
+ configurable: true,
102
+ writable: true,
103
+ value: void 0
104
+ });
105
+ _VanillaContext_activation.set(this, void 0);
106
+ Object.defineProperty(this, "idx", {
107
+ enumerable: true,
108
+ configurable: true,
109
+ writable: true,
110
+ value: void 0
111
+ });
112
+ Object.defineProperty(this, "kvp", {
113
+ enumerable: true,
114
+ configurable: true,
115
+ writable: true,
116
+ value: void 0
117
+ });
118
+ Object.defineProperty(this, "queue", {
119
+ enumerable: true,
120
+ configurable: true,
121
+ writable: true,
122
+ value: void 0
123
+ }); // Optional, can be used for durable workflows
124
+ _VanillaContext_issues.set(this, void 0);
125
+ Object.defineProperty(this, "options", {
126
+ enumerable: true,
127
+ configurable: true,
128
+ writable: true,
129
+ value: void 0
130
+ });
131
+ this.log = log;
132
+ this.executionId = executionId;
133
+ this.startTime = startTime;
134
+ this.data = data;
135
+ __classPrivateFieldSet(this, _VanillaContext_activation, activation, "f");
136
+ this.idx = void 0;
137
+ __classPrivateFieldSet(this, _VanillaContext_issues, issues, "f");
138
+ this.kvp = kvp;
139
+ this.options = options;
140
+ this.queue = queue;
141
+ // all methods on ContextImpl which are exposed via the Context interface need to be bound
142
+ // so that destructuring the context object doesn't break the binding of the methods to the
143
+ // correct instance.
144
+ this.openKv = this.openKv.bind(this);
145
+ this.credentials = this.credentials.bind(this);
146
+ this.start = this.start.bind(this);
147
+ this.request = this.request.bind(this);
148
+ this.createIssue = this.createIssue.bind(this);
149
+ this.destroy = this.destroy.bind(this);
150
+ }
151
+ get activation() {
152
+ return __classPrivateFieldGet(this, _VanillaContext_activation, "f");
153
+ }
154
+ get workflowId() {
155
+ return this.options.workflowId;
156
+ }
157
+ setIndex(idx) {
158
+ 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);
159
+ next.idx = idx;
160
+ return next;
161
+ }
162
+ withData(data) {
163
+ 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);
164
+ }
165
+ openKv(scope = ':project:') {
166
+ if (scope === ':execution:') {
167
+ return this.kvp.kv({
168
+ scope,
169
+ executionId: this.executionId,
170
+ activationId: this.activation?.id,
171
+ });
172
+ }
173
+ return this.kvp.kv({
174
+ scope,
175
+ activationId: this.activation?.id,
176
+ });
177
+ }
178
+ request() {
179
+ return this.options.request;
180
+ }
181
+ async start(group, opts) {
182
+ // this makes a post request to the endpoint sending a message and schedule the workflow to run
183
+ if (!this.queue) {
184
+ throw new Error('Queue is not available for this context, cannot start workflow');
185
+ }
186
+ let payload;
187
+ if (opts.data) {
188
+ payload = opts.data ? btoa(JSON.stringify(opts.data)) : undefined;
189
+ }
190
+ else if (opts.dataRaw) {
191
+ payload = opts.dataRaw; // Assume this is already base64 encoded
192
+ }
193
+ const resp = await this.queue.submit({
194
+ workflows: [
195
+ {
196
+ group,
197
+ metadata: {
198
+ executionId: this.executionId,
199
+ activationId: this.activation?.id,
200
+ userId: this.activation?.user?.externalId,
201
+ },
202
+ payload,
203
+ maxAttempts: opts.maxAttempts,
204
+ },
205
+ ],
206
+ });
207
+ return new AsyncWorkflow(this.queue, resp.workflows[0].id ?? 'unknown');
208
+ }
209
+ createIssue(issue, options) {
210
+ return __classPrivateFieldGet(this, _VanillaContext_issues, "f").createIssue({
211
+ reason: 'manual',
212
+ ...issue,
213
+ }, { deduplicate: true, ...options });
214
+ }
215
+ credentials() {
216
+ throw new Error('Credentials are not available in VanillaContext');
217
+ }
218
+ destroy(scope) {
219
+ if (scope === ':execution:') {
220
+ return this.kvp.destroy({
221
+ scope,
222
+ executionId: this.executionId,
223
+ activationId: this.activation?.id,
224
+ });
225
+ }
226
+ return this.kvp.destroy({
227
+ scope,
228
+ activationId: this.activation?.id,
229
+ });
230
+ }
231
+ [(_VanillaContext_activation = new WeakMap(), _VanillaContext_issues = new WeakMap(), Symbol.toPrimitive)]() {
232
+ return {
233
+ startTime: this.startTime,
234
+ executionId: this.executionId,
235
+ activation: this.activation,
236
+ data: this.data,
237
+ };
238
+ }
239
+ }
240
+ export class VanillaContextProvider {
241
+ constructor(log, kvp, organisationId, environmentId, issues, queue = undefined) {
242
+ Object.defineProperty(this, "organisationId", {
243
+ enumerable: true,
244
+ configurable: true,
245
+ writable: true,
246
+ value: organisationId
247
+ });
248
+ Object.defineProperty(this, "environmentId", {
249
+ enumerable: true,
250
+ configurable: true,
251
+ writable: true,
252
+ value: environmentId
253
+ });
254
+ Object.defineProperty(this, "log", {
255
+ enumerable: true,
256
+ configurable: true,
257
+ writable: true,
258
+ value: void 0
259
+ });
260
+ Object.defineProperty(this, "kvp", {
261
+ enumerable: true,
262
+ configurable: true,
263
+ writable: true,
264
+ value: void 0
265
+ });
266
+ Object.defineProperty(this, "issues", {
267
+ enumerable: true,
268
+ configurable: true,
269
+ writable: true,
270
+ value: void 0
271
+ });
272
+ Object.defineProperty(this, "queue", {
273
+ enumerable: true,
274
+ configurable: true,
275
+ writable: true,
276
+ value: void 0
277
+ });
278
+ this.log = log;
279
+ this.kvp = kvp;
280
+ this.issues = issues;
281
+ this.queue = queue;
282
+ }
283
+ create(activation, data, options = {}) {
284
+ const executionId = ulid();
285
+ const logger = this.log.child({
286
+ executionId,
287
+ activationId: activation.id,
288
+ externalUserId: activation.user.externalId,
289
+ });
290
+ const activationImpl = new VanillaActivation(activation, this.organisationId, this.environmentId, logger);
291
+ return new VanillaContext(logger, this.kvp, executionId, new Date(), data, activationImpl, this.issues, this.queue, options);
292
+ }
293
+ destroy(_) {
294
+ return Promise.resolve();
295
+ }
296
+ }
@@ -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"}