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.
Files changed (53) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/README.md +1 -1
  3. package/dist/chunk-5J6TNMJG.js +1 -0
  4. package/dist/chunk-6UXAINJQ.js +1 -0
  5. package/dist/chunk-7WFHHPX4.js +1 -0
  6. package/dist/chunk-BNX2SV7E.js +1 -0
  7. package/dist/chunk-CYVALTSI.js +218 -0
  8. package/dist/chunk-DMHGXYVW.js +14 -0
  9. package/dist/chunk-IEOZJAW2.js +1 -0
  10. package/dist/chunk-KFTXS23Q.js +1 -0
  11. package/dist/chunk-NI6U7PHC.js +76 -0
  12. package/dist/chunk-PRVESNIO.js +1 -0
  13. package/dist/chunk-QMJQ5NK5.js +42 -0
  14. package/dist/chunk-QRG4O4PE.js +2 -0
  15. package/dist/chunk-R5GS6TJS.js +1 -0
  16. package/dist/client/index.js +160 -13725
  17. package/dist/condition-CFAA7UDI.js +1 -0
  18. package/dist/database-query-OHFQUPLV.js +1 -0
  19. package/dist/handler-YTQRRHEK.js +1 -0
  20. package/dist/http-request-EHJHOTNA.js +1 -0
  21. package/dist/loop-5LPVY452.js +1 -0
  22. package/dist/merge-HYBHX22D.js +1 -0
  23. package/dist/next/index.d.ts +9 -0
  24. package/dist/next/index.js +1 -84
  25. package/dist/plugins/index.js +1 -54
  26. package/dist/server/api/index.d.ts +30 -1
  27. package/dist/server/api/index.js +18 -2360
  28. package/dist/server/index.js +1 -60
  29. package/dist/styles.css +3 -0
  30. package/dist/switch-ZPVREROE.js +1 -0
  31. package/drizzle.config.ts +9 -0
  32. package/package.json +27 -2
  33. package/src/plugins/types.ts +31 -0
  34. package/src/server/db/schema.ts +228 -0
  35. package/src/server/lib/utils/id.ts +26 -0
  36. package/dist/chunk-3XFDIK7H.js +0 -251
  37. package/dist/chunk-5H76TY4T.js +0 -51
  38. package/dist/chunk-5YYA34YV.js +0 -96
  39. package/dist/chunk-C7GDB4KC.js +0 -550
  40. package/dist/chunk-CKE7ETZL.js +0 -169
  41. package/dist/chunk-EMCA7GLF.js +0 -1305
  42. package/dist/chunk-J72T2LRL.js +0 -66
  43. package/dist/chunk-JUV5RBYM.js +0 -105
  44. package/dist/chunk-O3I2INCD.js +0 -71
  45. package/dist/chunk-OQHML4II.js +0 -36
  46. package/dist/chunk-PEVVELQ6.js +0 -438
  47. package/dist/condition-VHC4KYLI.js +0 -29
  48. package/dist/database-query-BYPF5CDB.js +0 -99
  49. package/dist/http-request-4OT32ZXA.js +0 -76
  50. package/dist/loop-S5H7DSCB.js +0 -47
  51. package/dist/merge-X5JAIZSZ.js +0 -107
  52. package/dist/style-prefixed.css +0 -5167
  53. package/dist/switch-WZBVDWWR.js +0 -68
@@ -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
- };