@5minds/processcube_engine_client 5.2.0-feature-9a5b28-m1yxdd4u → 6.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/Client.d.ts +4 -5
  2. package/dist/ClientFactory.d.ts +16 -17
  3. package/dist/Clients/ApplicationInfoHttpClient.d.ts +5 -4
  4. package/dist/Clients/BaseClient.d.ts +10 -8
  5. package/dist/Clients/CorrelationHttpClient.d.ts +4 -3
  6. package/dist/Clients/CronjobHttpClient.d.ts +5 -4
  7. package/dist/Clients/DataObjectInstanceHttpClient.d.ts +3 -2
  8. package/dist/Clients/EventHttpClient.d.ts +15 -11
  9. package/dist/Clients/ExternalTaskApiHttpClient.d.ts +7 -6
  10. package/dist/Clients/ExternalTaskHttpClient.d.ts +4 -3
  11. package/dist/Clients/FlowNodeInstanceHttpClient.d.ts +8 -10
  12. package/dist/Clients/Lib/SocketIoManager.d.ts +15 -28
  13. package/dist/Clients/ManualTaskHttpClient.d.ts +7 -6
  14. package/dist/Clients/NotificationHttpClient.d.ts +52 -59
  15. package/dist/Clients/ProcessDefinitionHttpClient.d.ts +11 -10
  16. package/dist/Clients/ProcessDefinitionHttpClientNode.d.ts +2 -2
  17. package/dist/Clients/ProcessInstanceHttpClient.d.ts +17 -7
  18. package/dist/Clients/ProcessModelHttpClient.d.ts +11 -10
  19. package/dist/Clients/UntypedTaskHttpClient.d.ts +7 -17
  20. package/dist/Clients/UserTaskHttpClient.d.ts +11 -10
  21. package/dist/Clients/index.d.ts +0 -1
  22. package/dist/ExternalTaskExecution.d.ts +1 -0
  23. package/dist/ExternalTaskWorker.d.ts +10 -1
  24. package/dist/IdentityAccessor.d.ts +54 -0
  25. package/dist/IdentityAccessorClientCredentials.d.ts +14 -0
  26. package/dist/Retry.d.ts +1 -0
  27. package/dist/Types/IExternalTaskWorker.d.ts +3 -2
  28. package/dist/Types/RestSettings.d.ts +18 -20
  29. package/dist/Types/SocketSettings.d.ts +0 -2
  30. package/dist/commonjs/Client.js +22 -27
  31. package/dist/commonjs/Client.js.map +1 -1
  32. package/dist/commonjs/ClientFactory.js +23 -29
  33. package/dist/commonjs/ClientFactory.js.map +1 -1
  34. package/dist/commonjs/Clients/ApplicationInfoHttpClient.js +5 -5
  35. package/dist/commonjs/Clients/ApplicationInfoHttpClient.js.map +1 -1
  36. package/dist/commonjs/Clients/BaseClient.js +23 -15
  37. package/dist/commonjs/Clients/BaseClient.js.map +1 -1
  38. package/dist/commonjs/Clients/CorrelationHttpClient.js +2 -2
  39. package/dist/commonjs/Clients/CorrelationHttpClient.js.map +1 -1
  40. package/dist/commonjs/Clients/CronjobHttpClient.js +3 -3
  41. package/dist/commonjs/Clients/CronjobHttpClient.js.map +1 -1
  42. package/dist/commonjs/Clients/DataObjectInstanceHttpClient.js +1 -1
  43. package/dist/commonjs/Clients/DataObjectInstanceHttpClient.js.map +1 -1
  44. package/dist/commonjs/Clients/EventHttpClient.js +9 -3
  45. package/dist/commonjs/Clients/EventHttpClient.js.map +1 -1
  46. package/dist/commonjs/Clients/ExternalTaskApiHttpClient.js +5 -5
  47. package/dist/commonjs/Clients/ExternalTaskApiHttpClient.js.map +1 -1
  48. package/dist/commonjs/Clients/ExternalTaskHttpClient.js +7 -5
  49. package/dist/commonjs/Clients/ExternalTaskHttpClient.js.map +1 -1
  50. package/dist/commonjs/Clients/FlowNodeInstanceHttpClient.js +8 -13
  51. package/dist/commonjs/Clients/FlowNodeInstanceHttpClient.js.map +1 -1
  52. package/dist/commonjs/Clients/Lib/SocketIoManager.js +149 -67
  53. package/dist/commonjs/Clients/Lib/SocketIoManager.js.map +1 -1
  54. package/dist/commonjs/Clients/ManualTaskHttpClient.js +2 -2
  55. package/dist/commonjs/Clients/ManualTaskHttpClient.js.map +1 -1
  56. package/dist/commonjs/Clients/NotificationHttpClient.js +3 -9
  57. package/dist/commonjs/Clients/NotificationHttpClient.js.map +1 -1
  58. package/dist/commonjs/Clients/ProcessDefinitionHttpClient.js +8 -8
  59. package/dist/commonjs/Clients/ProcessDefinitionHttpClient.js.map +1 -1
  60. package/dist/commonjs/Clients/ProcessDefinitionHttpClientNode.js +17 -7
  61. package/dist/commonjs/Clients/ProcessDefinitionHttpClientNode.js.map +1 -1
  62. package/dist/commonjs/Clients/ProcessInstanceHttpClient.js +22 -8
  63. package/dist/commonjs/Clients/ProcessInstanceHttpClient.js.map +1 -1
  64. package/dist/commonjs/Clients/ProcessModelHttpClient.js +9 -9
  65. package/dist/commonjs/Clients/ProcessModelHttpClient.js.map +1 -1
  66. package/dist/commonjs/Clients/UntypedTaskHttpClient.js +4 -15
  67. package/dist/commonjs/Clients/UntypedTaskHttpClient.js.map +1 -1
  68. package/dist/commonjs/Clients/UserTaskHttpClient.js +4 -4
  69. package/dist/commonjs/Clients/UserTaskHttpClient.js.map +1 -1
  70. package/dist/commonjs/Clients/index.js +0 -1
  71. package/dist/commonjs/Clients/index.js.map +1 -1
  72. package/dist/commonjs/ExternalTaskExecution.js +14 -3
  73. package/dist/commonjs/ExternalTaskExecution.js.map +1 -1
  74. package/dist/commonjs/ExternalTaskWorker.js +50 -18
  75. package/dist/commonjs/ExternalTaskWorker.js.map +1 -1
  76. package/dist/commonjs/IdentityAccessor.js +246 -0
  77. package/dist/commonjs/IdentityAccessor.js.map +1 -0
  78. package/dist/commonjs/IdentityAccessorClientCredentials.js +94 -0
  79. package/dist/commonjs/IdentityAccessorClientCredentials.js.map +1 -0
  80. package/dist/commonjs/Retry.js +30 -0
  81. package/dist/commonjs/Retry.js.map +1 -0
  82. package/dist/commonjs/Types/RestSettings.js +18 -21
  83. package/dist/commonjs/Types/RestSettings.js.map +1 -1
  84. package/dist/commonjs/Types/SocketSettings.js +0 -2
  85. package/dist/commonjs/Types/SocketSettings.js.map +1 -1
  86. package/dist/commonjs/Types/index.js +17 -7
  87. package/dist/commonjs/Types/index.js.map +1 -1
  88. package/dist/commonjs/index.js +5 -1
  89. package/dist/commonjs/index.js.map +1 -1
  90. package/dist/index.d.ts +2 -0
  91. package/package.json +16 -10
  92. package/tsconfig.tests.json +20 -0
  93. package/dist/Clients/AnonymousSessionHttpClient.d.ts +0 -26
  94. package/dist/commonjs/Clients/AnonymousSessionHttpClient.js +0 -48
  95. package/dist/commonjs/Clients/AnonymousSessionHttpClient.js.map +0 -1
