@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.
- package/esm/src/connection/VanillaConnectionFactory.d.ts +16 -0
- package/esm/src/connection/VanillaConnectionFactory.d.ts.map +1 -0
- package/esm/src/connection/VanillaConnectionFactory.js +23 -0
- package/esm/src/context/ActivationImpl.d.ts +2 -1
- package/esm/src/context/ActivationImpl.d.ts.map +1 -1
- package/esm/src/context/Context.d.ts +4 -2
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.d.ts +6 -6
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/VanillaContext.d.ts +60 -0
- package/esm/src/context/VanillaContext.d.ts.map +1 -0
- package/esm/src/context/VanillaContext.js +296 -0
- package/esm/src/dsl/http/mod.d.ts +1 -1
- package/esm/src/dsl/http/mod.d.ts.map +1 -1
- package/esm/src/dsl/http/types.d.ts +19 -134
- package/esm/src/dsl/http/types.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.js +3 -0
- package/esm/src/dsl/tasks/HttpTask.d.ts +5 -5
- package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/esm/src/dsl/triggers/ScheduleTrigger.d.ts +2 -2
- package/esm/src/dsl/triggers/ScheduleTrigger.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +2 -2
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/mod.d.ts +1 -0
- package/esm/src/interpreter/mod.d.ts.map +1 -1
- package/esm/src/interpreter/mod.js +1 -0
- package/esm/src/interpreter/vanilla/ExecutionError.d.ts +27 -0
- package/esm/src/interpreter/vanilla/ExecutionError.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/ExecutionError.js +48 -0
- package/esm/src/interpreter/vanilla/ObservableCompiler.d.ts +38 -0
- package/esm/src/interpreter/vanilla/ObservableCompiler.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/ObservableCompiler.js +95 -0
- package/esm/src/interpreter/vanilla/Queue.d.ts +72 -0
- package/esm/src/interpreter/vanilla/Queue.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/Queue.js +176 -0
- package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts +95 -0
- package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/VanillaInterpreter.js +428 -0
- package/esm/src/interpreter/vanilla/compilers/background.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/background.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/background.js +34 -0
- package/esm/src/interpreter/vanilla/compilers/catch.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/catch.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/catch.js +75 -0
- package/esm/src/interpreter/vanilla/compilers/chain.d.ts +3 -0
- package/esm/src/interpreter/vanilla/compilers/chain.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/chain.js +21 -0
- package/esm/src/interpreter/vanilla/compilers/durableworkflow.d.ts +8 -0
- package/esm/src/interpreter/vanilla/compilers/durableworkflow.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/durableworkflow.js +90 -0
- package/esm/src/interpreter/vanilla/compilers/fn.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/fn.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/fn.js +34 -0
- package/esm/src/interpreter/vanilla/compilers/http.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/http.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/http.js +54 -0
- package/esm/src/interpreter/vanilla/compilers/mod.d.ts +2 -0
- package/esm/src/interpreter/vanilla/compilers/mod.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/mod.js +13 -0
- package/esm/src/interpreter/vanilla/compilers/parallel.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/parallel.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/parallel.js +31 -0
- package/esm/src/interpreter/vanilla/compilers/schedule.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/schedule.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/schedule.js +76 -0
- package/esm/src/interpreter/vanilla/compilers/serial.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/serial.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/serial.js +28 -0
- package/esm/src/interpreter/vanilla/compilers/types.d.ts +15 -0
- package/esm/src/interpreter/vanilla/compilers/types.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/types.js +13 -0
- package/esm/src/interpreter/vanilla/compilers/unpack.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/unpack.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/unpack.js +34 -0
- package/esm/src/interpreter/vanilla/compilers/webhook.d.ts +4 -0
- package/esm/src/interpreter/vanilla/compilers/webhook.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/compilers/webhook.js +259 -0
- package/esm/src/interpreter/vanilla/mod.d.ts +3 -0
- package/esm/src/interpreter/vanilla/mod.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/mod.js +14 -0
- package/esm/src/issues/Issues.d.ts +1 -18
- package/esm/src/issues/Issues.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/src/connection/VanillaConnectionFactory.d.ts +16 -0
- package/script/src/connection/VanillaConnectionFactory.d.ts.map +1 -0
- package/script/src/connection/VanillaConnectionFactory.js +28 -0
- package/script/src/context/ActivationImpl.d.ts +2 -1
- package/script/src/context/ActivationImpl.d.ts.map +1 -1
- package/script/src/context/Context.d.ts +4 -2
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/ContextProvider.d.ts +6 -6
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/VanillaContext.d.ts +60 -0
- package/script/src/context/VanillaContext.d.ts.map +1 -0
- package/script/src/context/VanillaContext.js +302 -0
- package/script/src/dsl/http/mod.d.ts +1 -1
- package/script/src/dsl/http/mod.d.ts.map +1 -1
- package/script/src/dsl/http/types.d.ts +19 -134
- package/script/src/dsl/http/types.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.js +3 -0
- package/script/src/dsl/tasks/HttpTask.d.ts +5 -5
- package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/script/src/dsl/triggers/ScheduleTrigger.d.ts +2 -2
- package/script/src/dsl/triggers/ScheduleTrigger.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +2 -2
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/mod.d.ts +1 -0
- package/script/src/interpreter/mod.d.ts.map +1 -1
- package/script/src/interpreter/mod.js +2 -1
- package/script/src/interpreter/vanilla/ExecutionError.d.ts +27 -0
- package/script/src/interpreter/vanilla/ExecutionError.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/ExecutionError.js +52 -0
- package/script/src/interpreter/vanilla/ObservableCompiler.d.ts +38 -0
- package/script/src/interpreter/vanilla/ObservableCompiler.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/ObservableCompiler.js +99 -0
- package/script/src/interpreter/vanilla/Queue.d.ts +72 -0
- package/script/src/interpreter/vanilla/Queue.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/Queue.js +181 -0
- package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts +95 -0
- package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/VanillaInterpreter.js +435 -0
- package/script/src/interpreter/vanilla/compilers/background.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/background.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/background.js +37 -0
- package/script/src/interpreter/vanilla/compilers/catch.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/catch.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/catch.js +78 -0
- package/script/src/interpreter/vanilla/compilers/chain.d.ts +3 -0
- package/script/src/interpreter/vanilla/compilers/chain.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/chain.js +24 -0
- package/script/src/interpreter/vanilla/compilers/durableworkflow.d.ts +8 -0
- package/script/src/interpreter/vanilla/compilers/durableworkflow.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/durableworkflow.js +94 -0
- package/script/src/interpreter/vanilla/compilers/fn.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/fn.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/fn.js +37 -0
- package/script/src/interpreter/vanilla/compilers/http.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/http.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/http.js +57 -0
- package/script/src/interpreter/vanilla/compilers/mod.d.ts +2 -0
- package/script/src/interpreter/vanilla/compilers/mod.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/mod.js +14 -0
- package/script/src/interpreter/vanilla/compilers/parallel.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/parallel.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/parallel.js +34 -0
- package/script/src/interpreter/vanilla/compilers/schedule.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/schedule.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/schedule.js +79 -0
- package/script/src/interpreter/vanilla/compilers/serial.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/serial.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/serial.js +31 -0
- package/script/src/interpreter/vanilla/compilers/types.d.ts +15 -0
- package/script/src/interpreter/vanilla/compilers/types.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/types.js +14 -0
- package/script/src/interpreter/vanilla/compilers/unpack.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/unpack.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/unpack.js +37 -0
- package/script/src/interpreter/vanilla/compilers/webhook.d.ts +4 -0
- package/script/src/interpreter/vanilla/compilers/webhook.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/compilers/webhook.js +265 -0
- package/script/src/interpreter/vanilla/mod.d.ts +3 -0
- package/script/src/interpreter/vanilla/mod.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/mod.js +30 -0
- package/script/src/issues/Issues.d.ts +1 -18
- package/script/src/issues/Issues.d.ts.map +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ProjectEnvironment, DynamicVariables, Connection } from '@versori/run/services/platform';
|
|
1
2
|
import { CredentialsProvider } from './versori/contextcredentials.js';
|
|
2
|
-
export type DynamicFetcher = (activation:
|
|
3
|
+
export type DynamicFetcher = (activation: ActivationInterface, input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
3
4
|
export type BaseUrlFetcher = (activationId: string) => Promise<string>;
|
|
4
5
|
export interface RoundTripperFactory {
|
|
5
6
|
create(connName: string): Promise<typeof fetch | undefined>;
|
|
@@ -7,7 +8,7 @@ export interface RoundTripperFactory {
|
|
|
7
8
|
credentials(): CredentialsProvider;
|
|
8
9
|
baseUrlFetcher(templateName: string): BaseUrlFetcher;
|
|
9
10
|
}
|
|
10
|
-
export declare function wrapDynamicFetcher(fetcher: DynamicFetcher, activation:
|
|
11
|
+
export declare function wrapDynamicFetcher(fetcher: DynamicFetcher, activation: ActivationInterface): typeof fetch;
|
|
11
12
|
export interface ConfigReader {
|
|
12
13
|
getCnxMapping(name: string): CnxMap | undefined;
|
|
13
14
|
getConnectionID(connName: string): string;
|
|
@@ -15,11 +16,11 @@ export interface ConfigReader {
|
|
|
15
16
|
}
|
|
16
17
|
export interface ConnectionProvider {
|
|
17
18
|
getStaticConnection(cnxId: string): Promise<Connection | undefined>;
|
|
18
|
-
getUserActivations(userId: string): Promise<
|
|
19
|
+
getUserActivations(userId: string): Promise<ActivationInterface[]>;
|
|
19
20
|
getActivationConnection(templateId: string, activationId: string): Promise<Connection | undefined>;
|
|
20
|
-
getActivation(activationId: string): Promise<
|
|
21
|
-
getStaticActivation(): Promise<
|
|
22
|
-
listActivations(): Promise<
|
|
21
|
+
getActivation(activationId: string): Promise<ActivationInterface | undefined>;
|
|
22
|
+
getStaticActivation(): Promise<ActivationInterface | undefined>;
|
|
23
|
+
listActivations(): Promise<ActivationInterface[]>;
|
|
23
24
|
updateDynamicVariable(activationId: string, name: string, value: unknown): Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
export type CronConfig = {
|
|
@@ -64,7 +65,7 @@ export type User = {
|
|
|
64
65
|
* Activation represents a user's activation of an integration. Activations contain user-specific configuration and
|
|
65
66
|
* credentials for accessing external systems. Workflows can be scoped to specific activations using predicates.
|
|
66
67
|
*/
|
|
67
|
-
export interface
|
|
68
|
+
export interface ActivationInterface {
|
|
68
69
|
/**
|
|
69
70
|
* The unique identifier for this activation.
|
|
70
71
|
*/
|
|
@@ -73,6 +74,17 @@ export interface Activation {
|
|
|
73
74
|
* The user who owns this activation.
|
|
74
75
|
*/
|
|
75
76
|
user: User;
|
|
77
|
+
/**
|
|
78
|
+
* The environment this activation is associated with.
|
|
79
|
+
*/
|
|
80
|
+
environment?: ProjectEnvironment;
|
|
81
|
+
/** * The connections associated with this activation.
|
|
82
|
+
*/
|
|
83
|
+
connections?: Array<Connection>;
|
|
84
|
+
/**
|
|
85
|
+
* Dynamic variables associated with this activation.
|
|
86
|
+
*/
|
|
87
|
+
dynamicVariables?: DynamicVariables;
|
|
76
88
|
/**
|
|
77
89
|
* Get a dynamic variable value for this activation.
|
|
78
90
|
*
|
|
@@ -88,132 +100,6 @@ export interface Activation {
|
|
|
88
100
|
*/
|
|
89
101
|
setVariable(name: string, value: unknown): Promise<void>;
|
|
90
102
|
}
|
|
91
|
-
export type AuthSchemeType = 'none' | 'api-key' | 'basic-auth' | 'oauth2' | 'hmac' | 'jwt-bearer' | 'custom-function' | 'certificate' | 'oauth1';
|
|
92
|
-
export type AuthSchemeConfig = {
|
|
93
|
-
type: AuthSchemeType;
|
|
94
|
-
none?: AuthSchemeConfigNone;
|
|
95
|
-
apiKey?: AuthSchemeConfigApiKey;
|
|
96
|
-
basicAuth?: AuthSchemeConfigBasicAuth;
|
|
97
|
-
oauth2?: AuthSchemeConfigOAuth2;
|
|
98
|
-
oauth1?: AuthSchemeConfigOAuth1;
|
|
99
|
-
hmac?: AuthSchemeConfigHMAC;
|
|
100
|
-
certificate?: AuthSchemeConfigCertificate;
|
|
101
|
-
};
|
|
102
|
-
type AuthSchemeConfigBase = {
|
|
103
|
-
id: string;
|
|
104
|
-
description: string;
|
|
105
|
-
};
|
|
106
|
-
export type AuthSchemeConfigNone = AuthSchemeConfigBase & {
|
|
107
|
-
schemeType: 'none';
|
|
108
|
-
};
|
|
109
|
-
export type AuthSchemeConfigBasicAuth = AuthSchemeConfigBase & {
|
|
110
|
-
schemeType: 'basic-auth';
|
|
111
|
-
};
|
|
112
|
-
export type AuthSchemeConfigApiKey = AuthSchemeConfigBase & {
|
|
113
|
-
schemeType: 'api-key';
|
|
114
|
-
in: 'query' | 'header' | 'cookie';
|
|
115
|
-
name: string;
|
|
116
|
-
};
|
|
117
|
-
type OAuth2Scope = {
|
|
118
|
-
name: string;
|
|
119
|
-
description: string;
|
|
120
|
-
};
|
|
121
|
-
type OAuth2GrantAuthCode = {
|
|
122
|
-
credentialId: string;
|
|
123
|
-
organisationId: string;
|
|
124
|
-
clientId: string;
|
|
125
|
-
clientSecret: string;
|
|
126
|
-
};
|
|
127
|
-
type OAuth2GrantClientCredentials = Record<PropertyKey, never>;
|
|
128
|
-
type OAuth2GrantPassword = {
|
|
129
|
-
credentialId: string;
|
|
130
|
-
organisationId: string;
|
|
131
|
-
clientId: string;
|
|
132
|
-
clientSecret: string;
|
|
133
|
-
};
|
|
134
|
-
type OAuth2Grant = {
|
|
135
|
-
type: 'authorizationCode' | 'clientCredentials' | 'password';
|
|
136
|
-
authorizationCode?: OAuth2GrantAuthCode;
|
|
137
|
-
clientCredentials?: OAuth2GrantClientCredentials;
|
|
138
|
-
password?: OAuth2GrantPassword;
|
|
139
|
-
};
|
|
140
|
-
export type AuthSchemeConfigOAuth2 = AuthSchemeConfigBase & {
|
|
141
|
-
schemeType: 'oauth2';
|
|
142
|
-
authorizeUrl: string;
|
|
143
|
-
tokenUrl: string;
|
|
144
|
-
scopes: OAuth2Scope[];
|
|
145
|
-
defaultScopes: string[];
|
|
146
|
-
additionalAuthorizeParams: string;
|
|
147
|
-
additionalTokenParams: string;
|
|
148
|
-
mltsEnabled: boolean;
|
|
149
|
-
mltsCredentialId: string;
|
|
150
|
-
grant: OAuth2Grant;
|
|
151
|
-
};
|
|
152
|
-
export type DigestInput = 'body' | 'url';
|
|
153
|
-
export type AuthSchemeConfigHMAC = AuthSchemeConfigBase & {
|
|
154
|
-
schemeType: 'hmac';
|
|
155
|
-
name: string;
|
|
156
|
-
in: 'query' | 'header' | 'cookie';
|
|
157
|
-
algorithm: 'sha1' | 'sha256' | 'sha512';
|
|
158
|
-
digestInputs: DigestInput[];
|
|
159
|
-
encoding: 'hex' | 'base64' | 'base64url';
|
|
160
|
-
};
|
|
161
|
-
type ParameterConfig = {
|
|
162
|
-
parameterName: string;
|
|
163
|
-
targetName: string;
|
|
164
|
-
location: 'LOCATION_IGNORE' | 'LOCATION_QUERY' | 'LOCATION_HEADER' | 'LOCATION_BODY' | 'LOCATION_ENDPOINT' | 'LOCAITON_HEADER_PARAMETER';
|
|
165
|
-
usages: 'USAGE_UNKNOWN' | 'USAGE_TEMP_CREDENTIAL_ENDPOINT' | 'USAGE_TOKEN_REQUEST_ENDPOINT';
|
|
166
|
-
required: boolean;
|
|
167
|
-
modifiable: boolean;
|
|
168
|
-
};
|
|
169
|
-
type Endpoint = {
|
|
170
|
-
url: string;
|
|
171
|
-
additionalParamConfigs: ParameterConfig[];
|
|
172
|
-
parameterTransmission: 'AUTH_STYLE_AUTHORIZATION_HEADER' | 'AUTH_STYLE_QUERY' | 'AUTH_STYLE_FORM';
|
|
173
|
-
};
|
|
174
|
-
export type AuthSchemeConfigOAuth1 = AuthSchemeConfigBase & {
|
|
175
|
-
consumerKey: string;
|
|
176
|
-
consumerSecret: string;
|
|
177
|
-
schemeType: 'oauth1';
|
|
178
|
-
tempCredentialEndpoint: Endpoint;
|
|
179
|
-
resourceOwnerAuthorizationEndpoint: Endpoint;
|
|
180
|
-
tokenEndpoint: Endpoint;
|
|
181
|
-
signatureMethod: string;
|
|
182
|
-
credentialId: string;
|
|
183
|
-
};
|
|
184
|
-
export type AuthSchemeConfigCertificate = AuthSchemeConfigBase & {
|
|
185
|
-
schemeType: 'certificate';
|
|
186
|
-
};
|
|
187
|
-
export type Credential = {
|
|
188
|
-
data: Record<string, string>;
|
|
189
|
-
id: string;
|
|
190
|
-
name: string;
|
|
191
|
-
organisationId: string;
|
|
192
|
-
type: string;
|
|
193
|
-
};
|
|
194
|
-
export type ConnectionCredential = {
|
|
195
|
-
authSchemeConfig: AuthSchemeConfig;
|
|
196
|
-
credential: Credential;
|
|
197
|
-
id: string;
|
|
198
|
-
};
|
|
199
|
-
export type Connection = {
|
|
200
|
-
createdAt: string;
|
|
201
|
-
credentials: ConnectionCredential[];
|
|
202
|
-
id: string;
|
|
203
|
-
name: string;
|
|
204
|
-
templateId: string;
|
|
205
|
-
dynamic: boolean;
|
|
206
|
-
updatedAt: string;
|
|
207
|
-
baseUrl: string;
|
|
208
|
-
};
|
|
209
|
-
export type System = {
|
|
210
|
-
documentationUrl: string;
|
|
211
|
-
name: string;
|
|
212
|
-
protocol: string;
|
|
213
|
-
variablesSchema: {
|
|
214
|
-
[key: string]: any;
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
103
|
export type StaticCnxMap = {
|
|
218
104
|
name: string;
|
|
219
105
|
dynamic: false;
|
|
@@ -232,5 +118,4 @@ export type VersoriAPIError = {
|
|
|
232
118
|
message: string;
|
|
233
119
|
code: string;
|
|
234
120
|
};
|
|
235
|
-
export {};
|
|
236
121
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG,CACzB,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG,CACzB,UAAU,EAAE,mBAAmB,EAC/B,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEvE,MAAM,WAAW,mBAAmB;IAChC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,KAAK,GAAG,SAAS,CAAC,CAAC;IAC5D,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IACzE,WAAW,IAAI,mBAAmB,CAAC;IACnC,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG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AO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,YAAY,EAA+B,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIlG;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAUrD;AAED,qBAAa,mBAAoB,YAAW,YAAY;IACpD,OAAO,CAAC,UAAU,CAAmB;gBAEzB,GAAG,EAAE,gBAAgB;IAIjC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB;IAShD,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,YAAY,EAA+B,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIlG;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAUrD;AAED,qBAAa,mBAAoB,YAAW,YAAY;IACpD,OAAO,CAAC,UAAU,CAAmB;gBAEzB,GAAG,EAAE,gBAAgB;IAIjC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB;IAShD,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAO/C,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAczC,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;CAa9C"}
|
|
@@ -49,6 +49,9 @@ export class VersoriConfigReader {
|
|
|
49
49
|
return new VersoriConfigReader(versoriCfg);
|
|
50
50
|
}
|
|
51
51
|
getCnxMapping(name) {
|
|
52
|
+
if (this.versoriCfg.mappings === null) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
52
55
|
return this.versoriCfg.mappings.find((c) => c.name.toLowerCase() === name.toLowerCase());
|
|
53
56
|
}
|
|
54
57
|
getConnectionID(connName) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type * as express from 'express';
|
|
2
2
|
import { AsyncWorkflow } from '../../context/AsyncWorkflow.js';
|
|
3
|
-
import { Context,
|
|
4
|
-
import { Issue } from '../../issues/Issues.js';
|
|
3
|
+
import { Context, CreateIssue, WorkflowOpts } from '../../context/Context.js';
|
|
5
4
|
import { KeyValue, KeyValueScope } from '../../kv/KeyValue.js';
|
|
6
5
|
import { Logger } from '../../observability/logging/Logger.js';
|
|
7
6
|
import { CredentialsProvider } from '../http/versori/contextcredentials.js';
|
|
8
7
|
import { ArrayTask, Task, Taskable, TaskType } from '../Task.js';
|
|
9
|
-
import { ActivationImpl } from '../../context/ActivationImpl.js';
|
|
10
8
|
import { FetchLike } from '../../connection/types.js';
|
|
9
|
+
import { ActivationInterface } from '../http/types.js';
|
|
10
|
+
import { Issue } from '../../services/platform/generated/types.gen.js';
|
|
11
11
|
/**
|
|
12
12
|
* HttpContext extends the standard {@link Context} with HTTP-specific functionality including an authenticated
|
|
13
13
|
* `fetch` function and connection variables.
|
|
@@ -93,11 +93,11 @@ export declare class HttpContextImpl<D, PageParams> implements HttpContext<D, Pa
|
|
|
93
93
|
pageParams?: PageParams;
|
|
94
94
|
readonly fetch: FetchLike;
|
|
95
95
|
readonly baseUrl: Promise<string>;
|
|
96
|
-
constructor(ctx:
|
|
96
|
+
constructor(ctx: Context<D>, connectionVars: Record<string, any>, fetch: FetchLike, baseUrl: string, pageParams?: PageParams);
|
|
97
97
|
get log(): Logger;
|
|
98
98
|
get executionId(): string;
|
|
99
99
|
get startTime(): Date;
|
|
100
|
-
get activation():
|
|
100
|
+
get activation(): ActivationInterface;
|
|
101
101
|
get data(): D;
|
|
102
102
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
103
103
|
destroy(scope: KeyValueScope): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpTask.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/tasks/HttpTask.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"HttpTask.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/tasks/HttpTask.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKjE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAE,SAAQ,OAAO,CAAC,IAAI,CAAC;IAC5E;;;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mBAAmB,CAEpC;IAED,IAAI,IAAI,IAAI,CAAC,CAEZ;IAED,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,QAAQ;IAIvC,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5C,WAAW,IAAI,mBAAmB;IAIlC,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAI7E,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QACtC,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAIzB,QAAQ,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD,OAAO,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS;CAGzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,UAAU,GAAG,OAAO,EAC1D,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,EAC7B,EAAE,EAAE,eAAe,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,GACzC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAEf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActivationInterface } from '../http/types.js';
|
|
2
2
|
import { Taskable } from '../Task.js';
|
|
3
3
|
import { Trigger, TriggerType } from '../Trigger.js';
|
|
4
4
|
import { Workflow } from '../Workflow.js';
|
|
@@ -15,7 +15,7 @@ export type PrebuiltPredicate = 'all';
|
|
|
15
15
|
* ActivationPredicate determines which user activations should trigger the workflow. Can be either a built-in
|
|
16
16
|
* predicate like 'all', or a custom function that receives an activation and returns a boolean.
|
|
17
17
|
*/
|
|
18
|
-
export type ActivationPredicate = PrebuiltPredicate | ((a?:
|
|
18
|
+
export type ActivationPredicate = PrebuiltPredicate | ((a?: ActivationInterface) => boolean);
|
|
19
19
|
export declare class ScheduleTrigger implements Trigger<ScheduleData> {
|
|
20
20
|
id: string;
|
|
21
21
|
[TriggerType]: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleTrigger.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/triggers/ScheduleTrigger.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ScheduleTrigger.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/triggers/ScheduleTrigger.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,mBAAmB,KAAK,OAAO,CAAC,CAAC;AAE7F,qBAAa,eAAgB,YAAW,OAAO,CAAC,YAAY,CAAC;IACzD,EAAE,EAAE,MAAM,CAAC;IAEX,CAAC,WAAW,CAAC,EAAE,MAAM,CAAc;IAEnC,QAAQ,EAAE,MAAM,CAAC;IAEjB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;gBAE9B,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,mBAAmB;IAMnF,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;IAIxD,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC;CAGvC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,QAAQ,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,mBAAmB,CAAC,EAAE,mBAAmB,GAC1C,QAAQ,CAAC,YAAY,CAAC,CAExB"}
|
|
@@ -4,7 +4,7 @@ import { Router } from 'express';
|
|
|
4
4
|
import { Observable, Subscription } from 'rxjs';
|
|
5
5
|
import { DirectConnectionFactory } from '../../connection/DirectConnectionFactory.js';
|
|
6
6
|
import { ContextImpl } from '../../context/Context.js';
|
|
7
|
-
import { ContextProvider } from '../../context/ContextProvider.js';
|
|
7
|
+
import { ContextProvider, ContextProviderImpl } from '../../context/ContextProvider.js';
|
|
8
8
|
import { ConfigReader, CronProvider } from '../../dsl/http/types.js';
|
|
9
9
|
import { Workflow } from '../../dsl/Workflow.js';
|
|
10
10
|
import { IssueAPI } from '../../issues/Issues.js';
|
|
@@ -26,7 +26,7 @@ export type MemoryInterpreterOptions = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Custom context provider. Advanced use only.
|
|
28
28
|
*/
|
|
29
|
-
contextProvider?:
|
|
29
|
+
contextProvider?: ContextProviderImpl;
|
|
30
30
|
/**
|
|
31
31
|
* Abort signal to cancel workflow execution.
|
|
32
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/MemoryInterpreter.ts"],"names":[],"mappings":"AAaA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MA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Aa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAC3B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACxB,UAAU,EAAE,uBAAuB,EACnC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,QAAQ,EACxB,SAAS,EAAE,YAAY,EACvB,OAAO,CAAC,EAAE,OAAO,YAAA;WAWzB,WAAW,CAAC,OAAO,GAAE,wBAA6B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAqG5F,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,wBAAwB;IAmDrE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA8LtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CASxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/schedule.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/schedule.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAyI7C,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,YAAY,EAAE,eAAe,CAG3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/interpreter/mod.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;GAYG;AACH,cAAc,iBAAiB,CAAC;AAChC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/interpreter/mod.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;GAYG;AACH,cAAc,iBAAiB,CAAC;AAChC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Context } from '../../context/Context.js';
|
|
2
|
+
/**
|
|
3
|
+
* ExecutionError wraps errors that occur during durable workflow execution, providing access to the context at the
|
|
4
|
+
* time of the error. This is used with the {@link DurableInterpreter}.
|
|
5
|
+
*
|
|
6
|
+
* Note: When using the {@link MemoryInterpreter}, errors in `.catch()` handlers will be instances of the regular
|
|
7
|
+
* `ExecutionError` instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ExecutionError extends Error {
|
|
10
|
+
/**
|
|
11
|
+
* The workflow context at the time the error occurred.
|
|
12
|
+
*/
|
|
13
|
+
ctx: Context<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new ExecutionError.
|
|
16
|
+
*
|
|
17
|
+
* @param ctx The workflow context at the time of the error.
|
|
18
|
+
* @param message The error message.
|
|
19
|
+
* @param opts Optional error options.
|
|
20
|
+
*/
|
|
21
|
+
constructor(ctx: Context<any>, message: string, opts?: ErrorOptions);
|
|
22
|
+
toJSON(): {
|
|
23
|
+
name: string;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ExecutionError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutionError.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/vanilla/ExecutionError.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD;;;;;;GAMG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACrC;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAElB;;;;;;OAMG;gBACS,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY;IAOnE,MAAM;;;;CAMT"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
/**
|
|
14
|
+
* ExecutionError wraps errors that occur during durable workflow execution, providing access to the context at the
|
|
15
|
+
* time of the error. This is used with the {@link DurableInterpreter}.
|
|
16
|
+
*
|
|
17
|
+
* Note: When using the {@link MemoryInterpreter}, errors in `.catch()` handlers will be instances of the regular
|
|
18
|
+
* `ExecutionError` instead.
|
|
19
|
+
*/
|
|
20
|
+
export class ExecutionError extends Error {
|
|
21
|
+
/**
|
|
22
|
+
* Create a new ExecutionError.
|
|
23
|
+
*
|
|
24
|
+
* @param ctx The workflow context at the time of the error.
|
|
25
|
+
* @param message The error message.
|
|
26
|
+
* @param opts Optional error options.
|
|
27
|
+
*/
|
|
28
|
+
constructor(ctx, message, opts) {
|
|
29
|
+
super(message, opts);
|
|
30
|
+
/**
|
|
31
|
+
* The workflow context at the time the error occurred.
|
|
32
|
+
*/
|
|
33
|
+
Object.defineProperty(this, "ctx", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: void 0
|
|
38
|
+
});
|
|
39
|
+
this.name = 'ExecutionError';
|
|
40
|
+
this.ctx = ctx;
|
|
41
|
+
}
|
|
42
|
+
toJSON() {
|
|
43
|
+
return {
|
|
44
|
+
name: this.name,
|
|
45
|
+
message: this.message,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Tracer } from '@opentelemetry/api';
|
|
2
|
+
import { Router } from 'express';
|
|
3
|
+
import { Observable, OperatorFunction } from 'rxjs';
|
|
4
|
+
import { ConfigReader } from '../../dsl/http/types.js';
|
|
5
|
+
import { Task } from '../../dsl/Task.js';
|
|
6
|
+
import { Trigger } from '../../dsl/Trigger.js';
|
|
7
|
+
import { Logger } from '../../observability/logging/Logger.js';
|
|
8
|
+
import { ContextOperatorFunction, TaskCompiler, TriggerCompiler } from './compilers/types.js';
|
|
9
|
+
import { QueueAPI } from './Queue.js';
|
|
10
|
+
import { ConnectionFactory } from '../../connection/types.js';
|
|
11
|
+
import { VanillaContext } from '../../context/VanillaContext.js';
|
|
12
|
+
import { Activation } from '@versori/run/services/platform';
|
|
13
|
+
import { ContextProvider } from '../../context/ContextProvider.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,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACpD,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;AAU/D,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG9F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EA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B,OAAO,EAAE,CAAC,EACV,MAAM,EAAE,WAAW,GACpB,UAAU,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,95 @@
|
|
|
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
|
+
import { TaskType } from '../../dsl/Task.js';
|
|
14
|
+
import { TriggerType } from '../../dsl/Trigger.js';
|
|
15
|
+
import { backgroundCompiler } from './compilers/background.js';
|
|
16
|
+
import { catchCompiler } from './compilers/catch.js';
|
|
17
|
+
import { chainCompiler } from './compilers/chain.js';
|
|
18
|
+
import { durableWorkflowCompiler } from './compilers/durableworkflow.js';
|
|
19
|
+
import { fnCompiler } from './compilers/fn.js';
|
|
20
|
+
import { httpCompiler } from './compilers/http.js';
|
|
21
|
+
import { parallelCompiler } from './compilers/parallel.js';
|
|
22
|
+
import { scheduleCompiler } from './compilers/schedule.js';
|
|
23
|
+
import { serialCompiler } from './compilers/serial.js';
|
|
24
|
+
import { unpackCompiler } from './compilers/unpack.js';
|
|
25
|
+
import { webhookCompiler } from './compilers/webhook.js';
|
|
26
|
+
export const VanillaActivation = {
|
|
27
|
+
id: 'vanilla-webhook-activation',
|
|
28
|
+
user: {
|
|
29
|
+
id: 'vanilla-user-id',
|
|
30
|
+
externalId: 'vanilla-user-external-id',
|
|
31
|
+
displayName: 'Vanilla User',
|
|
32
|
+
organisationId: 'vanilla-org-id',
|
|
33
|
+
createdAt: new Date().toISOString(),
|
|
34
|
+
updatedAt: new Date().toISOString(),
|
|
35
|
+
},
|
|
36
|
+
connections: [],
|
|
37
|
+
dynamicVariables: {},
|
|
38
|
+
environment: undefined,
|
|
39
|
+
};
|
|
40
|
+
export class ObservableCompiler {
|
|
41
|
+
constructor() {
|
|
42
|
+
Object.defineProperty(this, "taskCompilers", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: new Map()
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(this, "triggerCompilers", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: new Map()
|
|
53
|
+
});
|
|
54
|
+
// Register all available compilers
|
|
55
|
+
this.registerTask(parallelCompiler);
|
|
56
|
+
this.registerTask(serialCompiler);
|
|
57
|
+
this.registerTask(catchCompiler);
|
|
58
|
+
this.registerTask(chainCompiler);
|
|
59
|
+
this.registerTask(fnCompiler);
|
|
60
|
+
this.registerTask(backgroundCompiler);
|
|
61
|
+
this.registerTask(unpackCompiler);
|
|
62
|
+
this.registerTask(httpCompiler);
|
|
63
|
+
this.registerTrigger(scheduleCompiler);
|
|
64
|
+
this.registerTrigger(webhookCompiler);
|
|
65
|
+
this.registerTrigger(durableWorkflowCompiler);
|
|
66
|
+
}
|
|
67
|
+
compileTask(ctx, task) {
|
|
68
|
+
const compiler = this.taskCompilers.get(task[TaskType]);
|
|
69
|
+
if (!compiler) {
|
|
70
|
+
throw new Error(`No compiler registered for task type: ${task[TaskType]}`);
|
|
71
|
+
}
|
|
72
|
+
if (!(task instanceof compiler.ctor)) {
|
|
73
|
+
throw new Error(`Task type mismatch: expected ${compiler.ctor.name}, got ${task.constructor.name}`);
|
|
74
|
+
}
|
|
75
|
+
return compiler.compile(ctx, task);
|
|
76
|
+
}
|
|
77
|
+
compileTrigger(ctx, trigger, signal) {
|
|
78
|
+
const compiler = this.triggerCompilers.get(trigger[TriggerType]);
|
|
79
|
+
if (!compiler) {
|
|
80
|
+
throw new Error(`No compiler registered for trigger type: ${trigger[TriggerType]}`);
|
|
81
|
+
}
|
|
82
|
+
if (!(trigger instanceof compiler.ctor)) {
|
|
83
|
+
throw new Error(`Trigger type mismatch: expected ${compiler.ctor.name}, got ${trigger.constructor.name}`);
|
|
84
|
+
}
|
|
85
|
+
return compiler.compile(ctx, trigger, signal);
|
|
86
|
+
}
|
|
87
|
+
registerTask(compiler) {
|
|
88
|
+
const task = new compiler.ctor();
|
|
89
|
+
this.taskCompilers.set(task[TaskType], compiler);
|
|
90
|
+
}
|
|
91
|
+
registerTrigger(compiler) {
|
|
92
|
+
const trigger = new compiler.ctor();
|
|
93
|
+
this.triggerCompilers.set(trigger[TriggerType], compiler);
|
|
94
|
+
}
|
|
95
|
+
}
|