@5minds/processcube_engine_sdk 6.1.0-feature-bee970-m7d7u950 → 6.1.0-feature-9a7e46-m7ipll5d

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 (56) hide show
  1. package/dist/DataModels/ApplicationInfo.d.ts +3 -0
  2. package/dist/DataModels/EngineMetadata.d.ts +13 -0
  3. package/dist/DataModels/ProcessInstance/ProcessInstance.d.ts +1 -0
  4. package/dist/DataModels/ProcessInstance/ProcessInstanceQuery.d.ts +0 -6
  5. package/dist/DataModels/index.d.ts +1 -0
  6. package/dist/Engine.d.ts +22 -1
  7. package/dist/EngineConfiguration.d.ts +1 -0
  8. package/dist/EngineEventBus.d.ts +87 -0
  9. package/dist/EngineEventBusSettings.d.ts +96 -0
  10. package/dist/EngineEvents/EventPayloads/KillProcessInstanceMessageInternal.d.ts +11 -0
  11. package/dist/EngineEvents/EventPayloads/TerminateProcessInstance.d.ts +1 -0
  12. package/dist/EngineEvents/EventPayloads/index.d.ts +1 -0
  13. package/dist/EngineEvents/index.d.ts +0 -1
  14. package/dist/EngineRestApiSettings.d.ts +2107 -0
  15. package/dist/EngineSocketIoSettings.d.ts +62 -0
  16. package/dist/ExtensionAdapter/ClusterExtensionAdapter.d.ts +9 -0
  17. package/dist/ExtensionAdapter/MessageEventExtensionAdapter.d.ts +4 -0
  18. package/dist/ExtensionAdapter/NotificationExtensionAdapter.d.ts +4 -4
  19. package/dist/ExtensionAdapter/ProcessInstanceExtensionAdapter.d.ts +1 -5
  20. package/dist/ExtensionAdapter/SignalEventExtensionAdapter.d.ts +4 -0
  21. package/dist/ExtensionAdapter/index.d.ts +3 -0
  22. package/dist/commonjs/{EngineEvents/Subscription.js → DataModels/EngineMetadata.js} +1 -1
  23. package/dist/commonjs/DataModels/EngineMetadata.js.map +1 -0
  24. package/dist/commonjs/DataModels/ProcessInstance/ProcessInstance.js.map +1 -1
  25. package/dist/commonjs/DataModels/ProcessInstance/ProcessInstanceQuery.js.map +1 -1
  26. package/dist/commonjs/DataModels/index.js +1 -0
  27. package/dist/commonjs/DataModels/index.js.map +1 -1
  28. package/dist/commonjs/Engine.js.map +1 -1
  29. package/dist/commonjs/EngineEventBus.js +3 -0
  30. package/dist/commonjs/EngineEventBus.js.map +1 -0
  31. package/dist/commonjs/EngineEventBusSettings.js +103 -0
  32. package/dist/commonjs/EngineEventBusSettings.js.map +1 -0
  33. package/dist/commonjs/EngineEvents/EventPayloads/KillProcessInstanceMessageInternal.js +3 -0
  34. package/dist/commonjs/EngineEvents/EventPayloads/KillProcessInstanceMessageInternal.js.map +1 -0
  35. package/dist/commonjs/EngineEvents/EventPayloads/index.js +1 -0
  36. package/dist/commonjs/EngineEvents/EventPayloads/index.js.map +1 -1
  37. package/dist/commonjs/EngineEvents/index.js +0 -1
  38. package/dist/commonjs/EngineEvents/index.js.map +1 -1
  39. package/dist/commonjs/EngineRestApiSettings.js +2139 -0
  40. package/dist/commonjs/EngineRestApiSettings.js.map +1 -0
  41. package/dist/commonjs/EngineSocketIoSettings.js +67 -0
  42. package/dist/commonjs/EngineSocketIoSettings.js.map +1 -0
  43. package/dist/commonjs/ExtensionAdapter/ClusterExtensionAdapter.js +3 -0
  44. package/dist/commonjs/ExtensionAdapter/ClusterExtensionAdapter.js.map +1 -0
  45. package/dist/commonjs/ExtensionAdapter/MessageEventExtensionAdapter.js +3 -0
  46. package/dist/commonjs/ExtensionAdapter/MessageEventExtensionAdapter.js.map +1 -0
  47. package/dist/commonjs/ExtensionAdapter/SignalEventExtensionAdapter.js +3 -0
  48. package/dist/commonjs/ExtensionAdapter/SignalEventExtensionAdapter.js.map +1 -0
  49. package/dist/commonjs/ExtensionAdapter/index.js +3 -0
  50. package/dist/commonjs/ExtensionAdapter/index.js.map +1 -1
  51. package/dist/commonjs/index.js +4 -0
  52. package/dist/commonjs/index.js.map +1 -1
  53. package/dist/index.d.ts +4 -0
  54. package/package.json +3 -3
  55. package/dist/EngineEvents/Subscription.d.ts +0 -26
  56. package/dist/commonjs/EngineEvents/Subscription.js.map +0 -1
