New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@5minds/processcube_engine_client

Package Overview
Dependencies
Maintainers
0
Versions
726
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@5minds/processcube_engine_client - npm Package Compare versions

Comparing version 6.0.0-feature-9de524-m4jrwzr9 to 6.0.0-feature-a171f9-m7lpldcm

dist/commonjs/IdentityAccessor.js

9

dist/Client.d.ts

@@ -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,3 +0,4 @@

import { DataModels, IApplicationInfoExtensionAdapter, Identity, Subscription } from '@5minds/processcube_engine_sdk';
import { Messages as ClientMessages } from '../Types/index';
import { DataModels, IApplicationInfoExtensionAdapter, Subscription } from '@5minds/processcube_engine_sdk';
import { IdentityLike } from '../IdentityAccessor';
import { OnConnected, OnDisconnected, OnReconnected } from '../Types/NotificationCallbackTypes';
import { BaseClient } from './BaseClient';

@@ -7,5 +8,5 @@ export declare class ApplicationInfoHttpClient extends BaseClient implements IApplicationInfoExtensionAdapter {

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: OnConnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
onDisconnected(callback: OnDisconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
onReconnected(callback: 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,3 +22,3 @@ triggerSignalEvent<TPayload>(signalName: string, options?: {

payload?: TPayload;
identity?: Identity;
identity?: IdentityLike;
}): Promise<void>;

@@ -29,35 +30,35 @@ triggerTimerEvent(flowNodeInstanceId: string, 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>;
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>;

@@ -64,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,12 @@ 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>;
/**
* @param useLegacyEndpoint If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
finishUntypedTask(taskInstanceId: string, identity?: IdentityLike, useLegacyEndpoint?: boolean): Promise<void>;
finishManualTask(manualTaskInstanceId: string, identity?: IdentityLike): Promise<void>;
finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: IdentityLike): Promise<void>;
triggerMessageEvent<TPayload>(messageName: string, options?: {
processInstanceId?: string;
payload?: TPayload;
identity?: Identity;
identity?: IdentityLike;
}): Promise<void>;

@@ -22,4 +26,4 @@ triggerSignalEvent<TPayload>(signalName: string, options?: {

payload?: TPayload;
identity?: Identity;
identity?: IdentityLike;
}): Promise<void>;
}

@@ -1,2 +0,1 @@

export * from './AnonymousSessionHttpClient';
export * from './ApplicationInfoHttpClient';

@@ -3,0 +2,0 @@ export * from './CorrelationHttpClient';

import { Socket } from 'socket.io-client';
import { Identity, Subscription } from '@5minds/processcube_engine_sdk';
import { Subscription } from '@5minds/processcube_engine_sdk';
import { IdentityAccessor } from '../../IdentityAccessor';
export declare class SocketIoManager {
private readonly engineUrl;
private logger;
private socketCollection;
private subscriptionCollection;
constructor(engineUrl: string);
/**
* Disconnects the socket associated with the given identity.
*
* @param identity The identity to disconnect.
*/
disconnectSocket(identity: Identity): void;
/**
* Disposes all sockets.
*/
disconnectSocket(accessor: IdentityAccessor): void;
dispose(): void;
/**
* Creates a new socket.io subscription for the given eventName.
*
* @param identity The identity for which to create the subscription.
* @param eventName The event to subscribe to.
* @param callback The callback to execute when the event gets triggered.
* @param subscribeOnce If true, the subscription will be disposed after the event was received once.
*/
createSocketIoSubscription(identity: Identity, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Subscription;
/**
* Removes the given subscription from the socket associated with the given identity.
*
* @param identity The identity for which to remove a subscription.
* @param subscription The subscription to remove.
*/
removeSocketIoSubscription(identity: Identity, subscription: Subscription): void;
getSocketForIdentity(identity: Identity): Socket;
createSocketIoSubscriptionSync(accessor: IdentityAccessor, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Subscription;
createSocketIoSubscription(accessor: IdentityAccessor, eventName: string, callback: (...args: any[]) => void, subscribeOnce: boolean): Promise<Subscription>;
removeSocketIoSubscription(accessor: IdentityAccessor, subscription: Subscription): void;
getSocketForIdentity(accessor: IdentityAccessor): Socket;
private createSocketForIdentitySync;
private createSocketForIdentity;
private buildSocketWithContext;
private getSocketContext;
private ensureSocketContextIsinitialized;
private addNewSubscriptionToSocketContext;
private getRecreateWhenIdentityIsRefreshedFunction;
private applySubscriptionsToSocket;
}

@@ -1,2 +0,3 @@

import { DataModels, IManualTaskExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk';
import { DataModels, IManualTaskExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk';
import { IdentityLike } from '../IdentityAccessor';
import { BaseClient } from './BaseClient';

@@ -6,3 +7,3 @@ type ManualTaskList = DataModels.FlowNodeInstances.ManualTaskList;

query(query: DataModels.FlowNodeInstances.ManualTaskQuery, options?: {
identity?: Identity;
identity?: IdentityLike;
offset?: number;

@@ -12,13 +13,13 @@ limit?: number;

}): Promise<ManualTaskList>;
finishManualTask(manualTaskInstanceId: string, identity?: Identity): Promise<void>;
finishManualTask(manualTaskInstanceId: string, identity?: IdentityLike): Promise<void>;
onManualTaskWaiting(callback: Messages.CallbackTypes.OnManualTaskWaitingCallback, options?: {
subscribeOnce?: boolean;
identity?: Identity;
identity?: IdentityLike;
}): Promise<Subscription>;
onManualTaskFinished(callback: Messages.CallbackTypes.OnManualTaskFinishedCallback, options?: {
subscribeOnce?: boolean;
identity?: Identity;
identity?: IdentityLike;
}): Promise<Subscription>;
removeSubscription(subscription: Subscription, identity?: Identity): void;
removeSubscription(subscription: Subscription, identity?: IdentityLike): void;
}
export {};

@@ -1,198 +0,207 @@

import { INotificationExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk';
import { Messages as ClientMessages } from '../Types/index';
import { INotificationExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk';
import { IdentityLike } from '../IdentityAccessor';
import { OnConnected, OnDisconnected, OnReconnected } from '../Types/NotificationCallbackTypes';
import { BaseClient } from './BaseClient';
export interface INotificationHttpClient extends INotificationExtensionAdapter {
onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean): Subscription;
onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean): Subscription;
onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean): Subscription;
onConnected(callback: OnConnected, subscribeOnce?: boolean): Subscription;
onDisconnected(callback: OnDisconnected, subscribeOnce?: boolean): Subscription;
onReconnected(callback: OnReconnected, subscribeOnce?: boolean): Subscription;
}
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: OnConnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
onDisconnected(callback: OnDisconnected, subscribeOnce?: boolean, identity?: IdentityLike): Subscription;
onReconnected(callback: 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;
/**
* If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
useLegacyEndpoint?: boolean;
}): Promise<Subscription>;
onUntypedTaskFinished(callback: Messages.CallbackTypes.OnUntypedTaskFinishedCallback, options?: {
subscribeOnce?: boolean;
identity?: Identity;
identity?: IdentityLike;
/**
* If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
useLegacyEndpoint?: boolean;
}): 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,23 @@ limit?: number;

}): Promise<UntypedTaskList>;
finishTask(taskInstanceId: string, identity?: Identity): Promise<void>;
/**
* @param useLegacyEndpoint If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
finishTask(taskInstanceId: string, identity?: IdentityLike, useLegacyEndpoint?: boolean): Promise<void>;
onUntypedTaskWaiting(callback: Messages.CallbackTypes.OnUntypedTaskWaitingCallback, options?: {
subscribeOnce?: boolean;
identity?: Identity;
identity?: IdentityLike;
/**
* If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
useLegacyEndpoint?: boolean;
}): Promise<Subscription>;
onUntypedTaskFinished(callback: Messages.CallbackTypes.OnUntypedTaskFinishedCallback, options?: {
subscribeOnce?: boolean;
identity?: Identity;
identity?: IdentityLike;
/**
* If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
useLegacyEndpoint?: boolean;
}): 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 @@ };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationInfoHttpClient = void 0;
const index_1 = require("../Types/index");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const BaseClient_1 = require("./BaseClient");
class ApplicationInfoHttpClient extends BaseClient_1.BaseClient {
async getApplicationInfo() {
const requestAuthHeaders = this.createRequestAuthHeaders(this.identity);
const url = this.buildUrl(index_1.restSettings.paths.getApplicationInfo);
const requestAuthHeaders = await this.createRequestAuthHeaders();
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.getApplicationInfo);
const httpResponse = await this.httpClient.get(url, requestAuthHeaders);

@@ -14,4 +14,4 @@ return httpResponse.result;

async getAuthorityAddress() {
const requestAuthHeaders = this.createRequestAuthHeaders(this.identity);
const url = this.buildUrl(index_1.restSettings.paths.getAuthorityAddress);
const requestAuthHeaders = await this.createRequestAuthHeaders();
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.getAuthorityAddress);
const httpResponse = await this.httpClient.get(url, requestAuthHeaders);

@@ -21,9 +21,9 @@ return httpResponse.result;

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);
}

@@ -30,0 +30,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseClient = void 0;
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const HttpClient_1 = require("../HttpClient");
const index_1 = require("../Types/index");
const IdentityAccessor_1 = require("../IdentityAccessor");
class BaseClient {
identity;
identityAccessor;
httpClient;
socketIoManager;
baseUrl = `${index_1.restSettings.baseRoute}/v1`;
baseUrl = `${processcube_engine_sdk_1.EngineRestApiSettings.baseRoute}/v1`;
engineUrl;

@@ -18,3 +19,3 @@ constructor(engineUrl, identity, socketIoManager) {

this.engineUrl = engineUrl;
this.identity = identity;
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(identity, engineUrl);
this.socketIoManager = socketIoManager;

@@ -25,3 +26,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;

@@ -37,10 +38,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);
}

@@ -52,2 +54,3 @@ }

}
this.identityAccessor.dispose();
}

@@ -71,4 +74,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 = {

@@ -87,9 +91,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);
}

@@ -96,0 +104,0 @@ addParameterToUrl(url, parameterName, parameterValue) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CorrelationHttpClient = void 0;
const index_1 = require("../Types/index");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const BaseClient_1 = require("./BaseClient");
class CorrelationHttpClient extends BaseClient_1.BaseClient {
async getAll(options) {
let urlRestPart = index_1.restSettings.paths.getCorrelations;
let urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.getCorrelations;
if (options?.includeProcessInstances) {

@@ -13,3 +13,3 @@ urlRestPart = `${urlRestPart}?includeProcessInstances=${options?.includeProcessInstances}`;

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);

@@ -19,3 +19,3 @@ return response.result;

async getById(correlationId, options) {
let urlRestPart = index_1.restSettings.paths.getCorrelationById.replace(index_1.restSettings.params.correlationId, correlationId);
let urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.getCorrelationById.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.correlationId, correlationId);
if (options?.includeProcessInstances) {

@@ -25,3 +25,3 @@ urlRestPart = `${urlRestPart}?includeProcessInstances=${options?.includeProcessInstances}`;

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);

@@ -28,0 +28,0 @@ return response.result;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CronjobHttpClient = void 0;
const index_1 = require("../Types/index");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const BaseClient_1 = require("./BaseClient");

@@ -9,4 +9,4 @@ const Mappers_1 = require("./Lib/Mappers");

async query(query, options) {
const url = this.buildUrl(index_1.restSettings.paths.getDeployedCronjobs, options?.offset, options?.limit, query, options?.sortSettings);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.queryCronjobs, options?.offset, options?.limit, query, options?.sortSettings);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -20,9 +20,13 @@ const mappedResult = {

async enableCronjob(processModelId, flowNodeId, identity) {
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 url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.enableCronjob)
.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, processModelId)
.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.flowNodeId, flowNodeId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.post(url, undefined, requestAuthHeaders);
}
async disableCronjob(processModelId, flowNodeId, identity) {
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 url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.disableCronjob)
.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, processModelId)
.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.flowNodeId, flowNodeId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.post(url, undefined, requestAuthHeaders);

@@ -29,0 +33,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataObjectInstanceHttpClient = void 0;
const index_1 = require("../Types/index");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const BaseClient_1 = require("./BaseClient");

@@ -9,4 +9,4 @@ const Mappers_1 = require("./Lib/Mappers");

async query(query, options) {
const url = this.buildUrl(index_1.restSettings.paths.getDataObjects, options?.offset, options?.limit, query, options?.sortSettings);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.getDataObjects, options?.offset, options?.limit, query, options?.sortSettings);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -13,0 +13,0 @@ const mappedResult = {

@@ -5,3 +5,2 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const index_1 = require("../Types/index");
const BaseClient_1 = require("./BaseClient");

@@ -15,4 +14,4 @@ const Mappers_1 = require("./Lib/Mappers");

};
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -26,4 +25,4 @@ const mappedResult = {

async triggerMessageEvent(messageName, options) {
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
let urlRestPart = index_1.restSettings.paths.triggerMessageEvent.replace(index_1.restSettings.params.eventName, messageName);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
let urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.triggerMessageEvent.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.eventName, messageName);
if (options?.processInstanceId) {

@@ -36,4 +35,4 @@ urlRestPart = `${urlRestPart}?process_instance_id=${options?.processInstanceId}`;

async triggerSignalEvent(signalName, options) {
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
let urlRestPart = index_1.restSettings.paths.triggerSignalEvent.replace(index_1.restSettings.params.eventName, signalName);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
let urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.triggerSignalEvent.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.eventName, signalName);
if (options?.processInstanceId) {

@@ -46,4 +45,4 @@ urlRestPart = `${urlRestPart}?process_instance_id=${options?.processInstanceId}`;

async triggerTimerEvent(flowNodeInstanceId, options) {
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
let urlRestPart = index_1.restSettings.paths.triggerTimerEvent.replace(index_1.restSettings.params.flowNodeInstanceId, flowNodeInstanceId);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
let urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.triggerTimerEvent.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.flowNodeInstanceId, flowNodeInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -53,27 +52,27 @@ await this.httpClient.post(url, undefined, requestAuthHeaders);

async onBoundaryEventTriggered(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.boundaryEventTriggered, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.boundaryEventTriggered, callback, options?.subscribeOnce, options?.identity);
}
async onBoundaryEventFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.boundaryEventFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.boundaryEventFinished, callback, options?.subscribeOnce, options?.identity);
}
async onIntermediateThrowEventTriggered(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.intermediateThrowEventTriggered, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.intermediateThrowEventTriggered, callback, options?.subscribeOnce, options?.identity);
}
async onIntermediateCatchEventReached(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.intermediateCatchEventReached, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.intermediateCatchEventReached, callback, options?.subscribeOnce, options?.identity);
}
async onIntermediateCatchEventFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.intermediateCatchEventFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.intermediateCatchEventFinished, callback, options?.subscribeOnce, options?.identity);
}
async onMessageTriggered(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.messageTriggered, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.messageTriggered, callback, options?.subscribeOnce, options?.identity);
}
async onSignalTriggered(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.signalTriggered, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.signalTriggered, callback, options?.subscribeOnce, options?.identity);
}
async onStartEventFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.startEventFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.startEventFinished, callback, options?.subscribeOnce, options?.identity);
}
async onEndEventFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.endEventFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.endEventFinished, callback, options?.subscribeOnce, options?.identity);
}

@@ -80,0 +79,0 @@ removeSubscription(subscription, identity) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExternalTaskApiClient = void 0;
const index_1 = require("../Types/index");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const BaseClient_1 = require("./BaseClient");

@@ -9,4 +9,4 @@ const Mappers_1 = require("./Lib/Mappers");

async getAllDeployedTopics(identity) {
const url = this.buildUrl(index_1.restSettings.paths.getAllDeployedTopics);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.getAllDeployedTopics);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -24,4 +24,4 @@ return response.result;

};
const url = this.buildUrl(index_1.restSettings.paths.fetchAndLockExternalTasks);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.fetchAndLockExternalTasks);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const response = await this.httpClient.post(url, httpPayload, requestAuthHeaders, abortSignal);

@@ -36,5 +36,5 @@ const mappedResult = response.result.map((result) => (0, Mappers_1.mapExternalTask)(result));

};
const endpoint = index_1.restSettings.paths.extendExternalTaskLock.replace(index_1.restSettings.params.externalTaskId, externalTaskId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.extendExternalTaskLock.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.externalTaskId, externalTaskId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.put(url, httpPayload, requestAuthHeaders, abortSignal);

@@ -47,5 +47,5 @@ }

};
const endpoint = index_1.restSettings.paths.finishExternalTaskWithError.replace(index_1.restSettings.params.externalTaskId, externalTaskId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.finishExternalTaskWithError.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.externalTaskId, externalTaskId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.put(url, httpPayload, requestAuthHeaders, abortSignal);

@@ -58,5 +58,5 @@ }

};
const endpoint = index_1.restSettings.paths.finishExternalTask.replace(index_1.restSettings.params.externalTaskId, externalTaskId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.finishExternalTask.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.externalTaskId, externalTaskId);
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;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlowNodeInstanceHttpClient = void 0;
const index_1 = require("../Types/index");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const BaseClient_1 = require("./BaseClient");

@@ -9,4 +9,4 @@ const Mappers_1 = require("./Lib/Mappers");

async query(query, options) {
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, query, options?.sortSettings);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, query, options?.sortSettings);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -19,5 +19,10 @@ const mappedResult = {

}
async finishUntypedTask(taskInstanceId, identity) {
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const urlRestPart = index_1.restSettings.paths.finishUntypedTask.replace(index_1.restSettings.params.untypedTaskInstanceId, taskInstanceId);
/**
* @param useLegacyEndpoint If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
async finishUntypedTask(taskInstanceId, identity, useLegacyEndpoint) {
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const urlRestPart = useLegacyEndpoint === true
? processcube_engine_sdk_1.EngineRestApiSettings.paths.finishEmptyActivity.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.emptyActivityInstanceId, taskInstanceId)
: processcube_engine_sdk_1.EngineRestApiSettings.paths.finishUntypedTask.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.untypedTaskInstanceId, taskInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -27,4 +32,4 @@ await this.httpClient.put(url, {}, requestAuthHeaders);

async finishManualTask(manualTaskInstanceId, identity) {
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const urlRestPart = index_1.restSettings.paths.finishManualTask.replace(index_1.restSettings.params.manualTaskInstanceId, manualTaskInstanceId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.finishManualTask.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.manualTaskInstanceId, manualTaskInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -34,4 +39,4 @@ await this.httpClient.put(url, {}, requestAuthHeaders);

async finishUserTask(userTaskInstanceId, userTaskResult, identity) {
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const urlRestPart = index_1.restSettings.paths.finishUserTask.replace(index_1.restSettings.params.userTaskInstanceId, userTaskInstanceId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.finishUserTask.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.userTaskInstanceId, userTaskInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -41,4 +46,4 @@ await this.httpClient.put(url, userTaskResult, requestAuthHeaders);

async triggerMessageEvent(messageName, options) {
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
let urlRestPart = index_1.restSettings.paths.triggerMessageEvent.replace(index_1.restSettings.params.eventName, messageName);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
let urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.triggerMessageEvent.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.eventName, messageName);
if (options?.processInstanceId) {

@@ -51,4 +56,4 @@ urlRestPart = `${urlRestPart}?process_instance_id=${options?.processInstanceId}`;

async triggerSignalEvent(signalName, options) {
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
let urlRestPart = index_1.restSettings.paths.triggerSignalEvent.replace(index_1.restSettings.params.eventName, signalName);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
let urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.triggerSignalEvent.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.eventName, signalName);
if (options?.processInstanceId) {

@@ -55,0 +60,0 @@ urlRestPart = `${urlRestPart}?process_instance_id=${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);

@@ -40,17 +40,11 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const index_1 = require("../../Types/index");
class SocketIoManager {
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) {

@@ -60,64 +54,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) {

@@ -133,5 +122,5 @@ return existingSocket;

const hostPath = indexOfLastSlash === -1 ? this.engineUrl : this.engineUrl.split('://')[0] + '://' + urlWithoutProtocol.substring(0, indexOfLastSlash);
const socketUrl = `${hostPath}/${index_1.socketSettings.namespace}`;
const socketUrl = `${hostPath}/${processcube_engine_sdk_1.EngineSocketIoSettings.namespace}`;
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',

@@ -147,6 +136,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

@@ -5,3 +5,2 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const index_1 = require("../Types/index");
const BaseClient_1 = require("./BaseClient");

@@ -15,4 +14,4 @@ const Mappers_1 = require("./Lib/Mappers");

};
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -26,4 +25,4 @@ const mappedResult = {

async finishManualTask(manualTaskInstanceId, identity) {
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const urlRestPart = index_1.restSettings.paths.finishManualTask.replace(index_1.restSettings.params.manualTaskInstanceId, manualTaskInstanceId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.finishManualTask.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.manualTaskInstanceId, manualTaskInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -33,6 +32,6 @@ await this.httpClient.put(url, {}, requestAuthHeaders);

async onManualTaskWaiting(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.manualTaskWaiting, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.manualTaskWaiting, callback, options?.subscribeOnce, options?.identity);
}
async onManualTaskFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.manualTaskFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.manualTaskFinished, callback, options?.subscribeOnce, options?.identity);
}

@@ -39,0 +38,0 @@ removeSubscription(subscription, identity) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotificationHttpClient = void 0;
const index_1 = require("../Types/index");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const BaseClient_1 = require("./BaseClient");

@@ -11,147 +11,153 @@ class NotificationHttpClient extends BaseClient_1.BaseClient {

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);
}
async onActivityError(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.activityError, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.activityError, callback, options?.subscribeOnce, options?.identity);
}
async onProcessDeployed(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processDeployed, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processDeployed, callback, options?.subscribeOnce, options?.identity);
}
async onProcessUndeployed(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processUndeployed, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processUndeployed, callback, options?.subscribeOnce, options?.identity);
}
async onProcessIsExecutableChanged(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processExecutableChanged, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processExecutableChanged, callback, options?.subscribeOnce, options?.identity);
}
async onCronjobEnabledChanged(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.cronjobEnabledChanged, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.cronjobEnabledChanged, callback, options?.subscribeOnce, options?.identity);
}
async onProcessStarting(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processStarting, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processStarting, callback, options?.subscribeOnce, options?.identity);
}
async onProcessStarted(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processStarted, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processStarted, callback, options?.subscribeOnce, options?.identity);
}
async onProcessResumed(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processResumed, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processResumed, callback, options?.subscribeOnce, options?.identity);
}
async onProcessEnded(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processEnded, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processEnded, callback, options?.subscribeOnce, options?.identity);
}
async onProcessOwnerChanged(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processInstanceOwnerChanged, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processInstanceOwnerChanged, callback, options?.subscribeOnce, options?.identity);
}
async onProcessTerminated(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processTerminated, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processTerminated, callback, options?.subscribeOnce, options?.identity);
}
async onProcessError(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processError, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processError, callback, options?.subscribeOnce, options?.identity);
}
async onProcessInstancesDeleted(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processInstancesDeleted, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processInstancesDeleted, callback, options?.subscribeOnce, options?.identity);
}
async onCronjobCreated(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.cronjobCreated, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.cronjobCreated, callback, options?.subscribeOnce, options?.identity);
}
async onCronjobStopped(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.cronjobStopped, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.cronjobStopped, callback, options?.subscribeOnce, options?.identity);
}
async onCronjobUpdated(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.cronjobUpdated, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.cronjobUpdated, callback, options?.subscribeOnce, options?.identity);
}
async onCronjobExecuted(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.cronjobExecuted, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.cronjobExecuted, callback, options?.subscribeOnce, options?.identity);
}
async onCronjobRemoved(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.cronjobRemoved, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.cronjobRemoved, callback, options?.subscribeOnce, options?.identity);
}
async onActivityReached(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.activityReached, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.activityReached, callback, options?.subscribeOnce, options?.identity);
}
async onActivityFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.activityFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.activityFinished, callback, options?.subscribeOnce, options?.identity);
}
async onActivityCanceled(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.activityCanceled, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.activityCanceled, callback, options?.subscribeOnce, options?.identity);
}
async onUntypedTaskWaiting(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.untypedTaskWaiting, callback, options?.subscribeOnce, options?.identity);
if (options?.useLegacyEndpoint === true) {
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.emptyActivityWaiting, callback, options?.subscribeOnce, options?.identity);
}
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.untypedTaskWaiting, callback, options?.subscribeOnce, options?.identity);
}
async onUntypedTaskFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.untypedTaskFinished, callback, options?.subscribeOnce, options?.identity);
if (options?.useLegacyEndpoint === true) {
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.emptyActivityFinished, callback, options?.subscribeOnce, options?.identity);
}
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.untypedTaskFinished, callback, options?.subscribeOnce, options?.identity);
}
async onManualTaskWaiting(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.manualTaskWaiting, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.manualTaskWaiting, callback, options?.subscribeOnce, options?.identity);
}
async onManualTaskFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.manualTaskFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.manualTaskFinished, callback, options?.subscribeOnce, options?.identity);
}
async onUserTaskWaiting(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.userTaskWaiting, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.userTaskWaiting, callback, options?.subscribeOnce, options?.identity);
}
async onUserTaskFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.userTaskFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.userTaskFinished, callback, options?.subscribeOnce, options?.identity);
}
async onUserTaskReserved(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.userTaskReserved, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.userTaskReserved, callback, options?.subscribeOnce, options?.identity);
}
async onUserTaskReservationCanceled(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.userTaskReservationCanceled, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.userTaskReservationCanceled, callback, options?.subscribeOnce, options?.identity);
}
async onBoundaryEventWaiting(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.boundaryEventWaiting, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.boundaryEventWaiting, callback, options?.subscribeOnce, options?.identity);
}
async onBoundaryEventTriggered(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.boundaryEventTriggered, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.boundaryEventTriggered, callback, options?.subscribeOnce, options?.identity);
}
async onBoundaryEventFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.boundaryEventFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.boundaryEventFinished, callback, options?.subscribeOnce, options?.identity);
}
async onIntermediateThrowEventTriggered(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.intermediateThrowEventTriggered, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.intermediateThrowEventTriggered, callback, options?.subscribeOnce, options?.identity);
}
async onIntermediateCatchEventReached(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.intermediateCatchEventReached, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.intermediateCatchEventReached, callback, options?.subscribeOnce, options?.identity);
}
async onIntermediateCatchEventFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.intermediateCatchEventFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.intermediateCatchEventFinished, callback, options?.subscribeOnce, options?.identity);
}
async onFlowNodeEventRetrySending(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.flowNodeEventRetrySending, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.flowNodeEventRetrySending, callback, options?.subscribeOnce, options?.identity);
}
async onMessageTriggered(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.messageTriggered, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.messageTriggered, callback, options?.subscribeOnce, options?.identity);
}
async onSignalTriggered(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.signalTriggered, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.signalTriggered, callback, options?.subscribeOnce, options?.identity);
}
async onStartEventFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.startEventFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.startEventFinished, callback, options?.subscribeOnce, options?.identity);
}
async onEndEventFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.endEventFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.endEventFinished, callback, options?.subscribeOnce, options?.identity);
}
async onExternalTaskCreated(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.externalTaskCreated, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.externalTaskCreated, callback, options?.subscribeOnce, options?.identity);
}
async onExternalTaskLocked(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.externalTaskLocked, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.externalTaskLocked, callback, options?.subscribeOnce, options?.identity);
}
async onExternalTaskUnlocked(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.externalTaskUnlocked, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.externalTaskUnlocked, callback, options?.subscribeOnce, options?.identity);
}
async onProcessInstanceMetadataChanged(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.processInstanceMetadataChanged, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.processInstanceMetadataChanged, callback, options?.subscribeOnce, options?.identity);
}
async onCorrelationMetadataChanged(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.correlationMetadataChanged, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.correlationMetadataChanged, callback, options?.subscribeOnce, options?.identity);
}
async onGatewayFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.gatewayFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.gatewayFinished, callback, options?.subscribeOnce, options?.identity);
}

@@ -158,0 +164,0 @@ }

@@ -5,3 +5,2 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const index_1 = require("../Types/index");
const BaseClient_1 = require("./BaseClient");

@@ -11,4 +10,4 @@ const Mappers_1 = require("./Lib/Mappers");

async getAll(options) {
const url = this.buildUrl(index_1.restSettings.paths.getProcessDefinitions, options?.offset, options?.limit);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.getProcessDefinitions, options?.offset, options?.limit);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -22,5 +21,5 @@ const result = response.result;

async getById(processDefinitionId, identity) {
const endpoint = index_1.restSettings.paths.getProcessDefinitionById.replace(index_1.restSettings.params.processDefinitionId, processDefinitionId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.getProcessDefinitionById.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processDefinitionId, processDefinitionId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -31,5 +30,5 @@ const processDefinition = (0, Mappers_1.mapProcessDefinition)(response.result);

async getByProcessModelId(processModelId, identity) {
const endpoint = index_1.restSettings.paths.getProcessDefinitionForProcessModel.replace(index_1.restSettings.params.processModelId, processModelId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.getProcessDefinitionForProcessModel.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, processModelId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -44,4 +43,4 @@ const processDefinition = (0, Mappers_1.mapProcessDefinition)(response.result);

};
const url = this.buildUrl(index_1.restSettings.paths.persistProcessDefinitions);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.persistProcessDefinitions);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
await this.httpClient.post(url, httpPayload, requestAuthHeaders);

@@ -53,4 +52,4 @@ }

async startProcessInstance(options, identity) {
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance).replace(index_1.restSettings.params.processModelId, options?.processModelId);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.startProcessInstance).replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, options?.processModelId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const processStartRequest = {

@@ -64,4 +63,4 @@ ...options,

async startProcessInstanceAndAwaitEndEvent(options, identity) {
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.startProcessInstance);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const processStartRequest = {

@@ -75,4 +74,4 @@ ...options,

async startProcessInstanceAndAwaitSpecificEndEvent(options, endEventId, identity) {
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.startProcessInstance);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const processStartRequest = {

@@ -92,3 +91,3 @@ ...options,

async deleteById(processDefinitionId, identity, deleteAllRelatedData = false) {
const endpoint = index_1.restSettings.paths.deleteProcessDefinition.replace(index_1.restSettings.params.processDefinitionId, processDefinitionId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.deleteProcessDefinition.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processDefinitionId, processDefinitionId);
let url = this.buildUrl(endpoint);

@@ -98,3 +97,3 @@ if (deleteAllRelatedData) {

}
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.delete(url, requestAuthHeaders);

@@ -101,0 +100,0 @@ }

@@ -5,3 +5,2 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const index_1 = require("../Types/index");
const BaseClient_1 = require("./BaseClient");

@@ -11,5 +10,5 @@ const Mappers_1 = require("./Lib/Mappers");

async query(query, options) {
let url = this.buildUrl(index_1.restSettings.paths.queryProcessInstances, options?.offset, options?.limit, query, options?.sortSettings);
let url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.queryProcessInstances, options?.offset, options?.limit, query, options?.sortSettings);
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);

@@ -23,5 +22,5 @@ const mappedResult = {

async getChildProcessInstanceIds(processInstanceId, options) {
const endpoint = index_1.restSettings.paths.getChildProcessInstanceIds.replace(index_1.restSettings.params.processInstanceId, processInstanceId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.getChildProcessInstanceIds.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processInstanceId, processInstanceId);
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);

@@ -31,5 +30,5 @@ return response.result;

async getAncestorProcessInstanceIds(processInstanceId, options) {
const endpoint = index_1.restSettings.paths.getAncestorProcessInstanceIds.replace(index_1.restSettings.params.processInstanceId, processInstanceId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.getAncestorProcessInstanceIds.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processInstanceId, processInstanceId);
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);

@@ -39,5 +38,5 @@ return response.result;

async getProcessDefinition(processInstanceId, identity) {
const endpoint = index_1.restSettings.paths.getProcessDefinitionForProcessInstance.replace(index_1.restSettings.params.processInstanceId, processInstanceId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.getProcessDefinitionForProcessInstance.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processInstanceId, processInstanceId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -48,5 +47,5 @@ const processDefinition = (0, Mappers_1.mapProcessDefinition)(response.result);

async getProcessModel(processInstanceId, identity) {
const endpoint = index_1.restSettings.paths.getProcessModelForProcessInstance.replace(index_1.restSettings.params.processInstanceId, processInstanceId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.getProcessModelForProcessInstance.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processInstanceId, processInstanceId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -57,11 +56,11 @@ const processModel = (0, Mappers_1.mapProcessModel)(response.result);

async transferOwnership(processInstanceId, newOwner, identity) {
const endpoint = index_1.restSettings.paths.changeProcessInstanceOwner.replace(index_1.restSettings.params.processInstanceId, processInstanceId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.changeProcessInstanceOwner.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processInstanceId, processInstanceId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.put(url, { newOwner: newOwner }, requestAuthHeaders);
}
async terminateProcessInstance(processInstanceId, identity) {
const endpoint = index_1.restSettings.paths.terminateProcessInstances.replace(index_1.restSettings.params.processInstanceId, processInstanceId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.terminateProcessInstances.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processInstanceId, processInstanceId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
try {

@@ -75,3 +74,3 @@ await this.httpClient.put(url, {}, requestAuthHeaders);

async retryProcessInstance(processInstanceId, options) {
const endpoint = index_1.restSettings.paths.retryProcessInstance.replace(index_1.restSettings.params.processInstanceId, processInstanceId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.retryProcessInstance.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processInstanceId, processInstanceId);
let url = this.buildUrl(endpoint);

@@ -84,3 +83,3 @@ if (options?.flowNodeInstanceId) {

}
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
try {

@@ -95,3 +94,3 @@ await this.httpClient.put(url, { newStartToken: options?.newStartToken }, requestAuthHeaders);

const serializedProcessInstanceIds = Array.isArray(processInstanceIds) ? processInstanceIds.join(';') : processInstanceIds;
let url = this.buildUrl(index_1.restSettings.paths.deleteProcessInstances);
let url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.deleteProcessInstances);
url = this.addParameterToUrl(url, 'process_instance_ids', serializedProcessInstanceIds);

@@ -101,3 +100,3 @@ if (deleteAllRelatedData) {

}
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.delete(url, requestAuthHeaders);

@@ -104,0 +103,0 @@ }

@@ -5,3 +5,2 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const index_1 = require("../Types/index");
const BaseClient_1 = require("./BaseClient");

@@ -11,4 +10,4 @@ const Mappers_1 = require("./Lib/Mappers");

async getAll(options) {
const url = this.buildUrl(index_1.restSettings.paths.getAllProcessModels, options?.offset, options?.limit);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.getAllProcessModels, options?.offset, options?.limit);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -22,5 +21,5 @@ const result = response.result;

async getById(processModelId, identity) {
const endpoint = index_1.restSettings.paths.getProcessModelById.replace(index_1.restSettings.params.processModelId, processModelId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.getProcessModelById.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, processModelId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -31,5 +30,5 @@ const processModel = response.result;

async getByProcessInstanceId(processInstanceId, identity) {
const endpoint = index_1.restSettings.paths.getProcessModelForProcessInstance.replace(index_1.restSettings.params.processInstanceId, processInstanceId);
const endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.getProcessModelForProcessInstance.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processInstanceId, processInstanceId);
const url = this.buildUrl(endpoint);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -40,4 +39,4 @@ const processModel = (0, Mappers_1.mapProcessModel)(response.result);

async startProcessInstance(options, identity) {
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance).replace(index_1.restSettings.params.processModelId, options?.processModelId);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.startProcessInstance).replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, options?.processModelId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const processStartRequest = {

@@ -51,4 +50,4 @@ ...options,

async startProcessInstanceAndAwaitEndEvent(options, identity) {
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.startProcessInstance);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const processStartRequest = {

@@ -62,4 +61,4 @@ ...options,

async startProcessInstanceAndAwaitSpecificEndEvent(options, endEventId, identity) {
const url = this.buildUrl(index_1.restSettings.paths.startProcessInstance);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.startProcessInstance);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const processStartRequest = {

@@ -79,3 +78,3 @@ ...options,

async deleteDefinitionByProcessModelId(processModelId, options) {
let endpoint = index_1.restSettings.paths.deleteProcessDefinitionByProcessModelId.replace(index_1.restSettings.params.processModelId, processModelId);
let endpoint = processcube_engine_sdk_1.EngineRestApiSettings.paths.deleteProcessDefinitionByProcessModelId.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, processModelId);
let url = this.buildUrl(endpoint);

@@ -88,13 +87,13 @@ if (options?.force) {

}
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
await this.httpClient.delete(url, requestAuthHeaders);
}
async enableProcessModel(processModelId, identity) {
const url = this.buildUrl(index_1.restSettings.paths.enableProcessModel).replace(index_1.restSettings.params.processModelId, processModelId);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.enableProcessModel).replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, processModelId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.post(url, undefined, requestAuthHeaders);
}
async disableProcessModel(processModelId, identity) {
const url = this.buildUrl(index_1.restSettings.paths.disableProcessModel).replace(index_1.restSettings.params.processModelId, processModelId);
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.disableProcessModel).replace(processcube_engine_sdk_1.EngineRestApiSettings.params.processModelId, processModelId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
await this.httpClient.post(url, undefined, requestAuthHeaders);

@@ -101,0 +100,0 @@ }

@@ -5,3 +5,2 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const index_1 = require("../Types/index");
const BaseClient_1 = require("./BaseClient");

@@ -15,4 +14,4 @@ const Mappers_1 = require("./Lib/Mappers");

};
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -25,5 +24,10 @@ const mappedResult = {

}
async finishTask(taskInstanceId, identity) {
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const urlRestPart = index_1.restSettings.paths.finishUntypedTask.replace(index_1.restSettings.params.untypedTaskInstanceId, taskInstanceId);
/**
* @param useLegacyEndpoint If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
async finishTask(taskInstanceId, identity, useLegacyEndpoint) {
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const urlRestPart = useLegacyEndpoint === true
? processcube_engine_sdk_1.EngineRestApiSettings.paths.finishEmptyActivity.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.emptyActivityInstanceId, taskInstanceId)
: processcube_engine_sdk_1.EngineRestApiSettings.paths.finishUntypedTask.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.untypedTaskInstanceId, taskInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -33,6 +37,12 @@ await this.httpClient.put(url, {}, requestAuthHeaders);

async onUntypedTaskWaiting(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.untypedTaskWaiting, callback, options?.subscribeOnce, options?.identity);
if (options?.useLegacyEndpoint === true) {
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.emptyActivityWaiting, callback, options?.subscribeOnce, options?.identity);
}
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.untypedTaskWaiting, callback, options?.subscribeOnce, options?.identity);
}
async onUntypedTaskFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.untypedTaskFinished, callback, options?.subscribeOnce, options?.identity);
if (options?.useLegacyEndpoint === true) {
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.emptyActivityFinished, callback, options?.subscribeOnce, options?.identity);
}
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.untypedTaskFinished, callback, options?.subscribeOnce, options?.identity);
}

@@ -39,0 +49,0 @@ removeSubscription(subscription, identity) {

@@ -5,3 +5,2 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const index_1 = require("../Types/index");
const BaseClient_1 = require("./BaseClient");

@@ -15,4 +14,4 @@ const Mappers_1 = require("./Lib/Mappers");

};
const url = this.buildUrl(index_1.restSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings);
const requestAuthHeaders = this.createRequestAuthHeaders(options?.identity);
const url = this.buildUrl(processcube_engine_sdk_1.EngineRestApiSettings.paths.queryFlowNodeInstances, options?.offset, options?.limit, enhancedQuery, options?.sortSettings);
const requestAuthHeaders = await this.createRequestAuthHeaders(options?.identity);
const response = await this.httpClient.get(url, requestAuthHeaders);

@@ -26,4 +25,4 @@ const mappedResult = {

async reserveUserTaskInstance(identity, flowNodeInstanceId, actualOwnerId) {
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const urlRestPart = index_1.restSettings.paths.reserveUserTaskInstance.replace(index_1.restSettings.params.userTaskInstanceId, flowNodeInstanceId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.reserveUserTaskInstance.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.userTaskInstanceId, flowNodeInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -33,4 +32,4 @@ await this.httpClient.put(url, { actualOwnerId: actualOwnerId }, requestAuthHeaders);

async cancelUserTaskInstanceReservation(identity, flowNodeInstanceId) {
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const urlRestPart = index_1.restSettings.paths.cancelUserTaskInstanceReservation.replace(index_1.restSettings.params.userTaskInstanceId, flowNodeInstanceId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.cancelUserTaskInstanceReservation.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.userTaskInstanceId, flowNodeInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -40,4 +39,4 @@ await this.httpClient.delete(url, requestAuthHeaders);

async finishUserTask(userTaskInstanceId, userTaskResult, identity) {
const requestAuthHeaders = this.createRequestAuthHeaders(identity);
const urlRestPart = index_1.restSettings.paths.finishUserTask.replace(index_1.restSettings.params.userTaskInstanceId, userTaskInstanceId);
const requestAuthHeaders = await this.createRequestAuthHeaders(identity);
const urlRestPart = processcube_engine_sdk_1.EngineRestApiSettings.paths.finishUserTask.replace(processcube_engine_sdk_1.EngineRestApiSettings.params.userTaskInstanceId, userTaskInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -47,12 +46,12 @@ await this.httpClient.put(url, userTaskResult, requestAuthHeaders);

async onUserTaskWaiting(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.userTaskWaiting, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.userTaskWaiting, callback, options?.subscribeOnce, options?.identity);
}
async onUserTaskFinished(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.userTaskFinished, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.userTaskFinished, callback, options?.subscribeOnce, options?.identity);
}
async onUserTaskReserved(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.userTaskReserved, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.userTaskReserved, callback, options?.subscribeOnce, options?.identity);
}
async onUserTaskReservationCanceled(callback, options) {
return this.createSocketIoSubscription(index_1.socketSettings.paths.userTaskReservationCanceled, callback, options?.subscribeOnce, options?.identity);
return this.createSocketIoSubscription(processcube_engine_sdk_1.EngineSocketIoSettings.paths.userTaskReservationCanceled, callback, options?.subscribeOnce, options?.identity);
}

@@ -59,0 +58,0 @@ removeSubscription(subscription, identity) {

@@ -5,2 +5,3 @@ "use strict";

const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const IdentityAccessor_1 = require("./IdentityAccessor");
class ExternalTaskExecution {

@@ -12,10 +13,10 @@ externalTask;

topic;
abortSignal;
abortExecutionController = new AbortController();
customErrorHandler;
onHeartbeatCallback = null;
interval;
abortSignalSubscription;
awaitAbortSignal;
abortSignalResolver;
identityAccessor;
logger;
constructor(externalTask, processingFunction, externalTaskClient, config, topic, abortSignal, customErrorHandler) {
isDisposed = false;
constructor(externalTask, processingFunction, externalTaskClient, config, topic, onHeartbeatCallback, customErrorHandler) {
this.externalTask = externalTask;

@@ -25,4 +26,5 @@ this.processingFunction = processingFunction;

this.config = config;
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(config.identity, this.externalTaskClient.getEngineUrl());
this.topic = topic;
this.abortSignal = abortSignal;
this.onHeartbeatCallback = onHeartbeatCallback;
this.customErrorHandler = customErrorHandler;

@@ -35,91 +37,147 @@ this.logger = new processcube_engine_sdk_1.Logger('external_task_execution', {

}
get disposed() {
return this.isDisposed;
}
async execute() {
try {
this.abortSignal.throwIfAborted();
this.startAbortSignalSubscription();
this.startExtendLockInterval();
const result = await Promise.race([this.processingFunction(this.externalTask.payload, this.externalTask, this.abortSignal), this.awaitAbortSignal]);
this.abortSignal.throwIfAborted();
this.stopLockingInterval();
if (typeof this.onHeartbeatCallback === 'function') {
this.onHeartbeatCallback('processExternalTask', this.externalTask.id);
}
const result = await this.processingFunction(this.externalTask.payload, this.externalTask, this.abortExecutionController.signal);
this.stopExtendLockInterval();
if (this.abortExecutionController.signal.aborted) {
return;
}
if (result) {
await this.processResult(result);
}
this.dispose();
}
catch (error) {
this.handleError('processExternalTask', error);
this.logger.error(`Error raised for external task '${this.externalTask.id}' with topic '${this.topic}': `, { err: error });
await this.evaluateError('processExternalTask', error);
await this.handleExternalTaskExecutionError(error);
}
finally {
this.dispose();
}
}
abort() {
this.logger.debug(`Abort Signal has been triggered for External Task Executor ${this.externalTask.id}`);
this.dispose();
}
async dispose() {
this.logger.debug(`Disposong Executor for External Task ${this.externalTask.id}`);
this.stopExtendLockInterval();
if (!this.abortExecutionController.signal.aborted) {
this.abortExecutionController.abort();
}
this.isDisposed = true;
// we explicitly do not dispose the identityAccessor here, since it is shared with the ExternalTaskWorker
}
async processResult(result) {
if (this.abortExecutionController.signal.aborted) {
return;
}
this.logger.trace(`Processing External Task Result ${this.externalTask.id}`, { externalTask: this.externalTask, result: result });
try {
if (result instanceof processcube_engine_sdk_1.ExternalTaskError || result instanceof Error) {
this.logger.trace(`External Task Result ${this.externalTask.id} is an error. The task will be finished as failed.`, { externalTask: this.externalTask, result: result });
return await this.handleExternalTaskExecutionError(result);
}
return await this.externalTaskClient.finishExternalTask(this.config.workerId, this.externalTask.id, result, this.config.identity, this.abortSignal);
if (typeof this.onHeartbeatCallback === 'function') {
this.onHeartbeatCallback('finishExternalTask', this.externalTask.id);
}
this.logger.trace(`Finishing ${this.externalTask.id} regularly.`, { externalTask: this.externalTask, result: result });
return await this.externalTaskClient.finishExternalTask(this.config.workerId, this.externalTask.id, result, await this.identityAccessor.getIdentity(), this.abortExecutionController.signal);
}
catch (error) {
this.handleError('finishExternalTask', error);
const errorIsRetryable = await this.evaluateError('finishExternalTask', error);
if (errorIsRetryable && !this.abortExecutionController.signal.aborted) {
await this.sleep(1000);
return await this.processResult(result);
}
}
}
async handleExternalTaskExecutionError(error) {
if (this.abortSignal.aborted) {
if (this.abortExecutionController.signal.aborted) {
return;
}
this.logger.error(`Error raised for external task '${this.externalTask.id}' with topic '${this.topic}': `, { err: error });
const workerError = new processcube_engine_sdk_1.ExternalTaskError(error?.errorCode || error?.name || 'ExternalTaskExecutionError', error?.errorMessage || error?.message || 'An error occurred while processing the external task.', error?.errorDetails || error?.stack || 'No error details available.');
return await this.externalTaskClient.handleError(this.config.workerId, this.externalTask.id, workerError, this.config.identity);
}
async dispose() {
this.removeAbortSignalSubscription();
this.stopLockingInterval();
}
stopLockingInterval() {
if (this.interval) {
clearInterval(this.interval);
this.interval = undefined;
try {
this.logger.trace(`Reporting Error for External Task ${this.externalTask.id} to Engine`);
const workerError = new processcube_engine_sdk_1.ExternalTaskError(error?.errorCode || error?.name || 'ExternalTaskExecutionError', error?.errorMessage || error?.message || 'An error occurred while processing the external task.', error?.errorDetails || error?.stack || 'No error details available.');
if (typeof this.onHeartbeatCallback === 'function') {
this.onHeartbeatCallback('handleError', this.externalTask.id);
}
return await this.externalTaskClient.handleError(this.config.workerId, this.externalTask.id, workerError, await this.identityAccessor.getIdentity());
}
}
startAbortSignalSubscription() {
this.awaitAbortSignal = new Promise((resolve) => (this.abortSignalResolver = resolve));
this.abortSignalSubscription = () => {
if (this.abortSignalResolver) {
this.abortSignalResolver();
catch (error) {
const errorIsRetryable = await this.evaluateError('finishExternalTask', error);
if (errorIsRetryable && !this.abortExecutionController.signal.aborted) {
await this.sleep(1000);
return await this.handleExternalTaskExecutionError(error);
}
this.dispose();
};
this.abortSignal.addEventListener('abort', this.abortSignalSubscription);
}
removeAbortSignalSubscription() {
if (this.abortSignalSubscription) {
this.abortSignal.removeEventListener('abort', this.abortSignalSubscription);
}
if (this.abortSignalResolver) {
this.abortSignalResolver();
}
}
startExtendLockInterval() {
const lockExtensionBuffer = 5000;
this.logger.trace(`Starting automatic Lock extension for External Task ${this.externalTask.id}`);
this.interval = setInterval(async () => this.extendLocks(this.externalTask), this.config.lockDuration - lockExtensionBuffer);
}
async extendLocks(externalTask) {
if (this.abortExecutionController.signal.aborted) {
return;
}
if (typeof this.onHeartbeatCallback === 'function') {
this.onHeartbeatCallback('extendLock', this.externalTask.id);
}
try {
await this.externalTaskClient.extendLock(this.config.workerId, externalTask.id, this.config.lockDuration, this.config.identity, this.abortSignal);
this.logger.debug(`Extending Lock on External Task ${this.externalTask.id}`);
await this.externalTaskClient.extendLock(this.config.workerId, externalTask.id, this.config.lockDuration, await this.identityAccessor.getIdentity(), this.abortExecutionController.signal);
}
catch (error) {
this.handleError('extendLock', error);
// This can happen, if the lock-extension was performed after the task was already finished.
// Since this isn't really an error, a warning suffices here.
this.logger.warn(`An error occured while trying to extend the lock for ExternalTask ${externalTask.id}`, { err: error });
const errorIsRetryable = await this.evaluateError('extendLock', error);
if (errorIsRetryable && !this.abortExecutionController.signal.aborted) {
await this.sleep(1000);
await this.extendLocks(externalTask);
}
}
}
handleError(errorType, error) {
stopExtendLockInterval() {
this.logger.debug(`Disposing automatic Lock Extension for External Task ${this.externalTask.id}`);
if (this.interval) {
clearInterval(this.interval);
this.interval = undefined;
}
}
async evaluateError(errorType, error) {
if (this.abortExecutionController.signal.aborted) {
return false;
}
if (typeof this.customErrorHandler === 'function') {
this.logger.trace(`Posting error for external task ${this.externalTask.id} to subscribed custom error handlers`, { errorType: errorType, err: error });
this.customErrorHandler(errorType, error, this.externalTask);
}
if (error.code === 409) {
this.logger.warn(`Failed to run ${errorType} for External Task ${this.externalTask.id} because the task has already been finished. Aborting now, since there is nothing more to do here.`, { err: error });
this.abort();
return false;
}
this.logger.warn(`An error occured while executing ${errorType} for External Task ${this.externalTask.id}`, { err: error });
if (error.message?.match(/expired/i) && this.identityAccessor.canIdentityBeRefreshed()) {
this.logger.info('Identity has expired. Refreshing identity to get a new auth token...');
await this.identityAccessor.forceImmediateIdentityRefresh();
this.logger.info('Identity refresh completed. Retrying to process External Task now.');
return true;
}
return false;
}
async sleep(milliseconds) {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, milliseconds);
});
}
}
exports.ExternalTaskExecution = ExternalTaskExecution;
//# sourceMappingURL=ExternalTaskExecution.js.map

@@ -41,7 +41,4 @@ "use strict";

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 {

@@ -55,8 +52,10 @@ _workerId;

payloadFilter;
_identity;
identityAccessor;
_pollingActive = false;
externalTaskClient;
customErrorHandler = null;
onHeartbeatCallback = null;
abortController;
abortSignal;
activelyProcessedExternalTasks = {};
constructor(engineUrl, topic, processingFunction, config) {

@@ -66,3 +65,3 @@ this._workerId = config?.workerId ?? uuid.v4();

this.processingFunction = processingFunction;
this.identity = config?.identity ?? dummyIdentity;
this.identityAccessor = IdentityAccessor_1.IdentityAccessor.wrap(config?.identity, engineUrl);
this.maxTasks = config?.maxTasks ?? 10;

@@ -72,9 +71,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());
}

@@ -90,2 +98,11 @@ get workerId() {

}
onHeartbeat(callback) {
this.onHeartbeatCallback = callback;
}
getActiveExternalTasks() {
return Object.keys(this.activelyProcessedExternalTasks);
}
isExternalTaskBeingProcessed(externalTaskId) {
return this.activelyProcessedExternalTasks[externalTaskId] != null;
}
start() {

@@ -95,2 +112,6 @@ this._pollingActive = true;

this.abortSignal = this.abortController.signal;
this.abortSignal.onabort = () => {
Object.values(this.activelyProcessedExternalTasks).forEach((executor) => executor.abort());
this.activelyProcessedExternalTasks = {};
};
this.processExternalTasks();

@@ -104,4 +125,12 @@ }

}
abortExternalTaskIfPresent(externalTaskId) {
if (this.activelyProcessedExternalTasks[externalTaskId] != null) {
this.activelyProcessedExternalTasks[externalTaskId].abort();
delete this.activelyProcessedExternalTasks[externalTaskId];
}
}
dispose() {
this.stop();
this.externalTaskClient.dispose();
this.identityAccessor?.dispose();
}

@@ -116,5 +145,16 @@ async processExternalTasks() {

errorCount = 0;
if (typeof this.onHeartbeatCallback === 'function') {
this.onHeartbeatCallback('fetchAndLock');
}
}
catch (error) {
if (this.abortSignal?.aborted) {
return;
}
logger.error('Failed to fetch and lock External Tasks.', { err: error });
if (error.message?.match(/expired/i) && this.identityAccessor.canIdentityBeRefreshed()) {
logger.info('Identity has expired. Refreshing identity to get a new auth token...');
await this.identityAccessor.forceImmediateIdentityRefresh();
logger.info('Identity refresh completed. Fetch and Lock will continue.');
}
errorCount++;

@@ -140,3 +180,3 @@ const timeoutOffset = (Math.floor(Math.random() * 10) + 1) * 30;

async fetchAndLockExternalTasks() {
return this.externalTaskClient.fetchAndLockExternalTasks(this.workerId, this.topic, this.maxTasks, this.longpollingTimeout, this.lockDuration, this.payloadFilter, this.identity, this.abortSignal);
return this.externalTaskClient.fetchAndLockExternalTasks(this.workerId, this.topic, this.maxTasks, this.longpollingTimeout, this.lockDuration, this.payloadFilter, this.identityAccessor, this.abortSignal);
}

@@ -146,3 +186,3 @@ async startExecutingExternalTask(externalTask) {

const externalTaskExecution = new ExternalTaskExecution_1.ExternalTaskExecution(externalTask, this.processingFunction, this.externalTaskClient, {
identity: this.identity,
identity: this.identityAccessor,
lockDuration: this.lockDuration,

@@ -153,3 +193,4 @@ longpollingTimeout: this.longpollingTimeout,

workerId: this.workerId,
}, this.topic, this.abortSignal, this.customErrorHandler);
}, this.topic, this.onHeartbeatCallback, this.customErrorHandler);
this.activelyProcessedExternalTasks[externalTask.id] = externalTaskExecution;
await externalTaskExecution.execute();

@@ -163,2 +204,5 @@ }

}
finally {
delete this.activelyProcessedExternalTasks[externalTask.id];
}
}

@@ -165,0 +209,0 @@ async sleep(milliseconds) {

@@ -17,3 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Model = exports.EventType = exports.DataModels = exports.BpmnType = void 0;
exports.Model = exports.Messages = exports.EventType = exports.DataModels = exports.BpmnType = exports.ClientCredentialsIdentityAccessor = exports.IdentityAccessor = void 0;
__exportStar(require("./Client"), exports);

@@ -24,2 +24,6 @@ __exportStar(require("./ClientFactory"), exports);

__exportStar(require("./Types/index"), exports);
var IdentityAccessor_1 = require("./IdentityAccessor");
Object.defineProperty(exports, "IdentityAccessor", { enumerable: true, get: function () { return IdentityAccessor_1.IdentityAccessor; } });
var IdentityAccessorClientCredentials_1 = require("./IdentityAccessorClientCredentials");
Object.defineProperty(exports, "ClientCredentialsIdentityAccessor", { enumerable: true, get: function () { return IdentityAccessorClientCredentials_1.ClientCredentialsIdentityAccessor; } });
var processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");

@@ -29,3 +33,4 @@ Object.defineProperty(exports, "BpmnType", { enumerable: true, get: function () { return processcube_engine_sdk_1.BpmnType; } });

Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return processcube_engine_sdk_1.EventType; } });
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return processcube_engine_sdk_1.Messages; } });
Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return processcube_engine_sdk_1.Model; } });
//# sourceMappingURL=index.js.map

@@ -13,24 +13,2 @@ "use strict";

}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
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) {

@@ -40,15 +18,4 @@ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);

Object.defineProperty(exports, "__esModule", { value: true });
exports.Messages = void 0;
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const callbackTypes = __importStar(require("./CallbackTypes"));
// Message Types are exported this way to remain compatible with older client versions.
var Messages;
(function (Messages) {
Messages.BpmnEvents = processcube_engine_sdk_1.Messages.BpmnEvents;
Messages.SystemEvents = processcube_engine_sdk_1.Messages.SystemEvents;
Messages.CallbackTypes = callbackTypes;
})(Messages || (exports.Messages = Messages = {}));
__exportStar(require("./IExternalTaskWorker"), exports);
__exportStar(require("./RestSettings"), exports);
__exportStar(require("./SocketSettings"), exports);
__exportStar(require("./NotificationCallbackTypes"), exports);
//# sourceMappingURL=index.js.map
import { ExternalTask } from '@5minds/processcube_engine_sdk';
import { ExternalTaskApiClient } from './Clients';
import { ExternalTaskWorkerHeartbeat } from './ExternalTaskWorker';
import { HandleExternalTaskAction, IExternalTaskWorkerConfig, WorkerErrorHandler } from './Types';

@@ -10,20 +11,21 @@ export declare class ExternalTaskExecution<TExternalTaskPayload, TResultPayload extends object> {

private topic;
private abortSignal;
private abortExecutionController;
private customErrorHandler?;
private onHeartbeatCallback;
private interval;
private abortSignalSubscription;
private awaitAbortSignal;
private abortSignalResolver;
private identityAccessor;
private logger;
constructor(externalTask: ExternalTask<TExternalTaskPayload>, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, externalTaskClient: ExternalTaskApiClient, config: IExternalTaskWorkerConfig, topic: string, abortSignal: AbortSignal, customErrorHandler?: WorkerErrorHandler);
private isDisposed;
constructor(externalTask: ExternalTask<TExternalTaskPayload>, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, externalTaskClient: ExternalTaskApiClient, config: IExternalTaskWorkerConfig, topic: string, onHeartbeatCallback?: ExternalTaskWorkerHeartbeat, customErrorHandler?: WorkerErrorHandler);
get disposed(): boolean;
execute(): Promise<void>;
abort(): void;
private dispose;
private processResult;
private handleExternalTaskExecutionError;
private dispose;
private stopLockingInterval;
private startAbortSignalSubscription;
private removeAbortSignalSubscription;
private startExtendLockInterval;
private extendLocks;
private handleError;
private stopExtendLockInterval;
private evaluateError;
private sleep;
}
import { Identity } from '@5minds/processcube_engine_sdk';
import { HandleExternalTaskAction, IExternalTaskWorkerConfig, WorkerErrorHandler } from './Types/index';
export type ExternalTaskWorkerHeartbeat = (operation?: 'fetchAndLock' | 'processExternalTask' | 'extendLock' | 'finishExternalTask' | 'handleError', externalTaskId?: string) => void;
export declare class ExternalTaskWorker<TExternalTaskPayload, TResultPayload extends object> {

@@ -11,10 +12,19 @@ private readonly _workerId;

private readonly payloadFilter;
private _identity;
private identityAccessor;
private _pollingActive;
private externalTaskClient;
private customErrorHandler;
private onHeartbeatCallback;
private abortController;
private abortSignal;
private activelyProcessedExternalTasks;
constructor(engineUrl: string, topic: string, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, config?: IExternalTaskWorkerConfig);
/**
* @deprecated Use getIdentity instead.
*/
get identity(): Identity;
getIdentity(): Promise<Identity>;
/**
* @deprecated This is no longer safe to use. Identity should be set via the constructor.
*/
set identity(value: Identity);

@@ -24,4 +34,8 @@ get workerId(): string;

onWorkerError(callback: WorkerErrorHandler): void;
onHeartbeat(callback: ExternalTaskWorkerHeartbeat): void;
getActiveExternalTasks(): string[];
isExternalTaskBeingProcessed(externalTaskId: string): boolean;
start(): void;
stop(): void;
abortExternalTaskIfPresent(externalTaskId: string): void;
dispose(): void;

@@ -28,0 +42,0 @@ private processExternalTasks;

@@ -6,2 +6,4 @@ export * from './Client';

export * from './Types/index';
export { BpmnType, DataModels, EventType, Identity, Model, EventReceivedCallback, Subscription } from '@5minds/processcube_engine_sdk';
export { ClientCredentialsConfig, IdentityAccessor, IdentityLike } from './IdentityAccessor';
export { ClientCredentialsIdentityAccessor } from './IdentityAccessorClientCredentials';
export { BpmnType, DataModels, EventType, Identity, Messages, 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 @@ };

@@ -1,15 +0,2 @@

import { Messages as SDKMessages } from '@5minds/processcube_engine_sdk';
import * as callbackTypes from './CallbackTypes';
export declare namespace Messages {
export import EventMessage = SDKMessages.EventMessage;
export import IConstructor = SDKMessages.IConstructor;
export import BpmnEvents = SDKMessages.BpmnEvents;
export import SystemEvents = SDKMessages.SystemEvents;
export import CallbackTypes = callbackTypes;
}
export type OnConnected = callbackTypes.OnConnected;
export type OnDisconnected = callbackTypes.OnDisconnected;
export type OnReconnected = callbackTypes.OnReconnected;
export * from './IExternalTaskWorker';
export * from './RestSettings';
export * from './SocketSettings';
export * from './NotificationCallbackTypes';

@@ -7,3 +7,3 @@ {

"name": "@5minds/processcube_engine_client",
"version": "6.0.0-feature-9de524-m4jrwzr9",
"version": "6.0.0-feature-a171f9-m7lpldcm",
"description": "Contains a typescript based client for accessing the Engine.",

@@ -37,8 +37,14 @@ "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": "feature~PCE-1404_singleton_processes",
"bufferutil": "4.0.8",
"cross-fetch": "4.0.0",
"@5minds/processcube_engine_sdk": "6.1.0-feature-e7b898-m7lp9tlv",
"async-lock": "^1.4.1",
"bufferutil": "4.0.9",
"cross-fetch": "4.1.0",
"dayjs": "^1.11.13",
"openid-client": "^6.1.7",
"socket.io-client": "4.8.1",

@@ -49,7 +55,8 @@ "utf-8-validate": "5.0.10",

"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^5.0.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc