@5minds/processcube_app_sdk 0.0.1-develop-5addcb-ljr75mtu → 0.0.1-develop-669364-ljwnpq3m
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 +5 -4
- package/client/index.cjs +1 -0
- package/common/index.cjs +1 -0
- package/package.json +18 -10
- package/server/index.cjs +1 -0
- /package/client/{index.js → index.mjs} +0 -0
- /package/common/{index.js → index.mjs} +0 -0
- /package/server/{index.js → index.mjs} +0 -0
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@ Das SDK beinhaltet Komponenten und Funktionen für Frontend und Backend (Client/
|
|
|
5
5
|
## Installation zur Verwendung
|
|
6
6
|
|
|
7
7
|
### Vorraussetzungen
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
- NodeJS `>= v16`
|
|
9
10
|
|
|
10
11
|
```shell
|
|
11
12
|
npm i @5minds/processcube_app_sdk
|
|
@@ -20,6 +21,7 @@ Das NPM Paket hat *drei* Exports.
|
|
|
20
21
|
Hier werden Komponten und Funktionen exportiert, die im Client und Server genutzt werden können.
|
|
21
22
|
|
|
22
23
|
Zum Beispiel die React Kompontene RemoteUserTask:
|
|
24
|
+
|
|
23
25
|
```javascript
|
|
24
26
|
import { RemoteUserTask } from "@5minds/processcube_app_sdk";
|
|
25
27
|
```
|
|
@@ -36,13 +38,12 @@ import { startProcess } from "@5minds/processcube_app_sdk/server";
|
|
|
36
38
|
|
|
37
39
|
### Client
|
|
38
40
|
|
|
39
|
-
Es können nur Komponenten und Funktionen
|
|
41
|
+
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.
|
|
40
42
|
|
|
41
43
|
```javascript
|
|
42
44
|
import { DynamicLink } from "@5minds/processcube_app_sdk/client";
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
|
|
46
47
|
## Wie kann ich das Projekt aufsetzen?
|
|
47
48
|
|
|
48
49
|
### Setup/Installation
|
|
@@ -77,4 +78,4 @@ npm link @5minds/processcube_app_sdk
|
|
|
77
78
|
|
|
78
79
|
## Wen kann ich auf das Projekt ansprechen?
|
|
79
80
|
|
|
80
|
-
1. [Alexander Kasten](mailto:alexander.kasten@5minds.de)
|
|
81
|
+
1. [Alexander Kasten](mailto:alexander.kasten@5minds.de)
|
package/client/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var u=(e,r)=>{for(var o in r)i(e,o,{get:r[o],enumerable:!0})},l=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of f(r))!m.call(e,n)&&n!==o&&i(e,n,{get:()=>r[n],enumerable:!(t=c(r,n))||t.enumerable});return e};var s=e=>l(i({},"__esModule",{value:!0}),e);var D={};u(D,{DynamicLink:()=>y});module.exports=s(D);var v=require("client-only");var p=require("next/navigation"),a=require("react/jsx-runtime");function y({href:e,children:r}){let o=(0,p.useRouter)();return(0,a.jsx)("a",{href:e,onClick:t=>{t.preventDefault(),o.replace(e),o.refresh()},children:r})}0&&(module.exports={DynamicLink});
|
package/common/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var f=(e,r)=>{for(var o in r)i(e,o,{get:r[o],enumerable:!0})},d=(e,r,o,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of p(r))!a.call(e,t)&&t!==o&&i(e,t,{get:()=>r[t],enumerable:!(m=h(r,t))||m.enumerable});return e};var R=e=>d(i({},"__esModule",{value:!0}),e);var k={};f(k,{RemoteUserTask:()=>g});module.exports=R(k);var s=require("react/jsx-runtime");function g(e){return(0,s.jsx)("div",{style:{width:"100%",height:"100%"},children:(0,s.jsx)("iframe",{width:"100%",height:"100%",src:e.url})})}0&&(module.exports={RemoteUserTask});
|
package/package.json
CHANGED
|
@@ -1,33 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@5minds/processcube_app_sdk",
|
|
3
|
-
"version": "0.0.1-develop-
|
|
3
|
+
"version": "0.0.1-develop-669364-ljwnpq3m",
|
|
4
4
|
"description": "The SDK for ProcessCube Apps",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "common/index.
|
|
7
|
-
"module": "common/index.
|
|
8
|
-
"browser": "client/index.
|
|
6
|
+
"main": "common/index.cjs",
|
|
7
|
+
"module": "common/index.mjs",
|
|
8
|
+
"browser": "client/index.mjs",
|
|
9
9
|
"types": "common/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./common/index.d.ts",
|
|
13
|
-
"
|
|
13
|
+
"require": "./common/index.cjs",
|
|
14
|
+
"default": "./common/index.mjs"
|
|
14
15
|
},
|
|
15
16
|
"./server": {
|
|
16
17
|
"types": "./server/index.d.ts",
|
|
17
|
-
"
|
|
18
|
+
"require": "./server/index.cjs",
|
|
19
|
+
"default": "./server/index.mjs"
|
|
18
20
|
},
|
|
19
21
|
"./client": {
|
|
20
22
|
"types": "./client/index.d.ts",
|
|
21
|
-
"
|
|
23
|
+
"require": "./client/index.cjs",
|
|
24
|
+
"default": "./client/index.mjs"
|
|
22
25
|
}
|
|
23
26
|
},
|
|
24
27
|
"scripts": {
|
|
25
28
|
"clean": "rm -rf server common client",
|
|
26
29
|
"prepare": "npm run build:prod",
|
|
27
30
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
28
|
-
"build": "
|
|
29
|
-
"build:
|
|
30
|
-
"
|
|
31
|
+
"build": "concurrently -n=build:esm,build:commonjs,build:types \"npm run build:esm\" \"npm run build:commonjs\" \"npm run build:types\"",
|
|
32
|
+
"build:esm": "NODE_ENV=development esbuild src/**/*.ts --outdir=. --packages=external --bundle --format=esm --analyze=verbose --out-extension:.js=.mjs",
|
|
33
|
+
"build:commonjs": "NODE_ENV=development esbuild src/**/*.ts --outdir=. --packages=external --bundle --platform=node --out-extension:.js=.cjs --analyze=verbose",
|
|
34
|
+
"build:types": "tsc --emitDeclarationOnly && tsc -p tsconfig.common.json --emitDeclarationOnly && tsc -p tsconfig.client.json --emitDeclarationOnly",
|
|
35
|
+
"build:prod": "npm run clean && concurrently -n=build:prod:esm,build:prod:commonjs,build:types \"npm run build:prod:esm\" \"npm run build:prod:commonjs\" \"npm run build:types\"",
|
|
36
|
+
"build:prod:esm": "NODE_ENV=production esbuild src/**/*.ts --outdir=. --packages=external --bundle --format=esm --tree-shaking=true --splitting --minify --drop:console --out-extension:.js=.mjs",
|
|
37
|
+
"build:prod:commonjs": "NODE_ENV=production esbuild src/**/*.ts --outdir=. --packages=external --bundle --platform=node --out-extension:.js=.cjs --tree-shaking=true --minify --drop:console",
|
|
38
|
+
"watch": "NODE_ENV=development concurrently --kill-others -n=esbuild:esm,esbuild:comonjs,tsc:server,tsc:common,tsc:client \"esbuild src/**/*.ts --watch --outdir=. --format=esm --bundle --packages=external --out-extension:.js=.mjs\" \"esbuild src/**/*.ts --watch --outdir=. --platform=node --bundle --packages=external --out-extension:.js=.cjs\" \"tsc -p tsconfig.json --watch --preserveWatchOutput --emitDeclarationOnly\" \"tsc -p tsconfig.common.json --watch --preserveWatchOutput --emitDeclarationOnly\" \"tsc -p tsconfig.client.json --watch --preserveWatchOutput --emitDeclarationOnly\""
|
|
31
39
|
},
|
|
32
40
|
"repository": {
|
|
33
41
|
"type": "git",
|
package/server/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var w=(s,t)=>{for(var e in t)u(s,e,{get:t[e],enumerable:!0})},y=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!k.call(s,n)&&n!==e&&u(s,n,{get:()=>t[n],enumerable:!(r=I(t,n))||r.enumerable});return s};var U=s=>y(u({},"__esModule",{value:!0}),s);var S={};w(S,{default:()=>B,finishTask:()=>R,finishUserTaskAndGetNext:()=>M,hardNavigate:()=>C,startProcess:()=>D,waitForUserTaskByProcessInstanceId:()=>h});module.exports=U(S);var K=require("server-only");var x=process.env.PROCESSCUBE_ENGINE_URL||"http://localhost:10560";function a(){return x}function l(s){s=s}var i=require("@5minds/processcube_engine_client");var N=a(),o=new i.EngineClient(N);async function E(s){return(await o.userTasks.query({flowNodeInstanceId:s})).userTasks[0]}async function P(s,t){let e=await o.userTasks.query({processInstanceId:s,flowNodeId:t});return e.totalCount==0?null:e.userTasks[0]}async function h(s,t){return new Promise(async e=>{let r=o.userTasks.onUserTaskWaiting(async c=>{if(c.processInstanceId===s&&c.flowNodeId===t){let m=await E(c.flowNodeInstanceId);e(m)}}),n=await P(s,t);n&&e(n),await r})}async function M(s,t,e){await o.userTasks.finishUserTask(s,t);let r=await o.userTasks.query({flowNodeId:e,state:i.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended});return r.totalCount>0?r.userTasks[0]:null}var f=require("next/cache"),d=require("next/navigation");async function C(s,t){(0,f.revalidatePath)(s),(0,d.redirect)(s,t)}var p=require("@5minds/processcube_engine_client");var F=a(),g=new p.EngineClient(F);async function D(s){return await g.processModels.startProcessInstance({processModelId:s})}async function R(s,t){await g.userTasks.finishUserTask(s,t)}var B={config:({engineUrl:s})=>{typeof s=="string"&&l(s)}};0&&(module.exports={finishTask,finishUserTaskAndGetNext,hardNavigate,startProcess,waitForUserTaskByProcessInstanceId});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|