@5minds/processcube_engine_sdk 5.0.0-feature-cafaa5-lpk388wt → 5.0.0-feature-b0ea23-lpl16hy9
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/dist/Engine.d.ts +9 -0
- package/dist/EngineEventBus.d.ts +76 -0
- package/dist/EngineEventBusSettings.d.ts +78 -0
- package/dist/EngineEvents/index.d.ts +0 -1
- package/dist/EngineRestApiSettings.d.ts +2006 -0
- package/dist/EngineSocketIoSettings.d.ts +51 -0
- package/dist/ExtensionAdapter/NotificationExtensionAdapter.d.ts +4 -8
- package/dist/amd/Engine.js.map +1 -1
- package/dist/amd/{EngineEvents/Subscription.js → EngineEventBus.js} +1 -1
- package/dist/amd/EngineEventBus.js.map +1 -0
- package/dist/amd/EngineEventBusSettings.js +86 -0
- package/dist/amd/EngineEventBusSettings.js.map +1 -0
- package/dist/amd/EngineEvents/index.js +1 -2
- package/dist/amd/EngineEvents/index.js.map +1 -1
- package/dist/amd/EngineRestApiSettings.js +2040 -0
- package/dist/amd/EngineRestApiSettings.js.map +1 -0
- package/dist/amd/EngineSocketIoSettings.js +58 -0
- package/dist/amd/EngineSocketIoSettings.js.map +1 -0
- package/dist/amd/index.js +5 -1
- package/dist/amd/index.js.map +1 -1
- package/dist/commonjs/Engine.js.map +1 -1
- package/dist/commonjs/{EngineEvents/Subscription.js → EngineEventBus.js} +1 -1
- package/dist/commonjs/EngineEventBus.js.map +1 -0
- package/dist/commonjs/EngineEventBusSettings.js +84 -0
- package/dist/commonjs/EngineEventBusSettings.js.map +1 -0
- package/dist/commonjs/EngineEvents/index.js +0 -1
- package/dist/commonjs/EngineEvents/index.js.map +1 -1
- package/dist/commonjs/EngineRestApiSettings.js +2038 -0
- package/dist/commonjs/EngineRestApiSettings.js.map +1 -0
- package/dist/commonjs/EngineSocketIoSettings.js +56 -0
- package/dist/commonjs/EngineSocketIoSettings.js.map +1 -0
- package/dist/commonjs/index.js +4 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
- package/dist/EngineEvents/Subscription.d.ts +0 -26
- package/dist/amd/EngineEvents/Subscription.js.map +0 -1
- package/dist/commonjs/EngineEvents/Subscription.js.map +0 -1
package/dist/Engine.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Identity } from './DataModels/Iam/index';
|
|
3
3
|
import { EngineEventType, MiddlewareCallback } from './EngineEvents/index';
|
|
4
|
+
import { EngineEventBus } from './EngineEventBus';
|
|
4
5
|
import { IApplicationInfoExtensionAdapter, ICorrelationExtensionAdapter, ICronjobExtensionAdapter, IDataObjectInstanceExtensionAdapter, IUntypedTaskExtensionAdapter, IEventExtensionAdapter, IExternalTaskExtensionAdapter, IFlowNodeInstanceExtensionAdapter, IIamExtensionAdapter, IManualTaskExtensionAdapter, INotificationExtensionAdapter, IProcessDefinitionExtensionAdapter, IProcessInstanceExtensionAdapter, IProcessModelExtensionAdapter, IUserTaskExtensionAdapter } from './ExtensionAdapter';
|
|
5
6
|
import { EventViewModel, FlowNodeViewModel } from './ProcessModel/index';
|
|
6
7
|
import * as express from 'express';
|
|
@@ -204,6 +205,14 @@ export type Engine = {
|
|
|
204
205
|
* @param callback The callback to call after the Engine has finished starting up.
|
|
205
206
|
*/
|
|
206
207
|
onReady(callback: () => void | Promise<void>): void;
|
|
208
|
+
/**
|
|
209
|
+
* Registers a custom Event Bus, which will replace the Engine's own internal Event Bus.
|
|
210
|
+
*
|
|
211
|
+
* **NOTE:** Can only be used BEFORE the {@link Engine.onReady} Event was fired!
|
|
212
|
+
*
|
|
213
|
+
* @param eventBus A custom {@link EngineEventBus}.
|
|
214
|
+
*/
|
|
215
|
+
registerCustomEventBus(eventBus: EngineEventBus): void;
|
|
207
216
|
/**
|
|
208
217
|
* Registers the given callback as an Event Middleware.
|
|
209
218
|
* This middleware gets called whenever a Log Event occurs at the Engine.
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
/**
|
|
28
|
+
* 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.
|
|
29
|
+
*
|
|
30
|
+
* By default, the Engine uses its own EventAggregator.
|
|
31
|
+
*
|
|
32
|
+
* You can replace it with your own, if you want to connect the engine to an external messagebus.
|
|
33
|
+
*/
|
|
34
|
+
export type EngineEventBus = {
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new {@link Subscription} on the EventBus for the event with the given name.
|
|
37
|
+
* The {@link Subscription} will remain active, until manually disposed through the {@link EngineEventBus.unsubscribe} method.
|
|
38
|
+
*
|
|
39
|
+
* @param eventName The name of the Event to subscribe to.
|
|
40
|
+
* @param callback The callback to execute, when the event is received.
|
|
41
|
+
* @returns A {@link Subscription} object.
|
|
42
|
+
*/
|
|
43
|
+
subscribe: (eventName: string, callback: EventReceivedCallback) => Subscription;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new {@link Subscription} on the EventBus for the event with the given name.
|
|
46
|
+
* The {@link Subscription} is automatically disposed, after the event was received once.
|
|
47
|
+
*
|
|
48
|
+
* @param eventName The name of the Event to subscribe to.
|
|
49
|
+
* @param callback The callback to execute, when the event is received.
|
|
50
|
+
* @returns A {@link Subscription} object.
|
|
51
|
+
*/
|
|
52
|
+
subscribeOnce: (eventName: string, callback: EventReceivedCallback) => Subscription;
|
|
53
|
+
/**
|
|
54
|
+
* Publishes a given event on the EventBus.
|
|
55
|
+
* Usually, this function returns as soon as the Event was published.
|
|
56
|
+
* However, it is possible to wait for all Subscribers to acknowledge receiving the Event, by providing an "onAcknowledgement" Callback function.
|
|
57
|
+
*
|
|
58
|
+
* @param eventName The name of the Event to publish.
|
|
59
|
+
* @param payload The payload to send with the Event.
|
|
60
|
+
* @param onAcknowledgement Optional: The callback to call, after all Subscribers have acknowledged receiving the Event.
|
|
61
|
+
* @param eventId Optional: The Event ID to use.
|
|
62
|
+
*/
|
|
63
|
+
publish: (eventName: string, payload?: Record<string, any>, onAcknowledgement?: () => void, eventId?: string) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Allows a Subscriber to acknowledge the receit of an Event with the given ID.
|
|
66
|
+
*
|
|
67
|
+
* @param eventId The ID of the Event to acknowledge.
|
|
68
|
+
*/
|
|
69
|
+
acknowledgeEvent: (eventId: string) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Disposes the given Event Subscription.
|
|
72
|
+
*
|
|
73
|
+
* @param subscription The Subscription to dispose.
|
|
74
|
+
*/
|
|
75
|
+
unsubscribe: (subscription: Subscription) => void;
|
|
76
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const EngineEventBusSettings: {
|
|
2
|
+
messageParams: {
|
|
3
|
+
externalTaskId: string;
|
|
4
|
+
flowNodeInstanceId: string;
|
|
5
|
+
messageReference: string;
|
|
6
|
+
processInstanceId: string;
|
|
7
|
+
triggerValueReference: string;
|
|
8
|
+
processModelId: string;
|
|
9
|
+
signalReference: string;
|
|
10
|
+
};
|
|
11
|
+
messagePaths: {
|
|
12
|
+
activityReached: string;
|
|
13
|
+
activityFinished: string;
|
|
14
|
+
boundaryEventTriggered: string;
|
|
15
|
+
boundaryEventFinished: string;
|
|
16
|
+
correlationMetadataChanged: string;
|
|
17
|
+
cronjobCreated: string;
|
|
18
|
+
cronjobExecuted: string;
|
|
19
|
+
cronjobEnabledChanged: string;
|
|
20
|
+
cronjobStopped: string;
|
|
21
|
+
cronjobUpdated: string;
|
|
22
|
+
cronjobRemoved: string;
|
|
23
|
+
untypedTaskReached: string;
|
|
24
|
+
untypedTaskFinished: string;
|
|
25
|
+
endEventFinished: string;
|
|
26
|
+
externalTaskCreated: string;
|
|
27
|
+
externalTaskExpired: string;
|
|
28
|
+
externalTaskFinished: string;
|
|
29
|
+
externalTaskLocked: string;
|
|
30
|
+
externalTaskUnlocked: string;
|
|
31
|
+
intermediateThrowEventTriggered: string;
|
|
32
|
+
intermediateCatchEventReached: string;
|
|
33
|
+
intermediateCatchEventFinished: string;
|
|
34
|
+
manualTaskReached: string;
|
|
35
|
+
manualTaskFinished: string;
|
|
36
|
+
processDeployed: string;
|
|
37
|
+
processUndeployed: string;
|
|
38
|
+
processInstancesDeleted: string;
|
|
39
|
+
processInstanceMetadataChanged: string;
|
|
40
|
+
processExecutableChanged: string;
|
|
41
|
+
startEventFinished: string;
|
|
42
|
+
userTaskReached: string;
|
|
43
|
+
userTaskFinished: string;
|
|
44
|
+
userTaskReserved: string;
|
|
45
|
+
userTaskReservationCanceled: string;
|
|
46
|
+
messageOnProcessInstanceTriggered: string;
|
|
47
|
+
messageEventTriggeredOnPath: string;
|
|
48
|
+
messageTriggered: string;
|
|
49
|
+
signalOnProcessInstanceTriggered: string;
|
|
50
|
+
signalEventTriggeredOnPath: string;
|
|
51
|
+
signalTriggered: string;
|
|
52
|
+
tokenPayloadChange: string;
|
|
53
|
+
tokenPayloadChangeFinished: string;
|
|
54
|
+
activityError: string;
|
|
55
|
+
processStarting: string;
|
|
56
|
+
processStarted: string;
|
|
57
|
+
processResumed: string;
|
|
58
|
+
processOwnerChanged: string;
|
|
59
|
+
processEnded: string;
|
|
60
|
+
processError: string;
|
|
61
|
+
processTerminated: string;
|
|
62
|
+
gatewayFinished: string;
|
|
63
|
+
finishUntypedTask: string;
|
|
64
|
+
untypedTaskWithInstanceIdFinished: string;
|
|
65
|
+
finishUserTask: string;
|
|
66
|
+
userTaskWithInstanceIdFinished: string;
|
|
67
|
+
finishManualTask: string;
|
|
68
|
+
manualTaskWithInstanceIdFinished: string;
|
|
69
|
+
endEventReached: string;
|
|
70
|
+
processInstanceWithIdStarted: string;
|
|
71
|
+
processInstanceWithIdEnded: string;
|
|
72
|
+
processInstanceWithIdErrored: string;
|
|
73
|
+
terminateProcessInstanceWithId: string;
|
|
74
|
+
processInstanceWithIdTerminated: string;
|
|
75
|
+
changeProcessInstanceOwner: string;
|
|
76
|
+
processInstanceOwnerChanged: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
@@ -3,7 +3,6 @@ export * from './EventCallbackTypes';
|
|
|
3
3
|
export * from './EngineEvent';
|
|
4
4
|
export * from './EngineEventMiddlewares';
|
|
5
5
|
export * from './EventPayloads/index';
|
|
6
|
-
export * from './Subscription';
|
|
7
6
|
/**
|
|
8
7
|
* Only for backwards compatibility.
|
|
9
8
|
* We'd get a ton of breaking changes without them, when using the SDK with the client or proxy.
|