@btst/stack 2.4.0 → 2.5.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 (225) hide show
  1. package/dist/node_modules/.pnpm/{@tiptap_core@3.15.3_@tiptap_pm@3.15.3 → @tiptap_core@3.20.0_@tiptap_pm@3.15.3}/node_modules/@tiptap/core/dist/index.cjs +68 -8
  2. package/dist/node_modules/.pnpm/{@tiptap_core@3.15.3_@tiptap_pm@3.15.3 → @tiptap_core@3.20.0_@tiptap_pm@3.15.3}/node_modules/@tiptap/core/dist/index.mjs +68 -8
  3. package/dist/node_modules/.pnpm/{@tiptap_extension-blockquote@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-blockquote@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-blockquote/dist/index.cjs +2 -2
  4. package/dist/node_modules/.pnpm/{@tiptap_extension-blockquote@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-blockquote@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-blockquote/dist/index.mjs +2 -2
  5. package/dist/node_modules/.pnpm/{@tiptap_extension-bold@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-bold@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-bold/dist/index.cjs +2 -2
  6. package/dist/node_modules/.pnpm/{@tiptap_extension-bold@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-bold@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-bold/dist/index.mjs +2 -2
  7. package/dist/node_modules/.pnpm/{@tiptap_extension-bubble-menu@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-bubble-menu@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs +1 -1
  8. package/dist/node_modules/.pnpm/{@tiptap_extension-bubble-menu@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-bubble-menu@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-bubble-menu/dist/index.mjs +1 -1
  9. package/dist/node_modules/.pnpm/{@tiptap_extension-code-block-lowlight@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@ti_2245ac34d84b5693aa60775b0f7781e3 → @tiptap_extension-code-block-lowlight@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@ti_360e739196c451ebf408f4af5a9f3f24}/node_modules/@tiptap/extension-code-block-lowlight/dist/index.cjs +2 -2
  10. package/dist/node_modules/.pnpm/{@tiptap_extension-code-block-lowlight@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@ti_2245ac34d84b5693aa60775b0f7781e3 → @tiptap_extension-code-block-lowlight@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@ti_360e739196c451ebf408f4af5a9f3f24}/node_modules/@tiptap/extension-code-block-lowlight/dist/index.mjs +2 -2
  11. package/dist/node_modules/.pnpm/@tiptap_extension-code-block@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3/node_modules/@tiptap/extension-code-block/dist/index.cjs +319 -0
  12. package/dist/node_modules/.pnpm/@tiptap_extension-code-block@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3/node_modules/@tiptap/extension-code-block/dist/index.mjs +315 -0
  13. package/dist/node_modules/.pnpm/{@tiptap_extension-code-block@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-code-block@3.20.0_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-code-block/dist/index.cjs +1 -1
  14. package/dist/node_modules/.pnpm/{@tiptap_extension-code-block@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-code-block@3.20.0_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-code-block/dist/index.mjs +1 -1
  15. package/dist/node_modules/.pnpm/{@tiptap_extension-code@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-code@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-code/dist/index.cjs +1 -1
  16. package/dist/node_modules/.pnpm/{@tiptap_extension-code@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-code@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-code/dist/index.mjs +1 -1
  17. package/dist/node_modules/.pnpm/{@tiptap_extension-document@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-document@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-document/dist/index.cjs +1 -1
  18. package/dist/node_modules/.pnpm/{@tiptap_extension-document@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-document@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-document/dist/index.mjs +1 -1
  19. package/dist/node_modules/.pnpm/{@tiptap_extension-floating-menu@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-floating-menu@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-floating-menu/dist/index.cjs +1 -1
  20. package/dist/node_modules/.pnpm/{@tiptap_extension-floating-menu@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-floating-menu@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-floating-menu/dist/index.mjs +1 -1
  21. package/dist/node_modules/.pnpm/{@tiptap_extension-hard-break@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-hard-break@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-hard-break/dist/index.cjs +1 -1
  22. package/dist/node_modules/.pnpm/{@tiptap_extension-hard-break@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-hard-break@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-hard-break/dist/index.mjs +1 -1
  23. package/dist/node_modules/.pnpm/{@tiptap_extension-heading@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-heading@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-heading/dist/index.cjs +1 -1
  24. package/dist/node_modules/.pnpm/{@tiptap_extension-heading@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-heading@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-heading/dist/index.mjs +1 -1
  25. package/dist/node_modules/.pnpm/{@tiptap_extension-horizontal-rule@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-horizontal-rule@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-horizontal-rule/dist/index.cjs +1 -1
  26. package/dist/node_modules/.pnpm/{@tiptap_extension-horizontal-rule@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-horizontal-rule@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-horizontal-rule/dist/index.mjs +1 -1
  27. package/dist/node_modules/.pnpm/{@tiptap_extension-image@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-image@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-image/dist/index.cjs +1 -1
  28. package/dist/node_modules/.pnpm/{@tiptap_extension-image@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-image@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-image/dist/index.mjs +1 -1
  29. package/dist/node_modules/.pnpm/{@tiptap_extension-italic@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-italic@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-italic/dist/index.cjs +1 -1
  30. package/dist/node_modules/.pnpm/{@tiptap_extension-italic@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-italic@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-italic/dist/index.mjs +1 -1
  31. package/dist/node_modules/.pnpm/{@tiptap_extension-link@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-link@3.20.0_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-link/dist/index.cjs +28 -22
  32. package/dist/node_modules/.pnpm/{@tiptap_extension-link@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-link@3.20.0_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-link/dist/index.mjs +28 -22
  33. package/dist/node_modules/.pnpm/{@tiptap_extension-list@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-list@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-list/dist/index.cjs +1 -1
  34. package/dist/node_modules/.pnpm/{@tiptap_extension-list@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-list@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-list/dist/index.mjs +1 -1
  35. package/dist/node_modules/.pnpm/{@tiptap_extension-paragraph@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-paragraph@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-paragraph/dist/index.cjs +1 -1
  36. package/dist/node_modules/.pnpm/{@tiptap_extension-paragraph@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-paragraph@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-paragraph/dist/index.mjs +1 -1
  37. package/dist/node_modules/.pnpm/{@tiptap_extension-strike@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-strike@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-strike/dist/index.cjs +1 -1
  38. package/dist/node_modules/.pnpm/{@tiptap_extension-strike@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-strike@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-strike/dist/index.mjs +1 -1
  39. package/dist/node_modules/.pnpm/{@tiptap_extension-table@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-table@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-table/dist/index.cjs +1 -1
  40. package/dist/node_modules/.pnpm/{@tiptap_extension-table@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-table@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-table/dist/index.mjs +1 -1
  41. package/dist/node_modules/.pnpm/{@tiptap_extension-text-style@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-text-style@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-text-style/dist/index.cjs +1 -1
  42. package/dist/node_modules/.pnpm/{@tiptap_extension-text-style@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-text-style@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-text-style/dist/index.mjs +1 -1
  43. package/dist/node_modules/.pnpm/{@tiptap_extension-text@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-text@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-text/dist/index.cjs +1 -1
  44. package/dist/node_modules/.pnpm/{@tiptap_extension-text@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-text@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-text/dist/index.mjs +1 -1
  45. package/dist/node_modules/.pnpm/{@tiptap_extension-typography@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-typography@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-typography/dist/index.cjs +1 -1
  46. package/dist/node_modules/.pnpm/{@tiptap_extension-typography@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-typography@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-typography/dist/index.mjs +1 -1
  47. package/dist/node_modules/.pnpm/{@tiptap_extension-underline@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-underline@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-underline/dist/index.cjs +1 -1
  48. package/dist/node_modules/.pnpm/{@tiptap_extension-underline@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-underline@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-underline/dist/index.mjs +1 -1
  49. package/dist/node_modules/.pnpm/{@tiptap_extensions@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extensions@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extensions/dist/index.cjs +1 -1
  50. package/dist/node_modules/.pnpm/{@tiptap_extensions@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extensions@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extensions/dist/index.mjs +1 -1
  51. package/dist/node_modules/.pnpm/{@tiptap_markdown@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_markdown@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/markdown/dist/index.cjs +1 -1
  52. package/dist/node_modules/.pnpm/{@tiptap_markdown@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_markdown@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/markdown/dist/index.mjs +1 -1
  53. package/dist/node_modules/.pnpm/{@tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tip_d7a2a9a319317617a8908309649a6dda → @tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tip_b42b5b2d59902d8a01cd4cc3e2d5dc64}/node_modules/@tiptap/react/dist/index.cjs +1 -1
  54. package/dist/node_modules/.pnpm/{@tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tip_d7a2a9a319317617a8908309649a6dda → @tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tip_b42b5b2d59902d8a01cd4cc3e2d5dc64}/node_modules/@tiptap/react/dist/index.mjs +2 -2
  55. package/dist/node_modules/.pnpm/{@tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tip_d7a2a9a319317617a8908309649a6dda → @tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tip_b42b5b2d59902d8a01cd4cc3e2d5dc64}/node_modules/@tiptap/react/dist/menus/index.cjs +2 -2
  56. package/dist/node_modules/.pnpm/{@tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tip_d7a2a9a319317617a8908309649a6dda → @tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tip_b42b5b2d59902d8a01cd4cc3e2d5dc64}/node_modules/@tiptap/react/dist/menus/index.mjs +2 -2
  57. package/dist/node_modules/.pnpm/@tiptap_starter-kit@3.15.3/node_modules/@tiptap/starter-kit/dist/index.cjs +17 -17
  58. package/dist/node_modules/.pnpm/@tiptap_starter-kit@3.15.3/node_modules/@tiptap/starter-kit/dist/index.mjs +17 -17
  59. package/dist/packages/stack/src/plugins/ai-chat/api/plugin.cjs +33 -47
  60. package/dist/packages/stack/src/plugins/ai-chat/api/plugin.mjs +33 -47
  61. package/dist/packages/stack/src/plugins/ai-chat/client/plugin.cjs +14 -21
  62. package/dist/packages/stack/src/plugins/ai-chat/client/plugin.mjs +15 -22
  63. package/dist/packages/stack/src/plugins/blog/api/plugin.cjs +28 -45
  64. package/dist/packages/stack/src/plugins/blog/api/plugin.mjs +22 -39
  65. package/dist/packages/stack/src/plugins/blog/client/plugin.cjs +23 -27
  66. package/dist/packages/stack/src/plugins/blog/client/plugin.mjs +24 -28
  67. package/dist/packages/stack/src/plugins/cms/api/plugin.cjs +14 -17
  68. package/dist/packages/stack/src/plugins/cms/api/plugin.mjs +14 -17
  69. package/dist/packages/stack/src/plugins/cms/client/plugin.cjs +11 -15
  70. package/dist/packages/stack/src/plugins/cms/client/plugin.mjs +12 -16
  71. package/dist/packages/stack/src/plugins/form-builder/api/plugin.cjs +58 -62
  72. package/dist/packages/stack/src/plugins/form-builder/api/plugin.mjs +58 -62
  73. package/dist/packages/stack/src/plugins/form-builder/client/plugin.cjs +12 -12
  74. package/dist/packages/stack/src/plugins/form-builder/client/plugin.mjs +13 -13
  75. package/dist/packages/stack/src/plugins/kanban/api/plugin.cjs +86 -117
  76. package/dist/packages/stack/src/plugins/kanban/api/plugin.mjs +83 -114
  77. package/dist/packages/stack/src/plugins/kanban/client/plugin.cjs +22 -29
  78. package/dist/packages/stack/src/plugins/kanban/client/plugin.mjs +23 -30
  79. package/dist/packages/stack/src/plugins/open-api/api/generator.cjs +2 -1
  80. package/dist/packages/stack/src/plugins/open-api/api/generator.mjs +2 -1
  81. package/dist/packages/stack/src/plugins/ui-builder/client/plugin.cjs +8 -8
  82. package/dist/packages/stack/src/plugins/ui-builder/client/plugin.mjs +9 -9
  83. package/dist/packages/stack/src/plugins/utils.cjs +42 -0
  84. package/dist/packages/stack/src/plugins/utils.mjs +41 -1
  85. package/dist/packages/ui/src/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.cjs +1 -1
  86. package/dist/packages/ui/src/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.mjs +1 -1
  87. package/dist/packages/ui/src/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.cjs +1 -1
  88. package/dist/packages/ui/src/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.mjs +1 -1
  89. package/dist/packages/ui/src/components/minimal-tiptap/extensions/color/color.cjs +1 -1
  90. package/dist/packages/ui/src/components/minimal-tiptap/extensions/color/color.mjs +1 -1
  91. package/dist/packages/ui/src/components/minimal-tiptap/extensions/file-handler/index.cjs +1 -1
  92. package/dist/packages/ui/src/components/minimal-tiptap/extensions/file-handler/index.mjs +1 -1
  93. package/dist/packages/ui/src/components/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.cjs +1 -1
  94. package/dist/packages/ui/src/components/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.mjs +1 -1
  95. package/dist/packages/ui/src/components/minimal-tiptap/extensions/image/components/image-view-block.cjs +1 -1
  96. package/dist/packages/ui/src/components/minimal-tiptap/extensions/image/components/image-view-block.mjs +1 -1
  97. package/dist/packages/ui/src/components/minimal-tiptap/extensions/image/image.cjs +2 -2
  98. package/dist/packages/ui/src/components/minimal-tiptap/extensions/image/image.mjs +2 -2
  99. package/dist/packages/ui/src/components/minimal-tiptap/extensions/markdown-paste/markdown-paste.cjs +1 -1
  100. package/dist/packages/ui/src/components/minimal-tiptap/extensions/markdown-paste/markdown-paste.mjs +1 -1
  101. package/dist/packages/ui/src/components/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.cjs +1 -1
  102. package/dist/packages/ui/src/components/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.mjs +1 -1
  103. package/dist/packages/ui/src/components/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.cjs +1 -1
  104. package/dist/packages/ui/src/components/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.mjs +1 -1
  105. package/dist/packages/ui/src/components/minimal-tiptap/hooks/use-minimal-tiptap.cjs +7 -7
  106. package/dist/packages/ui/src/components/minimal-tiptap/hooks/use-minimal-tiptap.mjs +7 -7
  107. package/dist/packages/ui/src/components/minimal-tiptap/hooks/use-tiptap-editor.cjs +1 -1
  108. package/dist/packages/ui/src/components/minimal-tiptap/hooks/use-tiptap-editor.mjs +1 -1
  109. package/dist/packages/ui/src/components/minimal-tiptap/minimal-tiptap.cjs +1 -1
  110. package/dist/packages/ui/src/components/minimal-tiptap/minimal-tiptap.mjs +1 -1
  111. package/dist/plugins/ai-chat/api/index.d.cts +1 -1
  112. package/dist/plugins/ai-chat/api/index.d.mts +1 -1
  113. package/dist/plugins/ai-chat/api/index.d.ts +1 -1
  114. package/dist/plugins/ai-chat/client/hooks/index.d.cts +1 -1
  115. package/dist/plugins/ai-chat/client/hooks/index.d.mts +1 -1
  116. package/dist/plugins/ai-chat/client/hooks/index.d.ts +1 -1
  117. package/dist/plugins/ai-chat/client/index.d.cts +8 -8
  118. package/dist/plugins/ai-chat/client/index.d.mts +8 -8
  119. package/dist/plugins/ai-chat/client/index.d.ts +8 -8
  120. package/dist/plugins/ai-chat/query-keys.d.cts +1 -1
  121. package/dist/plugins/ai-chat/query-keys.d.mts +1 -1
  122. package/dist/plugins/ai-chat/query-keys.d.ts +1 -1
  123. package/dist/plugins/blog/api/index.d.cts +1 -1
  124. package/dist/plugins/blog/api/index.d.mts +1 -1
  125. package/dist/plugins/blog/api/index.d.ts +1 -1
  126. package/dist/plugins/blog/client/index.d.cts +12 -12
  127. package/dist/plugins/blog/client/index.d.mts +12 -12
  128. package/dist/plugins/blog/client/index.d.ts +12 -12
  129. package/dist/plugins/blog/query-keys.d.cts +1 -1
  130. package/dist/plugins/blog/query-keys.d.mts +1 -1
  131. package/dist/plugins/blog/query-keys.d.ts +1 -1
  132. package/dist/plugins/client/index.cjs +1 -0
  133. package/dist/plugins/client/index.d.cts +8 -1
  134. package/dist/plugins/client/index.d.mts +8 -1
  135. package/dist/plugins/client/index.d.ts +8 -1
  136. package/dist/plugins/client/index.mjs +1 -1
  137. package/dist/plugins/cms/api/index.d.cts +2 -2
  138. package/dist/plugins/cms/api/index.d.mts +2 -2
  139. package/dist/plugins/cms/api/index.d.ts +2 -2
  140. package/dist/plugins/cms/client/hooks/index.d.cts +1 -1
  141. package/dist/plugins/cms/client/hooks/index.d.mts +1 -1
  142. package/dist/plugins/cms/client/hooks/index.d.ts +1 -1
  143. package/dist/plugins/cms/client/index.d.cts +6 -6
  144. package/dist/plugins/cms/client/index.d.mts +6 -6
  145. package/dist/plugins/cms/client/index.d.ts +6 -6
  146. package/dist/plugins/cms/query-keys.d.cts +2 -2
  147. package/dist/plugins/cms/query-keys.d.mts +2 -2
  148. package/dist/plugins/cms/query-keys.d.ts +2 -2
  149. package/dist/plugins/form-builder/api/index.d.cts +2 -2
  150. package/dist/plugins/form-builder/api/index.d.mts +2 -2
  151. package/dist/plugins/form-builder/api/index.d.ts +2 -2
  152. package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
  153. package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
  154. package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
  155. package/dist/plugins/form-builder/client/hooks/index.d.cts +1 -1
  156. package/dist/plugins/form-builder/client/hooks/index.d.mts +1 -1
  157. package/dist/plugins/form-builder/client/hooks/index.d.ts +1 -1
  158. package/dist/plugins/form-builder/client/index.d.cts +6 -6
  159. package/dist/plugins/form-builder/client/index.d.mts +6 -6
  160. package/dist/plugins/form-builder/client/index.d.ts +6 -6
  161. package/dist/plugins/form-builder/query-keys.d.cts +2 -2
  162. package/dist/plugins/form-builder/query-keys.d.mts +2 -2
  163. package/dist/plugins/form-builder/query-keys.d.ts +2 -2
  164. package/dist/plugins/kanban/api/index.d.cts +1 -1
  165. package/dist/plugins/kanban/api/index.d.mts +1 -1
  166. package/dist/plugins/kanban/api/index.d.ts +1 -1
  167. package/dist/plugins/kanban/client/index.d.cts +12 -12
  168. package/dist/plugins/kanban/client/index.d.mts +12 -12
  169. package/dist/plugins/kanban/client/index.d.ts +12 -12
  170. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  171. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  172. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  173. package/dist/plugins/ui-builder/client/hooks/index.d.cts +1 -1
  174. package/dist/plugins/ui-builder/client/hooks/index.d.mts +1 -1
  175. package/dist/plugins/ui-builder/client/hooks/index.d.ts +1 -1
  176. package/dist/plugins/ui-builder/client/index.d.cts +3 -3
  177. package/dist/plugins/ui-builder/client/index.d.mts +3 -3
  178. package/dist/plugins/ui-builder/client/index.d.ts +3 -3
  179. package/dist/plugins/ui-builder/index.d.cts +2 -2
  180. package/dist/plugins/ui-builder/index.d.mts +2 -2
  181. package/dist/plugins/ui-builder/index.d.ts +2 -2
  182. package/dist/shared/{stack.C-WUPMT6.d.cts → stack.B2xZTSiO.d.cts} +4 -4
  183. package/dist/shared/{stack.CczspVn2.d.mts → stack.B58oHdqm.d.mts} +1 -1
  184. package/dist/shared/{stack.BepFXT3w.d.mts → stack.B8D4r97Z.d.mts} +22 -22
  185. package/dist/shared/{stack.CVDTkMoO.d.mts → stack.B8QD11QU.d.cts} +7 -7
  186. package/dist/shared/{stack.CVDTkMoO.d.cts → stack.B8QD11QU.d.mts} +7 -7
  187. package/dist/shared/{stack.CVDTkMoO.d.ts → stack.B8QD11QU.d.ts} +7 -7
  188. package/dist/shared/{stack.kcdnD4gA.d.cts → stack.BgTmujxW.d.mts} +1 -1
  189. package/dist/shared/{stack.DdI5W6MB.d.mts → stack.BozPgbrZ.d.cts} +19 -19
  190. package/dist/shared/{stack.DdI5W6MB.d.ts → stack.BozPgbrZ.d.mts} +19 -19
  191. package/dist/shared/{stack.DdI5W6MB.d.cts → stack.BozPgbrZ.d.ts} +19 -19
  192. package/dist/shared/{stack.BUkC2EsZ.d.cts → stack.C9Mg2Q46.d.cts} +1 -1
  193. package/dist/shared/{stack.Kq2-QzOC.d.ts → stack.CLQuVdwK.d.ts} +1 -1
  194. package/dist/shared/{stack.B7ONvlD_.d.mts → stack.CSx98K5H.d.cts} +1 -1
  195. package/dist/shared/{stack.BEn34wW6.d.ts → stack.CTDVxbrA.d.ts} +12 -12
  196. package/dist/shared/{stack.C-Ptrz8s.d.ts → stack.Cj_zKww4.d.ts} +4 -4
  197. package/dist/shared/{stack.DWoCZff7.d.cts → stack.D-b5zbPm.d.cts} +12 -12
  198. package/dist/shared/{stack.CL8ts1Mu.d.ts → stack.DXnclTG7.d.ts} +8 -8
  199. package/dist/shared/{stack.heOA9gzA.d.cts → stack.DaZM10cp.d.cts} +8 -8
  200. package/dist/shared/{stack.CgWzG5jH.d.ts → stack.DgKOwl20.d.ts} +22 -22
  201. package/dist/shared/{stack.DTDxgFj8.d.mts → stack.FVWf2JhZ.d.mts} +12 -12
  202. package/dist/shared/{stack.Dk5r4W1F.d.mts → stack.cfCkioTe.d.mts} +8 -8
  203. package/dist/shared/{stack.6fUOjLs9.d.mts → stack.dH7u-TJH.d.mts} +4 -4
  204. package/dist/shared/{stack.DASmUVjX.d.ts → stack.sO33ZDhK.d.ts} +1 -1
  205. package/dist/shared/{stack.D3GB6wKv.d.cts → stack.uWSqCWAb.d.cts} +22 -22
  206. package/package.json +1 -1
  207. package/src/plugins/ai-chat/api/plugin.ts +48 -63
  208. package/src/plugins/ai-chat/client/plugin.tsx +23 -31
  209. package/src/plugins/blog/api/plugin.ts +31 -47
  210. package/src/plugins/blog/client/plugin.tsx +36 -39
  211. package/src/plugins/client/index.ts +5 -1
  212. package/src/plugins/cms/api/plugin.ts +14 -17
  213. package/src/plugins/cms/client/plugin.tsx +18 -21
  214. package/src/plugins/cms/types.ts +7 -7
  215. package/src/plugins/form-builder/api/plugin.ts +64 -64
  216. package/src/plugins/form-builder/client/plugin.tsx +19 -18
  217. package/src/plugins/form-builder/types.ts +19 -24
  218. package/src/plugins/kanban/api/plugin.ts +111 -136
  219. package/src/plugins/kanban/client/plugin.tsx +35 -41
  220. package/src/plugins/open-api/api/generator.ts +3 -1
  221. package/src/plugins/ui-builder/client/plugin.tsx +11 -10
  222. package/src/plugins/ui-builder/types.ts +4 -4
  223. package/src/plugins/utils.ts +92 -1
  224. /package/dist/node_modules/.pnpm/{@tiptap_core@3.15.3_@tiptap_pm@3.15.3 → @tiptap_core@3.20.0_@tiptap_pm@3.15.3}/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs +0 -0
  225. /package/dist/node_modules/.pnpm/{@tiptap_core@3.15.3_@tiptap_pm@3.15.3 → @tiptap_core@3.20.0_@tiptap_pm@3.15.3}/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.mjs +0 -0
@@ -2,11 +2,12 @@
2
2
 
3
3
  const api = require('@btst/stack/plugins/api');
4
4
  const db = require('../db.cjs');
5
- const utils = require('../utils.cjs');
5
+ const utils$1 = require('../utils.cjs');
6
6
  const schemas = require('../schemas.cjs');
7
7
  const getters = require('./getters.cjs');
8
8
  const mutations = require('./mutations.cjs');
9
9
  const queryKeyDefs = require('./query-key-defs.cjs');
10
+ const utils = require('../../utils.cjs');
10
11
  const serializers = require('./serializers.cjs');
11
12
 
12
13
  function createKanbanPrefetchForRoute(adapter) {
@@ -58,12 +59,11 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
58
59
  const context = { query, headers };
59
60
  try {
60
61
  if (hooks?.onBeforeListBoards) {
61
- const canList = await hooks.onBeforeListBoards(query, context);
62
- if (!canList) {
63
- throw ctx.error(403, {
64
- message: "Unauthorized: Cannot list boards"
65
- });
66
- }
62
+ await utils.runHookWithShim(
63
+ () => hooks.onBeforeListBoards(query, context),
64
+ ctx.error,
65
+ "Unauthorized: Cannot list boards"
66
+ );
67
67
  }
68
68
  const result = await getters.getAllBoards(adapter, query);
69
69
  if (hooks?.onBoardsRead) {
@@ -88,12 +88,11 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
88
88
  const context = { params, headers };
89
89
  try {
90
90
  if (hooks?.onBeforeReadBoard) {
91
- const canRead = await hooks.onBeforeReadBoard(params.id, context);
92
- if (!canRead) {
93
- throw ctx.error(403, {
94
- message: "Unauthorized: Cannot read board"
95
- });
96
- }
91
+ await utils.runHookWithShim(
92
+ () => hooks.onBeforeReadBoard(params.id, context),
93
+ ctx.error,
94
+ "Unauthorized: Cannot read board"
95
+ );
97
96
  }
98
97
  const result = await getters.getBoardById(adapter, params.id);
99
98
  if (!result) {
@@ -124,18 +123,14 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
124
123
  };
125
124
  try {
126
125
  if (hooks?.onBeforeCreateBoard) {
127
- const canCreate = await hooks.onBeforeCreateBoard(
128
- ctx.body,
129
- context
126
+ await utils.runHookWithShim(
127
+ () => hooks.onBeforeCreateBoard(ctx.body, context),
128
+ ctx.error,
129
+ "Unauthorized: Cannot create board"
130
130
  );
131
- if (!canCreate) {
132
- throw ctx.error(403, {
133
- message: "Unauthorized: Cannot create board"
134
- });
135
- }
136
131
  }
137
132
  const { ...boardData } = ctx.body;
138
- const slug = utils.slugify(boardData.slug || boardData.name);
133
+ const slug = utils$1.slugify(boardData.slug || boardData.name);
139
134
  if (!slug) {
140
135
  throw ctx.error(400, {
141
136
  message: "Invalid slug: must contain at least one alphanumeric character"
@@ -202,19 +197,18 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
202
197
  };
203
198
  try {
204
199
  if (hooks?.onBeforeUpdateBoard) {
205
- const canUpdate = await hooks.onBeforeUpdateBoard(
206
- ctx.params.id,
207
- { ...ctx.body, id: ctx.params.id },
208
- context
200
+ await utils.runHookWithShim(
201
+ () => hooks.onBeforeUpdateBoard(
202
+ ctx.params.id,
203
+ { ...ctx.body, id: ctx.params.id },
204
+ context
205
+ ),
206
+ ctx.error,
207
+ "Unauthorized: Cannot update board"
209
208
  );
210
- if (!canUpdate) {
211
- throw ctx.error(403, {
212
- message: "Unauthorized: Cannot update board"
213
- });
214
- }
215
209
  }
216
210
  const { slug: rawSlug, ...restBoardData } = ctx.body;
217
- const slugified = rawSlug ? utils.slugify(rawSlug) : void 0;
211
+ const slugified = rawSlug ? utils$1.slugify(rawSlug) : void 0;
218
212
  if (rawSlug && !slugified) {
219
213
  throw ctx.error(400, {
220
214
  message: "Invalid slug: must contain at least one alphanumeric character"
@@ -268,15 +262,11 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
268
262
  throw ctx.error(404, { message: "Board not found" });
269
263
  }
270
264
  if (hooks?.onBeforeDeleteBoard) {
271
- const canDelete = await hooks.onBeforeDeleteBoard(
272
- ctx.params.id,
273
- context
265
+ await utils.runHookWithShim(
266
+ () => hooks.onBeforeDeleteBoard(ctx.params.id, context),
267
+ ctx.error,
268
+ "Unauthorized: Cannot delete board"
274
269
  );
275
- if (!canDelete) {
276
- throw ctx.error(403, {
277
- message: "Unauthorized: Cannot delete board"
278
- });
279
- }
280
270
  }
281
271
  await adapter.delete({
282
272
  model: "kanbanBoard",
@@ -307,15 +297,11 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
307
297
  };
308
298
  try {
309
299
  if (hooks?.onBeforeCreateColumn) {
310
- const canCreate = await hooks.onBeforeCreateColumn(
311
- ctx.body,
312
- context
300
+ await utils.runHookWithShim(
301
+ () => hooks.onBeforeCreateColumn(ctx.body, context),
302
+ ctx.error,
303
+ "Unauthorized: Cannot create column"
313
304
  );
314
- if (!canCreate) {
315
- throw ctx.error(403, {
316
- message: "Unauthorized: Cannot create column"
317
- });
318
- }
319
305
  }
320
306
  const existingColumns = await adapter.findMany({
321
307
  model: "kanbanColumn",
@@ -360,16 +346,15 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
360
346
  };
361
347
  try {
362
348
  if (hooks?.onBeforeUpdateColumn) {
363
- const canUpdate = await hooks.onBeforeUpdateColumn(
364
- ctx.params.id,
365
- { ...ctx.body, id: ctx.params.id },
366
- context
349
+ await utils.runHookWithShim(
350
+ () => hooks.onBeforeUpdateColumn(
351
+ ctx.params.id,
352
+ { ...ctx.body, id: ctx.params.id },
353
+ context
354
+ ),
355
+ ctx.error,
356
+ "Unauthorized: Cannot update column"
367
357
  );
368
- if (!canUpdate) {
369
- throw ctx.error(403, {
370
- message: "Unauthorized: Cannot update column"
371
- });
372
- }
373
358
  }
374
359
  const updated = await adapter.update({
375
360
  model: "kanbanColumn",
@@ -412,15 +397,11 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
412
397
  throw ctx.error(404, { message: "Column not found" });
413
398
  }
414
399
  if (hooks?.onBeforeDeleteColumn) {
415
- const canDelete = await hooks.onBeforeDeleteColumn(
416
- ctx.params.id,
417
- context
400
+ await utils.runHookWithShim(
401
+ () => hooks.onBeforeDeleteColumn(ctx.params.id, context),
402
+ ctx.error,
403
+ "Unauthorized: Cannot delete column"
418
404
  );
419
- if (!canDelete) {
420
- throw ctx.error(403, {
421
- message: "Unauthorized: Cannot delete column"
422
- });
423
- }
424
405
  }
425
406
  await adapter.delete({
426
407
  model: "kanbanColumn",
@@ -451,16 +432,15 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
451
432
  for (let i = 0; i < columnIds.length; i++) {
452
433
  const columnId = columnIds[i];
453
434
  if (!columnId) continue;
454
- const canUpdate = await hooks.onBeforeUpdateColumn(
455
- columnId,
456
- { id: columnId, order: i },
457
- context
435
+ await utils.runHookWithShim(
436
+ () => hooks.onBeforeUpdateColumn(
437
+ columnId,
438
+ { id: columnId, order: i },
439
+ context
440
+ ),
441
+ ctx.error,
442
+ "Unauthorized: Cannot reorder columns"
458
443
  );
459
- if (!canUpdate) {
460
- throw ctx.error(403, {
461
- message: "Unauthorized: Cannot reorder columns"
462
- });
463
- }
464
444
  }
465
445
  }
466
446
  const updatedColumns = [];
@@ -502,15 +482,11 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
502
482
  };
503
483
  try {
504
484
  if (hooks?.onBeforeCreateTask) {
505
- const canCreate = await hooks.onBeforeCreateTask(
506
- ctx.body,
507
- context
485
+ await utils.runHookWithShim(
486
+ () => hooks.onBeforeCreateTask(ctx.body, context),
487
+ ctx.error,
488
+ "Unauthorized: Cannot create task"
508
489
  );
509
- if (!canCreate) {
510
- throw ctx.error(403, {
511
- message: "Unauthorized: Cannot create task"
512
- });
513
- }
514
490
  }
515
491
  const existingTasks = await adapter.findMany({
516
492
  model: "kanbanTask",
@@ -561,16 +537,15 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
561
537
  };
562
538
  try {
563
539
  if (hooks?.onBeforeUpdateTask) {
564
- const canUpdate = await hooks.onBeforeUpdateTask(
565
- ctx.params.id,
566
- { ...ctx.body, id: ctx.params.id },
567
- context
540
+ await utils.runHookWithShim(
541
+ () => hooks.onBeforeUpdateTask(
542
+ ctx.params.id,
543
+ { ...ctx.body, id: ctx.params.id },
544
+ context
545
+ ),
546
+ ctx.error,
547
+ "Unauthorized: Cannot update task"
568
548
  );
569
- if (!canUpdate) {
570
- throw ctx.error(403, {
571
- message: "Unauthorized: Cannot update task"
572
- });
573
- }
574
549
  }
575
550
  const updated = await adapter.update({
576
551
  model: "kanbanTask",
@@ -613,15 +588,11 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
613
588
  throw ctx.error(404, { message: "Task not found" });
614
589
  }
615
590
  if (hooks?.onBeforeDeleteTask) {
616
- const canDelete = await hooks.onBeforeDeleteTask(
617
- ctx.params.id,
618
- context
591
+ await utils.runHookWithShim(
592
+ () => hooks.onBeforeDeleteTask(ctx.params.id, context),
593
+ ctx.error,
594
+ "Unauthorized: Cannot delete task"
619
595
  );
620
- if (!canDelete) {
621
- throw ctx.error(403, {
622
- message: "Unauthorized: Cannot delete task"
623
- });
624
- }
625
596
  }
626
597
  await adapter.delete({
627
598
  model: "kanbanTask",
@@ -656,16 +627,15 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
656
627
  throw ctx.error(404, { message: "Task not found" });
657
628
  }
658
629
  if (hooks?.onBeforeUpdateTask) {
659
- const canUpdate = await hooks.onBeforeUpdateTask(
660
- taskId,
661
- { id: taskId, columnId: targetColumnId, order: targetOrder },
662
- context
630
+ await utils.runHookWithShim(
631
+ () => hooks.onBeforeUpdateTask(
632
+ taskId,
633
+ { id: taskId, columnId: targetColumnId, order: targetOrder },
634
+ context
635
+ ),
636
+ ctx.error,
637
+ "Unauthorized: Cannot move task"
663
638
  );
664
- if (!canUpdate) {
665
- throw ctx.error(403, {
666
- message: "Unauthorized: Cannot move task"
667
- });
668
- }
669
639
  }
670
640
  const updated = await adapter.update({
671
641
  model: "kanbanTask",
@@ -701,16 +671,15 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
701
671
  for (let i = 0; i < taskIds.length; i++) {
702
672
  const taskId = taskIds[i];
703
673
  if (!taskId) continue;
704
- const canUpdate = await hooks.onBeforeUpdateTask(
705
- taskId,
706
- { id: taskId, order: i },
707
- context
674
+ await utils.runHookWithShim(
675
+ () => hooks.onBeforeUpdateTask(
676
+ taskId,
677
+ { id: taskId, order: i },
678
+ context
679
+ ),
680
+ ctx.error,
681
+ "Unauthorized: Cannot reorder tasks"
708
682
  );
709
- if (!canUpdate) {
710
- throw ctx.error(403, {
711
- message: "Unauthorized: Cannot reorder tasks"
712
- });
713
- }
714
683
  }
715
684
  }
716
685
  const updatedTasks = [];
@@ -5,6 +5,7 @@ import { BoardListQuerySchema, createBoardSchema, updateBoardSchema, createColum
5
5
  import { getBoardById, getAllBoards } from './getters.mjs';
6
6
  import { getKanbanColumnsByBoardId, findOrCreateKanbanBoard, createKanbanTask } from './mutations.mjs';
7
7
  import { KANBAN_QUERY_KEYS } from './query-key-defs.mjs';
8
+ import { runHookWithShim } from '../../utils.mjs';
8
9
  import { serializeBoard } from './serializers.mjs';
9
10
 
10
11
  function createKanbanPrefetchForRoute(adapter) {
@@ -56,12 +57,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
56
57
  const context = { query, headers };
57
58
  try {
58
59
  if (hooks?.onBeforeListBoards) {
59
- const canList = await hooks.onBeforeListBoards(query, context);
60
- if (!canList) {
61
- throw ctx.error(403, {
62
- message: "Unauthorized: Cannot list boards"
63
- });
64
- }
60
+ await runHookWithShim(
61
+ () => hooks.onBeforeListBoards(query, context),
62
+ ctx.error,
63
+ "Unauthorized: Cannot list boards"
64
+ );
65
65
  }
66
66
  const result = await getAllBoards(adapter, query);
67
67
  if (hooks?.onBoardsRead) {
@@ -86,12 +86,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
86
86
  const context = { params, headers };
87
87
  try {
88
88
  if (hooks?.onBeforeReadBoard) {
89
- const canRead = await hooks.onBeforeReadBoard(params.id, context);
90
- if (!canRead) {
91
- throw ctx.error(403, {
92
- message: "Unauthorized: Cannot read board"
93
- });
94
- }
89
+ await runHookWithShim(
90
+ () => hooks.onBeforeReadBoard(params.id, context),
91
+ ctx.error,
92
+ "Unauthorized: Cannot read board"
93
+ );
95
94
  }
96
95
  const result = await getBoardById(adapter, params.id);
97
96
  if (!result) {
@@ -122,15 +121,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
122
121
  };
123
122
  try {
124
123
  if (hooks?.onBeforeCreateBoard) {
125
- const canCreate = await hooks.onBeforeCreateBoard(
126
- ctx.body,
127
- context
124
+ await runHookWithShim(
125
+ () => hooks.onBeforeCreateBoard(ctx.body, context),
126
+ ctx.error,
127
+ "Unauthorized: Cannot create board"
128
128
  );
129
- if (!canCreate) {
130
- throw ctx.error(403, {
131
- message: "Unauthorized: Cannot create board"
132
- });
133
- }
134
129
  }
135
130
  const { ...boardData } = ctx.body;
136
131
  const slug = slugify(boardData.slug || boardData.name);
@@ -200,16 +195,15 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
200
195
  };
201
196
  try {
202
197
  if (hooks?.onBeforeUpdateBoard) {
203
- const canUpdate = await hooks.onBeforeUpdateBoard(
204
- ctx.params.id,
205
- { ...ctx.body, id: ctx.params.id },
206
- context
198
+ await runHookWithShim(
199
+ () => hooks.onBeforeUpdateBoard(
200
+ ctx.params.id,
201
+ { ...ctx.body, id: ctx.params.id },
202
+ context
203
+ ),
204
+ ctx.error,
205
+ "Unauthorized: Cannot update board"
207
206
  );
208
- if (!canUpdate) {
209
- throw ctx.error(403, {
210
- message: "Unauthorized: Cannot update board"
211
- });
212
- }
213
207
  }
214
208
  const { slug: rawSlug, ...restBoardData } = ctx.body;
215
209
  const slugified = rawSlug ? slugify(rawSlug) : void 0;
@@ -266,15 +260,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
266
260
  throw ctx.error(404, { message: "Board not found" });
267
261
  }
268
262
  if (hooks?.onBeforeDeleteBoard) {
269
- const canDelete = await hooks.onBeforeDeleteBoard(
270
- ctx.params.id,
271
- context
263
+ await runHookWithShim(
264
+ () => hooks.onBeforeDeleteBoard(ctx.params.id, context),
265
+ ctx.error,
266
+ "Unauthorized: Cannot delete board"
272
267
  );
273
- if (!canDelete) {
274
- throw ctx.error(403, {
275
- message: "Unauthorized: Cannot delete board"
276
- });
277
- }
278
268
  }
279
269
  await adapter.delete({
280
270
  model: "kanbanBoard",
@@ -305,15 +295,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
305
295
  };
306
296
  try {
307
297
  if (hooks?.onBeforeCreateColumn) {
308
- const canCreate = await hooks.onBeforeCreateColumn(
309
- ctx.body,
310
- context
298
+ await runHookWithShim(
299
+ () => hooks.onBeforeCreateColumn(ctx.body, context),
300
+ ctx.error,
301
+ "Unauthorized: Cannot create column"
311
302
  );
312
- if (!canCreate) {
313
- throw ctx.error(403, {
314
- message: "Unauthorized: Cannot create column"
315
- });
316
- }
317
303
  }
318
304
  const existingColumns = await adapter.findMany({
319
305
  model: "kanbanColumn",
@@ -358,16 +344,15 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
358
344
  };
359
345
  try {
360
346
  if (hooks?.onBeforeUpdateColumn) {
361
- const canUpdate = await hooks.onBeforeUpdateColumn(
362
- ctx.params.id,
363
- { ...ctx.body, id: ctx.params.id },
364
- context
347
+ await runHookWithShim(
348
+ () => hooks.onBeforeUpdateColumn(
349
+ ctx.params.id,
350
+ { ...ctx.body, id: ctx.params.id },
351
+ context
352
+ ),
353
+ ctx.error,
354
+ "Unauthorized: Cannot update column"
365
355
  );
366
- if (!canUpdate) {
367
- throw ctx.error(403, {
368
- message: "Unauthorized: Cannot update column"
369
- });
370
- }
371
356
  }
372
357
  const updated = await adapter.update({
373
358
  model: "kanbanColumn",
@@ -410,15 +395,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
410
395
  throw ctx.error(404, { message: "Column not found" });
411
396
  }
412
397
  if (hooks?.onBeforeDeleteColumn) {
413
- const canDelete = await hooks.onBeforeDeleteColumn(
414
- ctx.params.id,
415
- context
398
+ await runHookWithShim(
399
+ () => hooks.onBeforeDeleteColumn(ctx.params.id, context),
400
+ ctx.error,
401
+ "Unauthorized: Cannot delete column"
416
402
  );
417
- if (!canDelete) {
418
- throw ctx.error(403, {
419
- message: "Unauthorized: Cannot delete column"
420
- });
421
- }
422
403
  }
423
404
  await adapter.delete({
424
405
  model: "kanbanColumn",
@@ -449,16 +430,15 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
449
430
  for (let i = 0; i < columnIds.length; i++) {
450
431
  const columnId = columnIds[i];
451
432
  if (!columnId) continue;
452
- const canUpdate = await hooks.onBeforeUpdateColumn(
453
- columnId,
454
- { id: columnId, order: i },
455
- context
433
+ await runHookWithShim(
434
+ () => hooks.onBeforeUpdateColumn(
435
+ columnId,
436
+ { id: columnId, order: i },
437
+ context
438
+ ),
439
+ ctx.error,
440
+ "Unauthorized: Cannot reorder columns"
456
441
  );
457
- if (!canUpdate) {
458
- throw ctx.error(403, {
459
- message: "Unauthorized: Cannot reorder columns"
460
- });
461
- }
462
442
  }
463
443
  }
464
444
  const updatedColumns = [];
@@ -500,15 +480,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
500
480
  };
501
481
  try {
502
482
  if (hooks?.onBeforeCreateTask) {
503
- const canCreate = await hooks.onBeforeCreateTask(
504
- ctx.body,
505
- context
483
+ await runHookWithShim(
484
+ () => hooks.onBeforeCreateTask(ctx.body, context),
485
+ ctx.error,
486
+ "Unauthorized: Cannot create task"
506
487
  );
507
- if (!canCreate) {
508
- throw ctx.error(403, {
509
- message: "Unauthorized: Cannot create task"
510
- });
511
- }
512
488
  }
513
489
  const existingTasks = await adapter.findMany({
514
490
  model: "kanbanTask",
@@ -559,16 +535,15 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
559
535
  };
560
536
  try {
561
537
  if (hooks?.onBeforeUpdateTask) {
562
- const canUpdate = await hooks.onBeforeUpdateTask(
563
- ctx.params.id,
564
- { ...ctx.body, id: ctx.params.id },
565
- context
538
+ await runHookWithShim(
539
+ () => hooks.onBeforeUpdateTask(
540
+ ctx.params.id,
541
+ { ...ctx.body, id: ctx.params.id },
542
+ context
543
+ ),
544
+ ctx.error,
545
+ "Unauthorized: Cannot update task"
566
546
  );
567
- if (!canUpdate) {
568
- throw ctx.error(403, {
569
- message: "Unauthorized: Cannot update task"
570
- });
571
- }
572
547
  }
573
548
  const updated = await adapter.update({
574
549
  model: "kanbanTask",
@@ -611,15 +586,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
611
586
  throw ctx.error(404, { message: "Task not found" });
612
587
  }
613
588
  if (hooks?.onBeforeDeleteTask) {
614
- const canDelete = await hooks.onBeforeDeleteTask(
615
- ctx.params.id,
616
- context
589
+ await runHookWithShim(
590
+ () => hooks.onBeforeDeleteTask(ctx.params.id, context),
591
+ ctx.error,
592
+ "Unauthorized: Cannot delete task"
617
593
  );
618
- if (!canDelete) {
619
- throw ctx.error(403, {
620
- message: "Unauthorized: Cannot delete task"
621
- });
622
- }
623
594
  }
624
595
  await adapter.delete({
625
596
  model: "kanbanTask",
@@ -654,16 +625,15 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
654
625
  throw ctx.error(404, { message: "Task not found" });
655
626
  }
656
627
  if (hooks?.onBeforeUpdateTask) {
657
- const canUpdate = await hooks.onBeforeUpdateTask(
658
- taskId,
659
- { id: taskId, columnId: targetColumnId, order: targetOrder },
660
- context
628
+ await runHookWithShim(
629
+ () => hooks.onBeforeUpdateTask(
630
+ taskId,
631
+ { id: taskId, columnId: targetColumnId, order: targetOrder },
632
+ context
633
+ ),
634
+ ctx.error,
635
+ "Unauthorized: Cannot move task"
661
636
  );
662
- if (!canUpdate) {
663
- throw ctx.error(403, {
664
- message: "Unauthorized: Cannot move task"
665
- });
666
- }
667
637
  }
668
638
  const updated = await adapter.update({
669
639
  model: "kanbanTask",
@@ -699,16 +669,15 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
699
669
  for (let i = 0; i < taskIds.length; i++) {
700
670
  const taskId = taskIds[i];
701
671
  if (!taskId) continue;
702
- const canUpdate = await hooks.onBeforeUpdateTask(
703
- taskId,
704
- { id: taskId, order: i },
705
- context
672
+ await runHookWithShim(
673
+ () => hooks.onBeforeUpdateTask(
674
+ taskId,
675
+ { id: taskId, order: i },
676
+ context
677
+ ),
678
+ ctx.error,
679
+ "Unauthorized: Cannot reorder tasks"
706
680
  );
707
- if (!canUpdate) {
708
- throw ctx.error(403, {
709
- message: "Unauthorized: Cannot reorder tasks"
710
- });
711
- }
712
681
  }
713
682
  }
714
683
  const updatedTasks = [];