@5minds/processcube_engine_client
Advanced tools
Comparing version 6.0.0-renovate-7e3b53-m2rwoku3 to 6.0.0-renovate-8ac102-m50c24h2
@@ -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; | ||
@@ -10,9 +11,9 @@ limit?: number; | ||
}): Promise<DataModels.FlowNodeInstances.FlowNodeInstanceList>; | ||
finishUntypedTask(taskInstanceId: string, identity?: Identity): 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): 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>; | ||
@@ -22,4 +23,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,190 +11,190 @@ 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; | ||
}): Promise<Subscription>; | ||
onUntypedTaskFinished(callback: Messages.CallbackTypes.OnUntypedTaskFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
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>; | ||
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,19 @@ 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>; | ||
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 +31,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,11 @@ 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>; | ||
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 +25,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; | ||
@@ -10,12 +11,12 @@ limit?: number; | ||
}): Promise<UntypedTaskList>; | ||
finishTask(taskInstanceId: string, identity?: Identity): Promise<void>; | ||
finishTask(taskInstanceId: string, identity?: IdentityLike): Promise<void>; | ||
onUntypedTaskWaiting(callback: Messages.CallbackTypes.OnUntypedTaskWaitingCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): Promise<Subscription>; | ||
onUntypedTaskFinished(callback: Messages.CallbackTypes.OnUntypedTaskFinishedCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
identity?: IdentityLike; | ||
}): 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); | ||
@@ -20,3 +20,3 @@ const mappedResult = { | ||
async finishUntypedTask(taskInstanceId, identity) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = index_1.restSettings.paths.finishUntypedTask.replace(index_1.restSettings.params.untypedTaskInstanceId, taskInstanceId); | ||
@@ -27,3 +27,3 @@ const url = this.buildUrl(urlRestPart); | ||
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); | ||
@@ -34,3 +34,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); | ||
@@ -41,3 +41,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); | ||
@@ -51,3 +51,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); | ||
@@ -54,0 +54,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); | ||
@@ -32,3 +32,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); | ||
@@ -44,3 +44,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 +53,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 +64,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 +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 = { | ||
@@ -96,3 +96,3 @@ ...options, | ||
} | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
await this.httpClient.delete(url, requestAuthHeaders); | ||
@@ -99,0 +99,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); | ||
@@ -32,3 +32,3 @@ const processModel = 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); | ||
@@ -40,3 +40,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 +51,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 +62,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 +86,3 @@ ...options, | ||
} | ||
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity); | ||
await this.httpClient.delete(url, requestAuthHeaders); | ||
@@ -92,3 +92,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 +98,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 +101,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); | ||
@@ -25,3 +25,3 @@ const mappedResult = { | ||
async finishTask(taskInstanceId, identity) { | ||
const requestAuthHeaders = this.createRequestAuthHeaders(identity); | ||
const requestAuthHeaders = await this.createRequestAuthHeaders(identity); | ||
const urlRestPart = index_1.restSettings.paths.finishUntypedTask.replace(index_1.restSettings.params.untypedTaskInstanceId, taskInstanceId); | ||
@@ -28,0 +28,0 @@ const url = this.buildUrl(urlRestPart); |
@@ -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 { | ||
@@ -18,2 +19,3 @@ externalTask; | ||
abortSignalResolver; | ||
identityAccessor; | ||
logger; | ||
@@ -25,2 +27,3 @@ constructor(externalTask, processingFunction, externalTaskClient, config, topic, abortSignal, customErrorHandler) { | ||
this.config = config; | ||
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(config.identity, this.externalTaskClient.getEngineUrl()); | ||
this.topic = topic; | ||
@@ -60,3 +63,3 @@ this.abortSignal = abortSignal; | ||
} | ||
return await this.externalTaskClient.finishExternalTask(this.config.workerId, this.externalTask.id, result, this.config.identity, this.abortSignal); | ||
return await this.externalTaskClient.finishExternalTask(this.config.workerId, this.externalTask.id, result, await this.identityAccessor.getIdentity(), this.abortSignal); | ||
} | ||
@@ -73,3 +76,3 @@ catch (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); | ||
return await this.externalTaskClient.handleError(this.config.workerId, this.externalTask.id, workerError, await this.identityAccessor.getIdentity()); | ||
} | ||
@@ -79,2 +82,3 @@ async dispose() { | ||
this.stopLockingInterval(); | ||
// we explicitly do not dispose the identityAccessor here, since it is shared with the ExternalTaskWorker | ||
} | ||
@@ -111,3 +115,3 @@ stopLockingInterval() { | ||
try { | ||
await this.externalTaskClient.extendLock(this.config.workerId, externalTask.id, this.config.lockDuration, this.config.identity, this.abortSignal); | ||
await this.externalTaskClient.extendLock(this.config.workerId, externalTask.id, this.config.lockDuration, await this.identityAccessor.getIdentity(), this.abortSignal); | ||
} | ||
@@ -114,0 +118,0 @@ catch (error) { |
@@ -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,3 +53,3 @@ _workerId; | ||
payloadFilter; | ||
_identity; | ||
identityAccessor; | ||
_pollingActive = false; | ||
@@ -57,3 +64,3 @@ externalTaskClient; | ||
this.processingFunction = processingFunction; | ||
this.identity = config?.identity ?? dummyIdentity; | ||
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(config?.identity, engineUrl); | ||
this.maxTasks = config?.maxTasks ?? 10; | ||
@@ -63,9 +70,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()); | ||
} | ||
@@ -95,2 +111,3 @@ get workerId() { | ||
this.externalTaskClient.dispose(); | ||
this.identityAccessor?.dispose(); | ||
} | ||
@@ -107,2 +124,5 @@ async processExternalTasks() { | ||
catch (error) { | ||
if (this.abortSignal?.aborted) { | ||
return; | ||
} | ||
logger.error('Failed to fetch and lock External Tasks.', { err: error }); | ||
@@ -129,3 +149,3 @@ errorCount++; | ||
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); | ||
} | ||
@@ -135,3 +155,3 @@ async startExecutingExternalTask(externalTask) { | ||
const externalTaskExecution = new ExternalTaskExecution_1.ExternalTaskExecution(externalTask, this.processingFunction, this.externalTaskClient, { | ||
identity: this.identity, | ||
identity: this.identityAccessor, | ||
lockDuration: this.lockDuration, | ||
@@ -138,0 +158,0 @@ longpollingTimeout: this.longpollingTimeout, |
@@ -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 ClientCredentialsIdentityAccessor_1 = require("./ClientCredentialsIdentityAccessor"); | ||
Object.defineProperty(exports, "ClientCredentialsIdentityAccessor", { enumerable: true, get: function () { return ClientCredentialsIdentityAccessor_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); |
@@ -147,2 +147,8 @@ "use strict"; | ||
/** | ||
* Triggers a TimerEvent by its InstanceId. | ||
* @tags Events | ||
* @method post | ||
*/ | ||
triggerTimerEvent: `/timer/${params.flowNodeInstanceId}/trigger`, | ||
/** | ||
* Finishes a specific UntypedTask by its InstanceId. | ||
@@ -149,0 +155,0 @@ * @tags UntypedTask |
@@ -16,2 +16,3 @@ import { ExternalTask } from '@5minds/processcube_engine_sdk'; | ||
private abortSignalResolver; | ||
private identityAccessor; | ||
private logger; | ||
@@ -18,0 +19,0 @@ constructor(externalTask: ExternalTask<TExternalTaskPayload>, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, externalTaskClient: ExternalTaskApiClient, config: IExternalTaskWorkerConfig, topic: string, abortSignal: AbortSignal, customErrorHandler?: WorkerErrorHandler); |
@@ -11,3 +11,3 @@ import { Identity } from '@5minds/processcube_engine_sdk'; | ||
private readonly payloadFilter; | ||
private _identity; | ||
private identityAccessor; | ||
private _pollingActive; | ||
@@ -19,3 +19,10 @@ private externalTaskClient; | ||
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); | ||
@@ -22,0 +29,0 @@ get workerId(): string; |
@@ -6,2 +6,4 @@ export * from './Client'; | ||
export * from './Types/index'; | ||
export { ClientCredentialsConfig, IdentityAccessor, IdentityLike } from './IdentityAccessor'; | ||
export { ClientCredentialsIdentityAccessor } from './ClientCredentialsIdentityAccessor'; | ||
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 @@ }; |
@@ -124,2 +124,8 @@ export declare const restSettings: { | ||
/** | ||
* Triggers a TimerEvent by its InstanceId. | ||
* @tags Events | ||
* @method post | ||
*/ | ||
triggerTimerEvent: string; | ||
/** | ||
* Finishes a specific UntypedTask by its InstanceId. | ||
@@ -126,0 +132,0 @@ * @tags UntypedTask |
@@ -7,3 +7,3 @@ { | ||
"name": "@5minds/processcube_engine_client", | ||
"version": "6.0.0-renovate-7e3b53-m2rwoku3", | ||
"version": "6.0.0-renovate-8ac102-m50c24h2", | ||
"description": "Contains a typescript based client for accessing the Engine.", | ||
@@ -37,8 +37,13 @@ "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-develop-5afe4c-m2lwt79r", | ||
"@5minds/processcube_engine_sdk": "6.1.0-alpha.6", | ||
"async-lock": "^1.4.1", | ||
"bufferutil": "4.0.8", | ||
"cross-fetch": "4.0.0", | ||
"cross-fetch": "4.1.0", | ||
"openid-client": "^6.1.7", | ||
"socket.io-client": "4.8.1", | ||
@@ -49,7 +54,8 @@ "utf-8-validate": "5.0.10", | ||
"devDependencies": { | ||
"@trivago/prettier-plugin-sort-imports": "^4.3.0", | ||
"@types/node": "^22.7.4", | ||
"@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
347283
106
4954
8
5
+ Addedasync-lock@^1.4.1
+ Addedopenid-client@^6.1.7
+ Added@5minds/processcube_engine_sdk@6.1.0-alpha.6(transitive)
+ Addedasync-lock@1.4.1(transitive)
+ Addedcross-fetch@4.1.0(transitive)
+ Addedjose@5.9.6(transitive)
+ Addedoauth4webapi@3.1.4(transitive)
+ Addedopenid-client@6.1.7(transitive)
- Removed@5minds/processcube_engine_sdk@6.1.0-develop-5afe4c-m2lwt79r(transitive)
- Removedcross-fetch@4.0.0(transitive)
Updatedcross-fetch@4.1.0