@5minds/processcube_engine_client
Advanced tools
Comparing version 6.0.0-feature-d19732-m234s4wd to 6.0.0-feature-d71480-m7bwe81b
@@ -1,7 +0,6 @@ | ||
import { Identity } from '@5minds/processcube_engine_sdk'; | ||
import * as Clients from './Clients/index'; | ||
import { IdentityLike } from './IdentityAccessor'; | ||
export declare class EngineClient { | ||
private readonly engineUrl; | ||
private readonly identity; | ||
private readonly anonymousSessionClient; | ||
private readonly identityAccessor; | ||
private readonly applicationInfoClient; | ||
@@ -21,3 +20,4 @@ private readonly correlationClient; | ||
private readonly userTaskClient; | ||
constructor(engineUrl: string, identity?: Identity); | ||
private readonly socketIoManager; | ||
constructor(engineUrl: string, identity?: IdentityLike); | ||
dispose(): void; | ||
@@ -28,3 +28,2 @@ /** | ||
getEngineUrl(): string; | ||
get anonymousSession(): Clients.AnonymousSessionHttpClient; | ||
get applicationInfo(): Clients.ApplicationInfoHttpClient; | ||
@@ -31,0 +30,0 @@ get correlations(): Clients.CorrelationHttpClient; |
@@ -1,20 +0,19 @@ | ||
import { Identity } from '@5minds/processcube_engine_sdk'; | ||
import { SocketIoManager } from './Clients/Lib/SocketIoManager'; | ||
import { AnonymousSessionHttpClient, ApplicationInfoHttpClient, CorrelationHttpClient, CronjobHttpClient, DataObjectInstanceHttpClient, EventHttpClient, ExternalTaskClient, FlowNodeInstanceHttpClient, ManualTaskHttpClient, NotificationHttpClient, ProcessDefinitionHttpClient, ProcessInstanceHttpClient, ProcessModelHttpClient, UntypedTaskHttpClient, UserTaskHttpClient } from './Clients/index'; | ||
import { ApplicationInfoHttpClient, CorrelationHttpClient, CronjobHttpClient, DataObjectInstanceHttpClient, EventHttpClient, ExternalTaskClient, FlowNodeInstanceHttpClient, ManualTaskHttpClient, NotificationHttpClient, ProcessDefinitionHttpClient, ProcessInstanceHttpClient, ProcessModelHttpClient, UntypedTaskHttpClient, UserTaskHttpClient } from './Clients/index'; | ||
import { IdentityLike } from './IdentityAccessor'; | ||
export declare const ClientFactory: { | ||
createAnonymousSessionClient: (engineUrl: string, identity?: Identity) => AnonymousSessionHttpClient; | ||
createApplicationInfoClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => ApplicationInfoHttpClient; | ||
createCorrelationClient: (engineUrl: string, identity?: Identity) => CorrelationHttpClient; | ||
createCronJobClient: (engineUrl: string, identity?: Identity) => CronjobHttpClient; | ||
createDataObjectInstanceClient: (engineUrl: string, identity?: Identity) => DataObjectInstanceHttpClient; | ||
createUntypedTaskClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => UntypedTaskHttpClient; | ||
createEventClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => EventHttpClient; | ||
createExternalTaskClient: (engineUrl: string, identity?: Identity) => ExternalTaskClient; | ||
createFlowNodeInstanceClient: (engineUrl: string, identity?: Identity) => FlowNodeInstanceHttpClient; | ||
createManualTaskClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => ManualTaskHttpClient; | ||
createNotificationClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => NotificationHttpClient; | ||
createProcessDefinitionClient: (engineUrl: string, identity?: Identity) => ProcessDefinitionHttpClient; | ||
createProcessInstanceClient: (engineUrl: string, identity?: Identity) => ProcessInstanceHttpClient; | ||
createProcessModelClient: (engineUrl: string, identity?: Identity) => ProcessModelHttpClient; | ||
createUserTaskClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => UserTaskHttpClient; | ||
createApplicationInfoClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => ApplicationInfoHttpClient; | ||
createCorrelationClient: (engineUrl: string, identity?: IdentityLike) => CorrelationHttpClient; | ||
createCronJobClient: (engineUrl: string, identity?: IdentityLike) => CronjobHttpClient; | ||
createDataObjectInstanceClient: (engineUrl: string, identity?: IdentityLike) => DataObjectInstanceHttpClient; | ||
createUntypedTaskClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => UntypedTaskHttpClient; | ||
createEventClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => EventHttpClient; | ||
createExternalTaskClient: (engineUrl: string, identity?: IdentityLike) => ExternalTaskClient; | ||
createFlowNodeInstanceClient: (engineUrl: string, identity?: IdentityLike) => FlowNodeInstanceHttpClient; | ||
createManualTaskClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => ManualTaskHttpClient; | ||
createNotificationClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => NotificationHttpClient; | ||
createProcessDefinitionClient: (engineUrl: string, identity?: IdentityLike) => ProcessDefinitionHttpClient; | ||
createProcessInstanceClient: (engineUrl: string, identity?: IdentityLike) => ProcessInstanceHttpClient; | ||
createProcessModelClient: (engineUrl: string, identity?: IdentityLike) => ProcessModelHttpClient; | ||
createUserTaskClient: (engineUrl: string, identity?: IdentityLike, socketIoManager?: SocketIoManager) => UserTaskHttpClient; | ||
}; |
@@ -1,2 +0,3 @@ | ||
import { DataModels, IApplicationInfoExtensionAdapter, Identity, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, IApplicationInfoExtensionAdapter, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { Messages as ClientMessages } from '../Types/index'; | ||
@@ -7,5 +8,5 @@ import { BaseClient } from './BaseClient'; | ||
getAuthorityAddress(): Promise<string>; | ||
onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: Identity): Subscription; | ||
onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: Identity): Subscription; | ||
onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: Identity): Subscription; | ||
onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription; | ||
onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription; | ||
onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription; | ||
} |
@@ -1,6 +0,7 @@ | ||
import { Identity, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { HttpClient, IRequestOptions } from '../HttpClient'; | ||
import { IdentityAccessor, IdentityLike } from '../IdentityAccessor'; | ||
import { SocketIoManager } from './Lib/SocketIoManager'; | ||
export declare class BaseClient { | ||
identity: Identity; | ||
identityAccessor: IdentityAccessor; | ||
protected httpClient: HttpClient; | ||
@@ -10,3 +11,3 @@ protected readonly socketIoManager: SocketIoManager; | ||
private readonly engineUrl; | ||
constructor(engineUrl: string, identity: Identity, socketIoManager?: SocketIoManager); | ||
constructor(engineUrl: string, identity: IdentityLike, socketIoManager?: SocketIoManager); | ||
get connected(): boolean; | ||
@@ -17,9 +18,10 @@ /** | ||
getEngineUrl(): string; | ||
isSocketConnected(identity?: Identity): boolean; | ||
disconnectSocket(identity: Identity): void; | ||
isSocketConnected(identityAccessor?: IdentityLike): boolean; | ||
disconnectSocket(identityAccessor?: IdentityLike): void; | ||
dispose(): void; | ||
protected buildUrl<TQuery, TSort>(url: string, offset?: number, limit?: number, query?: TQuery, sortSettings?: TSort): string; | ||
protected createRequestAuthHeaders(identity: Identity): IRequestOptions; | ||
protected createSocketIoSubscription(route: string, callback: (args: any) => void, subscribeOnce: boolean, identity?: Identity): Subscription; | ||
protected removeSocketIoSubscription(subscription: Subscription, identity?: Identity): void; | ||
protected createRequestAuthHeaders(identityAccessor?: IdentityLike): Promise<IRequestOptions>; | ||
protected createSocketIoSubscription(route: string, callback: (args: any) => void, subscribeOnce: boolean, identity?: IdentityLike): Promise<Subscription>; | ||
protected createSocketIoSubscriptionSync(route: string, callback: (args: any) => void, subscribeOnce: boolean, identity?: IdentityLike): Subscription; | ||
protected removeSocketIoSubscription(subscription: Subscription, identity?: IdentityLike): void; | ||
protected addParameterToUrl<TValue>(url: string, parameterName: string, parameterValue: TValue): string; | ||
@@ -26,0 +28,0 @@ private encodeQueryAndAddParametersToUrl; |
@@ -1,6 +0,7 @@ | ||
import { DataModels, ICorrelationExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, ICorrelationExtensionAdapter } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
export declare class CorrelationHttpClient extends BaseClient implements ICorrelationExtensionAdapter { | ||
getAll(options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
includeProcessInstances?: boolean; | ||
@@ -12,5 +13,5 @@ offset?: number; | ||
getById(correlationId: string, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
includeProcessInstances?: boolean; | ||
}): Promise<DataModels.Correlation.Correlation>; | ||
} |
@@ -1,6 +0,7 @@ | ||
import { CronjobQuery, CronjobSortSettings, DeployedCronjobList, ICronjobExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { CronjobQuery, CronjobSortSettings, DeployedCronjobList, ICronjobExtensionAdapter } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
export declare class CronjobHttpClient extends BaseClient implements ICronjobExtensionAdapter { | ||
query(query: CronjobQuery, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
@@ -10,4 +11,4 @@ limit?: number; | ||
}): Promise<DeployedCronjobList>; | ||
enableCronjob(processModelId: string, flowNodeId: string, identity?: Identity): Promise<void>; | ||
disableCronjob(processModelId: string, flowNodeId: string, identity?: Identity): Promise<void>; | ||
enableCronjob(processModelId: string, flowNodeId: string, identity?: IdentityLike): Promise<void>; | ||
disableCronjob(processModelId: string, flowNodeId: string, identity?: IdentityLike): Promise<void>; | ||
} |
@@ -1,6 +0,7 @@ | ||
import { DataModels, IDataObjectInstanceExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, IDataObjectInstanceExtensionAdapter } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
export declare class DataObjectInstanceHttpClient extends BaseClient implements IDataObjectInstanceExtensionAdapter { | ||
query(query: DataModels.DataObjects.DataObjectInstanceQuery, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
@@ -7,0 +8,0 @@ limit?: number; |
import { DataModels, IEventExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
@@ -6,3 +7,3 @@ type EventList = DataModels.FlowNodeInstances.EventList; | ||
query(query: DataModels.FlowNodeInstances.EventQuery, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
@@ -15,3 +16,3 @@ limit?: number; | ||
payload?: TPayload; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<void>; | ||
@@ -21,2 +22,5 @@ triggerSignalEvent<TPayload>(signalName: string, options?: { | ||
payload?: TPayload; | ||
identity?: IdentityLike; | ||
}): Promise<void>; | ||
triggerTimerEvent(flowNodeInstanceId: string, options?: { | ||
identity?: Identity; | ||
@@ -26,35 +30,35 @@ }): Promise<void>; | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onBoundaryEventFinished(callback: Messages.CallbackTypes.OnBoundaryEventFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onIntermediateThrowEventTriggered(callback: Messages.CallbackTypes.OnIntermediateThrowEventTriggeredCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onIntermediateCatchEventReached(callback: Messages.CallbackTypes.OnIntermediateCatchEventReachedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onIntermediateCatchEventFinished(callback: Messages.CallbackTypes.OnIntermediateCatchEventFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onMessageTriggered(callback: Messages.CallbackTypes.OnMessageTriggeredCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onSignalTriggered(callback: Messages.CallbackTypes.OnSignalTriggeredCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onStartEventFinished(callback: Messages.CallbackTypes.OnStartEventFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onEndEventFinished(callback: Messages.CallbackTypes.OnEndEventFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
@@ -61,0 +65,0 @@ removeSubscription(subscription: Subscription, identity?: Identity): void; |
@@ -1,11 +0,12 @@ | ||
import { DataModels, IExternalTaskExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, IExternalTaskExtensionAdapter } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
type ExternalTask<TPayload> = DataModels.ExternalTasks.ExternalTask<TPayload>; | ||
export declare class ExternalTaskApiClient extends BaseClient implements IExternalTaskExtensionAdapter { | ||
getAllDeployedTopics(identity?: Identity): Promise<Array<string>>; | ||
fetchAndLockExternalTasks<TPayload>(workerId: string, topicNames: string | Array<string>, maxTasks: number, longPollingTimeout: number, lockDuration: number, payloadFilter?: RegExp, identity?: Identity, abortSignal?: AbortSignal): Promise<Array<ExternalTask<TPayload>>>; | ||
extendLock(workerId: string, externalTaskId: string, additionalDuration: number, identity?: Identity, abortSignal?: AbortSignal): Promise<void>; | ||
handleError(workerId: string, externalTaskId: string, error: DataModels.ExternalTasks.ExternalTaskError, identity?: Identity, abortSignal?: AbortSignal): Promise<void>; | ||
finishExternalTask<TResultType>(workerId: string, externalTaskId: string, result: TResultType, identity?: Identity, abortSignal?: AbortSignal): Promise<void>; | ||
getAllDeployedTopics(identity?: IdentityLike): Promise<Array<string>>; | ||
fetchAndLockExternalTasks<TPayload>(workerId: string, topicNames: string | Array<string>, maxTasks: number, longPollingTimeout: number, lockDuration: number, payloadFilter?: RegExp, identity?: IdentityLike, abortSignal?: AbortSignal): Promise<Array<ExternalTask<TPayload>>>; | ||
extendLock(workerId: string, externalTaskId: string, additionalDuration: number, identity?: IdentityLike, abortSignal?: AbortSignal): Promise<void>; | ||
handleError(workerId: string, externalTaskId: string, error: DataModels.ExternalTasks.ExternalTaskError, identity?: IdentityLike, abortSignal?: AbortSignal): Promise<void>; | ||
finishExternalTask<TResultType>(workerId: string, externalTaskId: string, result: TResultType, identity?: IdentityLike, abortSignal?: AbortSignal): Promise<void>; | ||
} | ||
export {}; |
@@ -1,8 +0,8 @@ | ||
import { Identity } from '@5minds/processcube_engine_sdk'; | ||
import { ExternalTaskWorker } from '../ExternalTaskWorker'; | ||
import { IdentityAccessor } from '../IdentityAccessor'; | ||
import { HandleExternalTaskAction, IExternalTaskWorkerConfig } from '../Types/index'; | ||
export declare class ExternalTaskClient { | ||
private engineUrl; | ||
private identity; | ||
constructor(engineUrl: string, identity: Identity); | ||
private identityAccessor; | ||
constructor(engineUrl: string, identity?: IdentityAccessor); | ||
/** | ||
@@ -12,3 +12,4 @@ * Gets the url of the engine that this client is communicating with. | ||
getEngineUrl(): string; | ||
dispose(): void; | ||
subscribeToExternalTaskTopic<TExternalTaskPayload, TResultPayload extends object>(topic: string, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, config?: IExternalTaskWorkerConfig): Promise<ExternalTaskWorker<TExternalTaskPayload, TResultPayload>>; | ||
} |
@@ -1,6 +0,7 @@ | ||
import { DataModels, IFlowNodeInstanceExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, IFlowNodeInstanceExtensionAdapter } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
export declare class FlowNodeInstanceHttpClient extends BaseClient implements IFlowNodeInstanceExtensionAdapter { | ||
query(query: DataModels.FlowNodeInstances.GenericFlowNodeInstanceQuery, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
@@ -13,9 +14,9 @@ limit?: number; | ||
*/ | ||
finishUntypedTask(taskInstanceId: string, identity?: Identity, useLegacyEndpoint?: boolean): Promise<void>; | ||
finishManualTask(manualTaskInstanceId: string, identity?: Identity): Promise<void>; | ||
finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: Identity): Promise<void>; | ||
finishUntypedTask(taskInstanceId: string, identity?: IdentityLike, useLegacyEndpoint?: boolean): Promise<void>; | ||
finishManualTask(manualTaskInstanceId: string, identity?: IdentityLike): Promise<void>; | ||
finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: IdentityLike): Promise<void>; | ||
triggerMessageEvent<TPayload>(messageName: string, options?: { | ||
processInstanceId?: string; | ||
payload?: TPayload; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<void>; | ||
@@ -25,4 +26,4 @@ triggerSignalEvent<TPayload>(signalName: string, options?: { | ||
payload?: TPayload; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<void>; | ||
} |
@@ -1,2 +0,1 @@ | ||
export * from './AnonymousSessionHttpClient'; | ||
export * from './ApplicationInfoHttpClient'; | ||
@@ -3,0 +2,0 @@ export * from './CorrelationHttpClient'; |
import { Socket } from 'socket.io-client'; | ||
import { Identity, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityAccessor } from '../../IdentityAccessor'; | ||
export declare class SocketIoManager { | ||
private readonly engineUrl; | ||
private logger; | ||
private socketCollection; | ||
private subscriptionCollection; | ||
constructor(engineUrl: string); | ||
/** | ||
* Disconnects the socket associated with the given identity. | ||
* | ||
* @param identity The identity to disconnect. | ||
*/ | ||
disconnectSocket(identity: Identity): void; | ||
/** | ||
* Disposes all sockets. | ||
*/ | ||
disconnectSocket(accessor: IdentityAccessor): void; | ||
dispose(): void; | ||
/** | ||
* Creates a new socket.io subscription for the given eventName. | ||
* | ||
* @param identity The identity for which to create the subscription. | ||
* @param eventName The event to subscribe to. | ||
* @param callback The callback to execute when the event gets triggered. | ||
* @param subscribeOnce If true, the subscription will be disposed after the event was received once. | ||
*/ | ||
createSocketIoSubscription(identity: Identity, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Subscription; | ||
/** | ||
* Removes the given subscription from the socket associated with the given identity. | ||
* | ||
* @param identity The identity for which to remove a subscription. | ||
* @param subscription The subscription to remove. | ||
*/ | ||
removeSocketIoSubscription(identity: Identity, subscription: Subscription): void; | ||
getSocketForIdentity(identity: Identity): Socket; | ||
createSocketIoSubscriptionSync(accessor: IdentityAccessor, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Subscription; | ||
createSocketIoSubscription(accessor: IdentityAccessor, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Promise<Subscription>; | ||
removeSocketIoSubscription(accessor: IdentityAccessor, subscription: Subscription): void; | ||
getSocketForIdentity(accessor: IdentityAccessor): Socket; | ||
private createSocketForIdentitySync; | ||
private createSocketForIdentity; | ||
private buildSocketWithContext; | ||
private getSocketContext; | ||
private ensureSocketContextIsinitialized; | ||
private addNewSubscriptionToSocketContext; | ||
private getRecreateWhenIdentityIsRefreshedFunction; | ||
private applySubscriptionsToSocket; | ||
} |
@@ -1,2 +0,3 @@ | ||
import { DataModels, IManualTaskExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, IManualTaskExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
@@ -6,3 +7,3 @@ type ManualTaskList = DataModels.FlowNodeInstances.ManualTaskList; | ||
query(query: DataModels.FlowNodeInstances.ManualTaskQuery, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
@@ -12,13 +13,13 @@ limit?: number; | ||
}): Promise<ManualTaskList>; | ||
finishManualTask(manualTaskInstanceId: string, identity?: Identity): Promise<void>; | ||
finishManualTask(manualTaskInstanceId: string, identity?: IdentityLike): Promise<void>; | ||
onManualTaskWaiting(callback: Messages.CallbackTypes.OnManualTaskWaitingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onManualTaskFinished(callback: Messages.CallbackTypes.OnManualTaskFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
removeSubscription(subscription: Subscription, identity?: Identity): void; | ||
removeSubscription(subscription: Subscription, identity?: IdentityLike): void; | ||
} | ||
export {}; |
@@ -1,2 +0,3 @@ | ||
import { INotificationExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { INotificationExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { Messages as ClientMessages } from '../Types/index'; | ||
@@ -10,93 +11,93 @@ import { BaseClient } from './BaseClient'; | ||
export declare class NotificationHttpClient extends BaseClient implements INotificationHttpClient { | ||
removeSubscription(subscription: Subscription, identity?: Identity): void; | ||
onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: Identity): Subscription; | ||
onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: Identity): Subscription; | ||
onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: Identity): Subscription; | ||
removeSubscription(subscription: Subscription, identity?: IdentityLike): void; | ||
onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription; | ||
onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription; | ||
onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription; | ||
onActivityError(callback: Messages.CallbackTypes.OnActivityErrorCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessDeployed(callback: Messages.CallbackTypes.OnProcessDeployedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessUndeployed(callback: Messages.CallbackTypes.OnProcessUndeployedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessIsExecutableChanged(callback: Messages.CallbackTypes.OnProcessIsExecutableChangedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onCronjobEnabledChanged(callback: Messages.CallbackTypes.OnCronjobEnabledChangedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessStarting(callback: Messages.CallbackTypes.OnProcessStartingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessStarted(callback: Messages.CallbackTypes.OnProcessStartedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessResumed(callback: Messages.CallbackTypes.OnProcessStartedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessEnded(callback: Messages.CallbackTypes.OnProcessEndedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessOwnerChanged(callback: Messages.CallbackTypes.OnProcessOwnerChangedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessTerminated(callback: Messages.CallbackTypes.OnProcessTerminatedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessError(callback: Messages.CallbackTypes.OnProcessErrorCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessInstancesDeleted(callback: Messages.CallbackTypes.OnProcessInstancesDeletedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onCronjobCreated(callback: Messages.CallbackTypes.OnCronjobCreatedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onCronjobStopped(callback: Messages.CallbackTypes.OnCronjobStoppedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onCronjobUpdated(callback: Messages.CallbackTypes.OnCronjobUpdatedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onCronjobExecuted(callback: Messages.CallbackTypes.OnCronjobExecutedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onCronjobRemoved(callback: Messages.CallbackTypes.OnCronjobRemovedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onActivityReached(callback: Messages.CallbackTypes.OnActivityReachedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onActivityFinished(callback: Messages.CallbackTypes.OnActivityFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onActivityCanceled(callback: Messages.CallbackTypes.OnActivityCanceledCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUntypedTaskWaiting(callback: Messages.CallbackTypes.OnUntypedTaskWaitingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
/** | ||
@@ -109,3 +110,3 @@ * If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification. | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
/** | ||
@@ -118,92 +119,92 @@ * If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification. | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onManualTaskFinished(callback: Messages.CallbackTypes.OnManualTaskFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUserTaskWaiting(callback: Messages.CallbackTypes.OnUserTaskWaitingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUserTaskFinished(callback: Messages.CallbackTypes.OnUserTaskFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUserTaskReserved(callback: Messages.CallbackTypes.OnUserTaskReservedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUserTaskReservationCanceled(callback: Messages.CallbackTypes.OnUserTaskReservationCanceledCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onBoundaryEventWaiting(callback: Messages.CallbackTypes.OnBoundaryEventWaitingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onBoundaryEventTriggered(callback: Messages.CallbackTypes.OnBoundaryEventTriggeredCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onBoundaryEventFinished(callback: Messages.CallbackTypes.OnBoundaryEventFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onIntermediateThrowEventTriggered(callback: Messages.CallbackTypes.OnIntermediateThrowEventTriggeredCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onIntermediateCatchEventReached(callback: Messages.CallbackTypes.OnIntermediateCatchEventReachedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onIntermediateCatchEventFinished(callback: Messages.CallbackTypes.OnIntermediateCatchEventFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onFlowNodeEventRetrySending(callback: Messages.CallbackTypes.OnFlowNodeEventRetrySendingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onMessageTriggered(callback: Messages.CallbackTypes.OnMessageTriggeredCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onSignalTriggered(callback: Messages.CallbackTypes.OnSignalTriggeredCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onStartEventFinished(callback: Messages.CallbackTypes.OnStartEventFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onEndEventFinished(callback: Messages.CallbackTypes.OnEndEventFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onExternalTaskCreated(callback: Messages.CallbackTypes.OnExternalTaskCreatedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onExternalTaskLocked(callback: Messages.CallbackTypes.OnExternalTaskLockedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onExternalTaskUnlocked(callback: Messages.CallbackTypes.OnExternalTaskUnlockedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onProcessInstanceMetadataChanged(callback: Messages.CallbackTypes.OnProcessInstanceMetadataChangedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onCorrelationMetadataChanged(callback: Messages.CallbackTypes.OnCorrelationMetadataChangedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onGatewayFinished(callback: Messages.CallbackTypes.OnGatewayFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
} |
@@ -1,2 +0,3 @@ | ||
import { DataModels, IProcessDefinitionExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, IProcessDefinitionExtensionAdapter } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
@@ -7,19 +8,20 @@ type ProcessStartOptions<TPayload extends object> = DataModels.ProcessInstances.ProcessStartOptions<TPayload>; | ||
getAll(options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
limit?: number; | ||
}): Promise<DataModels.ProcessDefinitions.ProcessDefinitionList>; | ||
getById(processDefinitionId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessDefinition>; | ||
getByProcessModelId(processModelId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessDefinition>; | ||
getById(processDefinitionId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessDefinition>; | ||
getAllDeployedById(processDefinitionId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessDefinitionList>; | ||
getByProcessModelId(processModelId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessDefinition>; | ||
persistProcessDefinitions(xml: string | Array<string>, options?: { | ||
overwriteExisting?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<void>; | ||
deployFiles(filePaths: string | Array<string>, options?: { | ||
overwriteExisting?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<void>; | ||
startProcessInstance<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: Identity): Promise<ProcessStartResponse>; | ||
startProcessInstanceAndAwaitEndEvent<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: Identity): Promise<ProcessStartResponse>; | ||
startProcessInstanceAndAwaitSpecificEndEvent<TPayload extends object>(options: DataModels.ProcessInstances.ProcessStartOptions<TPayload>, endEventId: string, identity?: Identity): Promise<ProcessStartResponse>; | ||
startProcessInstance<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: IdentityLike): Promise<ProcessStartResponse>; | ||
startProcessInstanceAndAwaitEndEvent<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: IdentityLike): Promise<ProcessStartResponse>; | ||
startProcessInstanceAndAwaitSpecificEndEvent<TPayload extends object>(options: DataModels.ProcessInstances.ProcessStartOptions<TPayload>, endEventId: string, identity?: IdentityLike): Promise<ProcessStartResponse>; | ||
/** | ||
@@ -30,4 +32,4 @@ * @param deleteAllRelatedData Optional: If set to true, the Process Definition, as well as all related data, will be completely deleted. | ||
*/ | ||
deleteById(processDefinitionId: string, identity?: Identity, deleteAllRelatedData?: boolean): Promise<void>; | ||
deleteById(processDefinitionId: string, identity?: IdentityLike, deleteAllRelatedData?: boolean): Promise<void>; | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { Identity } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { ProcessDefinitionHttpClient } from './ProcessDefinitionHttpClient'; | ||
@@ -6,4 +6,4 @@ export declare class ProcessDefinitionHttpClientNode extends ProcessDefinitionHttpClient { | ||
overwriteExisting?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<void>; | ||
} |
@@ -1,6 +0,7 @@ | ||
import { BpmnType, DataModels, IProcessInstanceExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { BpmnType, DataModels, IProcessInstanceExtensionAdapter } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
export declare class ProcessInstanceHttpClient extends BaseClient implements IProcessInstanceExtensionAdapter { | ||
query(query: DataModels.ProcessInstances.ProcessInstanceQuery, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
includeXml?: boolean; | ||
@@ -12,3 +13,3 @@ offset?: number; | ||
getChildProcessInstanceIds(processInstanceId: string, options: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
parentFlowNodeType?: BpmnType.subProcess | BpmnType.callActivity; | ||
@@ -18,9 +19,9 @@ includeNested?: boolean; | ||
getAncestorProcessInstanceIds(processInstanceId: string, options: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
onlyForEmbeddedProcesses?: boolean; | ||
}): Promise<Array<string>>; | ||
getProcessDefinition(processInstanceId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessDefinition>; | ||
getProcessModel(processInstanceId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessModel>; | ||
getProcessDefinition(processInstanceId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessDefinition>; | ||
getProcessModel(processInstanceId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessModel>; | ||
transferOwnership(processInstanceId: string, newOwner: DataModels.Iam.Identity, identity?: DataModels.Iam.Identity): Promise<void>; | ||
terminateProcessInstance(processInstanceId: string, identity?: Identity): Promise<void>; | ||
terminateProcessInstance(processInstanceId: string, identity?: IdentityLike): Promise<void>; | ||
retryProcessInstance(processInstanceId: string, options?: { | ||
@@ -30,6 +31,6 @@ flowNodeInstanceId?: string; | ||
updateProcessModel?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<void>; | ||
deleteProcessInstances(processInstanceIds: string | Array<string>, deleteAllRelatedData?: boolean, identity?: Identity): Promise<void>; | ||
deleteProcessInstances(processInstanceIds: string | Array<string>, deleteAllRelatedData?: boolean, identity?: IdentityLike): Promise<void>; | ||
private handleError; | ||
} |
@@ -1,2 +0,3 @@ | ||
import { DataModels, IProcessModelExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, IProcessModelExtensionAdapter } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
@@ -7,11 +8,12 @@ type ProcessStartOptions<TPayload extends object> = DataModels.ProcessInstances.ProcessStartOptions<TPayload>; | ||
getAll(options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
limit?: number; | ||
}): Promise<DataModels.ProcessDefinitions.ProcessModelList>; | ||
getById(processModelId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessModel>; | ||
getByProcessInstanceId(processInstanceId: string, identity?: Identity): Promise<DataModels.ProcessDefinitions.ProcessModel>; | ||
startProcessInstance<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: Identity): Promise<ProcessStartResponse>; | ||
startProcessInstanceAndAwaitEndEvent<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: Identity): Promise<ProcessStartResponse>; | ||
startProcessInstanceAndAwaitSpecificEndEvent<TPayload extends object>(options: DataModels.ProcessInstances.ProcessStartOptions<TPayload>, endEventId: string, identity?: Identity): Promise<ProcessStartResponse>; | ||
getById(processModelId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessModel>; | ||
getByHash(processDefinitionHash: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessModel>; | ||
getByProcessInstanceId(processInstanceId: string, identity?: IdentityLike): Promise<DataModels.ProcessDefinitions.ProcessModel>; | ||
startProcessInstance<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: IdentityLike): Promise<ProcessStartResponse>; | ||
startProcessInstanceAndAwaitEndEvent<TPayload extends object>(options: ProcessStartOptions<TPayload>, identity?: IdentityLike): Promise<ProcessStartResponse>; | ||
startProcessInstanceAndAwaitSpecificEndEvent<TPayload extends object>(options: DataModels.ProcessInstances.ProcessStartOptions<TPayload>, endEventId: string, identity?: IdentityLike): Promise<ProcessStartResponse>; | ||
/** | ||
@@ -24,8 +26,8 @@ * @param deleteAllRelatedData Optional: If set to true, the Process Definition, as well as all related data, will be completely deleted. | ||
force?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
deleteAllRelatedData?: boolean; | ||
}): Promise<void>; | ||
enableProcessModel(processModelId: string, identity?: Identity): Promise<void>; | ||
disableProcessModel(processModelId: string, identity?: Identity): Promise<void>; | ||
enableProcessModel(processModelId: string, identity?: IdentityLike): Promise<void>; | ||
disableProcessModel(processModelId: string, identity?: IdentityLike): Promise<void>; | ||
} | ||
export {}; |
@@ -1,6 +0,7 @@ | ||
import { FlowNodeInstanceSortSettings, IUntypedTaskExtensionAdapter, Identity, Messages, Subscription, UntypedTaskList, UntypedTaskQuery } from '@5minds/processcube_engine_sdk'; | ||
import { FlowNodeInstanceSortSettings, IUntypedTaskExtensionAdapter, Messages, Subscription, UntypedTaskList, UntypedTaskQuery } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
export declare class UntypedTaskHttpClient extends BaseClient implements IUntypedTaskExtensionAdapter { | ||
query(query: UntypedTaskQuery, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
@@ -13,6 +14,6 @@ limit?: number; | ||
*/ | ||
finishTask(taskInstanceId: string, identity?: Identity, useLegacyEndpoint?: boolean): Promise<void>; | ||
finishTask(taskInstanceId: string, identity?: IdentityLike, useLegacyEndpoint?: boolean): Promise<void>; | ||
onUntypedTaskWaiting(callback: Messages.CallbackTypes.OnUntypedTaskWaitingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
/** | ||
@@ -25,3 +26,3 @@ * If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification. | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
/** | ||
@@ -32,3 +33,3 @@ * If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification. | ||
}): Promise<Subscription>; | ||
removeSubscription(subscription: Subscription, identity?: Identity): void; | ||
removeSubscription(subscription: Subscription, identity?: IdentityLike): void; | ||
} |
@@ -1,2 +0,3 @@ | ||
import { DataModels, IUserTaskExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { DataModels, IUserTaskExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
import { BaseClient } from './BaseClient'; | ||
@@ -6,3 +7,3 @@ type UserTaskList = DataModels.FlowNodeInstances.UserTaskList; | ||
query(query: DataModels.FlowNodeInstances.UserTaskQuery, options?: { | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
offset?: number; | ||
@@ -12,23 +13,23 @@ limit?: number; | ||
}): Promise<UserTaskList>; | ||
reserveUserTaskInstance(identity: Identity, flowNodeInstanceId: string, actualOwnerId: string): Promise<void>; | ||
cancelUserTaskInstanceReservation(identity: Identity, flowNodeInstanceId: string): Promise<void>; | ||
finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: Identity): Promise<void>; | ||
reserveUserTaskInstance(identity: IdentityLike, flowNodeInstanceId: string, actualOwnerId: string): Promise<void>; | ||
cancelUserTaskInstanceReservation(identity: IdentityLike, flowNodeInstanceId: string): Promise<void>; | ||
finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: IdentityLike): Promise<void>; | ||
onUserTaskWaiting(callback: Messages.CallbackTypes.OnUserTaskWaitingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUserTaskFinished(callback: Messages.CallbackTypes.OnUserTaskFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUserTaskReserved(callback: Messages.CallbackTypes.OnUserTaskReservedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUserTaskReservationCanceled(callback: Messages.CallbackTypes.OnUserTaskReservationCanceledCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
removeSubscription(subscription: Subscription, identity?: Identity): void; | ||
removeSubscription(subscription: Subscription, identity?: IdentityLike): void; | ||
} | ||
export {}; |
@@ -6,10 +6,6 @@ "use strict"; | ||
const SocketIoManager_1 = require("./Clients/Lib/SocketIoManager"); | ||
const dummyIdentity = { | ||
token: 'ZHVtbXlfdG9rZW4=', | ||
userId: 'dummy_token', | ||
}; | ||
const IdentityAccessor_1 = require("./IdentityAccessor"); | ||
class EngineClient { | ||
engineUrl; | ||
identity; | ||
anonymousSessionClient; | ||
identityAccessor; | ||
applicationInfoClient; | ||
@@ -29,24 +25,23 @@ correlationClient; | ||
userTaskClient; | ||
socketIoManager; | ||
constructor(engineUrl, identity) { | ||
this.engineUrl = engineUrl; | ||
this.identity = identity ?? dummyIdentity; | ||
const socketIoManager = new SocketIoManager_1.SocketIoManager(this.engineUrl); | ||
this.anonymousSessionClient = ClientFactory_1.ClientFactory.createAnonymousSessionClient(this.engineUrl, this.identity); | ||
this.applicationInfoClient = ClientFactory_1.ClientFactory.createApplicationInfoClient(this.engineUrl, this.identity, socketIoManager); | ||
this.correlationClient = ClientFactory_1.ClientFactory.createCorrelationClient(this.engineUrl, this.identity); | ||
this.cronjobClient = ClientFactory_1.ClientFactory.createCronJobClient(this.engineUrl, this.identity); | ||
this.dataObjectInstanceClient = ClientFactory_1.ClientFactory.createDataObjectInstanceClient(this.engineUrl, this.identity); | ||
this.eventClient = ClientFactory_1.ClientFactory.createEventClient(this.engineUrl, this.identity, socketIoManager); | ||
this.externalTaskClient = ClientFactory_1.ClientFactory.createExternalTaskClient(this.engineUrl, this.identity); | ||
this.flowNodeInstanceClient = ClientFactory_1.ClientFactory.createFlowNodeInstanceClient(this.engineUrl, this.identity); | ||
this.manualTaskClient = ClientFactory_1.ClientFactory.createManualTaskClient(this.engineUrl, this.identity, socketIoManager); | ||
this.notificationClient = ClientFactory_1.ClientFactory.createNotificationClient(this.engineUrl, this.identity, socketIoManager); | ||
this.processDefinitionClient = ClientFactory_1.ClientFactory.createProcessDefinitionClient(this.engineUrl, this.identity); | ||
this.processInstanceClient = ClientFactory_1.ClientFactory.createProcessInstanceClient(this.engineUrl, this.identity); | ||
this.processModelClient = ClientFactory_1.ClientFactory.createProcessModelClient(this.engineUrl, this.identity); | ||
this.untypedTaskClient = ClientFactory_1.ClientFactory.createUntypedTaskClient(this.engineUrl, this.identity, socketIoManager); | ||
this.userTaskClient = ClientFactory_1.ClientFactory.createUserTaskClient(this.engineUrl, this.identity, socketIoManager); | ||
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl); | ||
this.socketIoManager = new SocketIoManager_1.SocketIoManager(this.engineUrl); | ||
this.applicationInfoClient = ClientFactory_1.ClientFactory.createApplicationInfoClient(this.engineUrl, this.identityAccessor, this.socketIoManager); | ||
this.correlationClient = ClientFactory_1.ClientFactory.createCorrelationClient(this.engineUrl, this.identityAccessor); | ||
this.cronjobClient = ClientFactory_1.ClientFactory.createCronJobClient(this.engineUrl, this.identityAccessor); | ||
this.dataObjectInstanceClient = ClientFactory_1.ClientFactory.createDataObjectInstanceClient(this.engineUrl, this.identityAccessor); | ||
this.eventClient = ClientFactory_1.ClientFactory.createEventClient(this.engineUrl, this.identityAccessor, this.socketIoManager); | ||
this.externalTaskClient = ClientFactory_1.ClientFactory.createExternalTaskClient(this.engineUrl, this.identityAccessor); | ||
this.flowNodeInstanceClient = ClientFactory_1.ClientFactory.createFlowNodeInstanceClient(this.engineUrl, this.identityAccessor); | ||
this.manualTaskClient = ClientFactory_1.ClientFactory.createManualTaskClient(this.engineUrl, this.identityAccessor, this.socketIoManager); | ||
this.notificationClient = ClientFactory_1.ClientFactory.createNotificationClient(this.engineUrl, this.identityAccessor, this.socketIoManager); | ||
this.processDefinitionClient = ClientFactory_1.ClientFactory.createProcessDefinitionClient(this.engineUrl, this.identityAccessor); | ||
this.processInstanceClient = ClientFactory_1.ClientFactory.createProcessInstanceClient(this.engineUrl, this.identityAccessor); | ||
this.processModelClient = ClientFactory_1.ClientFactory.createProcessModelClient(this.engineUrl, this.identityAccessor); | ||
this.untypedTaskClient = ClientFactory_1.ClientFactory.createUntypedTaskClient(this.engineUrl, this.identityAccessor, this.socketIoManager); | ||
this.userTaskClient = ClientFactory_1.ClientFactory.createUserTaskClient(this.engineUrl, this.identityAccessor, this.socketIoManager); | ||
} | ||
dispose() { | ||
this.anonymousSessionClient.dispose(); | ||
this.applicationInfoClient.dispose(); | ||
@@ -57,2 +52,3 @@ this.correlationClient.dispose(); | ||
this.eventClient.dispose(); | ||
this.externalTaskClient.dispose(); | ||
this.flowNodeInstanceClient.dispose(); | ||
@@ -65,2 +61,4 @@ this.manualTaskClient.dispose(); | ||
this.userTaskClient.dispose(); | ||
this.identityAccessor.dispose(); | ||
this.socketIoManager.dispose(); | ||
} | ||
@@ -73,5 +71,2 @@ /** | ||
} | ||
get anonymousSession() { | ||
return this.anonymousSessionClient; | ||
} | ||
get applicationInfo() { | ||
@@ -78,0 +73,0 @@ return this.applicationInfoClient; |
@@ -6,46 +6,40 @@ "use strict"; | ||
const index_1 = require("./Clients/index"); | ||
const dummyIdentity = { | ||
token: 'ZHVtbXlfdG9rZW4=', | ||
userId: 'dummy_token', | ||
}; | ||
const IdentityAccessor_1 = require("./IdentityAccessor"); | ||
exports.ClientFactory = { | ||
createAnonymousSessionClient: (engineUrl, identity = dummyIdentity) => { | ||
return new index_1.AnonymousSessionHttpClient(engineUrl, identity); | ||
}, | ||
createApplicationInfoClient: (engineUrl, identity = dummyIdentity, socketIoManager) => { | ||
createApplicationInfoClient: (engineUrl, identity, socketIoManager) => { | ||
socketIoManager = socketIoManager ?? new SocketIoManager_1.SocketIoManager(engineUrl); | ||
return new index_1.ApplicationInfoHttpClient(engineUrl, identity, socketIoManager); | ||
return new index_1.ApplicationInfoHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl), socketIoManager); | ||
}, | ||
createCorrelationClient: (engineUrl, identity = dummyIdentity) => new index_1.CorrelationHttpClient(engineUrl, identity), | ||
createCronJobClient: (engineUrl, identity = dummyIdentity) => new index_1.CronjobHttpClient(engineUrl, identity), | ||
createDataObjectInstanceClient: (engineUrl, identity = dummyIdentity) => new index_1.DataObjectInstanceHttpClient(engineUrl, identity), | ||
createUntypedTaskClient: (engineUrl, identity = dummyIdentity, socketIoManager) => { | ||
createCorrelationClient: (engineUrl, identity) => new index_1.CorrelationHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)), | ||
createCronJobClient: (engineUrl, identity) => new index_1.CronjobHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)), | ||
createDataObjectInstanceClient: (engineUrl, identity) => new index_1.DataObjectInstanceHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)), | ||
createUntypedTaskClient: (engineUrl, identity, socketIoManager) => { | ||
socketIoManager = socketIoManager ?? new SocketIoManager_1.SocketIoManager(engineUrl); | ||
return new index_1.UntypedTaskHttpClient(engineUrl, identity, socketIoManager); | ||
return new index_1.UntypedTaskHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl), socketIoManager); | ||
}, | ||
createEventClient: (engineUrl, identity = dummyIdentity, socketIoManager) => { | ||
createEventClient: (engineUrl, identity, socketIoManager) => { | ||
socketIoManager = socketIoManager ?? new SocketIoManager_1.SocketIoManager(engineUrl); | ||
return new index_1.EventHttpClient(engineUrl, identity, socketIoManager); | ||
return new index_1.EventHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl), socketIoManager); | ||
}, | ||
createExternalTaskClient: (engineUrl, identity = dummyIdentity) => new index_1.ExternalTaskClient(engineUrl, identity), | ||
createFlowNodeInstanceClient: (engineUrl, identity = dummyIdentity) => new index_1.FlowNodeInstanceHttpClient(engineUrl, identity), | ||
createManualTaskClient: (engineUrl, identity = dummyIdentity, socketIoManager) => { | ||
createExternalTaskClient: (engineUrl, identity) => new index_1.ExternalTaskClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)), | ||
createFlowNodeInstanceClient: (engineUrl, identity) => new index_1.FlowNodeInstanceHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)), | ||
createManualTaskClient: (engineUrl, identity, socketIoManager) => { | ||
socketIoManager = socketIoManager ?? new SocketIoManager_1.SocketIoManager(engineUrl); | ||
return new index_1.ManualTaskHttpClient(engineUrl, identity, socketIoManager); | ||
return new index_1.ManualTaskHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl), socketIoManager); | ||
}, | ||
createNotificationClient: (engineUrl, identity = dummyIdentity, socketIoManager) => { | ||
createNotificationClient: (engineUrl, identity, socketIoManager) => { | ||
socketIoManager = socketIoManager ?? new SocketIoManager_1.SocketIoManager(engineUrl); | ||
return new index_1.NotificationHttpClient(engineUrl, identity, socketIoManager); | ||
return new index_1.NotificationHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl), socketIoManager); | ||
}, | ||
createProcessDefinitionClient: (engineUrl, identity = dummyIdentity) => { | ||
createProcessDefinitionClient: (engineUrl, identity) => { | ||
if (isNodeEnvironment()) { | ||
return new index_1.ProcessDefinitionHttpClientNode(engineUrl, identity); | ||
return new index_1.ProcessDefinitionHttpClientNode(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)); | ||
} | ||
return new index_1.ProcessDefinitionHttpClient(engineUrl, identity); | ||
return new index_1.ProcessDefinitionHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)); | ||
}, | ||
createProcessInstanceClient: (engineUrl, identity = dummyIdentity) => new index_1.ProcessInstanceHttpClient(engineUrl, identity), | ||
createProcessModelClient: (engineUrl, identity = dummyIdentity) => new index_1.ProcessModelHttpClient(engineUrl, identity), | ||
createUserTaskClient: (engineUrl, identity = dummyIdentity, socketIoManager) => { | ||
createProcessInstanceClient: (engineUrl, identity) => new index_1.ProcessInstanceHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)), | ||
createProcessModelClient: (engineUrl, identity) => new index_1.ProcessModelHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl)), | ||
createUserTaskClient: (engineUrl, identity, socketIoManager) => { | ||
socketIoManager = socketIoManager ?? new SocketIoManager_1.SocketIoManager(engineUrl); | ||
return new index_1.UserTaskHttpClient(engineUrl, identity, socketIoManager); | ||
return new index_1.UserTaskHttpClient(engineUrl, IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl), socketIoManager); | ||
}, | ||
@@ -52,0 +46,0 @@ }; |
@@ -8,3 +8,3 @@ "use strict"; | ||
async getApplicationInfo() { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(this.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(); | ||
const url = this.buildUrl(index_1.restSettings.paths.getApplicationInfo); | ||
@@ -15,3 +15,3 @@ const httpResponse = await this.httpClient.get(url, requestAuthHeaders); | ||
async getAuthorityAddress() { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(this.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(); | ||
const url = this.buildUrl(index_1.restSettings.paths.getAuthorityAddress); | ||
@@ -22,9 +22,9 @@ const httpResponse = await this.httpClient.get(url, requestAuthHeaders); | ||
onConnected(callback, subscribeOnce, identity) { | ||
return this.createSocketIoSubscription('connect', callback, subscribeOnce, identity); | ||
return this.createSocketIoSubscriptionSync('connect', callback, subscribeOnce, identity); | ||
} | ||
onDisconnected(callback, subscribeOnce, identity) { | ||
return this.createSocketIoSubscription('disconnect', callback, subscribeOnce, identity); | ||
return this.createSocketIoSubscriptionSync('disconnect', callback, subscribeOnce, identity); | ||
} | ||
onReconnected(callback, subscribeOnce, identity) { | ||
return this.createSocketIoSubscription('reconnect', callback, subscribeOnce, identity); | ||
return this.createSocketIoSubscriptionSync('reconnect', callback, subscribeOnce, identity); | ||
} | ||
@@ -31,0 +31,0 @@ } |
@@ -5,5 +5,6 @@ "use strict"; | ||
const HttpClient_1 = require("../HttpClient"); | ||
const IdentityAccessor_1 = require("../IdentityAccessor"); | ||
const index_1 = require("../Types/index"); | ||
class BaseClient { | ||
identity; | ||
identityAccessor; | ||
httpClient; | ||
@@ -19,3 +20,3 @@ socketIoManager; | ||
this.engineUrl = engineUrl; | ||
this.identity = identity; | ||
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl); | ||
this.socketIoManager = socketIoManager; | ||
@@ -26,3 +27,3 @@ this.httpClient = new HttpClient_1.HttpClient(this.engineUrl); | ||
if (this.socketIoManager) { | ||
const socketIoClient = this.socketIoManager.getSocketForIdentity(this.identity); | ||
const socketIoClient = this.socketIoManager.getSocketForIdentity(this.identityAccessor); | ||
return socketIoClient?.connected ?? false; | ||
@@ -38,10 +39,11 @@ } | ||
} | ||
isSocketConnected(identity) { | ||
const identityToUse = identity ?? this.identity; | ||
const socketIoClient = this.socketIoManager.getSocketForIdentity(identityToUse); | ||
isSocketConnected(identityAccessor) { | ||
const identityAccessorToUse = IdentityAccessor_1.IdentityAccessor.wrap(identityAccessor ?? this.identityAccessor, this.engineUrl); | ||
const socketIoClient = this.socketIoManager.getSocketForIdentity(identityAccessorToUse); | ||
return socketIoClient?.connected ?? false; | ||
} | ||
disconnectSocket(identity) { | ||
disconnectSocket(identityAccessor) { | ||
if (this.socketIoManager) { | ||
this.socketIoManager.disconnectSocket(identity); | ||
const identityAccessorToUse = IdentityAccessor_1.IdentityAccessor.wrap(identityAccessor ?? this.identityAccessor, this.engineUrl); | ||
this.socketIoManager.disconnectSocket(identityAccessorToUse); | ||
} | ||
@@ -53,2 +55,3 @@ } | ||
} | ||
this.identityAccessor.dispose(); | ||
} | ||
@@ -72,4 +75,5 @@ buildUrl(url, offset = 0, limit = 0, query, sortSettings) { | ||
} | ||
createRequestAuthHeaders(identity) { | ||
const identityToUse = identity ?? this.identity; | ||
async createRequestAuthHeaders(identityAccessor) { | ||
const identityAccessorToUse = IdentityAccessor_1.IdentityAccessor.wrap(identityAccessor ?? this.identityAccessor, this.engineUrl); | ||
const identityToUse = await identityAccessorToUse.getIdentity(); | ||
const requestAuthHeaders = { | ||
@@ -88,9 +92,13 @@ headers: { | ||
} | ||
createSocketIoSubscription(route, callback, subscribeOnce, identity) { | ||
const identityToUse = identity ?? this.identity; | ||
return this.socketIoManager.createSocketIoSubscription(identityToUse, route, callback, subscribeOnce); | ||
async createSocketIoSubscription(route, callback, subscribeOnce, identity) { | ||
const identityAccessorToUse = IdentityAccessor_1.IdentityAccessor.wrap(identity ?? this.identityAccessor, this.engineUrl); | ||
return this.socketIoManager.createSocketIoSubscription(identityAccessorToUse, route, callback, subscribeOnce); | ||
} | ||
createSocketIoSubscriptionSync(route, callback, subscribeOnce, identity) { | ||
const identityAccessorToUse = IdentityAccessor_1.IdentityAccessor.wrap(identity ?? this.identityAccessor, this.engineUrl); | ||
return this.socketIoManager.createSocketIoSubscriptionSync(identityAccessorToUse, route, callback, subscribeOnce); | ||
} | ||
removeSocketIoSubscription(subscription, identity) { | ||
const identityToUse = identity ?? this.identity; | ||
this.socketIoManager.removeSocketIoSubscription(identityToUse, subscription); | ||
const identityAccessorToUse = IdentityAccessor_1.IdentityAccessor.wrap(identity ?? this.identityAccessor, this.engineUrl); | ||
this.socketIoManager.removeSocketIoSubscription(identityAccessorToUse, subscription); | ||
} | ||
@@ -97,0 +105,0 @@ addParameterToUrl(url, parameterName, parameterValue) { |
@@ -13,3 +13,3 @@ "use strict"; | ||
const url = this.buildUrl(urlRestPart, options?.offset, options?.limit, null, options?.sortSettings); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -24,3 +24,3 @@ return response.result; | ||
const url = this.buildUrl(urlRestPart); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -27,0 +27,0 @@ return response.result; |
@@ -10,3 +10,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.getDeployedCronjobs, options?.offset, options?.limit, query, options?.sortSettings); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -21,3 +21,3 @@ const mappedResult = { | ||
const url = this.buildUrl(index_1.restSettings.paths.enableCronjob).replace(index_1.restSettings.params.processModelId, processModelId).replace(index_1.restSettings.params.flowNodeId, flowNodeId); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.post(url, undefined, requestAuthHeaders); | ||
@@ -27,3 +27,3 @@ } | ||
const url = this.buildUrl(index_1.restSettings.paths.disableCronjob).replace(index_1.restSettings.params.processModelId, processModelId).replace(index_1.restSettings.params.flowNodeId, flowNodeId); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.post(url, undefined, requestAuthHeaders); | ||
@@ -30,0 +30,0 @@ } |
@@ -10,3 +10,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.getDataObjects, options?.offset, options?.limit, query, options?.sortSettings); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -13,0 +13,0 @@ const mappedResult = { |
@@ -15,3 +15,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -25,3 +25,3 @@ const mappedResult = { | ||
async triggerMessageEvent(messageName, options) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
let urlRestPart = index_1.restSettings.paths.triggerMessageEvent.replace(index_1.restSettings.params.eventName, messageName); | ||
@@ -35,3 +35,3 @@ if (options?.processInstanceId) { | ||
async triggerSignalEvent(signalName, options) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
let urlRestPart = index_1.restSettings.paths.triggerSignalEvent.replace(index_1.restSettings.params.eventName, signalName); | ||
@@ -44,2 +44,8 @@ if (options?.processInstanceId) { | ||
} | ||
async triggerTimerEvent(flowNodeInstanceId, options) { | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
let urlRestPart = index_1.restSettings.paths.triggerTimerEvent.replace(index_1.restSettings.params.flowNodeInstanceId, flowNodeInstanceId); | ||
const url = this.buildUrl(urlRestPart); | ||
await this.httpClient.post(url, undefined, requestAuthHeaders); | ||
} | ||
async onBoundaryEventTriggered(callback, options) { | ||
@@ -46,0 +52,0 @@ return this.createSocketIoSubscription(index_1.socketSettings.paths.boundaryEventTriggered, callback, options?.subscribeOnce, options?.identity); |
@@ -10,3 +10,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.getAllDeployedTopics); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -25,3 +25,3 @@ return response.result; | ||
const url = this.buildUrl(index_1.restSettings.paths.fetchAndLockExternalTasks); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.post(url, httpPayload, requestAuthHeaders, abortSignal); | ||
@@ -38,3 +38,3 @@ const mappedResult = response.result.map((result) => (0, Mappers_1.mapExternalTask)(result)); | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.put(url, httpPayload, requestAuthHeaders, abortSignal); | ||
@@ -49,3 +49,3 @@ } | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.put(url, httpPayload, requestAuthHeaders, abortSignal); | ||
@@ -60,3 +60,3 @@ } | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.put(url, httpPayload, requestAuthHeaders, abortSignal); | ||
@@ -63,0 +63,0 @@ } |
@@ -5,8 +5,9 @@ "use strict"; | ||
const ExternalTaskWorker_1 = require("../ExternalTaskWorker"); | ||
const IdentityAccessor_1 = require("../IdentityAccessor"); | ||
class ExternalTaskClient { | ||
engineUrl; | ||
identity; | ||
identityAccessor; | ||
constructor(engineUrl, identity) { | ||
this.engineUrl = engineUrl; | ||
this.identity = identity; | ||
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(identity, this.engineUrl); | ||
} | ||
@@ -19,7 +20,8 @@ /** | ||
} | ||
dispose() { | ||
this.identityAccessor?.dispose(); | ||
} | ||
async subscribeToExternalTaskTopic(topic, processingFunction, config) { | ||
const extendedConfig = { ...config }; | ||
if (!extendedConfig.identity) { | ||
extendedConfig.identity = this.identity; | ||
} | ||
extendedConfig.identity = IdentityAccessor_1.IdentityAccessor.wrap(extendedConfig.identity ?? this.identityAccessor, this.engineUrl); | ||
const externalTaskWorker = new ExternalTaskWorker_1.ExternalTaskWorker(this.engineUrl, topic, processingFunction, extendedConfig); | ||
@@ -26,0 +28,0 @@ return externalTaskWorker; |
@@ -10,3 +10,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, query, options?.sortSettings); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -23,3 +23,3 @@ const mappedResult = { | ||
async finishUntypedTask(taskInstanceId, identity, useLegacyEndpoint) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = useLegacyEndpoint === true | ||
@@ -32,3 +32,3 @@ ? index_1.restSettings.paths.finishEmptyActivity.replace(index_1.restSettings.params.emptyActivityInstanceId, taskInstanceId) | ||
async finishManualTask(manualTaskInstanceId, identity) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = index_1.restSettings.paths.finishManualTask.replace(index_1.restSettings.params.manualTaskInstanceId, manualTaskInstanceId); | ||
@@ -39,3 +39,3 @@ const url = this.buildUrl(urlRestPart); | ||
async finishUserTask(userTaskInstanceId, userTaskResult, identity) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = index_1.restSettings.paths.finishUserTask.replace(index_1.restSettings.params.userTaskInstanceId, userTaskInstanceId); | ||
@@ -46,3 +46,3 @@ const url = this.buildUrl(urlRestPart); | ||
async triggerMessageEvent(messageName, options) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
let urlRestPart = index_1.restSettings.paths.triggerMessageEvent.replace(index_1.restSettings.params.eventName, messageName); | ||
@@ -56,3 +56,3 @@ if (options?.processInstanceId) { | ||
async triggerSignalEvent(signalName, options) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
let urlRestPart = index_1.restSettings.paths.triggerSignalEvent.replace(index_1.restSettings.params.eventName, signalName); | ||
@@ -59,0 +59,0 @@ if (options?.processInstanceId) { |
@@ -17,3 +17,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./AnonymousSessionHttpClient"), exports); | ||
__exportStar(require("./ApplicationInfoHttpClient"), exports); | ||
@@ -20,0 +19,0 @@ __exportStar(require("./CorrelationHttpClient"), exports); |
@@ -18,9 +18,19 @@ "use strict"; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importStar = (this && this.__importStar) || (function () { | ||
var ownKeys = function(o) { | ||
ownKeys = Object.getOwnPropertyNames || function (o) { | ||
var ar = []; | ||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
return ar; | ||
}; | ||
return ownKeys(o); | ||
}; | ||
return function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -34,14 +44,9 @@ exports.SocketIoManager = void 0; | ||
engineUrl; | ||
logger = new processcube_engine_sdk_1.Logger('engine-client:socket-io-manager'); | ||
socketCollection = {}; | ||
subscriptionCollection = {}; | ||
constructor(engineUrl) { | ||
this.engineUrl = engineUrl; | ||
} | ||
/** | ||
* Disconnects the socket associated with the given identity. | ||
* | ||
* @param identity The identity to disconnect. | ||
*/ | ||
disconnectSocket(identity) { | ||
const socketForIdentity = this.getSocketForIdentity(identity); | ||
disconnectSocket(accessor) { | ||
const socketForIdentity = this.getSocketForIdentity(accessor); | ||
if (!socketForIdentity) { | ||
@@ -51,64 +56,59 @@ return; | ||
socketForIdentity.disconnect(); | ||
socketForIdentity.close(); | ||
delete this.socketCollection[identity.userId]; | ||
socketForIdentity.removeAllListeners(); | ||
if (this.socketCollection[accessor.getId()].identityRefreshSubscription) { | ||
accessor.removeOnNewIdentityListener(this.socketCollection[accessor.getId()].identityRefreshSubscription); | ||
} | ||
delete this.socketCollection[accessor.getId()]; | ||
} | ||
/** | ||
* Disposes all sockets. | ||
*/ | ||
dispose() { | ||
const sockets = Object.keys(this.socketCollection); | ||
for (const socketId of sockets) { | ||
this.socketCollection[socketId].disconnect(); | ||
this.socketCollection[socketId].close(); | ||
for (const socketId of Object.keys(this.socketCollection)) { | ||
this.socketCollection[socketId]?.socket?.disconnect(); | ||
this.socketCollection[socketId]?.socket?.removeAllListeners(); | ||
if (this.socketCollection[socketId]?.identityRefreshSubscription) { | ||
this.socketCollection[socketId].identityAccessor.removeOnNewIdentityListener(this.socketCollection[socketId].identityRefreshSubscription); | ||
} | ||
if (this.socketCollection[socketId]?.identityAccessor) { | ||
this.socketCollection[socketId]?.identityAccessor?.dispose(); | ||
} | ||
delete this.socketCollection[socketId]; | ||
} | ||
} | ||
/** | ||
* Creates a new socket.io subscription for the given eventName. | ||
* | ||
* @param identity The identity for which to create the subscription. | ||
* @param eventName The event to subscribe to. | ||
* @param callback The callback to execute when the event gets triggered. | ||
* @param subscribeOnce If true, the subscription will be disposed after the event was received once. | ||
*/ | ||
createSocketIoSubscription(identity, eventName, callback, subscribeOnce) { | ||
const socketForIdentity = this.createSocketForIdentity(identity); | ||
if (subscribeOnce) { | ||
socketForIdentity.once(eventName, callback); | ||
} | ||
else { | ||
socketForIdentity.on(eventName, callback); | ||
} | ||
const subscriptionId = uuid.v4(); | ||
const subscription = { | ||
id: subscriptionId, | ||
eventName: eventName, | ||
onlyReceiveOnce: subscribeOnce, | ||
}; | ||
this.subscriptionCollection[subscriptionId] = callback; | ||
return subscription; | ||
createSocketIoSubscriptionSync(accessor, eventName, callback, subscribeOnce) { | ||
this.createSocketForIdentitySync(accessor); | ||
return this.addNewSubscriptionToSocketContext(accessor, eventName, callback, subscribeOnce); | ||
} | ||
/** | ||
* Removes the given subscription from the socket associated with the given identity. | ||
* | ||
* @param identity The identity for which to remove a subscription. | ||
* @param subscription The subscription to remove. | ||
*/ | ||
removeSocketIoSubscription(identity, subscription) { | ||
const socketForIdentity = this.getSocketForIdentity(identity); | ||
if (!socketForIdentity) { | ||
async createSocketIoSubscription(accessor, eventName, callback, subscribeOnce) { | ||
await this.createSocketForIdentity(accessor); | ||
return this.addNewSubscriptionToSocketContext(accessor, eventName, callback, subscribeOnce); | ||
} | ||
removeSocketIoSubscription(accessor, subscription) { | ||
const socketContext = this.getSocketContext(accessor); | ||
if (!socketContext.socket) { | ||
return; | ||
} | ||
const callbackToRemove = this.subscriptionCollection[subscription.id]; | ||
if (!callbackToRemove) { | ||
const eventSubscriptions = socketContext.subscriptions[subscription.eventName]; | ||
if (!eventSubscriptions) { | ||
return; | ||
} | ||
socketForIdentity.off(subscription.eventName, callbackToRemove); | ||
delete this.subscriptionCollection[subscription.id]; | ||
const subscriptionContext = eventSubscriptions[subscription.id]; | ||
if (!subscriptionContext) { | ||
return; | ||
} | ||
socketContext.socket.off(subscription.eventName, subscriptionContext.callback); | ||
delete socketContext.subscriptions[subscription.eventName]; | ||
delete eventSubscriptions[subscription.id]; | ||
} | ||
getSocketForIdentity(identity) { | ||
return this.socketCollection[identity.userId]; | ||
getSocketForIdentity(accessor) { | ||
return this.socketCollection[accessor.getId()]?.socket; | ||
} | ||
createSocketForIdentity(identity) { | ||
const existingSocket = this.getSocketForIdentity(identity); | ||
createSocketForIdentitySync(accessor) { | ||
const identity = accessor.getIdentitySync(); | ||
return this.buildSocketWithContext(accessor, identity); | ||
} | ||
async createSocketForIdentity(accessor) { | ||
const identity = await accessor.getIdentity(); | ||
return this.buildSocketWithContext(accessor, identity); | ||
} | ||
buildSocketWithContext(accessor, identity) { | ||
const existingSocket = this.getSocketForIdentity(accessor); | ||
if (existingSocket) { | ||
@@ -126,3 +126,3 @@ return existingSocket; | ||
const urlPath = indexOfLastSlash === -1 ? undefined : urlWithoutProtocol.substring(indexOfLastSlash); | ||
this.socketCollection[identity.userId] = (0, socket_io_client_1.io)(socketUrl, { | ||
const socket = (0, socket_io_client_1.io)(socketUrl, { | ||
path: urlPath ? `${urlPath}/socket.io` : '/socket.io', | ||
@@ -138,6 +138,88 @@ transportOptions: { | ||
}); | ||
return this.socketCollection[identity.userId]; | ||
const socketContext = this.getSocketContext(accessor); | ||
socketContext.socket = socket; | ||
socketContext.identityAccessor = accessor; | ||
// this.applySubscriptionsToSocket(socketContext); | ||
return socket; | ||
} | ||
getSocketContext(accessor) { | ||
this.ensureSocketContextIsinitialized(accessor); | ||
return this.socketCollection[accessor.getId()]; | ||
} | ||
ensureSocketContextIsinitialized(accessor) { | ||
if (!Object.hasOwn(this.socketCollection, accessor.getId())) { | ||
this.socketCollection[accessor.getId()] = { | ||
subscriptions: {}, | ||
identityAccessor: accessor, | ||
socket: null, | ||
identityRefreshSubscription: null, | ||
}; | ||
} | ||
if (!this.socketCollection[accessor.getId()].identityRefreshSubscription) { | ||
this.socketCollection[accessor.getId()].identityRefreshSubscription = this.getRecreateWhenIdentityIsRefreshedFunction(this.socketCollection[accessor.getId()]); | ||
accessor.onNewIdentity(this.socketCollection[accessor.getId()].identityRefreshSubscription); | ||
} | ||
} | ||
addNewSubscriptionToSocketContext(accessor, eventName, callback, subscribeOnce) { | ||
const subscriptionId = uuid.v4(); | ||
const subscription = { | ||
id: subscriptionId, | ||
eventName: eventName, | ||
onlyReceiveOnce: subscribeOnce, | ||
}; | ||
const socketContext = this.getSocketContext(accessor); | ||
if (subscribeOnce) { | ||
socketContext.socket.once(eventName, callback); | ||
} | ||
else { | ||
socketContext.socket.on(eventName, callback); | ||
} | ||
if (!socketContext.subscriptions[eventName]) { | ||
socketContext.subscriptions[eventName] = {}; | ||
} | ||
socketContext.subscriptions[eventName][subscriptionId] = { | ||
subscription: subscription, | ||
callback: callback, | ||
}; | ||
return subscription; | ||
} | ||
getRecreateWhenIdentityIsRefreshedFunction(socketContext) { | ||
return async (identity) => { | ||
this.logger.info(`Recreating socket.io connection for identity ${identity?.userId ?? socketContext.identityAccessor.getId()}`); | ||
const oldSocket = socketContext.socket; | ||
if (oldSocket) { | ||
oldSocket.removeAllListeners(); | ||
oldSocket.disconnect(); | ||
} | ||
this.socketCollection[socketContext.identityAccessor.getId()].socket = undefined; | ||
const newSocket = await this.createSocketForIdentity(socketContext.identityAccessor); | ||
this.applySubscriptionsToSocket(socketContext); | ||
socketContext.socket = newSocket; | ||
}; | ||
} | ||
applySubscriptionsToSocket(socketContext) { | ||
const subscriptions = socketContext.subscriptions; | ||
const socket = socketContext.socket; | ||
for (const eventName of Object.keys(subscriptions)) { | ||
const currentSubscriptions = subscriptions[eventName]; | ||
const callback = async (...args) => { | ||
for (const currentSub of Object.values(currentSubscriptions)) { | ||
try { | ||
if (currentSub.subscription.onlyReceiveOnce) { | ||
this.removeSocketIoSubscription(socketContext.identityAccessor, currentSub.subscription); | ||
} | ||
await currentSub.callback(...args); | ||
} | ||
catch (error) { | ||
this.logger.error('Error while executing socket.io callback', { err: error, eventName: eventName }); | ||
} | ||
} | ||
}; | ||
if (!socket.hasListeners(eventName)) { | ||
socket.on(eventName, callback); | ||
} | ||
} | ||
} | ||
} | ||
exports.SocketIoManager = SocketIoManager; | ||
//# sourceMappingURL=SocketIoManager.js.map |
@@ -15,3 +15,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -25,3 +25,3 @@ const mappedResult = { | ||
async finishManualTask(manualTaskInstanceId, identity) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = index_1.restSettings.paths.finishManualTask.replace(index_1.restSettings.params.manualTaskInstanceId, manualTaskInstanceId); | ||
@@ -28,0 +28,0 @@ const url = this.buildUrl(urlRestPart); |
@@ -11,9 +11,9 @@ "use strict"; | ||
onConnected(callback, subscribeOnce, identity) { | ||
return this.createSocketIoSubscription('connect', callback, subscribeOnce, identity); | ||
return this.createSocketIoSubscriptionSync('connect', callback, subscribeOnce, identity); | ||
} | ||
onDisconnected(callback, subscribeOnce, identity) { | ||
return this.createSocketIoSubscription('disconnect', callback, subscribeOnce, identity); | ||
return this.createSocketIoSubscriptionSync('disconnect', callback, subscribeOnce, identity); | ||
} | ||
onReconnected(callback, subscribeOnce, identity) { | ||
return this.createSocketIoSubscription('reconnect', callback, subscribeOnce, identity); | ||
return this.createSocketIoSubscriptionSync('reconnect', callback, subscribeOnce, identity); | ||
} | ||
@@ -20,0 +20,0 @@ async onActivityError(callback, options) { |
@@ -11,3 +11,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.getProcessDefinitions, options?.offset, options?.limit); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -23,3 +23,3 @@ const result = response.result; | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -29,6 +29,17 @@ const processDefinition = (0, Mappers_1.mapProcessDefinition)(response.result); | ||
} | ||
async getAllDeployedById(processDefinitionId, identity) { | ||
const endpoint = index_1.restSettings.paths.getAllDeployedProcessDefinitionsById.replace(index_1.restSettings.params.processDefinitionId, processDefinitionId); | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
const result = response.result; | ||
return { | ||
processDefinitions: result.processDefinitions.map(Mappers_1.mapProcessDefinition), | ||
totalCount: result.totalCount, | ||
}; | ||
} | ||
async getByProcessModelId(processModelId, identity) { | ||
const endpoint = index_1.restSettings.paths.getProcessDefinitionForProcessModel.replace(index_1.restSettings.params.processModelId, processModelId); | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -44,3 +55,3 @@ const processDefinition = (0, Mappers_1.mapProcessDefinition)(response.result); | ||
const url = this.buildUrl(index_1.restSettings.paths.persistProcessDefinitions); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
await this.httpClient.post(url, httpPayload, requestAuthHeaders); | ||
@@ -53,3 +64,3 @@ } | ||
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance).replace(index_1.restSettings.params.processModelId, options?.processModelId); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const processStartRequest = { | ||
@@ -64,3 +75,3 @@ ...options, | ||
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const processStartRequest = { | ||
@@ -75,3 +86,3 @@ ...options, | ||
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const processStartRequest = { | ||
@@ -96,3 +107,3 @@ ...options, | ||
} | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.delete(url, requestAuthHeaders); | ||
@@ -99,0 +110,0 @@ } |
@@ -18,9 +18,19 @@ "use strict"; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importStar = (this && this.__importStar) || (function () { | ||
var ownKeys = function(o) { | ||
ownKeys = Object.getOwnPropertyNames || function (o) { | ||
var ar = []; | ||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
return ar; | ||
}; | ||
return ownKeys(o); | ||
}; | ||
return function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -27,0 +37,0 @@ exports.ProcessDefinitionHttpClientNode = void 0; |
@@ -12,3 +12,3 @@ "use strict"; | ||
url = this.addParameterToUrl(url, 'includeXml', options?.includeXml ?? true); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -24,3 +24,3 @@ const mappedResult = { | ||
const url = this.buildUrl(endpoint, undefined, undefined, { parentFlowNodeType: options.parentFlowNodeType, includeNested: options.includeNested }); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -32,3 +32,3 @@ return response.result; | ||
const url = this.buildUrl(endpoint, undefined, undefined, { onlyForEmbeddedProcesses: options.onlyForEmbeddedProcesses }); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -40,3 +40,3 @@ return response.result; | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -49,3 +49,3 @@ const processDefinition = (0, Mappers_1.mapProcessDefinition)(response.result); | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -58,3 +58,3 @@ const processModel = (0, Mappers_1.mapProcessModel)(response.result); | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.put(url, { newOwner: newOwner }, requestAuthHeaders); | ||
@@ -65,3 +65,3 @@ } | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
try { | ||
@@ -83,3 +83,3 @@ await this.httpClient.put(url, {}, requestAuthHeaders); | ||
} | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
try { | ||
@@ -99,3 +99,3 @@ await this.httpClient.put(url, { newStartToken: options?.newStartToken }, requestAuthHeaders); | ||
} | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.delete(url, requestAuthHeaders); | ||
@@ -102,0 +102,0 @@ } |
@@ -11,3 +11,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.getAllProcessModels, options?.offset, options?.limit); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -23,3 +23,3 @@ const result = response.result; | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -29,6 +29,14 @@ const processModel = response.result; | ||
} | ||
async getByHash(processDefinitionHash, identity) { | ||
const endpoint = index_1.restSettings.paths.getProcessModelByHash.replace(index_1.restSettings.params.hash, processDefinitionHash); | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
const processModel = response.result; | ||
return processModel; | ||
} | ||
async getByProcessInstanceId(processInstanceId, identity) { | ||
const endpoint = index_1.restSettings.paths.getProcessModelForProcessInstance.replace(index_1.restSettings.params.processInstanceId, processInstanceId); | ||
const url = this.buildUrl(endpoint); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -40,3 +48,3 @@ const processModel = (0, Mappers_1.mapProcessModel)(response.result); | ||
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance).replace(index_1.restSettings.params.processModelId, options?.processModelId); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const processStartRequest = { | ||
@@ -51,3 +59,3 @@ ...options, | ||
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const processStartRequest = { | ||
@@ -62,3 +70,3 @@ ...options, | ||
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const processStartRequest = { | ||
@@ -86,3 +94,3 @@ ...options, | ||
} | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
await this.httpClient.delete(url, requestAuthHeaders); | ||
@@ -92,3 +100,3 @@ } | ||
const url = this.buildUrl(index_1.restSettings.paths.enableProcessModel).replace(index_1.restSettings.params.processModelId, processModelId); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.post(url, undefined, requestAuthHeaders); | ||
@@ -98,3 +106,3 @@ } | ||
const url = this.buildUrl(index_1.restSettings.paths.disableProcessModel).replace(index_1.restSettings.params.processModelId, processModelId); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.post(url, undefined, requestAuthHeaders); | ||
@@ -101,0 +109,0 @@ } |
@@ -15,3 +15,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -28,3 +28,3 @@ const mappedResult = { | ||
async finishTask(taskInstanceId, identity, useLegacyEndpoint) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = useLegacyEndpoint === true | ||
@@ -31,0 +31,0 @@ ? index_1.restSettings.paths.finishEmptyActivity.replace(index_1.restSettings.params.emptyActivityInstanceId, taskInstanceId) |
@@ -15,3 +15,3 @@ "use strict"; | ||
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings); | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
const response = await this.httpClient.get(url, requestAuthHeaders); | ||
@@ -25,3 +25,3 @@ const mappedResult = { | ||
async reserveUserTaskInstance(identity, flowNodeInstanceId, actualOwnerId) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = index_1.restSettings.paths.reserveUserTaskInstance.replace(index_1.restSettings.params.userTaskInstanceId, flowNodeInstanceId); | ||
@@ -32,3 +32,3 @@ const url = this.buildUrl(urlRestPart); | ||
async cancelUserTaskInstanceReservation(identity, flowNodeInstanceId) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = index_1.restSettings.paths.cancelUserTaskInstanceReservation.replace(index_1.restSettings.params.userTaskInstanceId, flowNodeInstanceId); | ||
@@ -39,3 +39,3 @@ const url = this.buildUrl(urlRestPart); | ||
async finishUserTask(userTaskInstanceId, userTaskResult, identity) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = index_1.restSettings.paths.finishUserTask.replace(index_1.restSettings.params.userTaskInstanceId, userTaskInstanceId); | ||
@@ -42,0 +42,0 @@ const url = this.buildUrl(urlRestPart); |
@@ -5,2 +5,3 @@ "use strict"; | ||
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk"); | ||
const IdentityAccessor_1 = require("./IdentityAccessor"); | ||
class ExternalTaskExecution { | ||
@@ -12,10 +13,10 @@ externalTask; | ||
topic; | ||
abortSignal; | ||
abortExecutionController = new AbortController(); | ||
customErrorHandler; | ||
onHeartbeatCallback = null; | ||
interval; | ||
abortSignalSubscription; | ||
awaitAbortSignal; | ||
abortSignalResolver; | ||
identityAccessor; | ||
logger; | ||
constructor(externalTask, processingFunction, externalTaskClient, config, topic, abortSignal, customErrorHandler) { | ||
isDisposed = false; | ||
constructor(externalTask, processingFunction, externalTaskClient, config, topic, onHeartbeatCallback, customErrorHandler) { | ||
this.externalTask = externalTask; | ||
@@ -25,4 +26,5 @@ this.processingFunction = processingFunction; | ||
this.config = config; | ||
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(config.identity, this.externalTaskClient.getEngineUrl()); | ||
this.topic = topic; | ||
this.abortSignal = abortSignal; | ||
this.onHeartbeatCallback = onHeartbeatCallback; | ||
this.customErrorHandler = customErrorHandler; | ||
@@ -35,91 +37,147 @@ this.logger = new processcube_engine_sdk_1.Logger('external_task_execution', { | ||
} | ||
get disposed() { | ||
return this.isDisposed; | ||
} | ||
async execute() { | ||
try { | ||
this.abortSignal.throwIfAborted(); | ||
this.startAbortSignalSubscription(); | ||
this.startExtendLockInterval(); | ||
const result = await Promise.race([this.processingFunction(this.externalTask.payload, this.externalTask, this.abortSignal), this.awaitAbortSignal]); | ||
this.abortSignal.throwIfAborted(); | ||
this.stopLockingInterval(); | ||
if (typeof this.onHeartbeatCallback === 'function') { | ||
this.onHeartbeatCallback('processExternalTask', this.externalTask.id); | ||
} | ||
const result = await this.processingFunction(this.externalTask.payload, this.externalTask, this.abortExecutionController.signal); | ||
this.stopExtendLockInterval(); | ||
if (this.abortExecutionController.signal.aborted) { | ||
return; | ||
} | ||
if (result) { | ||
await this.processResult(result); | ||
} | ||
this.dispose(); | ||
} | ||
catch (error) { | ||
this.handleError('processExternalTask', error); | ||
this.logger.error(`Error raised for external task '${this.externalTask.id}' with topic '${this.topic}': `, { err: error }); | ||
await this.evaluateError('processExternalTask', error); | ||
await this.handleExternalTaskExecutionError(error); | ||
} | ||
finally { | ||
this.dispose(); | ||
} | ||
} | ||
abort() { | ||
this.logger.debug(`Abort Signal has been triggered for External Task Executor ${this.externalTask.id}`); | ||
this.dispose(); | ||
} | ||
async dispose() { | ||
this.logger.debug(`Disposong Executor for External Task ${this.externalTask.id}`); | ||
this.stopExtendLockInterval(); | ||
if (!this.abortExecutionController.signal.aborted) { | ||
this.abortExecutionController.abort(); | ||
} | ||
this.isDisposed = true; | ||
// we explicitly do not dispose the identityAccessor here, since it is shared with the ExternalTaskWorker | ||
} | ||
async processResult(result) { | ||
if (this.abortExecutionController.signal.aborted) { | ||
return; | ||
} | ||
this.logger.trace(`Processing External Task Result ${this.externalTask.id}`, { externalTask: this.externalTask, result: result }); | ||
try { | ||
if (result instanceof processcube_engine_sdk_1.ExternalTaskError || result instanceof Error) { | ||
this.logger.trace(`External Task Result ${this.externalTask.id} is an error. The task will be finished as failed.`, { externalTask: this.externalTask, result: result }); | ||
return await this.handleExternalTaskExecutionError(result); | ||
} | ||
return await this.externalTaskClient.finishExternalTask(this.config.workerId, this.externalTask.id, result, this.config.identity, this.abortSignal); | ||
if (typeof this.onHeartbeatCallback === 'function') { | ||
this.onHeartbeatCallback('finishExternalTask', this.externalTask.id); | ||
} | ||
this.logger.trace(`Finishing ${this.externalTask.id} regularly.`, { externalTask: this.externalTask, result: result }); | ||
return await this.externalTaskClient.finishExternalTask(this.config.workerId, this.externalTask.id, result, await this.identityAccessor.getIdentity(), this.abortExecutionController.signal); | ||
} | ||
catch (error) { | ||
this.handleError('finishExternalTask', error); | ||
const errorIsRetryable = await this.evaluateError('finishExternalTask', error); | ||
if (errorIsRetryable && !this.abortExecutionController.signal.aborted) { | ||
await this.sleep(1000); | ||
return await this.processResult(result); | ||
} | ||
} | ||
} | ||
async handleExternalTaskExecutionError(error) { | ||
if (this.abortSignal.aborted) { | ||
if (this.abortExecutionController.signal.aborted) { | ||
return; | ||
} | ||
this.logger.error(`Error raised for external task '${this.externalTask.id}' with topic '${this.topic}': `, { err: error }); | ||
const workerError = new processcube_engine_sdk_1.ExternalTaskError(error?.errorCode || error?.name || 'ExternalTaskExecutionError', error?.errorMessage || error?.message || 'An error occurred while processing the external task.', error?.errorDetails || error?.stack || 'No error details available.'); | ||
return await this.externalTaskClient.handleError(this.config.workerId, this.externalTask.id, workerError, this.config.identity); | ||
} | ||
async dispose() { | ||
this.removeAbortSignalSubscription(); | ||
this.stopLockingInterval(); | ||
} | ||
stopLockingInterval() { | ||
if (this.interval) { | ||
clearInterval(this.interval); | ||
this.interval = undefined; | ||
try { | ||
this.logger.trace(`Reporting Error for External Task ${this.externalTask.id} to Engine`); | ||
const workerError = new processcube_engine_sdk_1.ExternalTaskError(error?.errorCode || error?.name || 'ExternalTaskExecutionError', error?.errorMessage || error?.message || 'An error occurred while processing the external task.', error?.errorDetails || error?.stack || 'No error details available.'); | ||
if (typeof this.onHeartbeatCallback === 'function') { | ||
this.onHeartbeatCallback('handleError', this.externalTask.id); | ||
} | ||
return await this.externalTaskClient.handleError(this.config.workerId, this.externalTask.id, workerError, await this.identityAccessor.getIdentity()); | ||
} | ||
} | ||
startAbortSignalSubscription() { | ||
this.awaitAbortSignal = new Promise((resolve) => (this.abortSignalResolver = resolve)); | ||
this.abortSignalSubscription = () => { | ||
if (this.abortSignalResolver) { | ||
this.abortSignalResolver(); | ||
catch (error) { | ||
const errorIsRetryable = await this.evaluateError('finishExternalTask', error); | ||
if (errorIsRetryable && !this.abortExecutionController.signal.aborted) { | ||
await this.sleep(1000); | ||
return await this.handleExternalTaskExecutionError(error); | ||
} | ||
this.dispose(); | ||
}; | ||
this.abortSignal.addEventListener('abort', this.abortSignalSubscription); | ||
} | ||
removeAbortSignalSubscription() { | ||
if (this.abortSignalSubscription) { | ||
this.abortSignal.removeEventListener('abort', this.abortSignalSubscription); | ||
} | ||
if (this.abortSignalResolver) { | ||
this.abortSignalResolver(); | ||
} | ||
} | ||
startExtendLockInterval() { | ||
const lockExtensionBuffer = 5000; | ||
this.logger.trace(`Starting automatic Lock extension for External Task ${this.externalTask.id}`); | ||
this.interval = setInterval(async () => this.extendLocks(this.externalTask), this.config.lockDuration - lockExtensionBuffer); | ||
} | ||
async extendLocks(externalTask) { | ||
if (this.abortExecutionController.signal.aborted) { | ||
return; | ||
} | ||
if (typeof this.onHeartbeatCallback === 'function') { | ||
this.onHeartbeatCallback('extendLock', this.externalTask.id); | ||
} | ||
try { | ||
await this.externalTaskClient.extendLock(this.config.workerId, externalTask.id, this.config.lockDuration, this.config.identity, this.abortSignal); | ||
this.logger.debug(`Extending Lock on External Task ${this.externalTask.id}`); | ||
await this.externalTaskClient.extendLock(this.config.workerId, externalTask.id, this.config.lockDuration, await this.identityAccessor.getIdentity(), this.abortExecutionController.signal); | ||
} | ||
catch (error) { | ||
this.handleError('extendLock', error); | ||
// This can happen, if the lock-extension was performed after the task was already finished. | ||
// Since this isn't really an error, a warning suffices here. | ||
this.logger.warn(`An error occured while trying to extend the lock for ExternalTask ${externalTask.id}`, { err: error }); | ||
const errorIsRetryable = await this.evaluateError('extendLock', error); | ||
if (errorIsRetryable && !this.abortExecutionController.signal.aborted) { | ||
await this.sleep(1000); | ||
await this.extendLocks(externalTask); | ||
} | ||
} | ||
} | ||
handleError(errorType, error) { | ||
stopExtendLockInterval() { | ||
this.logger.debug(`Disposing automatic Lock Extension for External Task ${this.externalTask.id}`); | ||
if (this.interval) { | ||
clearInterval(this.interval); | ||
this.interval = undefined; | ||
} | ||
} | ||
async evaluateError(errorType, error) { | ||
if (this.abortExecutionController.signal.aborted) { | ||
return false; | ||
} | ||
if (typeof this.customErrorHandler === 'function') { | ||
this.logger.trace(`Posting error for external task ${this.externalTask.id} to subscribed custom error handlers`, { errorType: errorType, err: error }); | ||
this.customErrorHandler(errorType, error, this.externalTask); | ||
} | ||
if (error.code === 409) { | ||
this.logger.warn(`Failed to run ${errorType} for External Task ${this.externalTask.id} because the task has already been finished. Aborting now, since there is nothing more to do here.`, { err: error }); | ||
this.abort(); | ||
return false; | ||
} | ||
this.logger.warn(`An error occured while executing ${errorType} for External Task ${this.externalTask.id}`, { err: error }); | ||
if (error.message?.match(/expired/i) && this.identityAccessor.canIdentityBeRefreshed()) { | ||
this.logger.info('Identity has expired. Refreshing identity to get a new auth token...'); | ||
await this.identityAccessor.forceImmediateIdentityRefresh(); | ||
this.logger.info('Identity refresh completed. Retrying to process External Task now.'); | ||
return true; | ||
} | ||
return false; | ||
} | ||
async sleep(milliseconds) { | ||
return new Promise((resolve) => { | ||
setTimeout(() => { | ||
resolve(); | ||
}, milliseconds); | ||
}); | ||
} | ||
} | ||
exports.ExternalTaskExecution = ExternalTaskExecution; | ||
//# sourceMappingURL=ExternalTaskExecution.js.map |
@@ -18,9 +18,19 @@ "use strict"; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importStar = (this && this.__importStar) || (function () { | ||
var ownKeys = function(o) { | ||
ownKeys = Object.getOwnPropertyNames || function (o) { | ||
var ar = []; | ||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
return ar; | ||
}; | ||
return ownKeys(o); | ||
}; | ||
return function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -32,7 +42,4 @@ exports.ExternalTaskWorker = void 0; | ||
const ExternalTaskExecution_1 = require("./ExternalTaskExecution"); | ||
const IdentityAccessor_1 = require("./IdentityAccessor"); | ||
const logger = new processcube_engine_sdk_1.Logger('external_task_worker'); | ||
const dummyIdentity = { | ||
token: 'ZHVtbXlfdG9rZW4=', | ||
userId: 'dummy_token', | ||
}; | ||
class ExternalTaskWorker { | ||
@@ -46,8 +53,10 @@ _workerId; | ||
payloadFilter; | ||
_identity; | ||
identityAccessor; | ||
_pollingActive = false; | ||
externalTaskClient; | ||
customErrorHandler = null; | ||
onHeartbeatCallback = null; | ||
abortController; | ||
abortSignal; | ||
activelyProcessedExternalTasks = {}; | ||
constructor(engineUrl, topic, processingFunction, config) { | ||
@@ -57,3 +66,3 @@ this._workerId = config?.workerId ?? uuid.v4(); | ||
this.processingFunction = processingFunction; | ||
this.identity = config?.identity ?? dummyIdentity; | ||
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(config?.identity, engineUrl); | ||
this.maxTasks = config?.maxTasks ?? 10; | ||
@@ -63,9 +72,18 @@ this.longpollingTimeout = config?.longpollingTimeout ?? 10000; | ||
this.payloadFilter = config?.payloadFilter; | ||
this.externalTaskClient = new ExternalTaskApiHttpClient_1.ExternalTaskApiClient(engineUrl, this.identity); | ||
this.externalTaskClient = new ExternalTaskApiHttpClient_1.ExternalTaskApiClient(engineUrl, this.identityAccessor); | ||
} | ||
/** | ||
* @deprecated Use getIdentity instead. | ||
*/ | ||
get identity() { | ||
return this._identity; | ||
return this.identityAccessor.getIdentityStatic(); | ||
} | ||
async getIdentity() { | ||
return this.identityAccessor.getIdentity(); | ||
} | ||
/** | ||
* @deprecated This is no longer safe to use. Identity should be set via the constructor. | ||
*/ | ||
set identity(value) { | ||
this._identity = value; | ||
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(value, this.externalTaskClient.getEngineUrl()); | ||
} | ||
@@ -81,2 +99,11 @@ get workerId() { | ||
} | ||
onHeartbeat(callback) { | ||
this.onHeartbeatCallback = callback; | ||
} | ||
getActiveExternalTasks() { | ||
return Object.keys(this.activelyProcessedExternalTasks); | ||
} | ||
isExternalTaskBeingProcessed(externalTaskId) { | ||
return this.activelyProcessedExternalTasks[externalTaskId] != null; | ||
} | ||
start() { | ||
@@ -86,2 +113,6 @@ this._pollingActive = true; | ||
this.abortSignal = this.abortController.signal; | ||
this.abortSignal.onabort = () => { | ||
Object.values(this.activelyProcessedExternalTasks).forEach((executor) => executor.abort()); | ||
this.activelyProcessedExternalTasks = {}; | ||
}; | ||
this.processExternalTasks(); | ||
@@ -95,4 +126,12 @@ } | ||
} | ||
abortExternalTaskIfPresent(externalTaskId) { | ||
if (this.activelyProcessedExternalTasks[externalTaskId] != null) { | ||
this.activelyProcessedExternalTasks[externalTaskId].abort(); | ||
delete this.activelyProcessedExternalTasks[externalTaskId]; | ||
} | ||
} | ||
dispose() { | ||
this.stop(); | ||
this.externalTaskClient.dispose(); | ||
this.identityAccessor?.dispose(); | ||
} | ||
@@ -107,5 +146,16 @@ async processExternalTasks() { | ||
errorCount = 0; | ||
if (typeof this.onHeartbeatCallback === 'function') { | ||
this.onHeartbeatCallback('fetchAndLock'); | ||
} | ||
} | ||
catch (error) { | ||
if (this.abortSignal?.aborted) { | ||
return; | ||
} | ||
logger.error('Failed to fetch and lock External Tasks.', { err: error }); | ||
if (error.message?.match(/expired/i) && this.identityAccessor.canIdentityBeRefreshed()) { | ||
logger.info('Identity has expired. Refreshing identity to get a new auth token...'); | ||
await this.identityAccessor.forceImmediateIdentityRefresh(); | ||
logger.info('Identity refresh completed. Fetch and Lock will continue.'); | ||
} | ||
errorCount++; | ||
@@ -131,3 +181,3 @@ const timeoutOffset = (Math.floor(Math.random() * 10) + 1) * 30; | ||
async fetchAndLockExternalTasks() { | ||
return this.externalTaskClient.fetchAndLockExternalTasks(this.workerId, this.topic, this.maxTasks, this.longpollingTimeout, this.lockDuration, this.payloadFilter, this.identity, this.abortSignal); | ||
return this.externalTaskClient.fetchAndLockExternalTasks(this.workerId, this.topic, this.maxTasks, this.longpollingTimeout, this.lockDuration, this.payloadFilter, this.identityAccessor, this.abortSignal); | ||
} | ||
@@ -137,3 +187,3 @@ async startExecutingExternalTask(externalTask) { | ||
const externalTaskExecution = new ExternalTaskExecution_1.ExternalTaskExecution(externalTask, this.processingFunction, this.externalTaskClient, { | ||
identity: this.identity, | ||
identity: this.identityAccessor, | ||
lockDuration: this.lockDuration, | ||
@@ -144,3 +194,4 @@ longpollingTimeout: this.longpollingTimeout, | ||
workerId: this.workerId, | ||
}, this.topic, this.abortSignal, this.customErrorHandler); | ||
}, this.topic, this.onHeartbeatCallback, this.customErrorHandler); | ||
this.activelyProcessedExternalTasks[externalTask.id] = externalTaskExecution; | ||
await externalTaskExecution.execute(); | ||
@@ -154,2 +205,5 @@ } | ||
} | ||
finally { | ||
delete this.activelyProcessedExternalTasks[externalTask.id]; | ||
} | ||
} | ||
@@ -156,0 +210,0 @@ async sleep(milliseconds) { |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Model = exports.EventType = exports.DataModels = exports.BpmnType = void 0; | ||
exports.Model = exports.EventType = exports.DataModels = exports.BpmnType = exports.ClientCredentialsIdentityAccessor = exports.IdentityAccessor = void 0; | ||
__exportStar(require("./Client"), exports); | ||
@@ -24,2 +24,6 @@ __exportStar(require("./ClientFactory"), exports); | ||
__exportStar(require("./Types/index"), exports); | ||
var IdentityAccessor_1 = require("./IdentityAccessor"); | ||
Object.defineProperty(exports, "IdentityAccessor", { enumerable: true, get: function () { return IdentityAccessor_1.IdentityAccessor; } }); | ||
var IdentityAccessorClientCredentials_1 = require("./IdentityAccessorClientCredentials"); | ||
Object.defineProperty(exports, "ClientCredentialsIdentityAccessor", { enumerable: true, get: function () { return IdentityAccessorClientCredentials_1.ClientCredentialsIdentityAccessor; } }); | ||
var processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk"); | ||
@@ -26,0 +30,0 @@ Object.defineProperty(exports, "BpmnType", { enumerable: true, get: function () { return processcube_engine_sdk_1.BpmnType; } }); |
@@ -18,9 +18,19 @@ "use strict"; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importStar = (this && this.__importStar) || (function () { | ||
var ownKeys = function(o) { | ||
ownKeys = Object.getOwnPropertyNames || function (o) { | ||
var ar = []; | ||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
return ar; | ||
}; | ||
return ownKeys(o); | ||
}; | ||
return function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
})(); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
@@ -27,0 +37,0 @@ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); |
@@ -29,2 +29,4 @@ "use strict"; | ||
processModelId: ':process_model_id', | ||
// Hash of a ProcessModel. | ||
hash: ':hash', | ||
// Id of an anonymous session. | ||
@@ -150,2 +152,8 @@ sessionId: ':session_id', | ||
/** | ||
* Triggers a TimerEvent by its InstanceId. | ||
* @tags Events | ||
* @method post | ||
*/ | ||
triggerTimerEvent: `/timer/${params.flowNodeInstanceId}/trigger`, | ||
/** | ||
* Finishes a specific EmptyActivity by its InstanceId. Deprecated, use "finish Untyped Task" instead | ||
@@ -249,2 +257,9 @@ * @tags EmptyActivity | ||
/** | ||
* Gets all deployed versions of a ProcessDefinition by its id. | ||
* @tags ProcessDefinitions | ||
* @method get | ||
* @responseType ProcessDefinitionList | ||
*/ | ||
getAllDeployedProcessDefinitionsById: `/process_definitions/${params.processDefinitionId}/get_all_deployed`, | ||
/** | ||
* Deletes the ProcessDefinition with the given ID. | ||
@@ -273,2 +288,9 @@ * Per default, a Process is only flagged as deleted. To actually delete the Process and all related data, set "delete_all_related_data" to "true". | ||
/** | ||
* Gets a deployed Process Model by its Hash. | ||
* @tags ProcessModels | ||
* @method get | ||
* @responseType ProcessModel | ||
*/ | ||
getProcessModelByHash: `/process_models/${params.hash}/`, | ||
/** | ||
* Gets a ProcessDefinition for a given ProcessModel. | ||
@@ -275,0 +297,0 @@ * @tags ProcessModels |
import { ExternalTask } from '@5minds/processcube_engine_sdk'; | ||
import { ExternalTaskApiClient } from './Clients'; | ||
import { ExternalTaskWorkerHeartbeat } from './ExternalTaskWorker'; | ||
import { HandleExternalTaskAction, IExternalTaskWorkerConfig, WorkerErrorHandler } from './Types'; | ||
@@ -10,20 +11,21 @@ export declare class ExternalTaskExecution<TExternalTaskPayload, TResultPayload extends object> { | ||
private topic; | ||
private abortSignal; | ||
private abortExecutionController; | ||
private customErrorHandler?; | ||
private onHeartbeatCallback; | ||
private interval; | ||
private abortSignalSubscription; | ||
private awaitAbortSignal; | ||
private abortSignalResolver; | ||
private identityAccessor; | ||
private logger; | ||
constructor(externalTask: ExternalTask<TExternalTaskPayload>, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, externalTaskClient: ExternalTaskApiClient, config: IExternalTaskWorkerConfig, topic: string, abortSignal: AbortSignal, customErrorHandler?: WorkerErrorHandler); | ||
private isDisposed; | ||
constructor(externalTask: ExternalTask<TExternalTaskPayload>, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, externalTaskClient: ExternalTaskApiClient, config: IExternalTaskWorkerConfig, topic: string, onHeartbeatCallback?: ExternalTaskWorkerHeartbeat, customErrorHandler?: WorkerErrorHandler); | ||
get disposed(): boolean; | ||
execute(): Promise<void>; | ||
abort(): void; | ||
private dispose; | ||
private processResult; | ||
private handleExternalTaskExecutionError; | ||
private dispose; | ||
private stopLockingInterval; | ||
private startAbortSignalSubscription; | ||
private removeAbortSignalSubscription; | ||
private startExtendLockInterval; | ||
private extendLocks; | ||
private handleError; | ||
private stopExtendLockInterval; | ||
private evaluateError; | ||
private sleep; | ||
} |
import { Identity } from '@5minds/processcube_engine_sdk'; | ||
import { HandleExternalTaskAction, IExternalTaskWorkerConfig, WorkerErrorHandler } from './Types/index'; | ||
export type ExternalTaskWorkerHeartbeat = (operation?: 'fetchAndLock' | 'processExternalTask' | 'extendLock' | 'finishExternalTask' | 'handleError', externalTaskId?: string) => void; | ||
export declare class ExternalTaskWorker<TExternalTaskPayload, TResultPayload extends object> { | ||
@@ -11,10 +12,19 @@ private readonly _workerId; | ||
private readonly payloadFilter; | ||
private _identity; | ||
private identityAccessor; | ||
private _pollingActive; | ||
private externalTaskClient; | ||
private customErrorHandler; | ||
private onHeartbeatCallback; | ||
private abortController; | ||
private abortSignal; | ||
private activelyProcessedExternalTasks; | ||
constructor(engineUrl: string, topic: string, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, config?: IExternalTaskWorkerConfig); | ||
/** | ||
* @deprecated Use getIdentity instead. | ||
*/ | ||
get identity(): Identity; | ||
getIdentity(): Promise<Identity>; | ||
/** | ||
* @deprecated This is no longer safe to use. Identity should be set via the constructor. | ||
*/ | ||
set identity(value: Identity); | ||
@@ -24,4 +34,8 @@ get workerId(): string; | ||
onWorkerError(callback: WorkerErrorHandler): void; | ||
onHeartbeat(callback: ExternalTaskWorkerHeartbeat): void; | ||
getActiveExternalTasks(): string[]; | ||
isExternalTaskBeingProcessed(externalTaskId: string): boolean; | ||
start(): void; | ||
stop(): void; | ||
abortExternalTaskIfPresent(externalTaskId: string): void; | ||
dispose(): void; | ||
@@ -28,0 +42,0 @@ private processExternalTasks; |
@@ -6,2 +6,4 @@ export * from './Client'; | ||
export * from './Types/index'; | ||
export { ClientCredentialsConfig, IdentityAccessor, IdentityLike } from './IdentityAccessor'; | ||
export { ClientCredentialsIdentityAccessor } from './IdentityAccessorClientCredentials'; | ||
export { BpmnType, DataModels, EventType, Identity, Model, EventReceivedCallback, Subscription } from '@5minds/processcube_engine_sdk'; |
@@ -1,2 +0,3 @@ | ||
import { ExternalTask, Identity } from '@5minds/processcube_engine_sdk'; | ||
import { ExternalTask } from '@5minds/processcube_engine_sdk'; | ||
import { IdentityLike } from '../IdentityAccessor'; | ||
/** | ||
@@ -12,3 +13,3 @@ * Definition of the HandleExternalTask Callback. | ||
longpollingTimeout?: number; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
payloadFilter?: RegExp; | ||
@@ -15,0 +16,0 @@ }; |
@@ -15,2 +15,3 @@ export declare const restSettings: { | ||
processModelId: string; | ||
hash: string; | ||
sessionId: string; | ||
@@ -126,2 +127,8 @@ userId: string; | ||
/** | ||
* Triggers a TimerEvent by its InstanceId. | ||
* @tags Events | ||
* @method post | ||
*/ | ||
triggerTimerEvent: string; | ||
/** | ||
* Finishes a specific EmptyActivity by its InstanceId. Deprecated, use "finish Untyped Task" instead | ||
@@ -223,2 +230,9 @@ * @tags EmptyActivity | ||
/** | ||
* Gets all deployed versions of a ProcessDefinition by its id. | ||
* @tags ProcessDefinitions | ||
* @method get | ||
* @responseType ProcessDefinitionList | ||
*/ | ||
getAllDeployedProcessDefinitionsById: string; | ||
/** | ||
* Deletes the ProcessDefinition with the given ID. | ||
@@ -246,2 +260,9 @@ * Per default, a Process is only flagged as deleted. To actually delete the Process and all related data, set "delete_all_related_data" to "true". | ||
/** | ||
* Gets a deployed Process Model by its Hash. | ||
* @tags ProcessModels | ||
* @method get | ||
* @responseType ProcessModel | ||
*/ | ||
getProcessModelByHash: string; | ||
/** | ||
* Gets a ProcessDefinition for a given ProcessModel. | ||
@@ -248,0 +269,0 @@ * @tags ProcessModels |
@@ -7,3 +7,3 @@ { | ||
"name": "@5minds/processcube_engine_client", | ||
"version": "6.0.0-feature-d19732-m234s4wd", | ||
"version": "6.0.0-feature-d71480-m7bwe81b", | ||
"description": "Contains a typescript based client for accessing the Engine.", | ||
@@ -37,18 +37,25 @@ "main": "dist/commonjs/index.js", | ||
"prepare": "npm run build", | ||
"test": ":" | ||
"build:test": "tsc --project tsconfig.tests.json", | ||
"test": "npm run test:smoke", | ||
"test:smoke": "npm run build:test && node ./dist_test/commonjs/test/smoke-test.js", | ||
"test:integration": "npm run build:test && node ./dist_test/commonjs/test/integration-test.js" | ||
}, | ||
"dependencies": { | ||
"@5minds/processcube_engine_sdk": "6.1.0-feature-078566-m232crvc", | ||
"bufferutil": "4.0.8", | ||
"cross-fetch": "4.0.0", | ||
"socket.io-client": "4.8.0", | ||
"@5minds/processcube_engine_sdk": "^6.1.0-feature-9ff938-m7bvz0uz", | ||
"async-lock": "^1.4.1", | ||
"bufferutil": "4.0.9", | ||
"cross-fetch": "4.1.0", | ||
"dayjs": "^1.11.13", | ||
"openid-client": "^6.1.7", | ||
"socket.io-client": "4.8.1", | ||
"utf-8-validate": "5.0.10", | ||
"uuid": "^10.0.0" | ||
"uuid": "^11.0.0" | ||
}, | ||
"devDependencies": { | ||
"@trivago/prettier-plugin-sort-imports": "^4.3.0", | ||
"@types/node": "^20.11.27", | ||
"@trivago/prettier-plugin-sort-imports": "^5.2.0", | ||
"@types/node": "^22.10.2", | ||
"prettier": "^3.3.2", | ||
"typescript": "^5.5.3" | ||
"typescript": "^5.5.3", | ||
"why-is-node-running": "^3.2.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
368666
106
5223
9
5
+ Addedasync-lock@^1.4.1
+ Addeddayjs@^1.11.13
+ Addedopenid-client@^6.1.7
+ Added@5minds/processcube_engine_sdk@6.1.0-renovate-fdcf8b-m4640r7i(transitive)
+ Addedasync-lock@1.4.1(transitive)
+ Addedbufferutil@4.0.9(transitive)
+ Addedcross-fetch@4.1.0(transitive)
+ Addedjose@5.10.0(transitive)
+ Addedoauth4webapi@3.3.0(transitive)
+ Addedopenid-client@6.3.1(transitive)
+ Addedsocket.io-client@4.8.1(transitive)
+ Addeduuid@11.1.0(transitive)
- Removed@5minds/processcube_engine_sdk@6.1.0-feature-078566-m232crvc(transitive)
- Removedbufferutil@4.0.8(transitive)
- Removedcross-fetch@4.0.0(transitive)
- Removedsocket.io-client@4.8.0(transitive)
- Removeduuid@10.0.0(transitive)
Updated@5minds/processcube_engine_sdk@^6.1.0-feature-9ff938-m7bvz0uz
Updatedbufferutil@4.0.9
Updatedcross-fetch@4.1.0
Updatedsocket.io-client@4.8.1
Updateduuid@^11.0.0