next-workflow-builder 0.5.0 → 0.7.1
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/CHANGELOG.md +167 -0
- package/README.md +1 -1
- package/dist/chunk-5J6TNMJG.js +1 -0
- package/dist/chunk-6UXAINJQ.js +1 -0
- package/dist/chunk-7WFHHPX4.js +1 -0
- package/dist/chunk-BNX2SV7E.js +1 -0
- package/dist/chunk-CYVALTSI.js +218 -0
- package/dist/chunk-DMHGXYVW.js +14 -0
- package/dist/chunk-IEOZJAW2.js +1 -0
- package/dist/chunk-KFTXS23Q.js +1 -0
- package/dist/chunk-NI6U7PHC.js +76 -0
- package/dist/chunk-PRVESNIO.js +1 -0
- package/dist/chunk-QMJQ5NK5.js +42 -0
- package/dist/chunk-QRG4O4PE.js +2 -0
- package/dist/chunk-R5GS6TJS.js +1 -0
- package/dist/client/index.js +160 -13725
- package/dist/condition-CFAA7UDI.js +1 -0
- package/dist/database-query-OHFQUPLV.js +1 -0
- package/dist/handler-YTQRRHEK.js +1 -0
- package/dist/http-request-EHJHOTNA.js +1 -0
- package/dist/loop-5LPVY452.js +1 -0
- package/dist/merge-HYBHX22D.js +1 -0
- package/dist/next/index.d.ts +9 -0
- package/dist/next/index.js +1 -84
- package/dist/plugins/index.js +1 -54
- package/dist/server/api/index.d.ts +30 -1
- package/dist/server/api/index.js +18 -2360
- package/dist/server/index.js +1 -60
- package/dist/styles.css +3 -0
- package/dist/switch-ZPVREROE.js +1 -0
- package/drizzle.config.ts +9 -0
- package/package.json +27 -2
- package/src/plugins/types.ts +31 -0
- package/src/server/db/schema.ts +228 -0
- package/src/server/lib/utils/id.ts +26 -0
- package/dist/chunk-3XFDIK7H.js +0 -251
- package/dist/chunk-5H76TY4T.js +0 -51
- package/dist/chunk-5YYA34YV.js +0 -96
- package/dist/chunk-C7GDB4KC.js +0 -550
- package/dist/chunk-CKE7ETZL.js +0 -169
- package/dist/chunk-EMCA7GLF.js +0 -1305
- package/dist/chunk-J72T2LRL.js +0 -66
- package/dist/chunk-JUV5RBYM.js +0 -105
- package/dist/chunk-O3I2INCD.js +0 -71
- package/dist/chunk-OQHML4II.js +0 -36
- package/dist/chunk-PEVVELQ6.js +0 -438
- package/dist/condition-VHC4KYLI.js +0 -29
- package/dist/database-query-BYPF5CDB.js +0 -99
- package/dist/http-request-4OT32ZXA.js +0 -76
- package/dist/loop-S5H7DSCB.js +0 -47
- package/dist/merge-X5JAIZSZ.js +0 -107
- package/dist/style-prefixed.css +0 -5167
- package/dist/switch-WZBVDWWR.js +0 -68
package/dist/switch-WZBVDWWR.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "./chunk-J72T2LRL.js";
|
|
2
|
-
import "./chunk-C7GDB4KC.js";
|
|
3
|
-
import "./chunk-JUV5RBYM.js";
|
|
4
|
-
import "./chunk-5YYA34YV.js";
|
|
5
|
-
import "./chunk-OQHML4II.js";
|
|
6
|
-
import "./chunk-5H76TY4T.js";
|
|
7
|
-
import "./chunk-CKE7ETZL.js";
|
|
8
|
-
import "./chunk-3XFDIK7H.js";
|
|
9
|
-
import "./chunk-O3I2INCD.js";
|
|
10
|
-
import {
|
|
11
|
-
withStepLogging
|
|
12
|
-
} from "./chunk-PEVVELQ6.js";
|
|
13
|
-
|
|
14
|
-
// src/plugins/switch/switch.ts
|
|
15
|
-
import "server-only";
|
|
16
|
-
function buildRoutes(input) {
|
|
17
|
-
const routes = [];
|
|
18
|
-
for (let i = 0; i < 4; i++) {
|
|
19
|
-
const name = input[`routeName${i}`];
|
|
20
|
-
const condition = input[`routeCondition${i}`];
|
|
21
|
-
const caseValue = input[`routeCaseValue${i}`];
|
|
22
|
-
routes.push({
|
|
23
|
-
name: name || `Route ${i + 1}`,
|
|
24
|
-
condition,
|
|
25
|
-
caseValue
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return routes;
|
|
29
|
-
}
|
|
30
|
-
function evaluateSwitch(input) {
|
|
31
|
-
const mode = input.mode || "rules";
|
|
32
|
-
const routes = buildRoutes(input);
|
|
33
|
-
if (mode === "rules") {
|
|
34
|
-
for (let i = 0; i < routes.length; i++) {
|
|
35
|
-
if (routes[i].condition === true) {
|
|
36
|
-
return {
|
|
37
|
-
matchedRouteIndex: i,
|
|
38
|
-
matchedRouteName: routes[i].name,
|
|
39
|
-
isDefault: false
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
const switchValue = String(input.switchValue ?? "");
|
|
45
|
-
for (let i = 0; i < routes.length; i++) {
|
|
46
|
-
if (routes[i].caseValue !== void 0 && String(routes[i].caseValue) === switchValue) {
|
|
47
|
-
return {
|
|
48
|
-
matchedRouteIndex: i,
|
|
49
|
-
matchedRouteName: routes[i].name,
|
|
50
|
-
isDefault: false
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
matchedRouteIndex: -1,
|
|
57
|
-
matchedRouteName: "Default",
|
|
58
|
-
isDefault: true
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
async function switchStep(input) {
|
|
62
|
-
"use step";
|
|
63
|
-
return withStepLogging(input, () => Promise.resolve(evaluateSwitch(input)));
|
|
64
|
-
}
|
|
65
|
-
switchStep.maxRetries = 0;
|
|
66
|
-
export {
|
|
67
|
-
switchStep
|
|
68
|
-
};
|