@5minds/processcube_app_sdk 0.0.1-develop-67a1d9-ljwtoaen → 0.0.1-develop-58ef18-ljwy3pcr
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/README.md +2 -0
- package/package.json +1 -1
- package/server/index.cjs +1 -1
- package/server/index.d.ts +7 -6
- package/server/index.mjs +1 -1
- package/server/lib/internal/EngineClient.d.ts +2 -0
- package/server/server-actions/UserTaskActions.d.ts +3 -3
- package/server/lib/internal/EngineUrlConfig.d.ts +0 -2
package/README.md
CHANGED
|
@@ -36,6 +36,8 @@ Beispiel:
|
|
|
36
36
|
import { startProcess } from "@5minds/processcube_app_sdk/server";
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
Um die Engine URL anzupassen, die von den exportierten Funktionen genutzt wird, muss `PROCESSCUBE_ENGINE_URL` als Umgebungsvariable gesetzt werden. Andernfalls wird localhost mit dem Standardport der Engine genutzt `10560`.
|
|
40
|
+
|
|
39
41
|
### Client
|
|
40
42
|
|
|
41
43
|
Es können nur Komponenten und Funktionen importiert werden, die im Browser funktionieren. Zum Beispiel React Komponenten, die einen Clientseitigen Router und dessen React Hooks nutzen oder Funktionen die auf `window` oder generell globale Browser APIs zugreifen möchten.
|
package/package.json
CHANGED
package/server/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var i=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var T=(s,e)=>{for(var t in e)i(s,t,{get:e[t],enumerable:!0})},k=(s,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!y.call(s,r)&&r!==t&&i(s,r,{get:()=>e[r],enumerable:!(o=d(e,r))||o.enumerable});return s};var I=s=>k(i({},"__esModule",{value:!0}),s);var x={};T(x,{finishTask:()=>P,finishUserTaskAndGetNext:()=>C,hardNavigate:()=>E,startProcess:()=>U,waitForUserTaskByProcessInstanceId:()=>N});module.exports=I(x);var O=require("only-server");var p=require("@5minds/processcube_engine_client");var c=require("@5minds/processcube_engine_client"),n=new c.EngineClient(process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560");async function g(s){return(await n.userTasks.query({flowNodeInstanceId:s})).userTasks[0]}async function w(s,e){let t=await n.userTasks.query({processInstanceId:s,flowNodeId:e});return t.totalCount==0?null:t.userTasks[0]}async function N(s,e){return new Promise(async t=>{let o=n.userTasks.onUserTaskWaiting(async a=>{if(a.processInstanceId===s&&a.flowNodeId===e){let l=await g(a.flowNodeInstanceId);t(l)}}),r=await w(s,e);r&&t(r),await o})}async function C(s,e,t){await n.userTasks.finishUserTask(s,e);let o=await n.userTasks.query({flowNodeId:t,state:p.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended});return o.totalCount>0?o.userTasks[0]:null}var u=require("next/cache"),f=require("next/navigation");async function E(s,e){(0,u.revalidatePath)(s),(0,f.redirect)(s,e)}async function U(...s){return await n.processModels.startProcessInstance(...s)}async function P(...s){await n.userTasks.finishUserTask(...s)}0&&(module.exports={finishTask,finishUserTaskAndGetNext,hardNavigate,startProcess,waitForUserTaskByProcessInstanceId});
|
package/server/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import 'only-server';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
config: ({ engineUrl }: {
|
|
4
|
-
engineUrl: string;
|
|
5
|
-
}) => void;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
8
2
|
export * from './lib';
|
|
9
3
|
export * from './server-actions';
|
|
4
|
+
declare global {
|
|
5
|
+
namespace NodeJS {
|
|
6
|
+
interface ProcessEnv {
|
|
7
|
+
PROCESSCUBE_ENGINE_URL?: string;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
package/server/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"only-server";
|
|
1
|
+
import"only-server";import{DataModels as p}from"@5minds/processcube_engine_client";import{EngineClient as c}from"@5minds/processcube_engine_client";var t=new c(process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560");async function u(s){return(await t.userTasks.query({flowNodeInstanceId:s})).userTasks[0]}async function f(s,e){let n=await t.userTasks.query({processInstanceId:s,flowNodeId:e});return n.totalCount==0?null:n.userTasks[0]}async function I(s,e){return new Promise(async n=>{let r=t.userTasks.onUserTaskWaiting(async o=>{if(o.processInstanceId===s&&o.flowNodeId===e){let i=await u(o.flowNodeInstanceId);n(i)}}),a=await f(s,e);a&&n(a),await r})}async function g(s,e,n){await t.userTasks.finishUserTask(s,e);let r=await t.userTasks.query({flowNodeId:n,state:p.FlowNodeInstances.FlowNodeInstanceState.suspended});return r.totalCount>0?r.userTasks[0]:null}import{revalidatePath as l}from"next/cache";import{redirect as d}from"next/navigation";async function P(s,e){l(s),d(s,e)}async function R(...s){return await t.processModels.startProcessInstance(...s)}async function F(...s){await t.userTasks.finishUserTask(...s)}export{F as finishTask,g as finishUserTaskAndGetNext,P as hardNavigate,R as startProcess,I as waitForUserTaskByProcessInstanceId};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function startProcess(
|
|
3
|
-
export declare function finishTask(
|
|
1
|
+
import type { EngineClient } from '@5minds/processcube_engine_client';
|
|
2
|
+
export declare function startProcess(...args: Parameters<typeof EngineClient.prototype.processModels.startProcessInstance>): ReturnType<typeof EngineClient.prototype.processModels.startProcessInstance>;
|
|
3
|
+
export declare function finishTask(...args: Parameters<typeof EngineClient.prototype.userTasks.finishUserTask>): ReturnType<typeof EngineClient.prototype.userTasks.finishUserTask>;
|