@@ -1,4 +1,5 @@
1
- import { INotificationExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk';
1
+ import { INotificationExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { Messages as ClientMessages } from '../Types/index';
3
4
  import { BaseClient } from './BaseClient';
4
5
  export interface INotificationHttpClient extends INotificationExtensionAdapter {
@@ -7,200 +8,192 @@ export interface INotificationHttpClient extends INotificationExtensionAdapter {
7
8
  onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean): Subscription;
8
9
  }
9
10
  export declare class NotificationHttpClient extends BaseClient implements INotificationHttpClient {
10
- removeSubscription(subscription: Subscription, identity?: Identity): void;
11
- onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
12
- onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
13
- onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
11
+ removeSubscription(subscription: Subscription, identity?: IdentityLike): void;
12
+ onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
13
+ onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
14
+ onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
14
15
  onActivityError(callback: Messages.CallbackTypes.OnActivityErrorCallback, options?: {
15
16
  subscribeOnce?: boolean;
16
- identity?: Identity;
17
+ identity?: IdentityLike;
17
18
  }): Promise<Subscription>;
18
19
  onProcessDeployed(callback: Messages.CallbackTypes.OnProcessDeployedCallback, options?: {
19
20
  subscribeOnce?: boolean;
20
- identity?: Identity;
21
+ identity?: IdentityLike;
21
22
  }): Promise<Subscription>;
22
23
  onProcessUndeployed(callback: Messages.CallbackTypes.OnProcessUndeployedCallback, options?: {
23
24
  subscribeOnce?: boolean;
24
- identity?: Identity;
25
+ identity?: IdentityLike;
25
26
  }): Promise<Subscription>;
26
27
  onProcessIsExecutableChanged(callback: Messages.CallbackTypes.OnProcessIsExecutableChangedCallback, options?: {
27
28
  subscribeOnce?: boolean;
28
- identity?: Identity;
29
+ identity?: IdentityLike;
29
30
  }): Promise<Subscription>;
30
31
  onCronjobEnabledChanged(callback: Messages.CallbackTypes.OnCronjobEnabledChangedCallback, options?: {
31
32
  subscribeOnce?: boolean;
32
- identity?: Identity;
33
+ identity?: IdentityLike;
33
34
  }): Promise<Subscription>;
34
35
  onProcessStarting(callback: Messages.CallbackTypes.OnProcessStartingCallback, options?: {
35
36
  subscribeOnce?: boolean;
36
- identity?: Identity;
37
+ identity?: IdentityLike;
37
38
  }): Promise<Subscription>;
38
39
  onProcessStarted(callback: Messages.CallbackTypes.OnProcessStartedCallback, options?: {
39
40
  subscribeOnce?: boolean;
40
- identity?: Identity;
41
+ identity?: IdentityLike;
41
42
  }): Promise<Subscription>;
42
43
  onProcessResumed(callback: Messages.CallbackTypes.OnProcessStartedCallback, options?: {
43
44
  subscribeOnce?: boolean;
44
- identity?: Identity;
45
+ identity?: IdentityLike;
45
46
  }): Promise<Subscription>;
46
47
  onProcessEnded(callback: Messages.CallbackTypes.OnProcessEndedCallback, options?: {
47
48
  subscribeOnce?: boolean;
48
- identity?: Identity;
49
+ identity?: IdentityLike;
49
50
  }): Promise<Subscription>;
50
51
  onProcessOwnerChanged(callback: Messages.CallbackTypes.OnProcessOwnerChangedCallback, options?: {
51
52
  subscribeOnce?: boolean;
52
- identity?: Identity;
53
+ identity?: IdentityLike;
53
54
  }): Promise<Subscription>;
54
55
  onProcessTerminated(callback: Messages.CallbackTypes.OnProcessTerminatedCallback, options?: {
55
56
  subscribeOnce?: boolean;
56
- identity?: Identity;
57
+ identity?: IdentityLike;
57
58
  }): Promise<Subscription>;
58
59
  onProcessError(callback: Messages.CallbackTypes.OnProcessErrorCallback, options?: {
59
60
  subscribeOnce?: boolean;
60
- identity?: Identity;
61
+ identity?: IdentityLike;
61
62
  }): Promise<Subscription>;
62
63
  onProcessInstancesDeleted(callback: Messages.CallbackTypes.OnProcessInstancesDeletedCallback, options?: {
63
64
  subscribeOnce?: boolean;
64
- identity?: Identity;
65
+ identity?: IdentityLike;
65
66
  }): Promise<Subscription>;
66
67
  onCronjobCreated(callback: Messages.CallbackTypes.OnCronjobCreatedCallback, options?: {
67
68
  subscribeOnce?: boolean;
68
- identity?: Identity;
69
+ identity?: IdentityLike;
69
70
  }): Promise<Subscription>;
70
71
  onCronjobStopped(callback: Messages.CallbackTypes.OnCronjobStoppedCallback, options?: {
71
72
  subscribeOnce?: boolean;
72
- identity?: Identity;
73
+ identity?: IdentityLike;
73
74
  }): Promise<Subscription>;
74
75
  onCronjobUpdated(callback: Messages.CallbackTypes.OnCronjobUpdatedCallback, options?: {
75
76
  subscribeOnce?: boolean;
76
- identity?: Identity;
77
+ identity?: IdentityLike;
77
78
  }): Promise<Subscription>;
78
79
  onCronjobExecuted(callback: Messages.CallbackTypes.OnCronjobExecutedCallback, options?: {
79
80
  subscribeOnce?: boolean;
80
- identity?: Identity;
81
+ identity?: IdentityLike;
81
82
  }): Promise<Subscription>;
82
83
  onCronjobRemoved(callback: Messages.CallbackTypes.OnCronjobRemovedCallback, options?: {
83
84
  subscribeOnce?: boolean;
84
- identity?: Identity;
85
+ identity?: IdentityLike;
85
86
  }): Promise<Subscription>;
86
87
  onActivityReached(callback: Messages.CallbackTypes.OnActivityReachedCallback, options?: {
87
88
  subscribeOnce?: boolean;
88
- identity?: Identity;
89
+ identity?: IdentityLike;
89
90
  }): Promise<Subscription>;
90
91
  onActivityFinished(callback: Messages.CallbackTypes.OnActivityFinishedCallback, options?: {
91
92
  subscribeOnce?: boolean;
92
- identity?: Identity;
93
+ identity?: IdentityLike;
93
94
  }): Promise<Subscription>;
94
95
  onActivityCanceled(callback: Messages.CallbackTypes.OnActivityCanceledCallback, options?: {
95
96
  subscribeOnce?: boolean;
96
- identity?: Identity;
97
+ identity?: IdentityLike;
97
98
  }): Promise<Subscription>;
98
99
  onUntypedTaskWaiting(callback: Messages.CallbackTypes.OnUntypedTaskWaitingCallback, options?: {
99
100
  subscribeOnce?: boolean;
100
- identity?: Identity;
101
- /**
102
- * If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
103
- */
104
- useLegacyEndpoint?: boolean;
101
+ identity?: IdentityLike;
105
102
  }): Promise<Subscription>;
106
103
  onUntypedTaskFinished(callback: Messages.CallbackTypes.OnUntypedTaskFinishedCallback, options?: {
107
104
  subscribeOnce?: boolean;
108
- identity?: Identity;
109
- /**
110
- * If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
111
- */
112
- useLegacyEndpoint?: boolean;
105
+ identity?: IdentityLike;
113
106
  }): Promise<Subscription>;
114
107
  onManualTaskWaiting(callback: Messages.CallbackTypes.OnManualTaskWaitingCallback, options?: {
115
108
  subscribeOnce?: boolean;
116
- identity?: Identity;
109
+ identity?: IdentityLike;
117
110
  }): Promise<Subscription>;
118
111
  onManualTaskFinished(callback: Messages.CallbackTypes.OnManualTaskFinishedCallback, options?: {
119
112
  subscribeOnce?: boolean;
120
- identity?: Identity;
113
+ identity?: IdentityLike;
121
114
  }): Promise<Subscription>;
122
115
  onUserTaskWaiting(callback: Messages.CallbackTypes.OnUserTaskWaitingCallback, options?: {
123
116
  subscribeOnce?: boolean;
124
- identity?: Identity;
117
+ identity?: IdentityLike;
125
118
  }): Promise<Subscription>;
126
119
  onUserTaskFinished(callback: Messages.CallbackTypes.OnUserTaskFinishedCallback, options?: {
127
120
  subscribeOnce?: boolean;
128
- identity?: Identity;
121
+ identity?: IdentityLike;
129
122
  }): Promise<Subscription>;
130
123
  onUserTaskReserved(callback: Messages.CallbackTypes.OnUserTaskReservedCallback, options?: {
131
124
  subscribeOnce?: boolean;
132
- identity?: Identity;
125
+ identity?: IdentityLike;
133
126
  }): Promise<Subscription>;
134
127
  onUserTaskReservationCanceled(callback: Messages.CallbackTypes.OnUserTaskReservationCanceledCallback, options?: {
135
128
  subscribeOnce?: boolean;
136
- identity?: Identity;
129
+ identity?: IdentityLike;
137
130
  }): Promise<Subscription>;
138
131
  onBoundaryEventWaiting(callback: Messages.CallbackTypes.OnBoundaryEventWaitingCallback, options?: {
139
132
  subscribeOnce?: boolean;
140
- identity?: Identity;
133
+ identity?: IdentityLike;
141
134
  }): Promise<Subscription>;
142
135
  onBoundaryEventTriggered(callback: Messages.CallbackTypes.OnBoundaryEventTriggeredCallback, options?: {
143
136
  subscribeOnce?: boolean;
144
- identity?: Identity;
137
+ identity?: IdentityLike;
145
138
  }): Promise<Subscription>;
146
139
  onBoundaryEventFinished(callback: Messages.CallbackTypes.OnBoundaryEventFinishedCallback, options?: {
147
140
  subscribeOnce?: boolean;
148
- identity?: Identity;
141
+ identity?: IdentityLike;
149
142
  }): Promise<Subscription>;
150
143
  onIntermediateThrowEventTriggered(callback: Messages.CallbackTypes.OnIntermediateThrowEventTriggeredCallback, options?: {
151
144
  subscribeOnce?: boolean;
152
- identity?: Identity;
145
+ identity?: IdentityLike;
153
146
  }): Promise<Subscription>;
154
147
  onIntermediateCatchEventReached(callback: Messages.CallbackTypes.OnIntermediateCatchEventReachedCallback, options?: {
155
148
  subscribeOnce?: boolean;
156
- identity?: Identity;
149
+ identity?: IdentityLike;
157
150
  }): Promise<Subscription>;
158
151
  onIntermediateCatchEventFinished(callback: Messages.CallbackTypes.OnIntermediateCatchEventFinishedCallback, options?: {
159
152
  subscribeOnce?: boolean;
160
- identity?: Identity;
153
+ identity?: IdentityLike;
161
154
  }): Promise<Subscription>;
162
155
  onFlowNodeEventRetrySending(callback: Messages.CallbackTypes.OnFlowNodeEventRetrySendingCallback, options?: {
163
156
  subscribeOnce?: boolean;
164
- identity?: Identity;
157
+ identity?: IdentityLike;
165
158
  }): Promise<Subscription>;
166
159
  onMessageTriggered(callback: Messages.CallbackTypes.OnMessageTriggeredCallback, options?: {
167
160
  subscribeOnce?: boolean;
168
- identity?: Identity;
161
+ identity?: IdentityLike;
169
162
  }): Promise<Subscription>;
170
163
  onSignalTriggered(callback: Messages.CallbackTypes.OnSignalTriggeredCallback, options?: {
171
164
  subscribeOnce?: boolean;
172
- identity?: Identity;
165
+ identity?: IdentityLike;
173
166
  }): Promise<Subscription>;
174
167
  onStartEventFinished(callback: Messages.CallbackTypes.OnStartEventFinishedCallback, options?: {
175
168
  subscribeOnce?: boolean;
176
- identity?: Identity;
169
+ identity?: IdentityLike;
177
170
  }): Promise<Subscription>;
178
171
  onEndEventFinished(callback: Messages.CallbackTypes.OnEndEventFinishedCallback, options?: {
179
172
  subscribeOnce?: boolean;
180
- identity?: Identity;
173
+ identity?: IdentityLike;
181
174
  }): Promise<Subscription>;
182
175
  onExternalTaskCreated(callback: Messages.CallbackTypes.OnExternalTaskCreatedCallback, options?: {
183
176
  subscribeOnce?: boolean;
184
- identity?: Identity;
177
+ identity?: IdentityLike;
185
178
  }): Promise<Subscription>;
186
179
  onExternalTaskLocked(callback: Messages.CallbackTypes.OnExternalTaskLockedCallback, options?: {
187
180
  subscribeOnce?: boolean;
188
- identity?: Identity;
181
+ identity?: IdentityLike;
189
182
  }): Promise<Subscription>;
190
183
  onExternalTaskUnlocked(callback: Messages.CallbackTypes.OnExternalTaskUnlockedCallback, options?: {
191
184
  subscribeOnce?: boolean;
192
- identity?: Identity;
185
+ identity?: IdentityLike;
193
186
  }): Promise<Subscription>;
194
187
  onProcessInstanceMetadataChanged(callback: Messages.CallbackTypes.OnProcessInstanceMetadataChangedCallback, options?: {
195
188
  subscribeOnce?: boolean;
196
- identity?: Identity;
189
+ identity?: IdentityLike;
197
190
  }): Promise<Subscription>;
198
191
  onCorrelationMetadataChanged(callback: Messages.CallbackTypes.OnCorrelationMetadataChangedCallback, options?: {
199
192
  subscribeOnce?: boolean;
200
- identity?: Identity;
193
+ identity?: IdentityLike;
201
194
  }): Promise<Subscription>;
202
195
  onGatewayFinished(callback: Messages.CallbackTypes.OnGatewayFinishedCallback, options?: {
203
196
  subscribeOnce?: boolean;
204
- identity?: Identity;
197
+ identity?: IdentityLike;
205
198
  }): Promise<Subscription>;
206
199
  }
@@ -1,31 +1,32 @@
1
- import { DataModels, IProcessDefinitionExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, IProcessDefinitionExtensionAdapter } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  type ProcessStartOptions<TPayload extends object> = DataModels.ProcessInstances.ProcessStartOptions<TPayload>;
4
5
  type ProcessStartResponse = DataModels.ProcessInstances.ProcessStartResponse;
5
6
  export declare class ProcessDefinitionHttpClient extends BaseClient implements IProcessDefinitionExtensionAdapter {
6
7
  getAll(options?: {
7
- identity?: Identity;
8
+ identity?: IdentityLike;
8
9
  offset?: number;
9
10
  limit?: number;
10
11
  }): Promise<DataModels.ProcessDefinitions.ProcessDefinitionList>;
11
- getById(processDefinitionId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessDefinition>;
12
- getByProcessModelId(processModelId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessDefinition>;
12
+ getById(processDefinitionId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessDefinition>;
13
+ getByProcessModelId(processModelId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessDefinition>;
13
14
  persistProcessDefinitions(xml: string | Array<string>, options?: {
14
15
  overwriteExisting?: boolean;
15
- identity?: Identity;
16
+ identity?: IdentityLike;
16
17
  }): Promise<void>;
17
18
  deployFiles(filePaths: string | Array<string>, options?: {
18
19
  overwriteExisting?: boolean;
19
- identity?: Identity;
20
+ identity?: IdentityLike;
20
21
  }): Promise<void>;
21
- startProcessInstance<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: Identity): Promise<ProcessStartResponse>;
22
- startProcessInstanceAndAwaitEndEvent<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: Identity): Promise<ProcessStartResponse>;
23
- startProcessInstanceAndAwaitSpecificEndEvent<TPayload extends object>(options: DataModels.ProcessInstances.ProcessStartOptions<TPayload>, endEventId: string, identity?: Identity): Promise<ProcessStartResponse>;
22
+ startProcessInstance<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: IdentityLike): Promise<ProcessStartResponse>;
23
+ startProcessInstanceAndAwaitEndEvent<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: IdentityLike): Promise<ProcessStartResponse>;
24
+ startProcessInstanceAndAwaitSpecificEndEvent<TPayload extends object>(options: DataModels.ProcessInstances.ProcessStartOptions<TPayload>, endEventId: string, identity?: IdentityLike): Promise<ProcessStartResponse>;
24
25
  /**
25
26
  * @param deleteAllRelatedData Optional: If set to true, the Process Definition, as well as all related data, will be completely deleted.
26
27
  * Otherwise, the Process Definition will only be flagged as deleted, but all data will be kept.
27
28
  * Note that this won't do anything on engines with a version below v13.0.7.
28
29
  */
29
- deleteById(processDefinitionId: string, identity?: Identity, deleteAllRelatedData?: boolean): Promise<void>;
30
+ deleteById(processDefinitionId: string, identity?: IdentityLike, deleteAllRelatedData?: boolean): Promise<void>;
30
31
  }
31
32
  export {};
@@ -1,8 +1,8 @@
1
- import { Identity } from '@5minds/processcube_engine_sdk';
1
+ import { IdentityLike } from '../IdentityAccessor';
2
2
  import { ProcessDefinitionHttpClient } from './ProcessDefinitionHttpClient';
3
3
  export declare class ProcessDefinitionHttpClientNode extends ProcessDefinitionHttpClient {
4
4
  deployFiles(filePaths: string | Array<string>, options?: {
5
5
  overwriteExisting?: boolean;
6
- identity?: Identity;
6
+ identity?: IdentityLike;
7
7
  }): Promise<void>;
8
8
  }
@@ -1,23 +1,33 @@
1
- import { DataModels, IProcessInstanceExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { BpmnType, DataModels, IProcessInstanceExtensionAdapter } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  export declare class ProcessInstanceHttpClient extends BaseClient implements IProcessInstanceExtensionAdapter {
4
5
  query(query: DataModels.ProcessInstances.ProcessInstanceQuery, options?: {
5
- identity?: Identity;
6
+ identity?: IdentityLike;
6
7
  includeXml?: boolean;
7
8
  offset?: number;
8
9
  limit?: number;
9
10
  sortSettings?: DataModels.ProcessInstances.ProcessInstanceSortSettings;
10
11
  }): Promise<DataModels.ProcessInstances.ProcessInstanceList>;
11
- getProcessDefinition(processInstanceId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessDefinition>;
12
- getProcessModel(processInstanceId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessModel>;
12
+ getChildProcessInstanceIds(processInstanceId: string, options: {
13
+ identity?: IdentityLike;
14
+ parentFlowNodeType?: BpmnType.subProcess | BpmnType.callActivity;
15
+ includeNested?: boolean;
16
+ }): Promise<Array<string>>;
17
+ getAncestorProcessInstanceIds(processInstanceId: string, options: {
18
+ identity?: IdentityLike;
19
+ onlyForEmbeddedProcesses?: boolean;
20
+ }): Promise<Array<string>>;
21
+ getProcessDefinition(processInstanceId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessDefinition>;
22
+ getProcessModel(processInstanceId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessModel>;
13
23
  transferOwnership(processInstanceId: string, newOwner: DataModels.Iam.Identity, identity?: DataModels.Iam.Identity): Promise<void>;
14
- terminateProcessInstance(processInstanceId: string, identity?: Identity): Promise<void>;
24
+ terminateProcessInstance(processInstanceId: string, identity?: IdentityLike): Promise<void>;
15
25
  retryProcessInstance(processInstanceId: string, options?: {
16
26
  flowNodeInstanceId?: string;
17
27
  newStartToken?: any;
18
28
  updateProcessModel?: boolean;
19
- identity?: Identity;
29
+ identity?: IdentityLike;
20
30
  }): Promise<void>;
21
- deleteProcessInstances(processInstanceIds: string | Array<string>, deleteAllRelatedData?: boolean, identity?: Identity): Promise<void>;
31
+ deleteProcessInstances(processInstanceIds: string | Array<string>, deleteAllRelatedData?: boolean, identity?: IdentityLike): Promise<void>;
22
32
  private handleError;
23
33
  }
@@ -1,18 +1,19 @@
1
- import { DataModels, IProcessModelExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, IProcessModelExtensionAdapter } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  type ProcessStartOptions<TPayload extends object> = DataModels.ProcessInstances.ProcessStartOptions<TPayload>;
4
5
  type ProcessStartResponse = DataModels.ProcessInstances.ProcessStartResponse;
5
6
  export declare class ProcessModelHttpClient extends BaseClient implements IProcessModelExtensionAdapter {
6
7
  getAll(options?: {
7
- identity?: Identity;
8
+ identity?: IdentityLike;
8
9
  offset?: number;
9
10
  limit?: number;
10
11
  }): Promise<DataModels.ProcessDefinitions.ProcessModelList>;
11
- getById(processModelId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessModel>;
12
- getByProcessInstanceId(processInstanceId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessModel>;
13
- startProcessInstance<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: Identity): Promise<ProcessStartResponse>;
14
- startProcessInstanceAndAwaitEndEvent<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: Identity): Promise<ProcessStartResponse>;
15
- startProcessInstanceAndAwaitSpecificEndEvent<TPayload extends object>(options: DataModels.ProcessInstances.ProcessStartOptions<TPayload>, endEventId: string, identity?: Identity): Promise<ProcessStartResponse>;
12
+ getById(processModelId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessModel>;
13
+ getByProcessInstanceId(processInstanceId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessModel>;
14
+ startProcessInstance<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: IdentityLike): Promise<ProcessStartResponse>;
15
+ startProcessInstanceAndAwaitEndEvent<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: IdentityLike): Promise<ProcessStartResponse>;
16
+ startProcessInstanceAndAwaitSpecificEndEvent<TPayload extends object>(options: DataModels.ProcessInstances.ProcessStartOptions<TPayload>, endEventId: string, identity?: IdentityLike): Promise<ProcessStartResponse>;
16
17
  /**
17
18
  * @param deleteAllRelatedData Optional: If set to true, the Process Definition, as well as all related data, will be completely deleted.
18
19
  * Otherwise, the Process Definition will only be flagged as deleted, but all data will be kept.
@@ -20,10 +21,10 @@ export declare class ProcessModelHttpClient extends BaseClient implements IProce
20
21
  */
21
22
  deleteDefinitionByProcessModelId(processModelId: string, options?: {
22
23
  force?: boolean;
23
- identity?: Identity;
24
+ identity?: IdentityLike;
24
25
  deleteAllRelatedData?: boolean;
25
26
  }): Promise<void>;
26
- enableProcessModel(processModelId: string, identity?: Identity): Promise<void>;
27
- disableProcessModel(processModelId: string, identity?: Identity): Promise<void>;
27
+ enableProcessModel(processModelId: string, identity?: IdentityLike): Promise<void>;
28
+ disableProcessModel(processModelId: string, identity?: IdentityLike): Promise<void>;
28
29
  }
29
30
  export {};
@@ -1,31 +1,21 @@
1
- import { FlowNodeInstanceSortSettings, IUntypedTaskExtensionAdapter, Identity, Messages, Subscription, UntypedTaskList, UntypedTaskQuery } from '@5minds/processcube_engine_sdk';
1
+ import { FlowNodeInstanceSortSettings, IUntypedTaskExtensionAdapter, Messages, Subscription, UntypedTaskList, UntypedTaskQuery } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  export declare class UntypedTaskHttpClient extends BaseClient implements IUntypedTaskExtensionAdapter {
4
5
  query(query: UntypedTaskQuery, options?: {
5
- identity?: Identity;
6
+ identity?: IdentityLike;
6
7
  offset?: number;
7
8
  limit?: number;
8
9
  sortSettings?: FlowNodeInstanceSortSettings;
9
10
  }): Promise<UntypedTaskList>;
10
- /**
11
- * @param useLegacyEndpoint If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
12
- */
13
- finishTask(taskInstanceId: string, identity?: Identity, useLegacyEndpoint?: boolean): Promise<void>;
11
+ finishTask(taskInstanceId: string, identity?: IdentityLike): Promise<void>;
14
12
  onUntypedTaskWaiting(callback: Messages.CallbackTypes.OnUntypedTaskWaitingCallback, options?: {
15
13
  subscribeOnce?: boolean;
16
- identity?: Identity;
17
- /**
18
- * If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
19
- */
20
- useLegacyEndpoint?: boolean;
14
+ identity?: IdentityLike;
21
15
  }): Promise<Subscription>;
22
16
  onUntypedTaskFinished(callback: Messages.CallbackTypes.OnUntypedTaskFinishedCallback, options?: {
23
17
  subscribeOnce?: boolean;
24
- identity?: Identity;
25
- /**
26
- * If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
27
- */
28
- useLegacyEndpoint?: boolean;
18
+ identity?: IdentityLike;
29
19
  }): Promise<Subscription>;
30
- removeSubscription(subscription: Subscription, identity?: Identity): void;
20
+ removeSubscription(subscription: Subscription, identity?: IdentityLike): void;
31
21
  }
@@ -1,32 +1,33 @@
1
- import { DataModels, IUserTaskExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk';
1
+ import { DataModels, IUserTaskExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  import { BaseClient } from './BaseClient';
3
4
  type UserTaskList = DataModels.FlowNodeInstances.UserTaskList;
4
5
  export declare class UserTaskHttpClient extends BaseClient implements IUserTaskExtensionAdapter {
5
6
  query(query: DataModels.FlowNodeInstances.UserTaskQuery, options?: {
6
- identity?: Identity;
7
+ identity?: IdentityLike;
7
8
  offset?: number;
8
9
  limit?: number;
9
10
  sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
10
11
  }): Promise<UserTaskList>;
11
- reserveUserTaskInstance(identity: Identity, flowNodeInstanceId: string, actualOwnerId: string): Promise<void>;
12
- cancelUserTaskInstanceReservation(identity: Identity, flowNodeInstanceId: string): Promise<void>;
13
- finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: Identity): Promise<void>;
12
+ reserveUserTaskInstance(identity: IdentityLike, flowNodeInstanceId: string, actualOwnerId: string): Promise<void>;
13
+ cancelUserTaskInstanceReservation(identity: IdentityLike, flowNodeInstanceId: string): Promise<void>;
14
+ finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: IdentityLike): Promise<void>;
14
15
  onUserTaskWaiting(callback: Messages.CallbackTypes.OnUserTaskWaitingCallback, options?: {
15
16
  subscribeOnce?: boolean;
16
- identity?: Identity;
17
+ identity?: IdentityLike;
17
18
  }): Promise<Subscription>;
18
19
  onUserTaskFinished(callback: Messages.CallbackTypes.OnUserTaskFinishedCallback, options?: {
19
20
  subscribeOnce?: boolean;
20
- identity?: Identity;
21
+ identity?: IdentityLike;
21
22
  }): Promise<Subscription>;
22
23
  onUserTaskReserved(callback: Messages.CallbackTypes.OnUserTaskReservedCallback, options?: {
23
24
  subscribeOnce?: boolean;
24
- identity?: Identity;
25
+ identity?: IdentityLike;
25
26
  }): Promise<Subscription>;
26
27
  onUserTaskReservationCanceled(callback: Messages.CallbackTypes.OnUserTaskReservationCanceledCallback, options?: {
27
28
  subscribeOnce?: boolean;
28
- identity?: Identity;
29
+ identity?: IdentityLike;
29
30
  }): Promise<Subscription>;
30
- removeSubscription(subscription: Subscription, identity?: Identity): void;
31
+ removeSubscription(subscription: Subscription, identity?: IdentityLike): void;
31
32
  }
32
33
  export {};
@@ -1,4 +1,3 @@
1
- export * from './AnonymousSessionHttpClient';
2
1
  export * from './ApplicationInfoHttpClient';
3
2
  export * from './CorrelationHttpClient';
4
3
  export * from './CronjobHttpClient';
@@ -13,6 +13,7 @@ export declare class ExternalTaskExecution<TExternalTaskPayload, TResultPayload
13
13
  private abortSignalSubscription;
14
14
  private awaitAbortSignal;
15
15
  private abortSignalResolver;
16
+ private identityAccessor;
16
17
  private logger;
17
18
  constructor(externalTask: ExternalTask<TExternalTaskPayload>, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, externalTaskClient: ExternalTaskApiClient, config: IExternalTaskWorkerConfig, topic: string, abortSignal: AbortSignal, customErrorHandler?: WorkerErrorHandler);
18
19
  execute(): Promise<void>;
@@ -8,18 +8,27 @@ export declare class ExternalTaskWorker<TExternalTaskPayload, TResultPayload ext
8
8
  private readonly longpollingTimeout;
9
9
  private readonly processingFunction;
10
10
  private readonly payloadFilter;
11
- private _identity;
11
+ private identityAccessor;
12
12
  private _pollingActive;
13
13
  private externalTaskClient;
14
14
  private customErrorHandler;
15
+ private onHeartbeatCallback;
15
16
  private abortController;
16
17
  private abortSignal;
17
18
  constructor(engineUrl: string, topic: string, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, config?: IExternalTaskWorkerConfig);
19
+ /**
20
+ * @deprecated Use getIdentity instead.
21
+ */
18
22
  get identity(): Identity;
23
+ getIdentity(): Promise<Identity>;
24
+ /**
25
+ * @deprecated This is no longer safe to use. Identity should be set via the constructor.
26
+ */
19
27
  set identity(value: Identity);
20
28
  get workerId(): string;
21
29
  get pollingIsActive(): boolean;
22
30
  onWorkerError(callback: WorkerErrorHandler): void;
31
+ onHeartbeat(callback: () => void): void;
23
32
  start(): void;
24
33
  stop(): void;
25
34
  dispose(): void;
@@ -0,0 +1,54 @@
1
+ import { Identity, Logger } from '@5minds/processcube_engine_sdk';
2
+ export type IdentityLike = Identity | (() => Promise<Identity>) | (() => Identity) | IdentityAccessor | ClientCredentialsConfig;
3
+ export type ClientCredentialsConfig = {
4
+ authorityUrl?: string;
5
+ engineUrl?: string;
6
+ baseMinRefreshTimeInMs?: number;
7
+ clientId: string;
8
+ clientSecret: string;
9
+ scope: string;
10
+ };
11
+ export declare class IdentityAccessor {
12
+ static wrap(identity?: IdentityLike, engineUrl?: string): IdentityAccessor;
13
+ private identityGetter;
14
+ private latestIdentity;
15
+ private expirationTimeInMs;
16
+ protected id: string;
17
+ private identityAvailablePromise;
18
+ private identityAvailableResolve;
19
+ private identityAvailableReject;
20
+ protected refreshFailedCritically: boolean;
21
+ protected refreshTimeout: NodeJS.Timeout;
22
+ protected disposed: boolean;
23
+ protected isDynamicRefreshObject: boolean;
24
+ protected logger: Logger;
25
+ private newIdentityCallbacks;
26
+ private asyncLock;
27
+ constructor(staticOrDynamicIdentity?: Identity | (() => Promise<Identity>) | (() => Identity));
28
+ initialize(): void;
29
+ getId(): string;
30
+ getIdentitySync(): Identity;
31
+ canIdentityBeRefreshed(): boolean;
32
+ getIdentity(): Promise<Identity>;
33
+ forceImmediateIdentityRefresh(): Promise<void>;
34
+ /**
35
+ * This method only waits the first time the identity is retrieved from any remote source to ensure no missing references occur.
36
+ */
37
+ waitUntilIdentityIsAvailable(): Promise<void>;
38
+ /**
39
+ * @deprecated This method only exists for downward compatibility purposes, use getIdentity instead.
40
+ */
41
+ getIdentityStatic(): Identity;
42
+ onNewIdentity(callback: (identity: Identity) => Promise<void>): void;
43
+ removeOnNewIdentityListener(callback: (identity: Identity) => Promise<void>): void;
44
+ /**
45
+ * The IdentityAccesor creates a refresh timer, which needs to be disposed.
46
+ * This method should be called when the IdentityAccessor is not needed anymore.
47
+ * If any Client using this will be disposed, the IdentityAccessor will be disposed as well.
48
+ */
49
+ dispose(): void;
50
+ protected getBaseMinRefreshTimeInMs(): number;
51
+ private refreshIdentityPeriodically;
52
+ private fetchIdentity;
53
+ private getDecodedToken;
54
+ }
@@ -0,0 +1,14 @@
1
+ import { Identity } from '@5minds/processcube_engine_sdk';
2
+ import { ClientCredentialsConfig, IdentityAccessor } from './index';
3
+ export declare class ClientCredentialsIdentityAccessor extends IdentityAccessor {
4
+ private config;
5
+ constructor(clientCredentialsConfig: ClientCredentialsConfig);
6
+ getFreshIdentity(clientCredentialsConfig: ClientCredentialsConfig): Promise<Identity>;
7
+ protected getBaseMinRefreshTimeInMs(): number;
8
+ private getNewToken;
9
+ private getOpenIdClient;
10
+ private getAuthorityUrl;
11
+ private getAuthorityUrlFromEngineUrl;
12
+ private ensureEndsWithoutSlash;
13
+ private hash;
14
+ }
@@ -0,0 +1 @@
1
+ export declare function executeWithRetry<TResult>(fn: () => Promise<TResult>, retryMessage?: string, errorsToRetry?: Array<string>, maxRetries?: number, retryInterval?: number): Promise<TResult>;
@@ -1,4 +1,5 @@
1
- import { ExternalTask, Identity } from '@5minds/processcube_engine_sdk';
1
+ import { ExternalTask } from '@5minds/processcube_engine_sdk';
2
+ import { IdentityLike } from '../IdentityAccessor';
2
3
  /**
3
4
  * Definition of the HandleExternalTask Callback.
4
5
  */
@@ -9,7 +10,7 @@ export type IExternalTaskWorkerConfig = {
9
10
  lockDuration?: number;
10
11
  maxTasks?: number;
11
12
  longpollingTimeout?: number;
12
- identity?: Identity;
13
+ identity?: IdentityLike;
13
14
  payloadFilter?: RegExp;
14
15
  };
15
16
  /**