@5minds/processcube_app_sdk 0.0.1-develop-ff2bac-lk2k7x10 → 0.0.1-develop-c3e473-lk6h0fnw
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/index.cjs +1 -1
- package/server/index.mjs +1 -1
- package/server/lib/UserTaskFunctions.d.ts +21 -0
package/package.json
CHANGED
package/server/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var u=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var g=(e,s)=>{for(var t in s)u(e,t,{get:s[t],enumerable:!0})},m=(e,s,t,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of k(s))!w.call(e,a)&&a!==t&&u(e,a,{get:()=>s[a],enumerable:!(r=T(s,a))||r.enumerable});return e};var N=e=>m(u({},"__esModule",{value:!0}),e);var b={};g(b,{finishUserTask:()=>D,finishUserTaskAndGetNext:()=>C,getActiveProcessInstances:()=>M,getAssignedUserTasksByIdentity:()=>q,getReservedUserTasksByIdentity:()=>h,getUserTasks:()=>F,getWaitingUserTaskByCorrelationId:()=>E,getWaitingUserTaskByFlowNodeInstanceId:()=>p,getWaitingUserTasks:()=>P,getWaitingUserTasksByFlowNodeId:()=>S,hardNavigate:()=>B,startProcess:()=>R,waitForUserTaskByProcessInstanceId:()=>x});module.exports=N(b);var X=require("only-server");var o=require("@5minds/processcube_engine_client");var d=require("@5minds/processcube_engine_client"),n=new d.EngineClient(process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560");async function U(e,s){let t=await n.userTasks.query({processInstanceId:e,flowNodeId:s});return t.totalCount==0?null:t.userTasks[0]}async function x(e,s){return new Promise(async(t,r)=>{let a=n.userTasks.onUserTaskWaiting(async i=>{if(i.processInstanceId===e&&i.flowNodeId===s&&i.flowNodeInstanceId!=null){let l=await p(i.flowNodeInstanceId);return l!=null?t(l):r(new Error(`UserTask with instance ID "${i.flowNodeInstanceId}" does not exist.`))}}),c=await U(e,s);c&&t(c),await a})}async function C(e,s,t){await n.userTasks.finishUserTask(e,s);let r=await n.userTasks.query({flowNodeId:t,state:o.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended});return r.totalCount>0?r.userTasks[0]:null}async function F(...e){return n.userTasks.query(...e)}async function P(e){return n.userTasks.query({state:o.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},e)}async function S(e,s){return n.userTasks.query({flowNodeId:e,state:o.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},s)}async function p(e,s){let t=await n.userTasks.query({flowNodeInstanceId:e,state:o.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return t.userTasks.length?t.userTasks[0]:null}async function E(e){let s=await n.userTasks.query({correlationId:e,state:o.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended});return s.totalCount==0?null:s.userTasks[0]}async function h(e,s){let r=(await n.userTasks.query({state:o.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...s})).userTasks.filter(a=>a.actualOwnerId===e.userId);return r.length?r:null}async function q(e,s){let r=(await n.userTasks.query({state:o.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...s})).userTasks.filter(a=>a.assignedUserIds?.includes(e.userId));return r.length?r:null}var f=require("@5minds/processcube_engine_client");async function M(){let e=await n.processInstances.query({state:f.DataModels.ProcessInstances.ProcessInstanceState.running});return e.totalCount===0?null:e.processInstances}var I=require("next/cache"),y=require("next/navigation");async function B(e,s){(0,I.revalidatePath)(e),(0,y.redirect)(e,s)}async function R(...e){return await n.processModels.startProcessInstance(...e)}async function D(...e){await n.userTasks.finishUserTask(...e)}0&&(module.exports={finishUserTask,finishUserTaskAndGetNext,getActiveProcessInstances,getAssignedUserTasksByIdentity,getReservedUserTasksByIdentity,getUserTasks,getWaitingUserTaskByCorrelationId,getWaitingUserTaskByFlowNodeInstanceId,getWaitingUserTasks,getWaitingUserTasksByFlowNodeId,hardNavigate,startProcess,waitForUserTaskByProcessInstanceId});
|
package/server/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"only-server";import{DataModels as
|
|
1
|
+
import"only-server";import{DataModels as a}from"@5minds/processcube_engine_client";import{EngineClient as l}from"@5minds/processcube_engine_client";var t=new l(process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560");async function d(e,s){let n=await t.userTasks.query({processInstanceId:e,flowNodeId:s});return n.totalCount==0?null:n.userTasks[0]}async function m(e,s){return new Promise(async(n,r)=>{let o=t.userTasks.onUserTaskWaiting(async i=>{if(i.processInstanceId===e&&i.flowNodeId===s&&i.flowNodeInstanceId!=null){let c=await p(i.flowNodeInstanceId);return c!=null?n(c):r(new Error(`UserTask with instance ID "${i.flowNodeInstanceId}" does not exist.`))}}),u=await d(e,s);u&&n(u),await o})}async function N(e,s,n){await t.userTasks.finishUserTask(e,s);let r=await t.userTasks.query({flowNodeId:n,state:a.FlowNodeInstances.FlowNodeInstanceState.suspended});return r.totalCount>0?r.userTasks[0]:null}async function U(...e){return t.userTasks.query(...e)}async function x(e){return t.userTasks.query({state:a.FlowNodeInstances.FlowNodeInstanceState.suspended},e)}async function C(e,s){return t.userTasks.query({flowNodeId:e,state:a.FlowNodeInstances.FlowNodeInstanceState.suspended},s)}async function p(e,s){let n=await t.userTasks.query({flowNodeInstanceId:e,state:a.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return n.userTasks.length?n.userTasks[0]:null}async function F(e){let s=await t.userTasks.query({correlationId:e,state:a.FlowNodeInstances.FlowNodeInstanceState.suspended});return s.totalCount==0?null:s.userTasks[0]}async function P(e,s){let r=(await t.userTasks.query({state:a.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...s})).userTasks.filter(o=>o.actualOwnerId===e.userId);return r.length?r:null}async function S(e,s){let r=(await t.userTasks.query({state:a.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...s})).userTasks.filter(o=>o.assignedUserIds?.includes(e.userId));return r.length?r:null}import{DataModels as f}from"@5minds/processcube_engine_client";async function M(){let e=await t.processInstances.query({state:f.ProcessInstances.ProcessInstanceState.running});return e.totalCount===0?null:e.processInstances}import{revalidatePath as I}from"next/cache";import{redirect as y}from"next/navigation";async function A(e,s){I(e),y(e,s)}async function v(...e){return await t.processModels.startProcessInstance(...e)}async function L(...e){await t.userTasks.finishUserTask(...e)}export{L as finishUserTask,N as finishUserTaskAndGetNext,M as getActiveProcessInstances,S as getAssignedUserTasksByIdentity,P as getReservedUserTasksByIdentity,U as getUserTasks,F as getWaitingUserTaskByCorrelationId,p as getWaitingUserTaskByFlowNodeInstanceId,x as getWaitingUserTasks,C as getWaitingUserTasksByFlowNodeId,A as hardNavigate,v as startProcess,m as waitForUserTaskByProcessInstanceId};
|
|
@@ -28,3 +28,24 @@ export declare function getWaitingUserTaskByFlowNodeInstanceId(flowNodeInstanceI
|
|
|
28
28
|
* @returns DataModels.FlowNodeInstances.UserTaskInstance | null
|
|
29
29
|
*/
|
|
30
30
|
export declare function getWaitingUserTaskByCorrelationId(correlationId: string): Promise<DataModels.FlowNodeInstances.UserTaskInstance | null>;
|
|
31
|
+
/**
|
|
32
|
+
* @param identity The identity of the user
|
|
33
|
+
* @param options Additional options for the query e.g. `sortSettings`
|
|
34
|
+
* @returns DataModels.FlowNodeInstances.UserTaskInstance[] | null
|
|
35
|
+
*/
|
|
36
|
+
export declare function getReservedUserTasksByIdentity(identity: DataModels.Iam.Identity, options?: {
|
|
37
|
+
offset?: number;
|
|
38
|
+
limit?: number;
|
|
39
|
+
sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
|
|
40
|
+
}): Promise<DataModels.FlowNodeInstances.UserTaskInstance[] | null>;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param identity The identity of the user
|
|
44
|
+
* @param options Additional options for the query e.g. `sortSettings`
|
|
45
|
+
* @returns DataModels.FlowNodeInstances.UserTaskInstance[] | null
|
|
46
|
+
*/
|
|
47
|
+
export declare function getAssignedUserTasksByIdentity(identity: DataModels.Iam.Identity, options?: {
|
|
48
|
+
offset?: number;
|
|
49
|
+
limit?: number;
|
|
50
|
+
sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
|
|
51
|
+
}): Promise<DataModels.FlowNodeInstances.UserTaskInstance[] | null>;
|