@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.
- package/esm/mod.d.ts +1 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- 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 +35 -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 +2 -1
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.d.ts +8 -8
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.js +1 -1
- package/esm/src/context/VanillaContext.d.ts +63 -0
- package/esm/src/context/VanillaContext.d.ts.map +1 -0
- package/esm/src/context/VanillaContext.js +313 -0
- package/esm/src/context/WorkflowClient.d.ts +2 -2
- package/esm/src/context/WorkflowClient.d.ts.map +1 -1
- 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 +20 -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/http/versori/webhookmiddleware.d.ts +1 -1
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
- package/esm/src/dsl/tasks/HttpTask.d.ts +4 -4
- 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/durable/DurableInterpreter.d.ts +1 -0
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/durable/DurableInterpreter.js +24 -7
- package/esm/src/interpreter/durable/Queue.d.ts +1 -1
- package/esm/src/interpreter/durable/Queue.js +1 -1
- package/esm/src/interpreter/durable/compilers/durableworkflow.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/durableworkflow.js +2 -1
- package/esm/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/fn.js +7 -4
- package/esm/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/webhook.js +7 -6
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +3 -2
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +24 -7
- package/esm/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/fn.js +7 -4
- package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +7 -6
- 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 +25 -0
- package/esm/src/interpreter/vanilla/ExecutionError.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/ExecutionError.js +46 -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/VanillaInterpreter.d.ts +96 -0
- package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -0
- package/esm/src/interpreter/vanilla/VanillaInterpreter.js +435 -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 +91 -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 +37 -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 +261 -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.map +1 -1
- package/esm/src/observability/logging/ConsoleLogger.d.ts +1 -1
- package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/esm/src/observability/logging/ConsoleLogger.js +11 -1
- package/esm/src/services/platform/generated/core/pathSerializer.gen.d.ts +2 -2
- package/package.json +1 -1
- package/script/mod.d.ts +1 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +2 -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 +40 -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 +2 -1
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/ContextProvider.d.ts +8 -8
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/ContextProvider.js +1 -1
- package/script/src/context/VanillaContext.d.ts +63 -0
- package/script/src/context/VanillaContext.d.ts.map +1 -0
- package/script/src/context/VanillaContext.js +319 -0
- package/script/src/context/WorkflowClient.d.ts +2 -2
- package/script/src/context/WorkflowClient.d.ts.map +1 -1
- 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 +20 -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/http/versori/webhookmiddleware.d.ts +1 -1
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
- package/script/src/dsl/tasks/HttpTask.d.ts +4 -4
- 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/durable/DurableInterpreter.d.ts +1 -0
- package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/durable/DurableInterpreter.js +24 -7
- package/script/src/interpreter/durable/Queue.d.ts +1 -1
- package/script/src/interpreter/durable/Queue.js +1 -1
- package/script/src/interpreter/durable/compilers/durableworkflow.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/durableworkflow.js +2 -1
- package/script/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/fn.js +7 -4
- package/script/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/webhook.js +7 -6
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +3 -2
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +24 -7
- package/script/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/fn.js +7 -4
- package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +7 -6
- 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 +25 -0
- package/script/src/interpreter/vanilla/ExecutionError.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/ExecutionError.js +50 -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/VanillaInterpreter.d.ts +96 -0
- package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -0
- package/script/src/interpreter/vanilla/VanillaInterpreter.js +442 -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 +95 -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 +40 -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 +267 -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.map +1 -1
- package/script/src/observability/logging/ConsoleLogger.d.ts +1 -1
- package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/script/src/observability/logging/ConsoleLogger.js +11 -1
- package/script/src/services/platform/generated/core/pathSerializer.gen.d.ts +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ProjectEnvironment, DynamicVariables, Connection } from '../../services/platform/mod.js';
|
|
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,18 @@ 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
|
+
/**
|
|
82
|
+
* The connections associated with this activation.
|
|
83
|
+
*/
|
|
84
|
+
connections?: Array<Connection>;
|
|
85
|
+
/**
|
|
86
|
+
* Dynamic variables associated with this activation.
|
|
87
|
+
*/
|
|
88
|
+
dynamicVariables?: DynamicVariables;
|
|
76
89
|
/**
|
|
77
90
|
* Get a dynamic variable value for this activation.
|
|
78
91
|
*
|
|
@@ -88,132 +101,6 @@ export interface Activation {
|
|
|
88
101
|
*/
|
|
89
102
|
setVariable(name: string, value: unknown): Promise<void>;
|
|
90
103
|
}
|
|
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
104
|
export type StaticCnxMap = {
|
|
218
105
|
name: string;
|
|
219
106
|
dynamic: false;
|
|
@@ -232,5 +119,4 @@ export type VersoriAPIError = {
|
|
|
232
119
|
message: string;
|
|
233
120
|
code: string;
|
|
234
121
|
};
|
|
235
|
-
export {};
|
|
236
122
|
//# 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,m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AAO,CAAC;IAEnC;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,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,4 +1,4 @@
|
|
|
1
|
-
import { PlatformApi } from '
|
|
1
|
+
import { PlatformApi } from '../../../services/platform/mod.js';
|
|
2
2
|
import { NextFunction, Request, Response } from 'express';
|
|
3
3
|
import { ConnectionFactory } from '../../../connection/types.js';
|
|
4
4
|
import { Logger } from '../../../observability/logging/Logger.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhookmiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/webhookmiddleware.ts"],"names":[],"mappings":"AAaA,OAAO,EAAc,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"webhookmiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/webhookmiddleware.ts"],"names":[],"mappings":"AAaA,OAAO,EAAc,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,2BAA2B,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,SAAS,EAAE,YAAY,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,6BAA6B,CACzC,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CA4GpE;AAED,wBAAgB,mCAAmC,CAC/C,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAkGpE;AAED,wBAAgB,oCAAoC,CAChD,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAqFpE"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type * as express from 'express';
|
|
2
2
|
import { FetchLike } from '../../connection/types.js';
|
|
3
|
-
import { ActivationImpl } from '../../context/ActivationImpl.js';
|
|
4
3
|
import { AsyncWorkflow } from '../../context/AsyncWorkflow.js';
|
|
5
|
-
import { Context,
|
|
4
|
+
import { Context, CreateIssue } from '../../context/Context.js';
|
|
6
5
|
import { WorkflowInterface, WorkflowOpts } from '../../context/WorkflowClient.js';
|
|
7
6
|
import { Issue } from '../../issues/Issues.js';
|
|
8
7
|
import { KeyValue, KeyValueScope } from '../../kv/KeyValue.js';
|
|
9
8
|
import { Logger } from '../../observability/logging/Logger.js';
|
|
9
|
+
import { ActivationInterface } from '../http/types.js';
|
|
10
10
|
import { CredentialsProvider } from '../http/versori/contextcredentials.js';
|
|
11
11
|
import { ArrayTask, Task, Taskable, TaskType } from '../Task.js';
|
|
12
12
|
/**
|
|
@@ -94,11 +94,11 @@ export declare class HttpContextImpl<D, PageParams> implements HttpContext<D, Pa
|
|
|
94
94
|
pageParams?: PageParams;
|
|
95
95
|
readonly fetch: FetchLike;
|
|
96
96
|
readonly baseUrl: Promise<string>;
|
|
97
|
-
constructor(ctx:
|
|
97
|
+
constructor(ctx: Context<D>, connectionVars: Record<string, any>, fetch: FetchLike, baseUrl: string, pageParams?: PageParams);
|
|
98
98
|
get log(): Logger;
|
|
99
99
|
get executionId(): string;
|
|
100
100
|
get startTime(): Date;
|
|
101
|
-
get activation():
|
|
101
|
+
get activation(): ActivationInterface;
|
|
102
102
|
get data(): D;
|
|
103
103
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
104
104
|
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,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"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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;IAItC,cAAc,IAAI,iBAAiB;CAGtC;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,O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C,QAAQ,CAAC,YAAY,CAAC,CAExB"}
|
|
@@ -39,6 +39,7 @@ export type DurableInterpreterOptions = {
|
|
|
39
39
|
skipVersoriCredentials?: boolean;
|
|
40
40
|
};
|
|
41
41
|
type Registration = {
|
|
42
|
+
triggerName: string;
|
|
42
43
|
trigger$: Observable<ContextImpl<any, void>>;
|
|
43
44
|
task$: ContextOperatorFunction<any, any, any>;
|
|
44
45
|
localAbortController: AbortController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DurableInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/durable/DurableInterpreter.ts"],"names":[],"mappings":"AAaA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AAEtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAarE,OAAO,EAAE,QAAQ,EAAgB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAa,MAAM,wBAAwB,CAAC;AAK7D,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAmB,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAA0B,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAa,MAAM,YAAY,CAAC;AAEjD;;GAEG;AACH,MAAM,M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DurableInterpreter {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
static async newInstance(options = {}) {
|
|
186
|
-
const log = options.logger || new ConsoleLogger(
|
|
186
|
+
const log = options.logger || new ConsoleLogger();
|
|
187
187
|
const compiler = options.compiler || new ObservableCompiler();
|
|
188
188
|
const serviceName = Deno.env.get(envVarProjectId) || 'example-service';
|
|
189
189
|
const environmentID = Deno.env.get(envVarEnvId) || 'development';
|
|
@@ -240,7 +240,10 @@ export class DurableInterpreter {
|
|
|
240
240
|
if (!(workflow instanceof WorkflowImpl)) {
|
|
241
241
|
throw new Error('workflow is not an instance of WorkflowImpl');
|
|
242
242
|
}
|
|
243
|
-
|
|
243
|
+
const triggerName = 'id' in workflow.trigger && typeof workflow.trigger.id === 'string'
|
|
244
|
+
? workflow.trigger.id
|
|
245
|
+
: workflow.trigger.constructor.name;
|
|
246
|
+
this.log.info('DurableInterpreter.register', { workflow, triggerName });
|
|
244
247
|
const compilerContext = {
|
|
245
248
|
compiler: this.compiler,
|
|
246
249
|
log: this.log,
|
|
@@ -259,11 +262,12 @@ export class DurableInterpreter {
|
|
|
259
262
|
const trigger$ = this.compiler.compileTrigger(compilerContext, workflow.trigger, combinedSignal);
|
|
260
263
|
const task$ = this.compiler.compileTask(compilerContext, workflow.task);
|
|
261
264
|
const registration = {
|
|
265
|
+
triggerName,
|
|
262
266
|
trigger$,
|
|
263
267
|
task$,
|
|
264
268
|
localAbortController,
|
|
265
269
|
sigintListener: () => {
|
|
266
|
-
this.log.info('Received SIGINT, shutting down workflow');
|
|
270
|
+
this.log.info('Received SIGINT, shutting down workflow', { triggerName });
|
|
267
271
|
localAbortController.abort();
|
|
268
272
|
},
|
|
269
273
|
};
|
|
@@ -291,16 +295,22 @@ export class DurableInterpreter {
|
|
|
291
295
|
Deno.addSignalListener('SIGINT', registration.sigintListener);
|
|
292
296
|
registration.subscription = registration.trigger$
|
|
293
297
|
.pipe(tap((ctx) => {
|
|
294
|
-
ctx.log.info('DurableInterpreter.executionStarted', {
|
|
298
|
+
ctx.log.info('DurableInterpreter.executionStarted', {
|
|
299
|
+
triggerName: registration.triggerName,
|
|
300
|
+
});
|
|
295
301
|
}), mergeMap((ctx) => of(ctx).pipe(registration.task$, catchError((err) => {
|
|
296
302
|
ctx.log.error('DurableInterpreter.executionError', {
|
|
303
|
+
triggerName: registration.triggerName,
|
|
297
304
|
error: err instanceof Error ? err.toString() : err,
|
|
298
305
|
});
|
|
299
306
|
try {
|
|
300
307
|
ctx.options.onError?.(ctx.withData(err));
|
|
301
308
|
}
|
|
302
309
|
catch (err) {
|
|
303
|
-
ctx.log.error('DurableInterpreter.onErrorError: failed to call onError handler', {
|
|
310
|
+
ctx.log.error('DurableInterpreter.onErrorError: failed to call onError handler', {
|
|
311
|
+
triggerName: registration.triggerName,
|
|
312
|
+
error: err instanceof Error ? err.toString() : err,
|
|
313
|
+
});
|
|
304
314
|
ctx.options.onError?.(ctx.withData({
|
|
305
315
|
message: 'Internal server error',
|
|
306
316
|
error: err instanceof Error ? err.toString() : err,
|
|
@@ -312,13 +322,17 @@ export class DurableInterpreter {
|
|
|
312
322
|
next: (ctx) => {
|
|
313
323
|
const durationMs = Date.now() - ctx.startTime.getTime();
|
|
314
324
|
ctx.log.info('DurableInterpreter.executionCompleted', {
|
|
325
|
+
triggerName: registration.triggerName,
|
|
315
326
|
durationMs,
|
|
316
327
|
});
|
|
317
328
|
try {
|
|
318
329
|
ctx.options.onSuccess?.(ctx);
|
|
319
330
|
}
|
|
320
331
|
catch (err) {
|
|
321
|
-
ctx.log.error('DurableInterpreter.onSuccessError: failed to call onSuccess handler', {
|
|
332
|
+
ctx.log.error('DurableInterpreter.onSuccessError: failed to call onSuccess handler', {
|
|
333
|
+
triggerName: registration.triggerName,
|
|
334
|
+
error: err instanceof Error ? err.toString() : err,
|
|
335
|
+
});
|
|
322
336
|
ctx.options.onSuccess?.(ctx.withData({
|
|
323
337
|
message: 'Internal server error',
|
|
324
338
|
error: err instanceof Error ? err.toString() : err,
|
|
@@ -328,12 +342,15 @@ export class DurableInterpreter {
|
|
|
328
342
|
},
|
|
329
343
|
error: (err) => {
|
|
330
344
|
this.log.error('DurableInterpreter.error', {
|
|
345
|
+
triggerName: registration.triggerName,
|
|
331
346
|
error: err instanceof Error ? err.toString() : err,
|
|
332
347
|
});
|
|
333
348
|
Deno.removeSignalListener('SIGINT', registration.sigintListener);
|
|
334
349
|
},
|
|
335
350
|
complete: () => {
|
|
336
|
-
this.log.info('DurableInterpreter.workflowCompleted'
|
|
351
|
+
this.log.info('DurableInterpreter.workflowCompleted', {
|
|
352
|
+
triggerName: registration.triggerName,
|
|
353
|
+
});
|
|
337
354
|
Deno.removeSignalListener('SIGINT', registration.sigintListener);
|
|
338
355
|
},
|
|
339
356
|
});
|
|
@@ -45,7 +45,7 @@ export class QueueImpl {
|
|
|
45
45
|
}
|
|
46
46
|
static fromEnv(log) {
|
|
47
47
|
const baseUrl = Deno.env.get(envVarSDKApiBaseURL);
|
|
48
|
-
const _log = log || new ConsoleLogger(
|
|
48
|
+
const _log = log || new ConsoleLogger();
|
|
49
49
|
const projectId = Deno.env.get(envVarProjectId) || 'default-project';
|
|
50
50
|
const environmentId = Deno.env.get(envVarEnvId) || 'default-environment';
|
|
51
51
|
if (!baseUrl) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durableworkflow.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/durableworkflow.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EACH,mBAAmB,EACnB,sBAAsB,EACzB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,sBAAsB,CAClC,GAAG,EAAE,sBAAsB,EAC3B,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,WAAW,GACpB,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"durableworkflow.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/durableworkflow.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EACH,mBAAmB,EACnB,sBAAsB,EACzB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,sBAAsB,CAClC,GAAG,EAAE,sBAAsB,EAC3B,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,WAAW,GACpB,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CA2F9C;AAED,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,mBAAmB,EAAE,sBAAsB,CAIhG,CAAC"}
|
|
@@ -40,7 +40,8 @@ export function compileDurableWorkflow(ctx, trigger, signal) {
|
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
42
|
for (const wf of wfs.workflows) {
|
|
43
|
-
const
|
|
43
|
+
const payload = wf.payload ? atob(wf.payload) : '{}';
|
|
44
|
+
const data = JSON.parse(payload);
|
|
44
45
|
let activation;
|
|
45
46
|
if (wf.metadata?.activationId) {
|
|
46
47
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fn.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/fn.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,OAAO,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"fn.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/fn.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,OAAO,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;AAiCnE,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAG/D,CAAC"}
|
|
@@ -19,12 +19,15 @@ function compileFn(compilerCtx, task) {
|
|
|
19
19
|
return await compilerCtx.tracer.startActiveSpan(`fn-${task.id}`, async (span) => {
|
|
20
20
|
span.setAttribute('task.id', task.id);
|
|
21
21
|
span.setAttribute('execution.id', ctx.executionId);
|
|
22
|
-
|
|
22
|
+
try {
|
|
23
|
+
if (typeof ctx.idx === 'number') {
|
|
24
|
+
return ctx.withData(await task._fn(ctx, ctx.idx));
|
|
25
|
+
}
|
|
26
|
+
return ctx.withData(await task._fn(ctx));
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
23
29
|
span.end();
|
|
24
|
-
return ctx.withData(await task._fn(ctx, ctx.idx));
|
|
25
30
|
}
|
|
26
|
-
span.end();
|
|
27
|
-
return ctx.withData(await task._fn(ctx));
|
|
28
31
|
});
|
|
29
32
|
}));
|
|
30
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/webhook.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAGtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAuD7C,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,WAAW,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/webhook.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAGtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAuD7C,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,WAAW,EAAE,cAAc,CAySxE,CAAC"}
|
|
@@ -96,12 +96,13 @@ export const webhookCompiler = {
|
|
|
96
96
|
},
|
|
97
97
|
request: req,
|
|
98
98
|
});
|
|
99
|
+
const routeMiddleware = [];
|
|
99
100
|
if (!trigger.options.request?.rawBody) {
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
routeMiddleware.push(express.json({ limit: '50mb', type: ['application/json', '*/*+json'] }));
|
|
102
|
+
routeMiddleware.push(xmlparser(xml2jsDefaults));
|
|
102
103
|
}
|
|
103
104
|
else {
|
|
104
|
-
|
|
105
|
+
routeMiddleware.push(express.raw({ type: '*/*', limit: '50mb' }));
|
|
105
106
|
}
|
|
106
107
|
return new Observable((subscriber) => {
|
|
107
108
|
if (!ctx.webhookRouter) {
|
|
@@ -118,7 +119,7 @@ export const webhookCompiler = {
|
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
// endpoint for sans user because I'm not quite sure how the dynamic routing works
|
|
121
|
-
ctx.webhookRouter[method](`/${trigger.id}`, createStaticWebhookMiddleware({
|
|
122
|
+
ctx.webhookRouter[method](`/${trigger.id}`, ...routeMiddleware, createStaticWebhookMiddleware({
|
|
122
123
|
id: trigger.id,
|
|
123
124
|
connName: trigger.options.connection,
|
|
124
125
|
organisationId: ctx.organisationId,
|
|
@@ -154,7 +155,7 @@ export const webhookCompiler = {
|
|
|
154
155
|
});
|
|
155
156
|
});
|
|
156
157
|
// this endpoint will trigger the workflow for each activation given by the external user ID
|
|
157
|
-
ctx.webhookRouter[method](`/${trigger.id}/users/:userId`, createUserIdDynamicWebhookMiddleware({
|
|
158
|
+
ctx.webhookRouter[method](`/${trigger.id}/users/:userId`, ...routeMiddleware, createUserIdDynamicWebhookMiddleware({
|
|
158
159
|
id: trigger.id,
|
|
159
160
|
connName: trigger.options.connection,
|
|
160
161
|
organisationId: ctx.organisationId,
|
|
@@ -210,7 +211,7 @@ export const webhookCompiler = {
|
|
|
210
211
|
});
|
|
211
212
|
});
|
|
212
213
|
// this endpoint will trigger the workflow only for the activation given by its ID
|
|
213
|
-
ctx.webhookRouter[method](`/${trigger.id}/activations/:activationId`, createActIdDynamicWebhookMiddleware({
|
|
214
|
+
ctx.webhookRouter[method](`/${trigger.id}/activations/:activationId`, ...routeMiddleware, createActIdDynamicWebhookMiddleware({
|
|
214
215
|
id: trigger.id,
|
|
215
216
|
organisationId: ctx.organisationId,
|
|
216
217
|
environmentId: Deno.env.get(envVarEnvId) ?? '',
|
|
@@ -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
|
*/
|
|
@@ -37,6 +37,7 @@ export type MemoryInterpreterOptions = {
|
|
|
37
37
|
skipVersoriCredentials?: boolean;
|
|
38
38
|
};
|
|
39
39
|
type Registration = {
|
|
40
|
+
triggerName: string;
|
|
40
41
|
trigger$: Observable<ContextImpl<any, void>>;
|
|
41
42
|
task$: ContextOperatorFunction<any, any, any>;
|
|
42
43
|
localAbortController: AbortController;
|
|
@@ -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,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AAEtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,
|
|
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,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AAEtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,OAAO,EAAE,QAAQ,EAAgB,MAAM,uBAAuB,CAAC;AAW/D,OAAO,EAAE,QAAQ,EAAa,MAAM,wBAAwB,CAAC;AAK7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