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-develop-c3bf3e-m6y57lcs to 6.0.0-develop-c55eaf-m7hse04c

5

dist/Clients/FlowNodeInstanceHttpClient.d.ts

@@ -11,3 +11,6 @@ import { DataModels, IFlowNodeInstanceExtensionAdapter } from '@5minds/processcube_engine_sdk';

}): Promise<DataModels.FlowNodeInstances.FlowNodeInstanceList>;
finishUntypedTask(taskInstanceId: string, identity?: IdentityLike): 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>;

@@ -14,0 +17,0 @@ finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: IdentityLike): Promise<void>;

@@ -102,2 +102,6 @@ import { INotificationExtensionAdapter, Messages, Subscription } from '@5minds/processcube_engine_sdk';

identity?: IdentityLike;
/**
* If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
useLegacyEndpoint?: boolean;
}): Promise<Subscription>;

@@ -107,2 +111,6 @@ onUntypedTaskFinished(callback: Messages.CallbackTypes.OnUntypedTaskFinishedCallback, options?: {

identity?: IdentityLike;
/**
* If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
useLegacyEndpoint?: boolean;
}): Promise<Subscription>;

@@ -109,0 +117,0 @@ onManualTaskWaiting(callback: Messages.CallbackTypes.OnManualTaskWaitingCallback, options?: {

13

dist/Clients/UntypedTaskHttpClient.d.ts

@@ -11,6 +11,13 @@ import { FlowNodeInstanceSortSettings, IUntypedTaskExtensionAdapter, Messages, Subscription, UntypedTaskList, UntypedTaskQuery } from '@5minds/processcube_engine_sdk';

}): Promise<UntypedTaskList>;
finishTask(taskInstanceId: string, identity?: IdentityLike): 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?: IdentityLike;
/**
* If true, will use the old "Empty Activity" Socket.IO Endpoint for receiving the notification.
*/
useLegacyEndpoint?: boolean;
}): Promise<Subscription>;

@@ -20,4 +27,8 @@ onUntypedTaskFinished(callback: Messages.CallbackTypes.OnUntypedTaskFinishedCallback, options?: {

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?: IdentityLike): void;
}

