@5minds/processcube_engine_client
Advanced tools
Comparing version 4.4.0-develop-f6025f-lj4b6jeg to 4.4.0-feature-114739-lkqrtr5m
define(["require", "exports", "@5minds/processcube_engine_sdk"], function (require, exports, processcube_engine_sdk_1) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mapProcessInstance = exports.mapExternalTask = exports.mapDataObjectInstance = exports.mapCronjobHistory = exports.mapActiveCronjobConfiguration = exports.mapCronjobConfiguration = exports.mapProcessToken = exports.mapUserTask = exports.mapServiceTask = exports.mapReceiveTask = exports.mapManualTask = exports.mapEvent = exports.mapEmptyActivity = exports.mapSubprocess = exports.mapCallActivity = exports.mapFlowNodeInstance = exports.mapProcessModel = exports.mapProcessDefinition = exports.mapAnonymousSession = void 0; | ||
exports.mapProcessInstance = exports.mapExternalTask = exports.mapDataObjectInstance = exports.mapCronjobHistory = exports.mapActiveCronjobConfiguration = exports.mapCronjobConfiguration = exports.mapProcessToken = exports.mapUserTask = exports.mapServiceTask = exports.mapSendTask = exports.mapReceiveTask = exports.mapManualTask = exports.mapEvent = exports.mapEmptyActivity = exports.mapSubprocess = exports.mapCallActivity = exports.mapBusinessRuleTask = exports.mapFlowNodeInstance = exports.mapProcessModel = exports.mapProcessDefinition = exports.mapAnonymousSession = void 0; | ||
function mapAnonymousSession(rawSession) { | ||
@@ -44,2 +44,5 @@ return { | ||
function mapFlowNodeInstance(data) { | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.businessRuleTask) { | ||
return mapBusinessRuleTask(data); | ||
} | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.callActivity) { | ||
@@ -54,8 +57,8 @@ return mapCallActivity(data); | ||
} | ||
if (data.eventType != undefined) { | ||
return mapEvent(data); | ||
} | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.manualTask) { | ||
return mapManualTask(data); | ||
} | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.sendTask) { | ||
return mapSendTask(data); | ||
} | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.receiveTask) { | ||
@@ -70,5 +73,27 @@ return mapReceiveTask(data); | ||
} | ||
if (data.eventType != undefined) { | ||
return mapEvent(data); | ||
} | ||
return createBaseFlowNodeInstance(data); | ||
} | ||
exports.mapFlowNodeInstance = mapFlowNodeInstance; | ||
function mapBusinessRuleTask(data) { | ||
const businessRuleTaskInstance = createBaseFlowNodeInstance(data); | ||
if (data.businessRuleTaskData) { | ||
businessRuleTaskInstance.businessRuleTaskData = { | ||
externalTaskId: data.businessRuleTaskData.externalTaskId, | ||
workerId: data.businessRuleTaskData.workerId, | ||
topic: data.businessRuleTaskData.topic, | ||
state: data.businessRuleTaskData.state, | ||
isSingleTry: data.businessRuleTaskData.isSingleTry, | ||
lockExpirationTime: data.businessRuleTaskData.lockExpirationTime ? new Date(data.businessRuleTaskData.lockExpirationTime) : undefined, | ||
payload: data.businessRuleTaskData.payload, | ||
result: data.businessRuleTaskData.result, | ||
error: typeof data.error === 'string' ? (0, processcube_engine_sdk_1.deserializeJson)(data.error) : data.error, | ||
finishedAt: data.businessRuleTaskData.finishedAt ? new Date(data.businessRuleTaskData.finishedAt) : undefined, | ||
}; | ||
} | ||
return businessRuleTaskInstance; | ||
} | ||
exports.mapBusinessRuleTask = mapBusinessRuleTask; | ||
function mapCallActivity(data) { | ||
@@ -114,6 +139,15 @@ return { | ||
...createBaseFlowNodeInstance(data), | ||
sendTaskFlowNodeInstanceId: data.sendTaskFlowNodeInstanceId, | ||
messageName: data.messageName, | ||
triggerValue: data.triggerValue, | ||
}; | ||
} | ||
exports.mapReceiveTask = mapReceiveTask; | ||
function mapSendTask(data) { | ||
return { | ||
...createBaseFlowNodeInstance(data), | ||
messageName: data.messageName, | ||
customCorrelationId: data.customCorrelationId, | ||
}; | ||
} | ||
exports.mapSendTask = mapSendTask; | ||
function mapServiceTask(data) { | ||
@@ -120,0 +154,0 @@ const serviceTaskInstance = createBaseFlowNodeInstance(data); |
@@ -18,2 +18,5 @@ define(["require", "exports", "../Types/index", "./BaseClient"], function (require, exports, index_1, BaseClient_1) { | ||
} | ||
async onActivityError(callback, options) { | ||
return this.createSocketIoSubscription(index_1.socketSettings.paths.activityError, callback, options === null || options === void 0 ? void 0 : options.subscribeOnce, options === null || options === void 0 ? void 0 : options.identity); | ||
} | ||
async onProcessDeployed(callback, options) { | ||
@@ -20,0 +23,0 @@ return this.createSocketIoSubscription(index_1.socketSettings.paths.processDeployed, callback, options === null || options === void 0 ? void 0 : options.subscribeOnce, options === null || options === void 0 ? void 0 : options.identity); |
@@ -6,2 +6,3 @@ define(["require", "exports"], function (require, exports) { | ||
const messagePaths = { | ||
activityError: 'OnActivityError', | ||
activityReached: 'activity_reached', | ||
@@ -8,0 +9,0 @@ activityFinished: 'activity_finished', |
@@ -6,2 +6,3 @@ import { AnonymousSession, DataModels, Cronjob } from '@5minds/processcube_engine_sdk'; | ||
export declare function mapFlowNodeInstance(data: any): DataModels.FlowNodeInstances.FlowNodeInstance; | ||
export declare function mapBusinessRuleTask(data: any): DataModels.FlowNodeInstances.BusinessRuleTaskInstance; | ||
export declare function mapCallActivity(data: any): DataModels.FlowNodeInstances.CallActivityInstance; | ||
@@ -13,2 +14,3 @@ export declare function mapSubprocess(data: any): DataModels.FlowNodeInstances.SubprocessInstance; | ||
export declare function mapReceiveTask(data: any): DataModels.FlowNodeInstances.ReceiveTaskInstance; | ||
export declare function mapSendTask(data: any): DataModels.FlowNodeInstances.SendTaskInstance; | ||
export declare function mapServiceTask(data: any): DataModels.FlowNodeInstances.ServiceTaskInstance; | ||
@@ -15,0 +17,0 @@ export declare function mapUserTask(data: any): DataModels.FlowNodeInstances.UserTaskInstance; |
@@ -14,2 +14,6 @@ import { INotificationExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk'; | ||
onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: Identity): Subscription; | ||
onActivityError(callback: Messages.CallbackTypes.OnActivityErrorCallback, options?: { | ||
subscribeOnce?: boolean; | ||
identity?: Identity; | ||
}): Promise<Subscription>; | ||
onProcessDeployed(callback: Messages.CallbackTypes.OnProcessDeployedCallback, options?: { | ||
@@ -16,0 +20,0 @@ subscribeOnce?: boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mapProcessInstance = exports.mapExternalTask = exports.mapDataObjectInstance = exports.mapCronjobHistory = exports.mapActiveCronjobConfiguration = exports.mapCronjobConfiguration = exports.mapProcessToken = exports.mapUserTask = exports.mapServiceTask = exports.mapReceiveTask = exports.mapManualTask = exports.mapEvent = exports.mapEmptyActivity = exports.mapSubprocess = exports.mapCallActivity = exports.mapFlowNodeInstance = exports.mapProcessModel = exports.mapProcessDefinition = exports.mapAnonymousSession = void 0; | ||
exports.mapProcessInstance = exports.mapExternalTask = exports.mapDataObjectInstance = exports.mapCronjobHistory = exports.mapActiveCronjobConfiguration = exports.mapCronjobConfiguration = exports.mapProcessToken = exports.mapUserTask = exports.mapServiceTask = exports.mapSendTask = exports.mapReceiveTask = exports.mapManualTask = exports.mapEvent = exports.mapEmptyActivity = exports.mapSubprocess = exports.mapCallActivity = exports.mapBusinessRuleTask = exports.mapFlowNodeInstance = exports.mapProcessModel = exports.mapProcessDefinition = exports.mapAnonymousSession = void 0; | ||
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk"); | ||
@@ -44,2 +44,5 @@ function mapAnonymousSession(rawSession) { | ||
function mapFlowNodeInstance(data) { | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.businessRuleTask) { | ||
return mapBusinessRuleTask(data); | ||
} | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.callActivity) { | ||
@@ -54,8 +57,8 @@ return mapCallActivity(data); | ||
} | ||
if (data.eventType != undefined) { | ||
return mapEvent(data); | ||
} | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.manualTask) { | ||
return mapManualTask(data); | ||
} | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.sendTask) { | ||
return mapSendTask(data); | ||
} | ||
if (data.flowNodeType === processcube_engine_sdk_1.BpmnType.receiveTask) { | ||
@@ -70,5 +73,27 @@ return mapReceiveTask(data); | ||
} | ||
if (data.eventType != undefined) { | ||
return mapEvent(data); | ||
} | ||
return createBaseFlowNodeInstance(data); | ||
} | ||
exports.mapFlowNodeInstance = mapFlowNodeInstance; | ||
function mapBusinessRuleTask(data) { | ||
const businessRuleTaskInstance = createBaseFlowNodeInstance(data); | ||
if (data.businessRuleTaskData) { | ||
businessRuleTaskInstance.businessRuleTaskData = { | ||
externalTaskId: data.businessRuleTaskData.externalTaskId, | ||
workerId: data.businessRuleTaskData.workerId, | ||
topic: data.businessRuleTaskData.topic, | ||
state: data.businessRuleTaskData.state, | ||
isSingleTry: data.businessRuleTaskData.isSingleTry, | ||
lockExpirationTime: data.businessRuleTaskData.lockExpirationTime ? new Date(data.businessRuleTaskData.lockExpirationTime) : undefined, | ||
payload: data.businessRuleTaskData.payload, | ||
result: data.businessRuleTaskData.result, | ||
error: typeof data.error === 'string' ? (0, processcube_engine_sdk_1.deserializeJson)(data.error) : data.error, | ||
finishedAt: data.businessRuleTaskData.finishedAt ? new Date(data.businessRuleTaskData.finishedAt) : undefined, | ||
}; | ||
} | ||
return businessRuleTaskInstance; | ||
} | ||
exports.mapBusinessRuleTask = mapBusinessRuleTask; | ||
function mapCallActivity(data) { | ||
@@ -114,6 +139,15 @@ return { | ||
...createBaseFlowNodeInstance(data), | ||
sendTaskFlowNodeInstanceId: data.sendTaskFlowNodeInstanceId, | ||
messageName: data.messageName, | ||
triggerValue: data.triggerValue, | ||
}; | ||
} | ||
exports.mapReceiveTask = mapReceiveTask; | ||
function mapSendTask(data) { | ||
return { | ||
...createBaseFlowNodeInstance(data), | ||
messageName: data.messageName, | ||
customCorrelationId: data.customCorrelationId, | ||
}; | ||
} | ||
exports.mapSendTask = mapSendTask; | ||
function mapServiceTask(data) { | ||
@@ -120,0 +154,0 @@ const serviceTaskInstance = createBaseFlowNodeInstance(data); |
@@ -19,2 +19,5 @@ "use strict"; | ||
} | ||
async onActivityError(callback, options) { | ||
return this.createSocketIoSubscription(index_1.socketSettings.paths.activityError, callback, options === null || options === void 0 ? void 0 : options.subscribeOnce, options === null || options === void 0 ? void 0 : options.identity); | ||
} | ||
async onProcessDeployed(callback, options) { | ||
@@ -21,0 +24,0 @@ return this.createSocketIoSubscription(index_1.socketSettings.paths.processDeployed, callback, options === null || options === void 0 ? void 0 : options.subscribeOnce, options === null || options === void 0 ? void 0 : options.identity); |
@@ -5,2 +5,3 @@ "use strict"; | ||
const messagePaths = { | ||
activityError: 'OnActivityError', | ||
activityReached: 'activity_reached', | ||
@@ -7,0 +8,0 @@ activityFinished: 'activity_finished', |
@@ -8,2 +8,3 @@ import { CronjobEventMessage, EventMessage, ExternalTaskCreatedMessage, ExternalTaskLockedMessage, ExternalTaskUnlockedMessage, ProcessDeploymentMessage, ProcessInstancesDeletedMessage, ProcessIsExecutableChangedMessage, UserTaskFinishedMessage } from '@5minds/processcube_engine_sdk'; | ||
export declare type OnReconnected = (attempt: number) => void | Promise<void>; | ||
export declare type OnActivityErrorCallback = (activityError: EventMessage) => void | Promise<void>; | ||
export declare type OnProcessDeployedCallback = (message: ProcessDeploymentMessage) => void | Promise<void>; | ||
@@ -10,0 +11,0 @@ export declare type OnProcessInstancesDeletedCallback = (message: ProcessInstancesDeletedMessage) => void | Promise<void>; |
export declare const socketSettings: { | ||
namespace: string; | ||
paths: { | ||
activityError: string; | ||
activityReached: string; | ||
@@ -5,0 +6,0 @@ activityFinished: string; |
{ | ||
"name": "@5minds/processcube_engine_client", | ||
"version": "4.4.0-develop-f6025f-lj4b6jeg", | ||
"version": "4.4.0-feature-114739-lkqrtr5m", | ||
"description": "Contains a typescript based client for accessing the Engine.", | ||
@@ -36,3 +36,3 @@ "main": "dist/commonjs/index.js", | ||
"dependencies": { | ||
"@5minds/processcube_engine_sdk": "3.3.0", | ||
"@5minds/processcube_engine_sdk": "4.0.0-feature-758110-lkqrmrtr", | ||
"@types/socket.io": "^2.1.13", | ||
@@ -39,0 +39,0 @@ "@types/socket.io-client": "^1.4.36", |
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
586732
7376
+ Added@5minds/processcube_engine_sdk@4.0.0-feature-758110-lkqrmrtr(transitive)
- Removed@5minds/processcube_engine_sdk@3.3.0(transitive)
Updated@5minds/processcube_engine_sdk@4.0.0-feature-758110-lkqrmrtr