@transai/connector-runner-api 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/index.cjs +1 -1
- package/index.cjs.map +3 -3
- package/index.js +1 -1
- package/index.js.map +2 -2
- package/libs/types/src/lib/management-api/workflow/enums/index.d.ts +3 -0
- package/libs/types/src/lib/management-api/workflow/enums/node-types.enum.d.ts +14 -0
- package/libs/types/src/lib/management-api/workflow/enums/workflow-status.enum.d.ts +16 -0
- package/libs/types/src/lib/management-api/workflow/index.d.ts +4 -3
- package/libs/types/src/lib/management-api/workflow/parameter-mapper.interface.d.ts +26 -0
- package/libs/types/src/lib/management-api/workflow/workflow-definition.interface.d.ts +37 -35
- package/libs/types/src/lib/management-api/workflow/{workflow.drawing.d.ts → workflow-drawing.interface.d.ts} +4 -17
- package/libs/types/src/lib/management-api/workflow/{workflow-run.d.ts → workflow-run.interface.d.ts} +31 -40
- package/package.json +2 -2
- /package/libs/types/src/lib/management-api/workflow/{trigger-types.interface.d.ts → enums/trigger-types.enum.d.ts} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface ValueMapper {
|
|
2
|
+
selector: string;
|
|
3
|
+
type: 'string' | 'number' | 'boolean';
|
|
4
|
+
required?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ArrayMapper {
|
|
7
|
+
selector: string;
|
|
8
|
+
type: 'array';
|
|
9
|
+
required?: boolean;
|
|
10
|
+
items: MessageMapper;
|
|
11
|
+
}
|
|
12
|
+
export type MessageMapper = {
|
|
13
|
+
[key: string]: ValueMapper | ArrayMapper;
|
|
14
|
+
};
|
|
15
|
+
export interface ConditionMapper {
|
|
16
|
+
selector: string;
|
|
17
|
+
[key: string]: string | {
|
|
18
|
+
id: string;
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface ValidationMapper {
|
|
23
|
+
selector: string;
|
|
24
|
+
custom_failure_message?: string;
|
|
25
|
+
}
|
|
26
|
+
export type NodeMapper = MessageMapper | ConditionMapper | ValidationMapper | {};
|
|
@@ -1,47 +1,45 @@
|
|
|
1
|
-
import { TriggerType } from './
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export interface ArrayMapper {
|
|
9
|
-
selector: string;
|
|
10
|
-
type: 'array';
|
|
11
|
-
required?: boolean;
|
|
12
|
-
items: MessageMapper;
|
|
13
|
-
}
|
|
14
|
-
export type MessageMapper = {
|
|
15
|
-
[key: string]: ValueMapper | ArrayMapper;
|
|
16
|
-
};
|
|
17
|
-
export interface ConditionMapper {
|
|
18
|
-
selector: string;
|
|
19
|
-
[key: string]: string | {
|
|
20
|
-
id: string;
|
|
21
|
-
value: string;
|
|
22
|
-
};
|
|
1
|
+
import { NodeTypes, TriggerType } from './enums';
|
|
2
|
+
import { ConditionMapper, MessageMapper, NodeMapper, ValidationMapper } from './parameter-mapper.interface';
|
|
3
|
+
import { WorkflowDrawing } from './workflow-drawing.interface';
|
|
4
|
+
export interface StoredInterface {
|
|
5
|
+
id: string;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
updatedAt: Date;
|
|
23
8
|
}
|
|
24
|
-
export type NodeMapper = MessageMapper | ConditionMapper;
|
|
25
9
|
export interface TriggerInterface {
|
|
26
10
|
name: string;
|
|
27
11
|
type: TriggerType;
|
|
28
12
|
identifier: string;
|
|
29
13
|
expression?: string;
|
|
30
14
|
}
|
|
31
|
-
export interface
|
|
15
|
+
export interface WorkflowDefinitionStepBase {
|
|
32
16
|
name: string;
|
|
33
17
|
identifier: string;
|
|
34
18
|
requires: Array<string>;
|
|
35
|
-
type: NodeTypes;
|
|
36
19
|
operationIdentifier: string;
|
|
37
20
|
operationVersion?: string;
|
|
21
|
+
type: NodeTypes;
|
|
38
22
|
with: NodeMapper;
|
|
39
23
|
}
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
export type BaseWorkflowDefinitionStep = WorkflowDefinitionStepBase & StoredInterface;
|
|
25
|
+
export interface ActionStep extends WorkflowDefinitionStepBase {
|
|
26
|
+
type: NodeTypes.ACTION;
|
|
27
|
+
with: MessageMapper;
|
|
28
|
+
operationVersion: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ConditionalStep extends WorkflowDefinitionStepBase {
|
|
31
|
+
type: NodeTypes.CONDITIONAL;
|
|
32
|
+
with: ConditionMapper;
|
|
33
|
+
}
|
|
34
|
+
export interface ValidationStep extends WorkflowDefinitionStepBase {
|
|
35
|
+
type: NodeTypes.VALIDATION;
|
|
36
|
+
with: ValidationMapper;
|
|
37
|
+
}
|
|
38
|
+
export interface PlaceholderStep extends WorkflowDefinitionStepBase {
|
|
39
|
+
type: NodeTypes.PLACEHOLDER;
|
|
40
|
+
with: {};
|
|
44
41
|
}
|
|
42
|
+
export type WorkflowDefinitionStep = ActionStep | ConditionalStep | ValidationStep | PlaceholderStep;
|
|
45
43
|
export interface CreateWorkflowDefinition {
|
|
46
44
|
identifier: string;
|
|
47
45
|
name: string;
|
|
@@ -50,15 +48,19 @@ export interface CreateWorkflowDefinition {
|
|
|
50
48
|
triggerType: TriggerType;
|
|
51
49
|
triggerIdentifier: string;
|
|
52
50
|
semanticIdentifier: string;
|
|
53
|
-
steps: Array<
|
|
51
|
+
steps: Array<WorkflowDefinitionStepBase>;
|
|
54
52
|
enabled: boolean;
|
|
55
53
|
workflowDrawing?: WorkflowDrawing;
|
|
56
54
|
trigger?: TriggerInterface;
|
|
57
55
|
}
|
|
58
|
-
export interface WorkflowDefinition extends CreateWorkflowDefinition {
|
|
59
|
-
steps: Array<
|
|
60
|
-
id: string;
|
|
61
|
-
createdAt: Date;
|
|
62
|
-
updatedAt: Date;
|
|
56
|
+
export interface WorkflowDefinition extends CreateWorkflowDefinition, StoredInterface {
|
|
57
|
+
steps: Array<WorkflowDefinitionStepBase>;
|
|
63
58
|
tenantIdentifier: string;
|
|
64
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* TODO: set this later as WorkflowDefinition
|
|
62
|
+
* However if i do that right now, compilation fails
|
|
63
|
+
*/
|
|
64
|
+
export interface BetterWorkflowDefinition extends WorkflowDefinition {
|
|
65
|
+
steps: Array<WorkflowDefinitionStep & StoredInterface>;
|
|
66
|
+
}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
import { TriggerType } from './
|
|
2
|
-
import { ConditionMapper, MessageMapper } from './
|
|
3
|
-
export declare enum NodeTypes {
|
|
4
|
-
TRIGGER = "TRIGGER",
|
|
5
|
-
ACTION = "ACTION",
|
|
6
|
-
CONDITIONAL = "CONDITIONAL",
|
|
7
|
-
VALIDATION = "VALIDATION",
|
|
8
|
-
ANNOTATION = "ANNOTATION",
|
|
9
|
-
PLACEHOLDER = "PLACEHOLDER",
|
|
10
|
-
INVISIBLE = "INVISIBLE",
|
|
11
|
-
END = "END"
|
|
12
|
-
}
|
|
13
|
-
export declare enum ConditionalTypes {
|
|
14
|
-
TRUE_FALSE = "TRUE_FALSE",
|
|
15
|
-
CASE = "CASE"
|
|
16
|
-
}
|
|
1
|
+
import { ConditionalTypes, NodeTypes, TriggerType } from './enums';
|
|
2
|
+
import { ConditionMapper, MessageMapper, ValidationMapper } from './parameter-mapper.interface';
|
|
17
3
|
export interface Conditional {
|
|
18
4
|
type: ConditionalTypes;
|
|
19
5
|
}
|
|
@@ -50,7 +36,7 @@ export interface ConditionalNode extends Node {
|
|
|
50
36
|
}
|
|
51
37
|
export interface ValidationNode extends Node {
|
|
52
38
|
type: NodeTypes.VALIDATION;
|
|
53
|
-
with:
|
|
39
|
+
with: ValidationMapper;
|
|
54
40
|
}
|
|
55
41
|
export interface AnnotationNode extends Node {
|
|
56
42
|
type: NodeTypes.ANNOTATION;
|
|
@@ -60,6 +46,7 @@ export interface EndNode extends Node {
|
|
|
60
46
|
}
|
|
61
47
|
export interface PlaceholderNode extends Node {
|
|
62
48
|
type: NodeTypes.PLACEHOLDER;
|
|
49
|
+
with: {};
|
|
63
50
|
}
|
|
64
51
|
export interface InvisibleNode extends Node {
|
|
65
52
|
type: NodeTypes.INVISIBLE;
|
package/libs/types/src/lib/management-api/workflow/{workflow-run.d.ts → workflow-run.interface.d.ts}
RENAMED
|
@@ -1,37 +1,9 @@
|
|
|
1
1
|
import { EventInterface } from '../event-origin.interface';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
SUCCESS = "SUCCESS",
|
|
8
|
-
FAILED = "FAILED"
|
|
9
|
-
}
|
|
10
|
-
export declare enum WorkflowJobStatusStatus {
|
|
11
|
-
PENDING = "PENDING",
|
|
12
|
-
RUNNING = "RUNNING",
|
|
13
|
-
SUCCESS = "SUCCESS",
|
|
14
|
-
SKIPPED = "SKIPPED",
|
|
15
|
-
BAD_REQUEST = "BAD_REQUEST",// input validation errors
|
|
16
|
-
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
|
|
17
|
-
ABORTED = "ABORTED"
|
|
18
|
-
}
|
|
19
|
-
export interface WorkflowRunInterface {
|
|
20
|
-
id: string;
|
|
21
|
-
tenantIdentifier: string;
|
|
22
|
-
semanticIdentifier: string;
|
|
23
|
-
status: WorkflowRunStatusStatus;
|
|
24
|
-
ttl: number;
|
|
25
|
-
workflow: WorkflowDefinition;
|
|
26
|
-
drawing?: WorkflowDrawing;
|
|
27
|
-
trigger: EventInterface;
|
|
28
|
-
jobs: Array<ActionJob | ConditionalJob | ValidationJob>;
|
|
29
|
-
createdAt: Date;
|
|
30
|
-
updatedAt: Date;
|
|
31
|
-
testRun?: boolean;
|
|
32
|
-
restartOf?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface WorkflowJobInterface {
|
|
2
|
+
import { WorkflowDefinition, WorkflowDefinitionStep } from './workflow-definition.interface';
|
|
3
|
+
import { WorkflowDrawing } from './workflow-drawing.interface';
|
|
4
|
+
import { ConditionMapper, MessageMapper, NodeMapper, ValidationMapper } from './parameter-mapper.interface';
|
|
5
|
+
import { WorkflowRunStatusStatus, WorkflowJobStatusStatus, NodeTypes } from './enums';
|
|
6
|
+
export interface BaseWorkflowJobInterface {
|
|
35
7
|
id: string;
|
|
36
8
|
identifier: string;
|
|
37
9
|
run: WorkflowRunInterface;
|
|
@@ -41,26 +13,45 @@ export interface WorkflowJobInterface {
|
|
|
41
13
|
payload?: Record<string, unknown> | undefined;
|
|
42
14
|
log?: string;
|
|
43
15
|
result?: unknown;
|
|
44
|
-
type: NodeTypes;
|
|
45
|
-
with: NodeMapper;
|
|
46
16
|
requires: Array<string>;
|
|
47
17
|
step: WorkflowDefinitionStep;
|
|
48
18
|
testRun?: boolean;
|
|
49
19
|
createdAt: Date;
|
|
50
20
|
updatedAt: Date;
|
|
21
|
+
type: NodeTypes;
|
|
22
|
+
with: NodeMapper;
|
|
51
23
|
}
|
|
52
|
-
export interface ActionJob extends
|
|
24
|
+
export interface ActionJob extends BaseWorkflowJobInterface {
|
|
53
25
|
type: NodeTypes.ACTION;
|
|
54
26
|
with: MessageMapper;
|
|
27
|
+
operationIdentifier: string;
|
|
28
|
+
operationVersion: string;
|
|
55
29
|
}
|
|
56
|
-
export interface ConditionalJob extends
|
|
30
|
+
export interface ConditionalJob extends BaseWorkflowJobInterface {
|
|
57
31
|
type: NodeTypes.CONDITIONAL;
|
|
58
32
|
with: ConditionMapper;
|
|
59
33
|
}
|
|
60
|
-
export interface ValidationJob extends
|
|
34
|
+
export interface ValidationJob extends BaseWorkflowJobInterface {
|
|
61
35
|
type: NodeTypes.VALIDATION;
|
|
62
|
-
with:
|
|
36
|
+
with: ValidationMapper;
|
|
63
37
|
}
|
|
64
|
-
export interface PlaceholderJob extends
|
|
38
|
+
export interface PlaceholderJob extends BaseWorkflowJobInterface {
|
|
65
39
|
type: NodeTypes.PLACEHOLDER;
|
|
40
|
+
with: {};
|
|
41
|
+
}
|
|
42
|
+
export type WorkflowJobInterface = ActionJob | ConditionalJob | ValidationJob | PlaceholderJob;
|
|
43
|
+
export interface WorkflowRunInterface {
|
|
44
|
+
id: string;
|
|
45
|
+
tenantIdentifier: string;
|
|
46
|
+
semanticIdentifier: string;
|
|
47
|
+
status: WorkflowRunStatusStatus;
|
|
48
|
+
ttl: number;
|
|
49
|
+
workflow: WorkflowDefinition;
|
|
50
|
+
drawing?: WorkflowDrawing;
|
|
51
|
+
trigger: EventInterface;
|
|
52
|
+
jobs: Array<WorkflowJobInterface>;
|
|
53
|
+
createdAt: Date;
|
|
54
|
+
updatedAt: Date;
|
|
55
|
+
testRun?: boolean;
|
|
56
|
+
restartOf?: string;
|
|
66
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transai/connector-runner-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
"url": "https://transai.com"
|
|
12
12
|
},
|
|
13
13
|
"type": "commonjs",
|
|
14
|
-
"main": "./index.
|
|
14
|
+
"main": "./index.cjs",
|
|
15
15
|
"typings": "./index.d.ts"
|
|
16
16
|
}
|
|
File without changes
|