@@ -56,5 +56,8 @@ export type ApplicationInfo = {
56
56
  name: string;
57
57
  version: string;
58
58
  }>;
59
+ extensionInfo?: {
60
+ [extensionName: string]: any;
61
+ };
59
62
  extraInfo: any;
60
63
  };
@@ -0,0 +1,13 @@
1
+ export type EngineMetadata = {
2
+ engineId: string;
3
+ hostname: string;
4
+ lastSeen: number;
5
+ alive?: boolean;
6
+ leader?: boolean;
7
+ current?: boolean;
8
+ allProcesses?: number;
9
+ runningProcesses?: number;
10
+ finishedProcesses?: number;
11
+ erroredProcesses?: number;
12
+ terminatedProcesses?: number;
13
+ };
@@ -161,6 +161,7 @@ export declare type ProcessInstance = {
161
161
  metadata?: ProcessInstanceMetadata;
162
162
  correlation?: Correlation;
163
163
  triggeredByFlowNodeInstance?: FlowNodeInstance;
164
+ engineId?: string;
164
165
  };
165
166
  /**
166
167
  * @swagger
@@ -92,12 +92,6 @@ export type ProcessInstanceQuery = {
92
92
  processInstanceMetadata?: Array<string> | string | SearchQuery;
93
93
  triggeredByFlowNodeInstance?: Array<string> | string | SearchQuery;
94
94
  };
95
- export type DeleteProcessInstanceQuery = {
96
- processInstanceId?: Array<string> | string | SearchQuery;
97
- processModelId?: Array<string> | string | SearchQuery;
98
- finishedBefore?: Date;
99
- finishedAfter?: Date;
100
- };
101
95
  export declare enum ProcessInstanceSortableColumns {
102
96
  correlationId = "correlationId",
103
97
  processInstanceId = "processInstanceId",
@@ -16,6 +16,7 @@ export * from './Constants';
16
16
  export * from './Correlation';
17
17
  export * from './Cronjob/index';
18
18
  export * from './DataObjectInstance';
19
+ export * from './EngineMetadata';
19
20
  export * from './ExternalTask/index';
20
21
  export * from './FlowNodeInstance/index';
21
22
  export * from './Iam/index';
package/dist/Engine.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as express from 'express';
2
2
  import { UserTaskInstance } from './DataModels';
3
3
  import { Identity } from './DataModels/Iam/index';
4
+ import { ExternalEventBus } from './EngineEventBus';
4
5
  import { EngineEventType, MiddlewareCallback } from './EngineEvents/index';
5
- import { IApplicationInfoExtensionAdapter, ICorrelationExtensionAdapter, ICronjobExtensionAdapter, IDataObjectInstanceExtensionAdapter, IEventExtensionAdapter, IExternalTaskExtensionAdapter, IFlowNodeInstanceExtensionAdapter, IIamExtensionAdapter, IManualTaskExtensionAdapter, INotificationExtensionAdapter, IProcessDefinitionExtensionAdapter, IProcessInstanceExtensionAdapter, IProcessModelExtensionAdapter, IUntypedTaskExtensionAdapter, IUserTaskExtensionAdapter } from './ExtensionAdapter';
6
+ import { IApplicationInfoExtensionAdapter, IClusterExtensionAdapter, ICorrelationExtensionAdapter, ICronjobExtensionAdapter, IDataObjectInstanceExtensionAdapter, IEventExtensionAdapter, IExternalTaskExtensionAdapter, IFlowNodeInstanceExtensionAdapter, IIamExtensionAdapter, IManualTaskExtensionAdapter, IMessageEventExtensionAdapter, INotificationExtensionAdapter, IProcessDefinitionExtensionAdapter, IProcessInstanceExtensionAdapter, IProcessModelExtensionAdapter, ISignalEventExtensionAdapter, IUntypedTaskExtensionAdapter, IUserTaskExtensionAdapter } from './ExtensionAdapter';
6
7
  import { EventViewModel, FlowNodeViewModel } from './ProcessModel/index';
7
8
  /**
8
9
  * Describes the onLoad function, which can be exported by an extension.
@@ -12,8 +13,16 @@ import { EventViewModel, FlowNodeViewModel } from './ProcessModel/index';
12
13
  * export const onLoad: onLoadFunction = (engine: Engine) => {}
13
14
  */