@@ -18,5 +18,10 @@ "use strict";

}
async finishUntypedTask(taskInstanceId, identity) {
/**
* @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 = index_1.restSettings.paths.finishUntypedTask.replace(index_1.restSettings.params.untypedTaskInstanceId, taskInstanceId);
const urlRestPart = useLegacyEndpoint === true
? index_1.restSettings.paths.finishEmptyActivity.replace(index_1.restSettings.params.emptyActivityInstanceId, taskInstanceId)
: index_1.restSettings.paths.finishUntypedTask.replace(index_1.restSettings.params.untypedTaskInstanceId, taskInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -23,0 +28,0 @@ await this.httpClient.put(url, {}, requestAuthHeaders);

@@ -83,5 +83,11 @@ "use strict";

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

@@ -88,0 +94,0 @@ }

@@ -23,5 +23,10 @@ "use strict";

}
async finishTask(taskInstanceId, identity) {
/**
* @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 = index_1.restSettings.paths.finishUntypedTask.replace(index_1.restSettings.params.untypedTaskInstanceId, taskInstanceId);
const urlRestPart = useLegacyEndpoint === true
? index_1.restSettings.paths.finishEmptyActivity.replace(index_1.restSettings.params.emptyActivityInstanceId, taskInstanceId)
: index_1.restSettings.paths.finishUntypedTask.replace(index_1.restSettings.params.untypedTaskInstanceId, taskInstanceId);
const url = this.buildUrl(urlRestPart);

@@ -31,5 +36,11 @@ await this.httpClient.put(url, {}, requestAuthHeaders);

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

@@ -36,0 +47,0 @@ }

@@ -12,11 +12,10 @@ "use strict";

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;

@@ -28,3 +27,3 @@ this.processingFunction = processingFunction;

this.topic = topic;
this.abortSignal = abortSignal;
this.onHeartbeatCallback = onHeartbeatCallback;
this.customErrorHandler = customErrorHandler;

@@ -37,99 +36,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, await this.identityAccessor.getIdentity(), 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, await this.identityAccessor.getIdentity());
}
async dispose() {
this.removeAbortSignalSubscription();
this.stopLockingInterval();
// we explicitly do not dispose the identityAccessor here, since it is shared with the ExternalTaskWorker
}
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, await this.identityAccessor.getIdentity(), 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...');
this.identityAccessor
.forceImmediateIdentityRefresh()
.then(() => this.logger.info('Identity refresh completed. Fetch and Lock will continue.'))
.catch((refreshError) => this.logger.error('Identity refresh failed', { err: refreshError }));
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

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

abortSignal;
activelyProcessedExternalTasks = {};
constructor(engineUrl, topic, processingFunction, config) {

@@ -97,2 +98,8 @@ this._workerId = config?.workerId ?? uuid.v4();

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

@@ -102,2 +109,6 @@ this._pollingActive = true;

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

@@ -111,3 +122,10 @@ }

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

@@ -125,3 +143,3 @@ this.identityAccessor?.dispose();

if (typeof this.onHeartbeatCallback === 'function') {
this.onHeartbeatCallback();
this.onHeartbeatCallback('fetchAndLock');
}

@@ -170,3 +188,4 @@ }

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

@@ -180,2 +199,5 @@ }

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

@@ -182,0 +204,0 @@ async sleep(milliseconds) {

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

const async_lock_1 = __importDefault(require("async-lock"));
const dayjs_1 = __importDefault(require("dayjs"));
const uuid = __importStar(require("uuid"));

@@ -180,2 +181,6 @@ const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");

const timeUntilNextRefresh32Bit = Math.min(timeUntilNextRefresh, 2147483647);
this.logger.debug(`Current Identity will expire at ${(0, dayjs_1.default)()
.add(this.expirationTimeInMs ?? 0, 'milliseconds')
.toISOString()}`);
this.logger.debug(`Next Refresh will be performed at ${(0, dayjs_1.default)().add(timeUntilNextRefresh32Bit, 'milliseconds').toISOString()}`);
this.refreshTimeout = setTimeout(async () => {

@@ -195,3 +200,5 @@ await this.fetchIdentity();

try {
this.logger.debug('Fetching new identity');
this.latestIdentity = await this.identityGetter();
this.logger.trace('New Identity fetched');
if (this.latestIdentity == dummyIdentity || this.latestIdentity?.token == dummyIdentity.token) {

@@ -198,0 +205,0 @@ this.expirationTimeInMs = 0;

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

async getNewToken(clientCredentialsConfig) {
this.logger.debug('Fetching new auth token from authority');
const authorityUrl = await this.getAuthorityUrl(clientCredentialsConfig);

@@ -48,2 +49,3 @@ const openIdClient = await this.getOpenIdClient();

if (tokenSet.access_token) {
this.logger.trace('Successfuily received a new access token from authority');
return tokenSet.access_token;

@@ -50,0 +52,0 @@ }

@@ -9,2 +9,4 @@ "use strict";

untypedTaskInstanceId: ':untyped_task_instance_id',
// Deprecated version of "untypedTaskInstanceId"
emptyActivityInstanceId: ':empty_activity_instance_id',
// Id of an Event.

@@ -154,2 +156,9 @@ eventId: ':event_id',

/**
* Finishes a specific EmptyActivity by its InstanceId. Deprecated, use "finish Untyped Task" instead
* @tags EmptyActivity
* @deprecated
* @method put
*/
finishEmptyActivity: `/empty_activities/${params.emptyActivityInstanceId}/finish`,
/**
* Finishes a specific UntypedTask by its InstanceId.

@@ -566,2 +575,16 @@ * @tags UntypedTask

/**
* Wait for an UntypedTaskWaiting notification and resolves with the notification's content.
* @tags Notifications
* @method get
* @responseType EventMessage
*/
onUntypedTaskWaiting: '/notifications/long_polling/empty_activity_waiting',
/**
* Wait for an UntypedTaskFinished notification and resolves with the notification's content.
* @tags Notifications
* @method get
* @responseType EventMessage
*/
onUntypedTaskFinished: '/notifications/long_polling/empty_activity_finished',
/**
* Wait for a ManualTaskWaiting notification and resolves with the notification's content.

@@ -568,0 +591,0 @@ * @tags Notifications

@@ -20,2 +20,4 @@ "use strict";

cronjobUpdated: 'cronjob_updated',
emptyActivityWaiting: 'empty_activity_waiting',
emptyActivityFinished: 'empty_activity_finished',
untypedTaskWaiting: 'untyped_task_waiting',

@@ -22,0 +24,0 @@ untypedTaskFinished: 'untyped_task_finished',

import { ExternalTask } from '@5minds/processcube_engine_sdk';
import { ExternalTaskApiClient } from './Clients';
import { ExternalTaskWorkerHeartbeat } from './ExternalTaskWorker';
import { HandleExternalTaskAction, IExternalTaskWorkerConfig, WorkerErrorHandler } from './Types';

@@ -10,21 +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> {

@@ -18,2 +19,3 @@ private readonly _workerId;

private abortSignal;
private activelyProcessedExternalTasks;
constructor(engineUrl: string, topic: string, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, config?: IExternalTaskWorkerConfig);

@@ -32,5 +34,8 @@ /**

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

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

@@ -5,2 +5,3 @@ export declare const restSettings: {

untypedTaskInstanceId: string;
emptyActivityInstanceId: string;
eventId: string;

@@ -131,2 +132,9 @@ eventName: string;

/**
* Finishes a specific EmptyActivity by its InstanceId. Deprecated, use "finish Untyped Task" instead
* @tags EmptyActivity
* @deprecated
* @method put
*/
finishEmptyActivity: string;
/**
* Finishes a specific UntypedTask by its InstanceId.

@@ -537,2 +545,16 @@ * @tags UntypedTask

/**
* Wait for an UntypedTaskWaiting notification and resolves with the notification's content.
* @tags Notifications
* @method get
* @responseType EventMessage
*/
onUntypedTaskWaiting: string;
/**
* Wait for an UntypedTaskFinished notification and resolves with the notification's content.
* @tags Notifications
* @method get
* @responseType EventMessage
*/
onUntypedTaskFinished: string;
/**
* Wait for a ManualTaskWaiting notification and resolves with the notification's content.

@@ -539,0 +561,0 @@ * @tags Notifications

@@ -19,2 +19,4 @@ export declare const socketSettings: {

cronjobUpdated: string;
emptyActivityWaiting: string;
emptyActivityFinished: string;
untypedTaskWaiting: string;

@@ -21,0 +23,0 @@ untypedTaskFinished: string;

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

"name": "@5minds/processcube_engine_client",
"version": "6.0.0-develop-c3bf3e-m6y57lcs",
"version": "6.0.0-develop-c55eaf-m7hse04c",
"description": "Contains a typescript based client for accessing the Engine.",

@@ -43,6 +43,7 @@ "main": "dist/commonjs/index.js",

"dependencies": {
"@5minds/processcube_engine_sdk": "6.1.0-alpha.8",
"@5minds/processcube_engine_sdk": "6.1.0-alpha.9",
"async-lock": "^1.4.1",
"bufferutil": "4.0.9",
"cross-fetch": "4.1.0",
"dayjs": "^1.11.13",
"openid-client": "^6.1.7",

@@ -49,0 +50,0 @@ "socket.io-client": "4.8.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

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