feat: per-user settings, workflow API key, cron scheduler, and engine logging
- Add ownerId to settings table for per-user key-value storage - Add settings KV API endpoint scoped by user - Add workflow API key config in settings page - Action executor uses per-user workflow API key, falls back to session auth - Bootstrap cron scheduler on server start via instrumentation hook - Re-register/unregister cron on workflow enable/disable/delete - Downgrade node-cron to v3 for Turbopack compatibility - Add structured console logs to workflow engine for all steps - Enabled toggle saves immediately to server - Schedule popover saves immediately to server - Use react-hot-toast instead of shadcn toast in workflow editor
This commit is contained in:
1 parent
4b6ec60cb9
commit
d0a7894a25
13 files changed
+1044
-14
No files matched your search
@@ -36,6 +36,7 @@
|
||||
"@types/react-autosuggest": "^10.1.11",
|
||||
"@types/react-calendar-heatmap": "^1.9.0",
|
||||
"@types/react-window": "^1.8.8",
|
||||
"@xyflow/react": "^12.10.2",
|
||||
"ai": "^6.0.146",
|
||||
"axios": "^1.14.0",
|
||||
"chrono-node": "^1.4.9",
|
||||
@@ -53,6 +54,7 @@
|
||||
"lucide-react": "^0.428.0",
|
||||
"next": "15.5.14",
|
||||
"next-themes": "^0.3.0",
|
||||
"node-cron": "3.0.3",
|
||||
"pg": "^8.20.0",
|
||||
"qs": "^6.15.0",
|
||||
"react": "19.2.4",
|
||||
@@ -78,6 +80,7 @@
|
||||
"@types/leaflet": "^1.9.21",
|
||||
"@types/leaflet.heat": "^0.2.5",
|
||||
"@types/node": "^20.19.39",
|
||||
"@types/node-cron": "3.0.11",
|
||||
"@types/pg": "^8.20.0",
|
||||
"@types/react": "19.2.14",
|
||||
"@types/react-dom": "19.2.3",
|
||||
@@ -517,6 +520,8 @@
|
||||
|
||||
"@types/d3-color": ["@types/d3-color@3.1.3", "", {}, "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A=="],
|
||||
|
||||
"@types/d3-drag": ["@types/d3-drag@3.0.7", "", { "dependencies": { "@types/d3-selection": "*" } }, "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ=="],
|
||||
|
||||
"@types/d3-ease": ["@types/d3-ease@3.0.2", "", {}, "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA=="],
|
||||
|
||||
"@types/d3-interpolate": ["@types/d3-interpolate@3.0.4", "", { "dependencies": { "@types/d3-color": "*" } }, "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA=="],
|
||||
@@ -525,12 +530,18 @@
|
||||
|
||||
"@types/d3-scale": ["@types/d3-scale@4.0.9", "", { "dependencies": { "@types/d3-time": "*" } }, "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw=="],
|
||||
|
||||
"@types/d3-selection": ["@types/d3-selection@3.0.11", "", {}, "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w=="],
|
||||
|
||||
"@types/d3-shape": ["@types/d3-shape@3.1.8", "", { "dependencies": { "@types/d3-path": "*" } }, "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w=="],
|
||||
|
||||
"@types/d3-time": ["@types/d3-time@3.0.4", "", {}, "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g=="],
|
||||
|
||||
"@types/d3-timer": ["@types/d3-timer@3.0.2", "", {}, "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw=="],
|
||||
|
||||
"@types/d3-transition": ["@types/d3-transition@3.0.9", "", { "dependencies": { "@types/d3-selection": "*" } }, "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg=="],
|
||||
|
||||
"@types/d3-zoom": ["@types/d3-zoom@3.0.8", "", { "dependencies": { "@types/d3-interpolate": "*", "@types/d3-selection": "*" } }, "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw=="],
|
||||
|
||||
"@types/eslint": ["@types/eslint@9.6.1", "", { "dependencies": { "@types/estree": "*", "@types/json-schema": "*" } }, "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag=="],
|
||||
|
||||
"@types/eslint-scope": ["@types/eslint-scope@3.7.7", "", { "dependencies": { "@types/eslint": "*", "@types/estree": "*" } }, "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg=="],
|
||||
@@ -553,6 +564,8 @@
|
||||
|
||||
"@types/node": ["@types/node@20.19.39", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-orrrD74MBUyK8jOAD/r0+lfa1I2MO6I+vAkmAWzMYbCcgrN4lCrmK52gRFQq/JRxfYPfonkr4b0jcY7Olqdqbw=="],
|
||||
|
||||
"@types/node-cron": ["@types/node-cron@3.0.11", "", {}, "sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg=="],
|
||||
|
||||
"@types/pg": ["@types/pg@8.20.0", "", { "dependencies": { "@types/node": "*", "pg-protocol": "*", "pg-types": "^2.2.0" } }, "sha512-bEPFOaMAHTEP1EzpvHTbmwR8UsFyHSKsRisLIHVMXnpNefSbGA1bD6CVy+qKjGSqmZqNqBDV2azOBo8TgkcVow=="],
|
||||
|
||||
"@types/qs": ["@types/qs@6.15.0", "", {}, "sha512-JawvT8iBVWpzTrz3EGw9BTQFg3BQNmwERdKE22vlTxawwtbyUSlMppvZYKLZzB5zgACXdXxbD3m1bXaMqP/9ow=="],
|
||||
@@ -667,6 +680,10 @@
|
||||
|
||||
"@xtuc/long": ["@xtuc/long@4.2.2", "", {}, "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="],
|
||||
|
||||
"@xyflow/react": ["@xyflow/react@12.10.2", "", { "dependencies": { "@xyflow/system": "0.0.76", "classcat": "^5.0.3", "zustand": "^4.4.0" }, "peerDependencies": { "react": ">=17", "react-dom": ">=17" } }, "sha512-CgIi6HwlcHXwlkTpr0fxLv/0sRVNZ8IdwKLzzeCscaYBwpvfcH1QFOCeaTCuEn1FQEs/B8CjnTSjhs8udgmBgQ=="],
|
||||
|
||||
"@xyflow/system": ["@xyflow/system@0.0.76", "", { "dependencies": { "@types/d3-drag": "^3.0.7", "@types/d3-interpolate": "^3.0.4", "@types/d3-selection": "^3.0.10", "@types/d3-transition": "^3.0.8", "@types/d3-zoom": "^3.0.8", "d3-drag": "^3.0.0", "d3-interpolate": "^3.0.1", "d3-selection": "^3.0.0", "d3-zoom": "^3.0.0" } }, "sha512-hvwvnRS1B3REwVDlWexsq7YQaPZeG3/mKo1jv38UmnpWmxihp14bW6VtEOuHEwJX2FvzFw8k77LyKSk/wiZVNA=="],
|
||||
|
||||
"acorn": ["acorn@8.16.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="],
|
||||
|
||||
"acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],
|
||||
@@ -771,6 +788,8 @@
|
||||
|
||||
"class-variance-authority": ["class-variance-authority@0.7.1", "", { "dependencies": { "clsx": "^2.1.1" } }, "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg=="],
|
||||
|
||||
"classcat": ["classcat@5.0.5", "", {}, "sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w=="],
|
||||
|
||||
"client-only": ["client-only@0.0.1", "", {}, "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="],
|
||||
|
||||
"clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
|
||||
@@ -805,6 +824,10 @@
|
||||
|
||||
"d3-color": ["d3-color@3.1.0", "", {}, "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA=="],
|
||||
|
||||
"d3-dispatch": ["d3-dispatch@3.0.1", "", {}, "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg=="],
|
||||
|
||||
"d3-drag": ["d3-drag@3.0.0", "", { "dependencies": { "d3-dispatch": "1 - 3", "d3-selection": "3" } }, "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg=="],
|
||||
|
||||
"d3-ease": ["d3-ease@3.0.1", "", {}, "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w=="],
|
||||
|
||||
"d3-format": ["d3-format@3.1.2", "", {}, "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg=="],
|
||||
@@ -815,6 +838,8 @@
|
||||
|
||||
"d3-scale": ["d3-scale@4.0.2", "", { "dependencies": { "d3-array": "2.10.0 - 3", "d3-format": "1 - 3", "d3-interpolate": "1.2.0 - 3", "d3-time": "2.1.1 - 3", "d3-time-format": "2 - 4" } }, "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ=="],
|
||||
|
||||
"d3-selection": ["d3-selection@3.0.0", "", {}, "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ=="],
|
||||
|
||||
"d3-shape": ["d3-shape@3.2.0", "", { "dependencies": { "d3-path": "^3.1.0" } }, "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA=="],
|
||||
|
||||
"d3-time": ["d3-time@3.1.0", "", { "dependencies": { "d3-array": "2 - 3" } }, "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q=="],
|
||||
@@ -823,6 +848,10 @@
|
||||
|
||||
"d3-timer": ["d3-timer@3.0.1", "", {}, "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA=="],
|
||||
|
||||
"d3-transition": ["d3-transition@3.0.1", "", { "dependencies": { "d3-color": "1 - 3", "d3-dispatch": "1 - 3", "d3-ease": "1 - 3", "d3-interpolate": "1 - 3", "d3-timer": "1 - 3" }, "peerDependencies": { "d3-selection": "2 - 3" } }, "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w=="],
|
||||
|
||||
"d3-zoom": ["d3-zoom@3.0.0", "", { "dependencies": { "d3-dispatch": "1 - 3", "d3-drag": "2 - 3", "d3-interpolate": "1 - 3", "d3-selection": "2 - 3", "d3-transition": "2 - 3" } }, "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw=="],
|
||||
|
||||
"damerau-levenshtein": ["damerau-levenshtein@1.0.8", "", {}, "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA=="],
|
||||
|
||||
"data-uri-to-buffer": ["data-uri-to-buffer@4.0.1", "", {}, "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A=="],
|
||||
@@ -1261,6 +1290,8 @@
|
||||
|
||||
"node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="],
|
||||
|
||||
"node-cron": ["node-cron@3.0.3", "", { "dependencies": { "uuid": "8.3.2" } }, "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A=="],
|
||||
|
||||
"node-domexception": ["node-domexception@1.0.0", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="],
|
||||
|
||||
"node-exports-info": ["node-exports-info@1.6.0", "", { "dependencies": { "array.prototype.flatmap": "^1.3.3", "es-errors": "^1.3.0", "object.entries": "^1.1.9", "semver": "^6.3.1" } }, "sha512-pyFS63ptit/P5WqUkt+UUfe+4oevH+bFeIiPPdfb0pFeYEu/1ELnJu5l+5EcTKYL5M7zaAa7S8ddywgXypqKCw=="],
|
||||
@@ -1615,6 +1646,8 @@
|
||||
|
||||
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
|
||||
|
||||
"uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="],
|
||||
|
||||
"victory-vendor": ["victory-vendor@36.9.2", "", { "dependencies": { "@types/d3-array": "^3.0.3", "@types/d3-ease": "^3.0.0", "@types/d3-interpolate": "^3.0.1", "@types/d3-scale": "^4.0.2", "@types/d3-shape": "^3.1.0", "@types/d3-time": "^3.0.0", "@types/d3-timer": "^3.0.0", "d3-array": "^3.1.6", "d3-ease": "^3.0.1", "d3-interpolate": "^3.0.1", "d3-scale": "^4.0.2", "d3-shape": "^3.1.0", "d3-time": "^3.0.0", "d3-timer": "^3.0.1" } }, "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ=="],
|
||||
|
||||
"watchpack": ["watchpack@2.5.1", "", { "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" } }, "sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg=="],
|
||||
@@ -1657,6 +1690,8 @@
|
||||
|
||||
"zod": ["zod@4.3.6", "", {}, "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg=="],
|
||||
|
||||
"zustand": ["zustand@4.5.7", "", { "dependencies": { "use-sync-external-store": "^1.2.2" }, "peerDependencies": { "@types/react": ">=16.8", "immer": ">=9.0.6", "react": ">=16.8" }, "optionalPeers": ["@types/react", "immer", "react"] }, "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw=="],
|
||||
|
||||
"@esbuild-kit/core-utils/esbuild": ["esbuild@0.18.20", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="],
|
||||
|
||||
"@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@
|
||||
"lucide-react": "^0.428.0",
|
||||
"next": "15.5.14",
|
||||
"next-themes": "^0.3.0",
|
||||
"node-cron": "^4.2.1",
|
||||
"node-cron": "3.0.3",
|
||||
"pg": "^8.20.0",
|
||||
"qs": "^6.15.0",
|
||||
"react": "19.2.4",
|
||||
@@ -92,7 +92,7 @@
|
||||
"@types/leaflet": "^1.9.21",
|
||||
"@types/leaflet.heat": "^0.2.5",
|
||||
"@types/node": "^20.19.39",
|
||||
"@types/node-cron": "^3.0.11",
|
||||
"@types/node-cron": "3.0.11",
|
||||
"@types/pg": "^8.20.0",
|
||||
"@types/react": "19.2.14",
|
||||
"@types/react-dom": "19.2.3",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
||||
CREATE TABLE `__new_settings` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`key` text NOT NULL,
|
||||
`value` text NOT NULL,
|
||||
`owner_id` text,
|
||||
`updated_at` integer
|
||||
);--> statement-breakpoint
|
||||
INSERT INTO `__new_settings`("id", "key", "value", "owner_id", "updated_at") SELECT "key", "key", "value", NULL, "updated_at" FROM `settings`;--> statement-breakpoint
|
||||
DROP TABLE `settings`;--> statement-breakpoint
|
||||
ALTER TABLE `__new_settings` RENAME TO `settings`;--> statement-breakpoint
|
||||
PRAGMA foreign_keys=ON;
|
||||
@@ -0,0 +1,747 @@
|
||||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "c9948313-c4b4-4db4-8975-8c409c20379e",
|
||||
"prevId": "f760ba33-ed15-4972-8578-51644001b8ed",
|
||||
"tables": {
|
||||
"settings": {
|
||||
"name": "settings",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"key": {
|
||||
"name": "key",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"value": {
|
||||
"name": "value",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"owner_id": {
|
||||
"name": "owner_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"api_keys": {
|
||||
"name": "api_keys",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"purpose": {
|
||||
"name": "purpose",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"key_name": {
|
||||
"name": "key_name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"secret": {
|
||||
"name": "secret",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"immich_key_id": {
|
||||
"name": "immich_key_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"api_keys_user_id_purpose_unique": {
|
||||
"name": "api_keys_user_id_purpose_unique",
|
||||
"columns": [
|
||||
"user_id",
|
||||
"purpose"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"import_job_items": {
|
||||
"name": "import_job_items",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"job_id": {
|
||||
"name": "job_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"asset_id": {
|
||||
"name": "asset_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"item_data": {
|
||||
"name": "item_data",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'{}'"
|
||||
},
|
||||
"immich_id": {
|
||||
"name": "immich_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"error": {
|
||||
"name": "error",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"import_job_items_job_id_import_jobs_id_fk": {
|
||||
"name": "import_job_items_job_id_import_jobs_id_fk",
|
||||
"tableFrom": "import_job_items",
|
||||
"tableTo": "import_jobs",
|
||||
"columnsFrom": [
|
||||
"job_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"import_jobs": {
|
||||
"name": "import_jobs",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"platform": {
|
||||
"name": "platform",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"url": {
|
||||
"name": "url",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"url_config": {
|
||||
"name": "url_config",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'{}'"
|
||||
},
|
||||
"import_data": {
|
||||
"name": "import_data",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'{}'"
|
||||
},
|
||||
"total_count": {
|
||||
"name": "total_count",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"uploaded_count": {
|
||||
"name": "uploaded_count",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"skipped_count": {
|
||||
"name": "skipped_count",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"failed_count": {
|
||||
"name": "failed_count",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"workflow_edges": {
|
||||
"name": "workflow_edges",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"workflow_id": {
|
||||
"name": "workflow_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"source_node_id": {
|
||||
"name": "source_node_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"target_node_id": {
|
||||
"name": "target_node_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"source_handle": {
|
||||
"name": "source_handle",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"workflow_edges_workflow_id_workflows_id_fk": {
|
||||
"name": "workflow_edges_workflow_id_workflows_id_fk",
|
||||
"tableFrom": "workflow_edges",
|
||||
"tableTo": "workflows",
|
||||
"columnsFrom": [
|
||||
"workflow_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"workflow_edges_source_node_id_workflow_nodes_id_fk": {
|
||||
"name": "workflow_edges_source_node_id_workflow_nodes_id_fk",
|
||||
"tableFrom": "workflow_edges",
|
||||
"tableTo": "workflow_nodes",
|
||||
"columnsFrom": [
|
||||
"source_node_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"workflow_edges_target_node_id_workflow_nodes_id_fk": {
|
||||
"name": "workflow_edges_target_node_id_workflow_nodes_id_fk",
|
||||
"tableFrom": "workflow_edges",
|
||||
"tableTo": "workflow_nodes",
|
||||
"columnsFrom": [
|
||||
"target_node_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"workflow_nodes": {
|
||||
"name": "workflow_nodes",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"workflow_id": {
|
||||
"name": "workflow_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sub_type": {
|
||||
"name": "sub_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"data": {
|
||||
"name": "data",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'{}'"
|
||||
},
|
||||
"position_x": {
|
||||
"name": "position_x",
|
||||
"type": "real",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"position_y": {
|
||||
"name": "position_y",
|
||||
"type": "real",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"workflow_nodes_workflow_id_workflows_id_fk": {
|
||||
"name": "workflow_nodes_workflow_id_workflows_id_fk",
|
||||
"tableFrom": "workflow_nodes",
|
||||
"tableTo": "workflows",
|
||||
"columnsFrom": [
|
||||
"workflow_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"workflow_processed_assets": {
|
||||
"name": "workflow_processed_assets",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"workflow_id": {
|
||||
"name": "workflow_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"asset_id": {
|
||||
"name": "asset_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"run_id": {
|
||||
"name": "run_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"processed_at": {
|
||||
"name": "processed_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"workflow_processed_assets_workflow_id_workflows_id_fk": {
|
||||
"name": "workflow_processed_assets_workflow_id_workflows_id_fk",
|
||||
"tableFrom": "workflow_processed_assets",
|
||||
"tableTo": "workflows",
|
||||
"columnsFrom": [
|
||||
"workflow_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"workflow_processed_assets_run_id_workflow_runs_id_fk": {
|
||||
"name": "workflow_processed_assets_run_id_workflow_runs_id_fk",
|
||||
"tableFrom": "workflow_processed_assets",
|
||||
"tableTo": "workflow_runs",
|
||||
"columnsFrom": [
|
||||
"run_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"workflow_runs": {
|
||||
"name": "workflow_runs",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"workflow_id": {
|
||||
"name": "workflow_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"trigger": {
|
||||
"name": "trigger",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'running'"
|
||||
},
|
||||
"result": {
|
||||
"name": "result",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false,
|
||||
"default": "'{}'"
|
||||
},
|
||||
"error": {
|
||||
"name": "error",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"started_at": {
|
||||
"name": "started_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"completed_at": {
|
||||
"name": "completed_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"workflow_runs_workflow_id_workflows_id_fk": {
|
||||
"name": "workflow_runs_workflow_id_workflows_id_fk",
|
||||
"tableFrom": "workflow_runs",
|
||||
"tableTo": "workflows",
|
||||
"columnsFrom": [
|
||||
"workflow_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"workflows": {
|
||||
"name": "workflows",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"owner_id": {
|
||||
"name": "owner_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"enabled": {
|
||||
"name": "enabled",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": false
|
||||
},
|
||||
"cron_schedule": {
|
||||
"name": "cron_schedule",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"webhook_token": {
|
||||
"name": "webhook_token",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"viewport": {
|
||||
"name": "viewport",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'{\"x\":0,\"y\":0,\"zoom\":1}'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"workflows_webhook_token_unique": {
|
||||
"name": "workflows_webhook_token_unique",
|
||||
"columns": [
|
||||
"webhook_token"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
}
|
||||
},
|
||||
"views": {},
|
||||
"enums": {},
|
||||
"_meta": {
|
||||
"schemas": {},
|
||||
"tables": {},
|
||||
"columns": {}
|
||||
},
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,13 @@
|
||||
"when": 1775567654903,
|
||||
"tag": "0003_spooky_lockheed",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "6",
|
||||
"when": 1775574030092,
|
||||
"tag": "0004_equal_iron_monger",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
||||
import { randomUUID } from "crypto";
|
||||
|
||||
export const settings = sqliteTable("settings", {
|
||||
key: text("key").primaryKey(),
|
||||
id: text("id").primaryKey().$defaultFn(() => randomUUID()),
|
||||
key: text("key").notNull(),
|
||||
value: text("value").notNull(),
|
||||
ownerId: text("owner_id"),
|
||||
updatedAt: integer("updated_at", { mode: "timestamp" }).$onUpdate(
|
||||
() => new Date()
|
||||
),
|
||||
|
||||
@@ -6,5 +6,8 @@ export async function register() {
|
||||
|
||||
const { resumePendingJobs } = await import("./workers/import/runner");
|
||||
await resumePendingJobs();
|
||||
|
||||
const { loadAllScheduledWorkflows } = await import("./lib/workflow/scheduler");
|
||||
await loadAllScheduledWorkflows();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
import { ENV } from "@/config/environment";
|
||||
import { db } from "@/config/db";
|
||||
import { appDb } from "@/db";
|
||||
import { settings } from "@/db/schema/settings.schema";
|
||||
import { exif } from "@/schema";
|
||||
import { assets } from "@/schema/assets.schema";
|
||||
import { person } from "@/schema/person.schema";
|
||||
import { assetFaces } from "@/schema/assetFaces.schema";
|
||||
import { eq, inArray, sql, desc } from "drizzle-orm";
|
||||
import { eq, and, inArray, sql, desc } from "drizzle-orm";
|
||||
import { IUser } from "@/types/user";
|
||||
import { getUserHeaders } from "@/helpers/user.helper";
|
||||
|
||||
export const WORKFLOW_API_KEY_SETTING = "workflow_api_key";
|
||||
|
||||
interface ActionResult {
|
||||
action: string;
|
||||
assetsProcessed: number;
|
||||
@@ -16,13 +20,28 @@ interface ActionResult {
|
||||
error?: string;
|
||||
}
|
||||
|
||||
async function getWorkflowApiKey(ownerId: string): Promise<string | null> {
|
||||
const [row] = await appDb
|
||||
.select()
|
||||
.from(settings)
|
||||
.where(and(eq(settings.key, WORKFLOW_API_KEY_SETTING), eq(settings.ownerId, ownerId)));
|
||||
return row?.value || null;
|
||||
}
|
||||
|
||||
async function immichFetch(path: string, method: string, body: any, user: IUser): Promise<any> {
|
||||
const workflowApiKey = await getWorkflowApiKey(user.id);
|
||||
|
||||
const headers: Record<string, string> = { "Content-Type": "application/json" };
|
||||
if (workflowApiKey) {
|
||||
headers["x-api-key"] = workflowApiKey;
|
||||
} else {
|
||||
const userHeaders = getUserHeaders(user);
|
||||
Object.assign(headers, userHeaders);
|
||||
}
|
||||
|
||||
const res = await fetch(`${ENV.IMMICH_URL}/api${path}`, {
|
||||
method,
|
||||
headers: {
|
||||
...getUserHeaders(user),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
headers,
|
||||
body: body ? JSON.stringify(body) : undefined,
|
||||
});
|
||||
if (!res.ok) {
|
||||
|
||||
@@ -9,11 +9,22 @@ import { executeAction } from "./actionExecutor";
|
||||
import { IUser } from "@/types/user";
|
||||
import { randomUUID } from "crypto";
|
||||
|
||||
const PREFIX = "[Workflow]";
|
||||
|
||||
function log(runId: string, ...args: any[]) {
|
||||
console.log(`${PREFIX} [run:${runId.slice(0, 8)}]`, ...args);
|
||||
}
|
||||
|
||||
function logError(runId: string, ...args: any[]) {
|
||||
console.error(`${PREFIX} [run:${runId.slice(0, 8)}]`, ...args);
|
||||
}
|
||||
|
||||
async function resolveAssetTrigger(
|
||||
subType: string,
|
||||
workflowId: string,
|
||||
userId: string,
|
||||
lookbackMinutes: number = 0,
|
||||
runId: string = "",
|
||||
): Promise<string[]> {
|
||||
// Get last successful non-debug run time
|
||||
const [lastRun] = await appDb
|
||||
@@ -36,11 +47,16 @@ async function resolveAssetTrigger(
|
||||
.where(eq(workflows.id, workflowId))
|
||||
.limit(1);
|
||||
sinceDate = wf?.createdAt || new Date();
|
||||
log(runId, `No previous run found, using workflow creation time: ${sinceDate.toISOString()}`);
|
||||
} else {
|
||||
log(runId, `Last completed run at: ${sinceDate.toISOString()}`);
|
||||
}
|
||||
|
||||
// Apply lookback buffer
|
||||
if (lookbackMinutes > 0) {
|
||||
const original = sinceDate;
|
||||
sinceDate = new Date(sinceDate.getTime() - lookbackMinutes * 60 * 1000);
|
||||
log(runId, `Lookback buffer: ${lookbackMinutes}m, adjusted sinceDate from ${original.toISOString()} to ${sinceDate.toISOString()}`);
|
||||
}
|
||||
|
||||
const baseConditions = [
|
||||
@@ -58,6 +74,7 @@ async function resolveAssetTrigger(
|
||||
.from(workflowProcessedAssets)
|
||||
.where(eq(workflowProcessedAssets.workflowId, workflowId));
|
||||
processedMap = new Map(processed.map((r) => [r.assetId, r.processedAt || new Date(0)]));
|
||||
log(runId, `Previously processed assets: ${processedMap.size}`);
|
||||
}
|
||||
|
||||
let candidateIds: string[];
|
||||
@@ -68,14 +85,17 @@ async function resolveAssetTrigger(
|
||||
.from(assets)
|
||||
.where(and(...baseConditions, gte(assets.createdAt, sinceDate)))
|
||||
.limit(10000);
|
||||
const totalCandidates = rows.length;
|
||||
// For new_asset: skip any asset we've ever processed
|
||||
candidateIds = rows.map((r) => r.id).filter((id) => !processedMap?.has(id));
|
||||
log(runId, `Trigger [new_asset]: ${totalCandidates} candidates, ${totalCandidates - candidateIds.length} already processed, ${candidateIds.length} remaining`);
|
||||
} else if (subType === "asset_updated") {
|
||||
const rows = await db
|
||||
.selectDistinctOn([assets.id], { id: assets.id, updatedAt: assets.updatedAt })
|
||||
.from(assets)
|
||||
.where(and(...baseConditions, gte(assets.updatedAt, sinceDate)))
|
||||
.limit(10000);
|
||||
const totalCandidates = rows.length;
|
||||
// For asset_updated: only skip if we processed it AFTER its current updatedAt
|
||||
candidateIds = rows
|
||||
.filter((r) => {
|
||||
@@ -84,6 +104,7 @@ async function resolveAssetTrigger(
|
||||
return r.updatedAt > lastProcessed; // updated since last processing
|
||||
})
|
||||
.map((r) => r.id);
|
||||
log(runId, `Trigger [asset_updated]: ${totalCandidates} candidates, ${totalCandidates - candidateIds.length} skipped (not updated since processing), ${candidateIds.length} remaining`);
|
||||
} else {
|
||||
// all_assets — no dedup
|
||||
const rows = await db
|
||||
@@ -91,6 +112,7 @@ async function resolveAssetTrigger(
|
||||
.from(assets)
|
||||
.where(and(...baseConditions))
|
||||
.limit(10000);
|
||||
log(runId, `Trigger [all_assets]: ${rows.length} assets found`);
|
||||
return rows.map((r) => r.id);
|
||||
}
|
||||
|
||||
@@ -131,11 +153,18 @@ export async function executeWorkflow(
|
||||
status: "running",
|
||||
});
|
||||
|
||||
log(runId, `=== Workflow execution started ===`);
|
||||
log(runId, `Workflow: ${workflowId}`);
|
||||
log(runId, `Trigger: ${trigger}${isDebug ? " (DRY RUN)" : ""}`);
|
||||
log(runId, `User: ${user.id}`);
|
||||
|
||||
try {
|
||||
// Load graph
|
||||
const nodes = await appDb.select().from(workflowNodes).where(eq(workflowNodes.workflowId, workflowId));
|
||||
const edges = await appDb.select().from(workflowEdges).where(eq(workflowEdges.workflowId, workflowId));
|
||||
|
||||
log(runId, `Graph loaded: ${nodes.length} nodes, ${edges.length} edges`);
|
||||
|
||||
// Build adjacency map: nodeId -> { handle -> targetNodeId[] }
|
||||
const adjacency = new Map<string, Map<string | null, string[]>>();
|
||||
for (const edge of edges) {
|
||||
@@ -154,6 +183,8 @@ export async function executeWorkflow(
|
||||
throw new Error("No asset trigger nodes found in the workflow");
|
||||
}
|
||||
|
||||
log(runId, `Found ${triggerNodes.length} trigger node(s): ${triggerNodes.map(n => n.subType).join(", ")}`);
|
||||
|
||||
const result: RunResult = { matchedAssets: 0, assetIds: [], actions: [] };
|
||||
const debugSteps: DebugStep[] = [];
|
||||
const allProcessedAssetIds = new Set<string>();
|
||||
@@ -165,9 +196,14 @@ export async function executeWorkflow(
|
||||
for (const triggerNode of triggerNodes) {
|
||||
const triggerConfig = JSON.parse(triggerNode.data || "{}");
|
||||
const lookback = triggerConfig.lookbackMinutes || 0;
|
||||
const assetIds = await resolveAssetTrigger(triggerNode.subType, workflowId, user.id, lookback);
|
||||
|
||||
log(runId, `--- Resolving trigger: ${triggerNode.subType} (node: ${triggerNode.id.slice(0, 8)}) ---`);
|
||||
|
||||
const assetIds = await resolveAssetTrigger(triggerNode.subType, workflowId, user.id, lookback, runId);
|
||||
result.matchedAssets += assetIds.length;
|
||||
|
||||
log(runId, `Trigger resolved: ${assetIds.length} assets`);
|
||||
|
||||
debugSteps.push({
|
||||
nodeId: triggerNode.id,
|
||||
nodeType: "trigger",
|
||||
@@ -186,17 +222,26 @@ export async function executeWorkflow(
|
||||
}
|
||||
|
||||
// Process queue
|
||||
let step = 0;
|
||||
while (queue.length > 0) {
|
||||
step++;
|
||||
const { nodeId, assetIds } = queue.shift()!;
|
||||
const node = nodeMap.get(nodeId);
|
||||
if (!node) continue;
|
||||
if (!node) {
|
||||
log(runId, `Step ${step}: Node ${nodeId.slice(0, 8)} not found, skipping`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const config = JSON.parse(node.data || "{}");
|
||||
|
||||
log(runId, `--- Step ${step}: ${node.type}/${node.subType} (node: ${nodeId.slice(0, 8)}) | Input: ${assetIds?.length ?? "null"} assets ---`);
|
||||
|
||||
if (node.type === "logic") {
|
||||
if (node.subType === "if") {
|
||||
// Query assets matching conditions, scoped to incoming set
|
||||
const conditions = config.conditions || [];
|
||||
log(runId, `IF: ${conditions.length} conditions: ${conditions.map((c: any) => c.type).join(", ")}`);
|
||||
|
||||
const whereClauses = buildConditions(conditions, user.id);
|
||||
|
||||
// Scope to incoming assets if available
|
||||
@@ -222,6 +267,8 @@ export async function executeWorkflow(
|
||||
falseIds = assetIds.filter((id) => !matchedSet.has(id));
|
||||
}
|
||||
|
||||
log(runId, `IF result: ${trueIds.length} → TRUE, ${falseIds.length} → FALSE`);
|
||||
|
||||
debugSteps.push({
|
||||
nodeId: node.id,
|
||||
nodeType: "logic",
|
||||
@@ -243,7 +290,12 @@ export async function executeWorkflow(
|
||||
const cases = config.cases || [];
|
||||
let remaining = assetIds;
|
||||
|
||||
for (const c of cases) {
|
||||
log(runId, `SWITCH: ${cases.length} cases`);
|
||||
|
||||
for (let ci = 0; ci < cases.length; ci++) {
|
||||
const c = cases[ci];
|
||||
log(runId, ` Case "${c.label || ci}": ${(c.conditions || []).length} conditions, checking against ${remaining?.length ?? "all"} assets`);
|
||||
|
||||
const whereClauses = buildConditions(c.conditions || [], user.id);
|
||||
|
||||
// Scope to remaining assets if available
|
||||
@@ -270,6 +322,8 @@ export async function executeWorkflow(
|
||||
remaining = [];
|
||||
}
|
||||
|
||||
log(runId, ` Case "${c.label || ci}" matched: ${caseIds.length} assets, ${remaining?.length ?? 0} remaining`);
|
||||
|
||||
result.matchedAssets = Math.max(result.matchedAssets, caseIds.length);
|
||||
|
||||
const caseTargets = adjacency.get(nodeId)?.get(c.handle) || [];
|
||||
@@ -278,7 +332,6 @@ export async function executeWorkflow(
|
||||
|
||||
const caseOutput: Record<string, number> = {};
|
||||
cases.forEach((c: any, i: number) => { caseOutput[c.label || `case_${i}`] = 0; });
|
||||
// Already routed above, just log
|
||||
debugSteps.push({
|
||||
nodeId: node.id,
|
||||
nodeType: "logic",
|
||||
@@ -288,6 +341,8 @@ export async function executeWorkflow(
|
||||
outputAssets: { ...caseOutput, default: (remaining || []).length },
|
||||
});
|
||||
|
||||
log(runId, `SWITCH default: ${(remaining || []).length} assets`);
|
||||
|
||||
// Default branch gets remaining
|
||||
const defaultTargets = adjacency.get(nodeId)?.get("default") || [];
|
||||
for (const t of defaultTargets) queue.push({ nodeId: t, assetIds: remaining || [] });
|
||||
@@ -298,6 +353,8 @@ export async function executeWorkflow(
|
||||
const actionAssetIds = assetIds || [];
|
||||
actionAssetIds.forEach((id) => allProcessedAssetIds.add(id));
|
||||
|
||||
log(runId, `ACTION [${node.subType}]: ${actionAssetIds.length} assets${isDebug ? " (DRY RUN)" : ""}`);
|
||||
|
||||
debugSteps.push({
|
||||
nodeId: node.id,
|
||||
nodeType: "action",
|
||||
@@ -311,6 +368,7 @@ export async function executeWorkflow(
|
||||
|
||||
if (!isDebug && actionAssetIds.length > 0) {
|
||||
const actionResult = await executeAction(node.subType, config, actionAssetIds, user);
|
||||
log(runId, `ACTION [${node.subType}] completed: ${actionResult.assetsProcessed} processed${actionResult.albumName ? ` → "${actionResult.albumName}"` : ""}${actionResult.error ? ` ERROR: ${actionResult.error}` : ""}`);
|
||||
result.actions.push({ ...actionResult, assetIds: actionAssetIds });
|
||||
|
||||
// Record processed assets to prevent reprocessing
|
||||
@@ -326,6 +384,7 @@ export async function executeWorkflow(
|
||||
}))
|
||||
);
|
||||
}
|
||||
log(runId, `Recorded ${actionAssetIds.length} assets as processed`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -343,9 +402,13 @@ export async function executeWorkflow(
|
||||
completedAt: new Date(),
|
||||
}).where(eq(workflowRuns.id, runId));
|
||||
|
||||
log(runId, `=== Workflow completed: ${result.matchedAssets} assets, ${result.actions.length} actions ===`);
|
||||
|
||||
return runId;
|
||||
|
||||
} catch (error: any) {
|
||||
logError(runId, `=== Workflow FAILED: ${error.message} ===`);
|
||||
|
||||
await appDb.update(workflowRuns).set({
|
||||
status: "failed",
|
||||
error: error.message || "Unknown error",
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import { appDb } from "@/db";
|
||||
import { settings } from "@/db/schema/settings.schema";
|
||||
import { getCurrentUser } from "@/handlers/serverUtils/user.utils";
|
||||
import { eq, and } from "drizzle-orm";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const currentUser = await getCurrentUser(req);
|
||||
if (!currentUser) return res.status(401).json({ message: "Unauthorized" });
|
||||
|
||||
const { key } = req.query as { key: string };
|
||||
|
||||
if (req.method === "GET") {
|
||||
const [row] = await appDb
|
||||
.select()
|
||||
.from(settings)
|
||||
.where(and(eq(settings.key, key), eq(settings.ownerId, currentUser.id)));
|
||||
if (!row) return res.status(404).json({ message: "Setting not found" });
|
||||
return res.status(200).json(row);
|
||||
}
|
||||
|
||||
if (req.method === "PUT") {
|
||||
const { value } = req.body;
|
||||
if (value === undefined) return res.status(400).json({ message: "value is required" });
|
||||
|
||||
const [existing] = await appDb
|
||||
.select()
|
||||
.from(settings)
|
||||
.where(and(eq(settings.key, key), eq(settings.ownerId, currentUser.id)));
|
||||
|
||||
if (existing) {
|
||||
await appDb.update(settings).set({ value }).where(eq(settings.id, existing.id));
|
||||
} else {
|
||||
await appDb.insert(settings).values({ key, value, ownerId: currentUser.id });
|
||||
}
|
||||
|
||||
const [row] = await appDb
|
||||
.select()
|
||||
.from(settings)
|
||||
.where(and(eq(settings.key, key), eq(settings.ownerId, currentUser.id)));
|
||||
return res.status(200).json(row);
|
||||
}
|
||||
|
||||
if (req.method === "DELETE") {
|
||||
await appDb.delete(settings).where(and(eq(settings.key, key), eq(settings.ownerId, currentUser.id)));
|
||||
return res.status(204).end();
|
||||
}
|
||||
|
||||
return res.status(405).json({ message: "Method not allowed" });
|
||||
}
|
||||
@@ -40,10 +40,23 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
|
||||
await appDb.update(workflows).set(updates).where(and(eq(workflows.id, id), eq(workflows.ownerId, currentUser.id)));
|
||||
const [updated] = await appDb.select().from(workflows).where(eq(workflows.id, id));
|
||||
|
||||
// Re-register or unregister cron schedule
|
||||
if (enabled !== undefined || cronSchedule !== undefined) {
|
||||
const { registerWorkflow, unregisterWorkflow } = await import("@/lib/workflow/scheduler");
|
||||
if (updated.enabled && updated.cronSchedule) {
|
||||
await registerWorkflow(id, updated.cronSchedule, updated.ownerId);
|
||||
} else {
|
||||
unregisterWorkflow(id);
|
||||
}
|
||||
}
|
||||
|
||||
return res.status(200).json(updated);
|
||||
}
|
||||
|
||||
if (req.method === "DELETE") {
|
||||
const { unregisterWorkflow } = await import("@/lib/workflow/scheduler");
|
||||
unregisterWorkflow(id);
|
||||
await appDb.delete(workflows).where(and(eq(workflows.id, id), eq(workflows.ownerId, currentUser.id)));
|
||||
return res.status(204).end();
|
||||
}
|
||||
|
||||
@@ -4,10 +4,13 @@ import { deleteApiKey, getApiKeys, regenerateApiKey } from "@/handlers/api/setti
|
||||
import { AlertDialog } from "@/components/ui/alert-dialog";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { RefreshCw, Trash2 } from "lucide-react";
|
||||
import { RefreshCw, Trash2, Save, Eye, EyeOff } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import API from "@/lib/api";
|
||||
|
||||
interface ApiKey {
|
||||
id: string;
|
||||
@@ -22,6 +25,31 @@ export default function SettingsPage() {
|
||||
const [deleting, setDeleting] = useState<string | null>(null);
|
||||
const [regenerating, setRegenerating] = useState<string | null>(null);
|
||||
|
||||
// Workflow API key
|
||||
const [workflowApiKey, setWorkflowApiKey] = useState("");
|
||||
const [workflowApiKeyLoading, setWorkflowApiKeyLoading] = useState(false);
|
||||
const [showWorkflowApiKey, setShowWorkflowApiKey] = useState(false);
|
||||
|
||||
const fetchWorkflowApiKey = async () => {
|
||||
try {
|
||||
const data = await API.get("/api/settings/kv/workflow_api_key");
|
||||
setWorkflowApiKey(data.value || "");
|
||||
} catch {
|
||||
// Not set yet
|
||||
}
|
||||
};
|
||||
|
||||
const saveWorkflowApiKey = async () => {
|
||||
setWorkflowApiKeyLoading(true);
|
||||
try {
|
||||
await API.put("/api/settings/kv/workflow_api_key", { value: workflowApiKey });
|
||||
toast.success("Workflow API key saved");
|
||||
} catch {
|
||||
toast.error("Failed to save workflow API key");
|
||||
}
|
||||
setWorkflowApiKeyLoading(false);
|
||||
};
|
||||
|
||||
const fetchKeys = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
@@ -35,6 +63,7 @@ export default function SettingsPage() {
|
||||
|
||||
useEffect(() => {
|
||||
fetchKeys();
|
||||
fetchWorkflowApiKey();
|
||||
}, []);
|
||||
|
||||
const handleDelete = async (purpose: string) => {
|
||||
@@ -127,6 +156,48 @@ export default function SettingsPage() {
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Workflow API Key</CardTitle>
|
||||
<CardDescription>
|
||||
Immich API key used by workflows to execute actions (create albums, favorite, archive, etc.).
|
||||
This key is used for scheduled and webhook-triggered runs. If not set, workflows will use the session of the user who created them.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="workflowApiKey" className="text-xs">API Key</Label>
|
||||
<div className="flex gap-2">
|
||||
<div className="relative flex-1">
|
||||
<Input
|
||||
id="workflowApiKey"
|
||||
type={showWorkflowApiKey ? "text" : "password"}
|
||||
className="h-9 text-sm font-mono pr-10"
|
||||
placeholder="Paste your Immich API key here"
|
||||
value={workflowApiKey}
|
||||
onChange={(e) => setWorkflowApiKey(e.target.value)}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground"
|
||||
onClick={() => setShowWorkflowApiKey((v) => !v)}
|
||||
>
|
||||
{showWorkflowApiKey ? <EyeOff className="h-4 w-4" /> : <Eye className="h-4 w-4" />}
|
||||
</button>
|
||||
</div>
|
||||
<Button size="sm" onClick={saveWorkflowApiKey} disabled={workflowApiKeyLoading}>
|
||||
<Save className="h-3.5 w-3.5 mr-1" />
|
||||
{workflowApiKeyLoading ? "Saving..." : "Save"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-[10px] text-muted-foreground">
|
||||
Create an API key in Immich (Account Settings → API Keys) with full permissions, then paste it here.
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</PageLayout>
|
||||
);
|
||||
|
||||
@@ -428,7 +428,14 @@ function WorkflowEditorInner() {
|
||||
/>
|
||||
<div className="flex items-center gap-2 ml-2">
|
||||
<span className="text-xs text-muted-foreground">Enabled</span>
|
||||
<Switch checked={enabled} onCheckedChange={setEnabled} />
|
||||
<Switch checked={enabled} onCheckedChange={(val) => {
|
||||
setEnabled(val);
|
||||
if (id) {
|
||||
updateWorkflow(id, { enabled: val } as any)
|
||||
.then(() => hotToast.success(val ? "Workflow enabled" : "Workflow disabled"))
|
||||
.catch(() => hotToast.error("Failed to update workflow"));
|
||||
}
|
||||
}} />
|
||||
</div>
|
||||
|
||||
<div className="h-5 w-px bg-border mx-1" />
|
||||
|
||||
Reference in new issue
Block a user