11import type {
2- CreateProcessInstanceResponse ,
3- DeployResourceResponse ,
4- SearchProcessInstanceResponse ,
5- SearchVariablesResponse ,
6- SearchElementInstancesResponse ,
7- SearchIncidentsResponse
8- } from '@camunda8/sdk/dist/c8/lib/C8Dto' ;
2+ CreateProcessInstanceResult ,
3+ SearchElementInstancesResponse ,
4+ SearchIncidentsResponse ,
5+ SearchProcessInstancesResponse ,
6+ SearchVariablesResponse ,
7+ CamundaClient
8+ } from '@camunda8/orchestration-cluster-api' ;
9+
10+ declare type ExtendedDeploymentResponse = Awaited < ReturnType < CamundaClient [ 'createDeployment' ] > >
11+
12+ export type {
13+ CreateProcessInstanceResult ,
14+ SearchElementInstancesResponse ,
15+ SearchIncidentsResponse ,
16+ SearchProcessInstancesResponse ,
17+ SearchVariablesResponse ,
18+ ExtendedDeploymentResponse
19+ }
20+
921
1022import type {
1123 ModdleElement
1224} from "bpmn-js/lib/model/Types" ;
1325
1426export type Input = {
15- [ elementId : string ] : string ;
27+ [ elementId : string ] : string ;
1628} ;
1729
1830export type Output = {
19- [ elementId : string ] : ElementOutput
31+ [ elementId : string ] : ElementOutput
2032} ;
2133
2234export type VARIABLE_SCOPE = 'LOCAL' | 'PROCESS' ;
2335
2436export type ElementOutputVariables = {
25- [ id : string ] : {
26- name : string ;
27- value : any ;
28- scope : VARIABLE_SCOPE ;
29- }
37+ [ id : string ] : {
38+ name : string ;
39+ value : any ;
40+ scope : VARIABLE_SCOPE ;
41+ }
3042} ;
3143
3244export type ElementOutput = {
33- success : boolean ;
34- variables ?: ElementOutputVariables ;
35- error ?: TaskExecutionError ;
36- incident ?: any ;
37- operateUrl ?: string ;
38- [ key : string ] : any ;
45+ success : boolean ;
46+ variables ?: ElementOutputVariables ;
47+ error ?: TaskExecutionError ;
48+ incident ?: any ;
49+ operateUrl ?: string ;
50+ [ key : string ] : any ;
3951} | undefined ;
4052
4153export type Config = {
42- input : Input ;
43- output : Output ;
54+ input : Input ;
55+ output : Output ;
4456} ;
4557
4658export type Variable = {
47- name : string ;
48- type ?: string ;
49- info ?: string ;
50- isList ?: boolean ;
51- entries ?: Variable [ ] ;
52- scope ?: ModdleElement ;
59+ name : string ;
60+ type ?: string ;
61+ info ?: string ;
62+ isList ?: boolean ;
63+ entries ?: Variable [ ] ;
64+ scope ?: ModdleElement ;
5365} ;
5466
5567export type Variables = Variable [ ] ;
5668
5769export type ApiResponse < T > =
58- | {
59- success : true ;
60- response : T ;
61- }
62- | {
63- success : false ;
64- error : string ;
65- }
70+ | {
71+ success : true ;
72+ response : T ;
73+ }
74+ | {
75+ success : false ;
76+ error : string ;
77+ }
6678
6779export type TaskExecutionApi = {
68- deploy : ( ) => Promise < ApiResponse < DeployResourceResponse > > ;
69- startInstance : ( processDefinitionKey : string , elementId : string , variables : { [ key : string ] : any } ) => Promise < ApiResponse < CreateProcessInstanceResponse > > ;
70- getProcessInstance : ( processInstanceKey : string ) => Promise < ApiResponse < SearchProcessInstanceResponse > > ;
71- getProcessInstanceVariables : ( processInstanceKey : string ) => Promise < ApiResponse < SearchVariablesResponse > > ;
72- getProcessInstanceElementInstances : ( processInstanceKey : string ) => Promise < ApiResponse < SearchElementInstancesResponse > > ;
73- getProcessInstanceIncident : ( processInstanceKey : string ) => Promise < ApiResponse < SearchIncidentsResponse > > ;
80+ deploy : ( ) => Promise < ApiResponse < ExtendedDeploymentResponse > > ;
81+ startInstance : ( processDefinitionKey : string , elementId : string , variables : {
82+ [ key : string ] : any
83+ } ) => Promise < ApiResponse < CreateProcessInstanceResult > > ;
84+ getProcessInstance : ( processInstanceKey : string ) => Promise < ApiResponse < SearchProcessInstancesResponse > > ;
85+ getProcessInstanceVariables : ( processInstanceKey : string ) => Promise < ApiResponse < SearchVariablesResponse > > ;
86+ getProcessInstanceElementInstances : ( processInstanceKey : string ) => Promise < ApiResponse < SearchElementInstancesResponse > > ;
87+ getProcessInstanceIncident : ( processInstanceKey : string ) => Promise < ApiResponse < SearchIncidentsResponse > > ;
7488} ;
7589
7690export type TaskExecutionStatus =
77- 'idle' |
78- 'deploying' |
79- 'starting-instance' |
80- 'executing' ;
91+ 'idle' |
92+ 'deploying' |
93+ 'starting-instance' |
94+ 'executing' ;
8195
8296export type TaskExecutionEvents =
83- 'taskExecution.status.changed' |
84- 'taskExecution.finished' |
85- 'taskExecution.error' |
86- 'taskExecution.interrupted' ;
97+ 'taskExecution.status.changed' |
98+ 'taskExecution.finished' |
99+ 'taskExecution.error' |
100+ 'taskExecution.interrupted' ;
87101
88102export type TaskExecutionResult = {
89- success : boolean ;
90- variables ?: ElementOutputVariables ;
91- error ?: TaskExecutionError ;
92- incident ?: any ;
103+ success : boolean ;
104+ variables ?: ElementOutputVariables ;
105+ error ?: TaskExecutionError ;
106+ incident ?: any ;
93107}
94108
95109export type TaskExecutionError = {
96- message : string ;
97- response ?: any ;
110+ message : string ;
111+ response ?: any ;
98112} ;
99113
100- export type { Element , ModdleElement } from 'bpmn-js/lib/model/Types' ;
114+ export type { Element , ModdleElement } from 'bpmn-js/lib/model/Types' ;
101115
102116export type Plugin = {
103- priority ?: number ;
104- render : Function ;
105- type : string ;
106- [ key : string ] : any ;
117+ priority ?: number ;
118+ render : Function ;
119+ type : string ;
120+ [ key : string ] : any ;
107121} ;
108122
109123export type PluginContextValue = {
110- plugins : Plugin [ ] ;
111- registerPlugin : ( plugin : Plugin ) => void ;
112- unregisterPlugin : ( plugin : Plugin ) => void ;
113- getPlugins : ( pluginPoint : string ) => Plugin [ ] ;
124+ plugins : Plugin [ ] ;
125+ registerPlugin : ( plugin : Plugin ) => void ;
126+ unregisterPlugin : ( plugin : Plugin ) => void ;
127+ getPlugins : ( pluginPoint : string ) => Plugin [ ] ;
114128} ;
0 commit comments