14
15
  export type OnLoad = (engine: Engine) => void | Promise<void>;
16
+ export type GetStatusInfo = () => Object | Promise<Object>;
15
17
  export type EngineExtension = {
16
18
  onLoad: OnLoad;
19
+ getStatusInfo?: GetStatusInfo;
20
+ };
21
+ export type Extension = {
22
+ exports: EngineExtension;
23
+ name: string;
24
+ version: string;
25
+ path: string;
17
26
  };
18
27
  export type CustomServiceTaskHandlerContext = {
19
28
  token: {
@@ -67,6 +76,7 @@ export type CustomHttpRouteRequest = {
67
76
  stale: boolean;
68
77
  subdomains: Array<string>;
69
78
  xhr: boolean;
79
+ nonce?: string;
70
80
  };
71
81
  export declare enum HttpResponseActionType {
72
82
  Send = "send",
@@ -206,6 +216,14 @@ export type Engine = {
206
216
  * @param callback The callback to call after the Engine has finished starting up.
207
217
  */
208
218
  onReady(callback: () => void | Promise<void>): void;
219
+ /**
220
+ * Registers a custom Event Bus, which will replace the Engine's own internal Event Bus.
221
+ *
222
+ * **NOTE:** Can only be used BEFORE the {@link Engine.onReady} Event was fired!
223
+ *
224
+ * @param eventBus A custom {@link ExternalEventBus}.
225
+ */
226
+ registerCustomEventBus(eventBus: ExternalEventBus): void;
209
227
  /**
210
228
  * Registers the given callback as an Event Middleware.
211
229
  * This middleware gets called whenever a Log Event occurs at the Engine.
@@ -339,6 +357,7 @@ export type Engine = {
339
357
  registerHttpRoute(path: string, method: 'get' | 'post' | 'put' | 'delete', routeHandler: CustomHttpRouteHandler, options?: CustomHttpRouteOptions): void;
340
358
  executeRuntimeExpression<TExpectedResult>(expression: string, params: RuntimeExpressionParameters): Promise<TExpectedResult>;
341
359
  applicationInfo: IApplicationInfoExtensionAdapter;
360
+ cluster: IClusterExtensionAdapter;
342
361
  correlations: ICorrelationExtensionAdapter;
343
362
  cronjobs: ICronjobExtensionAdapter;
344
363
  dataObjectInstances: IDataObjectInstanceExtensionAdapter;
@@ -348,9 +367,11 @@ export type Engine = {
348
367
  flowNodeInstances: IFlowNodeInstanceExtensionAdapter;
349
368
  iam: IIamExtensionAdapter;
350
369
  manualTasks: IManualTaskExtensionAdapter;
370
+ messageEvents: IMessageEventExtensionAdapter;
351
371
  notification: INotificationExtensionAdapter;
352
372
  processDefinitions: IProcessDefinitionExtensionAdapter;
353
373
  processInstances: IProcessInstanceExtensionAdapter;
354
374
  processModels: IProcessModelExtensionAdapter;
375
+ signalEvents: ISignalEventExtensionAdapter;
355
376
  userTasks: IUserTaskExtensionAdapter;
356
377
  };
@@ -87,6 +87,7 @@ export declare type HttpServerConfig = {
87
87
  };
88
88
  export declare type IAMConfiguration = {
89
89
  baseUrl: string;
90
+ internalUrl?: string;
90
91
  allowAnonymousRootAccess?: boolean;
91
92
  rootAccessToken?: string;
92
93
  };
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Defines the signature for the Callback that an EventSubscription should have.
3
+ *
4
+ * @param eventPayload Optional: The payload received with the event.
5
+ * @param eventName Optional: The name of the received event.
6
+ */
7
+ export type EventReceivedCallback = (eventPayload?: any, eventName?: string) => void | Promise<void>;
8
+ /**
9
+ * Contains information about a subscription on the EngineEventBus.
10
+ * External services can use this information to manage their own subscriptions.
11
+ */
12
+ export type Subscription = {
13
+ /**
14
+ * The Id under which the EngineEventBus has stored the Subscription.
15
+ */
16
+ readonly id: string;
17
+ /**
18
+ * The name of the event for which the Subscription was created.
19
+ */
20
+ readonly eventName: string;
21
+ /**
22
+ * If set to true, the Subscription will be destroyed after first receiving
23
+ * the event.
24
+ */
25
+ readonly onlyReceiveOnce: boolean;
26
+ };
27
+ export type ExternalSubscription = {
28
+ remove: () => Promise<void>;
29
+ };
30
+ /**
31
+ * The Event Bus is used by the Engine to manage communications between the individual engine services, as well as all Flow Node Instances and Process Instances.
32
+ *
33
+ * By default, the Engine uses its own EventAggregator.
34
+ *
35
+ * You can replace it with your own, if you want to connect the engine to an external messagebus.
36
+ */
37
+ export type EngineEventBus = {
38
+ /**
39
+ * Creates a new {@link Subscription} on the EventBus for the event with the given name.
40
+ * The {@link Subscription} will remain active, until manually disposed through the {@link EngineEventBus.unsubscribe} method.
41
+ *
42
+ * @param eventName The name of the Event to subscribe to.
43
+ * @param callback The callback to execute, when the event is received.
44
+ * @returns A {@link Subscription} object.
45
+ */
46
+ subscribe: (eventName: string, callback: EventReceivedCallback) => Subscription;
47
+ /**
48
+ * Creates a new {@link Subscription} on the EventBus for the event with the given name.
49
+ * The {@link Subscription} is automatically disposed, after the event was received once.
50
+ *
51
+ * @param eventName The name of the Event to subscribe to.
52
+ * @param callback The callback to execute, when the event is received.
53
+ * @returns A {@link Subscription} object.
54
+ */
55
+ subscribeOnce: (eventName: string, callback: EventReceivedCallback) => Subscription;
56
+ /**
57
+ * Publishes a given event on the EventBus.
58
+ * Usually, this function returns as soon as the Event was published.
59
+ * However, it is possible to wait for all Subscribers to acknowledge receiving the Event, by providing an "onAcknowledgement" Callback function.
60
+ *
61
+ * @param eventName The name of the Event to publish.
62
+ * @param payload The payload to send with the Event.
63
+ * @param onAcknowledgement Optional: The callback to call, after all Subscribers have acknowledged receiving the Event.
64
+ * @param eventId Optional: The Event ID to use.
65
+ */
66
+ publish: (eventName: string, payload?: Record<string, any>, onAcknowledgement?: () => void, eventId?: string) => void;
67
+ /**
68
+ * Allows a Subscriber to acknowledge the receit of an Event with the given ID.
69
+ *
70
+ * @param eventId The ID of the Event to acknowledge.
71
+ */
72
+ acknowledgeEvent: (eventId: string) => void;
73
+ /**
74
+ * Disposes the given Event Subscription.
75
+ *
76
+ * @param subscription The Subscription to dispose.
77
+ */
78
+ unsubscribe: (subscription: Subscription) => void;
79
+ };
80
+ export type ExternalEventBus = {
81
+ subscribeToWorkQueue: (queueName: string, callback: Function, oneTimeSubscription?: boolean) => Promise<ExternalSubscription>;
82
+ subscribeToTopicWithRoutingKey: (topic: string, routingKey: string, callback: Function, oneTimeSubscription?: boolean) => Promise<ExternalSubscription>;
83
+ subscribeToBroadcast: (topic: string, callback: Function, oneTimeSubscription?: boolean) => Promise<ExternalSubscription>;
84
+ publishToWorkQueue: (queueName: string, payload: Record<string, any>) => Promise<void>;
85
+ publishToTopicWithRoutingKey: (topic: string, routingKey: string, payload: Record<string, any>) => Promise<void>;
86
+ publishToBroadcast: (topic: string, payload: Record<string, any>) => Promise<void>;
87
+ };
@@ -0,0 +1,96 @@
1
+ export declare const EngineEventBusSettings: {
2
+ messageParams: {
3
+ correlationId: string;
4
+ externalTaskId: string;
5
+ flowNodeInstanceId: string;
6
+ messageReference: string;
7
+ processInstanceId: string;
8
+ triggerValueReference: string;
9
+ processModelId: string;
10
+ signalReference: string;
11
+ };
12
+ messagePaths: {
13
+ activityReached: string;
14
+ activityFinished: string;
15
+ activityCanceled: string;
16
+ boundaryEventTriggered: string;
17
+ boundaryEventFinished: string;
18
+ boundaryEventWaiting: string;
19
+ changeCorrelationMetadata: string;
20
+ correlationMetadataChanged: string;
21
+ cronjobCreated: string;
22
+ cronjobExecuted: string;
23
+ cronjobEnabledChanged: string;
24
+ cronjobStopped: string;
25
+ cronjobUpdated: string;
26
+ cronjobRemoved: string;
27
+ untypedTaskReached: string;
28
+ untypedTaskFinished: string;
29
+ endEventFinished: string;
30
+ engineDied: string;
31
+ externalTaskCreated: string;
32
+ externalTaskExpired: string;
33
+ externalTaskFinished: string;
34
+ externalTaskLocked: string;
35
+ externalTaskUnlocked: string;
36
+ finishExternalTask: string;
37
+ flowNodeEventRetrySending: string;
38
+ intermediateThrowEventTriggered: string;
39
+ intermediateCatchEventReached: string;
40
+ intermediateCatchEventFinished: string;
41
+ killProcessInstance: string;
42
+ livenessProbe: string;
43
+ manualTaskReached: string;
44
+ manualTaskFinished: string;
45
+ processDeployed: string;
46
+ processUndeployed: string;
47
+ processInstancesDeleted: string;
48
+ processInstanceMetadataChanged: string;
49
+ processExecutableChanged: string;
50
+ selectLeader: string;
51
+ startEventFinished: string;
52
+ terminateProcessInstance: string;
53
+ userTaskReached: string;
54
+ userTaskFinished: string;
55
+ userTaskReserved: string;
56
+ userTaskReservationCanceled: string;
57
+ messageOnProcessInstanceTriggered: string;
58
+ messageEventTriggeredOnPath: string;
59
+ messageTriggered: string;
60
+ signalOnProcessInstanceTriggered: string;
61
+ signalEventTriggeredOnPath: string;
62
+ signalTriggered: string;
63
+ triggerTimerEvent: string;
64
+ tokenPayloadChange: string;
65
+ tokenPayloadChangeFinished: string;
66
+ activityError: string;
67
+ processStarting: string;
68
+ processStarted: string;
69
+ processResumed: string;
70
+ processOwnerChanged: string;
71
+ processEnded: string;
72
+ processError: string;
73
+ processTerminated: string;
74
+ gatewayFinished: string;
75
+ finishUntypedTask: string;
76
+ untypedTaskWithInstanceIdFinished: string;
77
+ finishUserTask: string;
78
+ userTaskWithInstanceIdFinished: string;
79
+ finishManualTask: string;
80
+ manualTaskWithInstanceIdFinished: string;
81
+ endEventReached: string;
82
+ processInstanceWithIdStarted: string;
83
+ processInstanceWithIdEnded: string;
84
+ processInstanceWithIdErrored: string;
85
+ terminateProcessInstanceWithId: string;
86
+ killProcessInstanceWithId: string;
87
+ processInstanceWithIdTerminated: string;
88
+ processInstanceWithIdKilled: string;
89
+ terminateEndEventReached: string;
90
+ changeProcessInstanceOwner: string;
91
+ processInstanceOwnerChanged: string;
92
+ };
93
+ externalMessagePaths: {
94
+ processStartRequest: string;
95
+ };
96
+ };
@@ -0,0 +1,11 @@
1
+ import { Identity } from '../../DataModels';
2
+ /**
3
+ * Encapsulates a message for when a Process Instance gets killed by a user.
4
+ */
5
+ export type KillProcessInstanceMessageInternal = {
6
+ /**
7
+ * Contain the killers identity.
8
+ */
9
+ killedBy: Identity;
10
+ processInstanceId: string;
11
+ };
@@ -3,6 +3,7 @@ import { Identity } from '../../DataModels/Iam/index';
3
3
  * Encapsulates a message for when a Process Instance gets terminated.
4
4
  */
5
5
  export type TerminateProcessInstanceMessage = {
6
+ processInstanceId: string;
6
7
  /**
7
8
  * If the Process Instance is terminated by a user, this will contain the users identity.
8
9
  */
@@ -5,6 +5,7 @@ export * from './ErrorEndEventReached';
5
5
  export * from './ExternalTaskMessages';
6
6
  export * from './FinishManualTask';
7
7
  export * from './FinishUserTask';
8
+ export * from './KillProcessInstanceMessageInternal';
8
9
  export * from './MessageEventReached';
9
10
  export * from './MetadataChangedMessage';
10
11
  export * from './ProcessDeploymentMessage';
@@ -9,7 +9,6 @@ export * from './EventCallbackTypes';
9
9
  export * from './EngineEvent';
10
10
  export * from './EngineEventMiddlewares';
11
11
  export * from './EventPayloads/index';
12
- export * from './Subscription';
13
12
  export declare namespace Messages {
14
13
  export import EventMessage = eventPayloads.EventMessage;
15
14
  export import IConstructor = iConstructor.IConstructor;