@btst/stack 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.cjs +9 -1
- package/dist/api/index.d.cts +4 -4
- package/dist/api/index.d.mts +4 -4
- package/dist/api/index.d.ts +4 -4
- package/dist/api/index.mjs +9 -1
- package/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/packages/stack/src/plugins/ai-chat/api/getters.cjs +42 -0
- package/dist/packages/stack/src/plugins/ai-chat/api/getters.mjs +39 -0
- package/dist/packages/stack/src/plugins/ai-chat/api/plugin.cjs +5 -0
- package/dist/packages/stack/src/plugins/ai-chat/api/plugin.mjs +5 -0
- package/dist/packages/stack/src/plugins/blog/api/getters.cjs +131 -0
- package/dist/packages/stack/src/plugins/blog/api/getters.mjs +127 -0
- package/dist/packages/stack/src/plugins/blog/api/plugin.cjs +60 -107
- package/dist/packages/stack/src/plugins/blog/api/plugin.mjs +60 -107
- package/dist/packages/stack/src/plugins/blog/api/query-key-defs.cjs +18 -0
- package/dist/packages/stack/src/plugins/blog/api/query-key-defs.mjs +15 -0
- package/dist/packages/stack/src/plugins/blog/api/serializers.cjs +21 -0
- package/dist/packages/stack/src/plugins/blog/api/serializers.mjs +18 -0
- package/dist/packages/stack/src/plugins/blog/client/plugin.cjs +16 -1
- package/dist/packages/stack/src/plugins/blog/client/plugin.mjs +17 -2
- package/dist/packages/stack/src/plugins/cms/api/getters.cjs +156 -0
- package/dist/packages/stack/src/plugins/cms/api/getters.mjs +147 -0
- package/dist/packages/stack/src/plugins/cms/api/plugin.cjs +624 -617
- package/dist/packages/stack/src/plugins/cms/api/plugin.mjs +623 -616
- package/dist/packages/stack/src/plugins/cms/api/query-key-defs.cjs +29 -0
- package/dist/packages/stack/src/plugins/cms/api/query-key-defs.mjs +26 -0
- package/dist/packages/stack/src/plugins/cms/client/components/pages/content-editor-page.internal.cjs +1 -1
- package/dist/packages/stack/src/plugins/cms/client/components/pages/content-editor-page.internal.mjs +1 -1
- package/dist/packages/stack/src/plugins/cms/client/hooks/cms-hooks.cjs +6 -3
- package/dist/packages/stack/src/plugins/cms/client/hooks/cms-hooks.mjs +6 -3
- package/dist/packages/stack/src/plugins/cms/client/plugin.cjs +15 -0
- package/dist/packages/stack/src/plugins/cms/client/plugin.mjs +16 -1
- package/dist/packages/stack/src/plugins/form-builder/api/getters.cjs +120 -0
- package/dist/packages/stack/src/plugins/form-builder/api/getters.mjs +112 -0
- package/dist/packages/stack/src/plugins/form-builder/api/plugin.cjs +75 -86
- package/dist/packages/stack/src/plugins/form-builder/api/plugin.mjs +71 -82
- package/dist/packages/stack/src/plugins/form-builder/api/query-key-defs.cjs +37 -0
- package/dist/packages/stack/src/plugins/form-builder/api/query-key-defs.mjs +33 -0
- package/dist/packages/stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.cjs +1 -1
- package/dist/packages/stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.mjs +1 -1
- package/dist/packages/stack/src/plugins/form-builder/client/plugin.cjs +15 -0
- package/dist/packages/stack/src/plugins/form-builder/client/plugin.mjs +16 -1
- package/dist/packages/stack/src/plugins/kanban/api/getters.cjs +84 -0
- package/dist/packages/stack/src/plugins/kanban/api/getters.mjs +81 -0
- package/dist/packages/stack/src/plugins/kanban/api/plugin.cjs +37 -123
- package/dist/packages/stack/src/plugins/kanban/api/plugin.mjs +37 -123
- package/dist/packages/stack/src/plugins/kanban/api/query-key-defs.cjs +26 -0
- package/dist/packages/stack/src/plugins/kanban/api/query-key-defs.mjs +23 -0
- package/dist/packages/stack/src/plugins/kanban/api/serializers.cjs +30 -0
- package/dist/packages/stack/src/plugins/kanban/api/serializers.mjs +26 -0
- package/dist/packages/stack/src/plugins/kanban/client/plugin.cjs +11 -1
- package/dist/packages/stack/src/plugins/kanban/client/plugin.mjs +12 -2
- package/dist/packages/stack/src/plugins/utils.cjs +6 -0
- package/dist/packages/stack/src/plugins/utils.mjs +6 -1
- package/dist/plugins/ai-chat/api/index.cjs +3 -0
- package/dist/plugins/ai-chat/api/index.d.cts +27 -4
- package/dist/plugins/ai-chat/api/index.d.mts +27 -4
- package/dist/plugins/ai-chat/api/index.d.ts +27 -4
- package/dist/plugins/ai-chat/api/index.mjs +1 -0
- package/dist/plugins/ai-chat/client/hooks/index.d.cts +2 -2
- package/dist/plugins/ai-chat/client/hooks/index.d.mts +2 -2
- package/dist/plugins/ai-chat/client/hooks/index.d.ts +2 -2
- package/dist/plugins/ai-chat/query-keys.d.cts +9 -284
- package/dist/plugins/ai-chat/query-keys.d.mts +9 -284
- package/dist/plugins/ai-chat/query-keys.d.ts +9 -284
- package/dist/plugins/api/index.d.cts +4 -3
- package/dist/plugins/api/index.d.mts +4 -3
- package/dist/plugins/api/index.d.ts +4 -3
- package/dist/plugins/blog/api/index.cjs +9 -0
- package/dist/plugins/blog/api/index.d.cts +20 -4
- package/dist/plugins/blog/api/index.d.mts +20 -4
- package/dist/plugins/blog/api/index.d.ts +20 -4
- package/dist/plugins/blog/api/index.mjs +3 -0
- package/dist/plugins/blog/client/hooks/index.d.cts +5 -5
- package/dist/plugins/blog/client/hooks/index.d.mts +5 -5
- package/dist/plugins/blog/client/hooks/index.d.ts +5 -5
- package/dist/plugins/blog/client/index.d.cts +1 -1
- package/dist/plugins/blog/client/index.d.mts +1 -1
- package/dist/plugins/blog/client/index.d.ts +1 -1
- package/dist/plugins/blog/query-keys.cjs +13 -9
- package/dist/plugins/blog/query-keys.d.cts +8 -333
- package/dist/plugins/blog/query-keys.d.mts +8 -333
- package/dist/plugins/blog/query-keys.d.ts +8 -333
- package/dist/plugins/blog/query-keys.mjs +13 -9
- package/dist/plugins/client/index.cjs +1 -0
- package/dist/plugins/client/index.d.cts +10 -3
- package/dist/plugins/client/index.d.mts +10 -3
- package/dist/plugins/client/index.d.ts +10 -3
- package/dist/plugins/client/index.mjs +1 -1
- package/dist/plugins/cms/api/index.cjs +10 -0
- package/dist/plugins/cms/api/index.d.cts +7 -163
- package/dist/plugins/cms/api/index.d.mts +7 -163
- package/dist/plugins/cms/api/index.d.ts +7 -163
- package/dist/plugins/cms/api/index.mjs +2 -0
- package/dist/plugins/cms/client/hooks/index.d.cts +1 -1
- package/dist/plugins/cms/client/hooks/index.d.mts +1 -1
- package/dist/plugins/cms/client/hooks/index.d.ts +1 -1
- package/dist/plugins/cms/query-keys.cjs +2 -1
- package/dist/plugins/cms/query-keys.d.cts +6 -9
- package/dist/plugins/cms/query-keys.d.mts +6 -9
- package/dist/plugins/cms/query-keys.d.ts +6 -9
- package/dist/plugins/cms/query-keys.mjs +2 -1
- package/dist/plugins/form-builder/api/index.cjs +10 -0
- package/dist/plugins/form-builder/api/index.d.cts +7 -141
- package/dist/plugins/form-builder/api/index.d.mts +7 -141
- package/dist/plugins/form-builder/api/index.d.ts +7 -141
- package/dist/plugins/form-builder/api/index.mjs +2 -0
- package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
- package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
- package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.cts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.mts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.ts +1 -1
- package/dist/plugins/form-builder/query-keys.cjs +3 -2
- package/dist/plugins/form-builder/query-keys.d.cts +7 -6
- package/dist/plugins/form-builder/query-keys.d.mts +7 -6
- package/dist/plugins/form-builder/query-keys.d.ts +7 -6
- package/dist/plugins/form-builder/query-keys.mjs +3 -2
- package/dist/plugins/kanban/api/index.cjs +9 -0
- package/dist/plugins/kanban/api/index.d.cts +17 -395
- package/dist/plugins/kanban/api/index.d.mts +17 -395
- package/dist/plugins/kanban/api/index.d.ts +17 -395
- package/dist/plugins/kanban/api/index.mjs +3 -0
- package/dist/plugins/kanban/client/components/index.d.cts +1 -1
- package/dist/plugins/kanban/client/components/index.d.mts +1 -1
- package/dist/plugins/kanban/client/components/index.d.ts +1 -1
- package/dist/plugins/kanban/client/hooks/index.d.cts +1 -1
- package/dist/plugins/kanban/client/hooks/index.d.mts +1 -1
- package/dist/plugins/kanban/client/hooks/index.d.ts +1 -1
- package/dist/plugins/kanban/client/index.d.cts +1 -1
- package/dist/plugins/kanban/client/index.d.mts +1 -1
- package/dist/plugins/kanban/client/index.d.ts +1 -1
- package/dist/plugins/kanban/query-keys.cjs +6 -12
- package/dist/plugins/kanban/query-keys.d.cts +5 -16
- package/dist/plugins/kanban/query-keys.d.mts +5 -16
- package/dist/plugins/kanban/query-keys.d.ts +5 -16
- package/dist/plugins/kanban/query-keys.mjs +6 -12
- package/dist/plugins/open-api/api/index.d.cts +2 -2
- package/dist/plugins/open-api/api/index.d.mts +2 -2
- package/dist/plugins/open-api/api/index.d.ts +2 -2
- package/dist/plugins/route-docs/client/index.d.cts +1 -1
- package/dist/plugins/route-docs/client/index.d.mts +1 -1
- package/dist/plugins/route-docs/client/index.d.ts +1 -1
- package/dist/plugins/ui-builder/index.d.cts +1 -1
- package/dist/plugins/ui-builder/index.d.mts +1 -1
- package/dist/plugins/ui-builder/index.d.ts +1 -1
- package/dist/shared/{stack.BoA0xkJv.d.cts → stack.7n9Y_u7N.d.cts} +33 -7
- package/dist/shared/{stack.BoA0xkJv.d.mts → stack.7n9Y_u7N.d.mts} +33 -7
- package/dist/shared/{stack.BoA0xkJv.d.ts → stack.7n9Y_u7N.d.ts} +33 -7
- package/dist/shared/stack.B1EeBt1b.d.ts +297 -0
- package/dist/shared/stack.BIXEI6v_.d.mts +419 -0
- package/dist/shared/stack.BKfolAyK.d.ts +419 -0
- package/dist/shared/stack.BeSm90va.d.ts +289 -0
- package/dist/shared/stack.BpolpQpf.d.cts +445 -0
- package/dist/shared/stack.C5dtIncc.d.mts +293 -0
- package/dist/shared/stack.CIP6QS9l.d.ts +293 -0
- package/dist/shared/stack.CMh_EdxW.d.cts +289 -0
- package/dist/shared/stack.CP68pFEH.d.mts +297 -0
- package/dist/shared/{stack.BsXokfNh.d.mts → stack.CVDTkMoO.d.cts} +8 -2
- package/dist/shared/{stack.BsXokfNh.d.ts → stack.CVDTkMoO.d.mts} +8 -2
- package/dist/shared/{stack.BsXokfNh.d.cts → stack.CVDTkMoO.d.ts} +8 -2
- package/dist/shared/{stack.DKDMI-QO.d.mts → stack.DJaKVY7v.d.cts} +7 -1
- package/dist/shared/{stack.DKDMI-QO.d.ts → stack.DJaKVY7v.d.mts} +7 -1
- package/dist/shared/{stack.DKDMI-QO.d.cts → stack.DJaKVY7v.d.ts} +7 -1
- package/dist/shared/{stack.DzH_wcvr.d.mts → stack.DdI5W6MB.d.cts} +9 -3
- package/dist/shared/{stack.DzH_wcvr.d.ts → stack.DdI5W6MB.d.mts} +9 -3
- package/dist/shared/{stack.DzH_wcvr.d.cts → stack.DdI5W6MB.d.ts} +9 -3
- package/dist/shared/stack.Dg09R0oB.d.mts +289 -0
- package/dist/shared/stack.Dw0Ly2TM.d.cts +293 -0
- package/dist/shared/stack.IdtKDRka.d.cts +297 -0
- package/dist/shared/stack.TIBF2AOx.d.ts +445 -0
- package/dist/shared/stack.rTy7-wQU.d.mts +445 -0
- package/dist/shared/stack.snB1EDP7.d.cts +419 -0
- package/package.json +3 -3
- package/src/__tests__/stack-api.test.ts +118 -0
- package/src/api/index.ts +15 -1
- package/src/plugins/ai-chat/__tests__/getters.test.ts +109 -0
- package/src/plugins/ai-chat/api/getters.ts +71 -0
- package/src/plugins/ai-chat/api/index.ts +1 -0
- package/src/plugins/ai-chat/api/plugin.ts +8 -0
- package/src/plugins/api/index.ts +3 -1
- package/src/plugins/blog/__tests__/getters.test.ts +540 -0
- package/src/plugins/blog/api/getters.ts +243 -0
- package/src/plugins/blog/api/index.ts +9 -0
- package/src/plugins/blog/api/plugin.ts +98 -141
- package/src/plugins/blog/api/query-key-defs.ts +46 -0
- package/src/plugins/blog/api/serializers.ts +27 -0
- package/src/plugins/blog/client/plugin.tsx +21 -1
- package/src/plugins/blog/query-keys.ts +21 -20
- package/src/plugins/client/index.ts +1 -1
- package/src/plugins/cms/__tests__/getters.test.ts +206 -0
- package/src/plugins/cms/api/getters.ts +268 -0
- package/src/plugins/cms/api/index.ts +15 -1
- package/src/plugins/cms/api/plugin.ts +151 -150
- package/src/plugins/cms/api/query-key-defs.ts +53 -0
- package/src/plugins/cms/api/serializers.ts +12 -0
- package/src/plugins/cms/client/components/pages/content-editor-page.internal.tsx +1 -1
- package/src/plugins/cms/client/hooks/cms-hooks.tsx +3 -0
- package/src/plugins/cms/client/plugin.tsx +19 -0
- package/src/plugins/cms/query-keys.ts +2 -1
- package/src/plugins/cms/types.ts +1 -1
- package/src/plugins/form-builder/__tests__/getters.test.ts +159 -0
- package/src/plugins/form-builder/api/getters.ts +226 -0
- package/src/plugins/form-builder/api/index.ts +15 -1
- package/src/plugins/form-builder/api/plugin.ts +107 -109
- package/src/plugins/form-builder/api/query-key-defs.ts +79 -0
- package/src/plugins/form-builder/api/serializers.ts +12 -0
- package/src/plugins/form-builder/client/components/pages/submissions-page.internal.tsx +1 -1
- package/src/plugins/form-builder/client/plugin.tsx +19 -0
- package/src/plugins/form-builder/query-keys.ts +6 -2
- package/src/plugins/form-builder/types.ts +2 -2
- package/src/plugins/kanban/__tests__/getters.test.ts +172 -0
- package/src/plugins/kanban/api/getters.ts +149 -0
- package/src/plugins/kanban/api/index.ts +4 -0
- package/src/plugins/kanban/api/plugin.ts +65 -146
- package/src/plugins/kanban/api/query-key-defs.ts +54 -0
- package/src/plugins/kanban/api/serializers.ts +49 -0
- package/src/plugins/kanban/client/plugin.tsx +15 -1
- package/src/plugins/kanban/query-keys.ts +10 -14
- package/src/plugins/utils.ts +19 -0
- package/src/types.ts +44 -5
- package/dist/shared/{stack.CbuN2zVV.d.cts → stack.CBON0dWL.d.cts} +7 -7
- package/dist/shared/{stack.CbuN2zVV.d.mts → stack.CBON0dWL.d.mts} +7 -7
- package/dist/shared/{stack.CbuN2zVV.d.ts → stack.CBON0dWL.d.ts} +7 -7
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
|
+
import * as better_call from 'better-call';
|
|
3
|
+
import { Adapter } from '@btst/db';
|
|
4
|
+
import { B as BoardWithColumns, d as Board, e as Column, T as Task, C as ColumnWithTasks } from './stack.DJaKVY7v.cjs';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
7
|
+
|
|
8
|
+
declare const createBoardSchema: z.ZodObject<{
|
|
9
|
+
description: z.ZodOptional<z.ZodString>;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
12
|
+
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
13
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
14
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
15
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
declare const updateBoardSchema: z.ZodObject<{
|
|
18
|
+
createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
19
|
+
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
20
|
+
name: z.ZodOptional<z.ZodString>;
|
|
21
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
22
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
organizationId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
25
|
+
id: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
declare const createColumnSchema: z.ZodObject<{
|
|
28
|
+
title: z.ZodString;
|
|
29
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
30
|
+
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
31
|
+
boardId: z.ZodString;
|
|
32
|
+
order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
declare const updateColumnSchema: z.ZodObject<{
|
|
35
|
+
createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
36
|
+
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
37
|
+
title: z.ZodOptional<z.ZodString>;
|
|
38
|
+
order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
|
|
39
|
+
boardId: z.ZodOptional<z.ZodString>;
|
|
40
|
+
id: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
declare const createTaskSchema: z.ZodObject<{
|
|
43
|
+
title: z.ZodString;
|
|
44
|
+
description: z.ZodOptional<z.ZodString>;
|
|
45
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
46
|
+
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
47
|
+
order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
48
|
+
completedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
49
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
LOW: "LOW";
|
|
51
|
+
MEDIUM: "MEDIUM";
|
|
52
|
+
HIGH: "HIGH";
|
|
53
|
+
URGENT: "URGENT";
|
|
54
|
+
}>>>;
|
|
55
|
+
columnId: z.ZodString;
|
|
56
|
+
assigneeId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
57
|
+
isArchived: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
declare const updateTaskSchema: z.ZodObject<{
|
|
60
|
+
completedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
61
|
+
createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
62
|
+
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
63
|
+
title: z.ZodOptional<z.ZodString>;
|
|
64
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
65
|
+
priority: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
LOW: "LOW";
|
|
67
|
+
MEDIUM: "MEDIUM";
|
|
68
|
+
HIGH: "HIGH";
|
|
69
|
+
URGENT: "URGENT";
|
|
70
|
+
}>>>>;
|
|
71
|
+
order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
|
|
72
|
+
columnId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
assigneeId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
74
|
+
isArchived: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
75
|
+
id: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
declare const BoardListQuerySchema: z.ZodObject<{
|
|
78
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
79
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
80
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
81
|
+
offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
82
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Paginated result returned by {@link getAllBoards}.
|
|
87
|
+
*/
|
|
88
|
+
interface BoardListResult {
|
|
89
|
+
items: BoardWithColumns[];
|
|
90
|
+
total: number;
|
|
91
|
+
limit?: number;
|
|
92
|
+
offset?: number;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Retrieve all boards matching optional filter criteria, with columns and tasks.
|
|
96
|
+
* Pure DB function - no hooks, no HTTP context. Safe for SSG and server-side use.
|
|
97
|
+
*
|
|
98
|
+
* @param adapter - The database adapter
|
|
99
|
+
* @param params - Optional filter/pagination parameters (same shape as the list API query)
|
|
100
|
+
*/
|
|
101
|
+
declare function getAllBoards(adapter: Adapter, params?: z.infer<typeof BoardListQuerySchema>): Promise<BoardListResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Retrieve a single board by its ID, with all columns and tasks.
|
|
104
|
+
* Returns null if the board is not found.
|
|
105
|
+
* Pure DB function - no hooks, no HTTP context. Safe for SSG and server-side use.
|
|
106
|
+
*
|
|
107
|
+
* @param adapter - The database adapter
|
|
108
|
+
* @param id - The board ID
|
|
109
|
+
*/
|
|
110
|
+
declare function getBoardById(adapter: Adapter, id: string): Promise<BoardWithColumns | null>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Route keys for the Kanban plugin — matches the keys returned by
|
|
114
|
+
* `stackClient.router.getRoute(path).routeKey`.
|
|
115
|
+
*/
|
|
116
|
+
type KanbanRouteKey = "boards" | "newBoard" | "board";
|
|
117
|
+
interface KanbanPrefetchForRoute {
|
|
118
|
+
(key: "boards" | "newBoard", qc: QueryClient): Promise<void>;
|
|
119
|
+
(key: "board", qc: QueryClient, params: {
|
|
120
|
+
boardId: string;
|
|
121
|
+
}): Promise<void>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Context passed to kanban API hooks
|
|
125
|
+
*/
|
|
126
|
+
interface KanbanApiContext<TBody = unknown, TParams = unknown, TQuery = unknown> {
|
|
127
|
+
body?: TBody;
|
|
128
|
+
params?: TParams;
|
|
129
|
+
query?: TQuery;
|
|
130
|
+
request?: Request;
|
|
131
|
+
headers?: Headers;
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Configuration hooks for kanban backend plugin
|
|
136
|
+
* All hooks are optional and allow consumers to customize behavior
|
|
137
|
+
*/
|
|
138
|
+
interface KanbanBackendHooks {
|
|
139
|
+
/**
|
|
140
|
+
* Called before listing boards. Return false to deny access.
|
|
141
|
+
*/
|
|
142
|
+
onBeforeListBoards?: (filter: z.infer<typeof BoardListQuerySchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Called before creating a board. Return false to deny access.
|
|
145
|
+
*/
|
|
146
|
+
onBeforeCreateBoard?: (data: z.infer<typeof createBoardSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Called before reading a single board. Return false to deny access.
|
|
149
|
+
*/
|
|
150
|
+
onBeforeReadBoard?: (boardId: string, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Called before updating a board. Return false to deny access.
|
|
153
|
+
*/
|
|
154
|
+
onBeforeUpdateBoard?: (boardId: string, data: z.infer<typeof updateBoardSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Called before deleting a board. Return false to deny access.
|
|
157
|
+
*/
|
|
158
|
+
onBeforeDeleteBoard?: (boardId: string, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Called after boards are listed successfully.
|
|
161
|
+
* Receives the items array (same shape as `board[]`) for consistency
|
|
162
|
+
* with analogous hooks in other plugins (e.g. `onPostsRead`).
|
|
163
|
+
*/
|
|
164
|
+
onBoardsRead?: (boards: BoardWithColumns[], filter: z.infer<typeof BoardListQuerySchema>, context: KanbanApiContext) => Promise<void> | void;
|
|
165
|
+
/**
|
|
166
|
+
* Called after a single board is read successfully
|
|
167
|
+
*/
|
|
168
|
+
onBoardRead?: (board: Board, context: KanbanApiContext) => Promise<void> | void;
|
|
169
|
+
/**
|
|
170
|
+
* Called after a board is created successfully
|
|
171
|
+
*/
|
|
172
|
+
onBoardCreated?: (board: Board, context: KanbanApiContext) => Promise<void> | void;
|
|
173
|
+
/**
|
|
174
|
+
* Called after a board is updated successfully
|
|
175
|
+
*/
|
|
176
|
+
onBoardUpdated?: (board: Board, context: KanbanApiContext) => Promise<void> | void;
|
|
177
|
+
/**
|
|
178
|
+
* Called after a board is deleted successfully
|
|
179
|
+
*/
|
|
180
|
+
onBoardDeleted?: (boardId: string, context: KanbanApiContext) => Promise<void> | void;
|
|
181
|
+
/**
|
|
182
|
+
* Called when listing boards fails
|
|
183
|
+
*/
|
|
184
|
+
onListBoardsError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
|
|
185
|
+
/**
|
|
186
|
+
* Called when reading a single board fails
|
|
187
|
+
*/
|
|
188
|
+
onReadBoardError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
|
|
189
|
+
/**
|
|
190
|
+
* Called when creating a board fails
|
|
191
|
+
*/
|
|
192
|
+
onCreateBoardError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
|
|
193
|
+
/**
|
|
194
|
+
* Called when updating a board fails
|
|
195
|
+
*/
|
|
196
|
+
onUpdateBoardError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
|
|
197
|
+
/**
|
|
198
|
+
* Called when deleting a board fails
|
|
199
|
+
*/
|
|
200
|
+
onDeleteBoardError?: (error: Error, context: KanbanApiContext) => Promise<void> | void;
|
|
201
|
+
/**
|
|
202
|
+
* Called before creating a column. Return false to deny access.
|
|
203
|
+
*/
|
|
204
|
+
onBeforeCreateColumn?: (data: z.infer<typeof createColumnSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Called before updating a column. Return false to deny access.
|
|
207
|
+
*/
|
|
208
|
+
onBeforeUpdateColumn?: (columnId: string, data: z.infer<typeof updateColumnSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Called before deleting a column. Return false to deny access.
|
|
211
|
+
*/
|
|
212
|
+
onBeforeDeleteColumn?: (columnId: string, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Called after a column is created successfully
|
|
215
|
+
*/
|
|
216
|
+
onColumnCreated?: (column: Column, context: KanbanApiContext) => Promise<void> | void;
|
|
217
|
+
/**
|
|
218
|
+
* Called after a column is updated successfully
|
|
219
|
+
*/
|
|
220
|
+
onColumnUpdated?: (column: Column, context: KanbanApiContext) => Promise<void> | void;
|
|
221
|
+
/**
|
|
222
|
+
* Called after a column is deleted successfully
|
|
223
|
+
*/
|
|
224
|
+
onColumnDeleted?: (columnId: string, context: KanbanApiContext) => Promise<void> | void;
|
|
225
|
+
/**
|
|
226
|
+
* Called before creating a task. Return false to deny access.
|
|
227
|
+
*/
|
|
228
|
+
onBeforeCreateTask?: (data: z.infer<typeof createTaskSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Called before updating a task. Return false to deny access.
|
|
231
|
+
*/
|
|
232
|
+
onBeforeUpdateTask?: (taskId: string, data: z.infer<typeof updateTaskSchema>, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Called before deleting a task. Return false to deny access.
|
|
235
|
+
*/
|
|
236
|
+
onBeforeDeleteTask?: (taskId: string, context: KanbanApiContext) => Promise<boolean> | boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Called after a task is created successfully
|
|
239
|
+
*/
|
|
240
|
+
onTaskCreated?: (task: Task, context: KanbanApiContext) => Promise<void> | void;
|
|
241
|
+
/**
|
|
242
|
+
* Called after a task is updated successfully
|
|
243
|
+
*/
|
|
244
|
+
onTaskUpdated?: (task: Task, context: KanbanApiContext) => Promise<void> | void;
|
|
245
|
+
/**
|
|
246
|
+
* Called after a task is deleted successfully
|
|
247
|
+
*/
|
|
248
|
+
onTaskDeleted?: (taskId: string, context: KanbanApiContext) => Promise<void> | void;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Kanban backend plugin
|
|
252
|
+
* Provides API endpoints for managing kanban boards, columns, and tasks
|
|
253
|
+
*
|
|
254
|
+
* @param hooks - Optional configuration hooks for customizing plugin behavior
|
|
255
|
+
*/
|
|
256
|
+
declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_plugins_api.BackendPlugin<{
|
|
257
|
+
readonly listBoards: better_call.StrictEndpoint<"/boards", {
|
|
258
|
+
method: "GET";
|
|
259
|
+
query: z.ZodObject<{
|
|
260
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
261
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
262
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
263
|
+
offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
264
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
}, BoardListResult>;
|
|
267
|
+
readonly getBoard: better_call.StrictEndpoint<"/boards/:id", {
|
|
268
|
+
method: "GET";
|
|
269
|
+
}, BoardWithColumns>;
|
|
270
|
+
readonly createBoard: better_call.StrictEndpoint<"/boards", {
|
|
271
|
+
method: "POST";
|
|
272
|
+
body: z.ZodObject<{
|
|
273
|
+
description: z.ZodOptional<z.ZodString>;
|
|
274
|
+
name: z.ZodString;
|
|
275
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
276
|
+
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
277
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
278
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
279
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strip>;
|
|
281
|
+
}, {
|
|
282
|
+
columns: ColumnWithTasks[];
|
|
283
|
+
id: string;
|
|
284
|
+
name: string;
|
|
285
|
+
slug: string;
|
|
286
|
+
description?: string;
|
|
287
|
+
ownerId?: string;
|
|
288
|
+
organizationId?: string;
|
|
289
|
+
createdAt: Date;
|
|
290
|
+
updatedAt: Date;
|
|
291
|
+
}>;
|
|
292
|
+
readonly updateBoard: better_call.StrictEndpoint<"/boards/:id", {
|
|
293
|
+
method: "PUT";
|
|
294
|
+
body: z.ZodObject<{
|
|
295
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
296
|
+
name: z.ZodOptional<z.ZodString>;
|
|
297
|
+
createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
298
|
+
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
299
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
300
|
+
ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
301
|
+
organizationId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
302
|
+
}, z.core.$strip>;
|
|
303
|
+
}, Board>;
|
|
304
|
+
readonly deleteBoard: better_call.StrictEndpoint<"/boards/:id", {
|
|
305
|
+
method: "DELETE";
|
|
306
|
+
}, {
|
|
307
|
+
success: boolean;
|
|
308
|
+
}>;
|
|
309
|
+
readonly createColumn: better_call.StrictEndpoint<"/columns", {
|
|
310
|
+
method: "POST";
|
|
311
|
+
body: z.ZodObject<{
|
|
312
|
+
title: z.ZodString;
|
|
313
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
314
|
+
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
315
|
+
boardId: z.ZodString;
|
|
316
|
+
order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
}, Column>;
|
|
319
|
+
readonly updateColumn: better_call.StrictEndpoint<"/columns/:id", {
|
|
320
|
+
method: "PUT";
|
|
321
|
+
body: z.ZodObject<{
|
|
322
|
+
title: z.ZodOptional<z.ZodString>;
|
|
323
|
+
createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
324
|
+
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
325
|
+
boardId: z.ZodOptional<z.ZodString>;
|
|
326
|
+
order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
}, Column>;
|
|
329
|
+
readonly deleteColumn: better_call.StrictEndpoint<"/columns/:id", {
|
|
330
|
+
method: "DELETE";
|
|
331
|
+
}, {
|
|
332
|
+
success: boolean;
|
|
333
|
+
}>;
|
|
334
|
+
readonly reorderColumns: better_call.StrictEndpoint<"/columns/reorder", {
|
|
335
|
+
method: "POST";
|
|
336
|
+
body: z.ZodObject<{
|
|
337
|
+
boardId: z.ZodString;
|
|
338
|
+
columnIds: z.ZodArray<z.ZodString>;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
}, {
|
|
341
|
+
success: boolean;
|
|
342
|
+
}>;
|
|
343
|
+
readonly createTask: better_call.StrictEndpoint<"/tasks", {
|
|
344
|
+
method: "POST";
|
|
345
|
+
body: z.ZodObject<{
|
|
346
|
+
title: z.ZodString;
|
|
347
|
+
description: z.ZodOptional<z.ZodString>;
|
|
348
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
349
|
+
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
350
|
+
order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
351
|
+
completedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
352
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
353
|
+
LOW: "LOW";
|
|
354
|
+
MEDIUM: "MEDIUM";
|
|
355
|
+
HIGH: "HIGH";
|
|
356
|
+
URGENT: "URGENT";
|
|
357
|
+
}>>>;
|
|
358
|
+
columnId: z.ZodString;
|
|
359
|
+
assigneeId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
360
|
+
isArchived: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
361
|
+
}, z.core.$strip>;
|
|
362
|
+
}, Task>;
|
|
363
|
+
readonly updateTask: better_call.StrictEndpoint<"/tasks/:id", {
|
|
364
|
+
method: "PUT";
|
|
365
|
+
body: z.ZodObject<{
|
|
366
|
+
title: z.ZodOptional<z.ZodString>;
|
|
367
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
368
|
+
createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
369
|
+
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
370
|
+
order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
|
|
371
|
+
completedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
372
|
+
priority: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
373
|
+
LOW: "LOW";
|
|
374
|
+
MEDIUM: "MEDIUM";
|
|
375
|
+
HIGH: "HIGH";
|
|
376
|
+
URGENT: "URGENT";
|
|
377
|
+
}>>>>;
|
|
378
|
+
columnId: z.ZodOptional<z.ZodString>;
|
|
379
|
+
assigneeId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
380
|
+
isArchived: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
}, Task>;
|
|
383
|
+
readonly deleteTask: better_call.StrictEndpoint<"/tasks/:id", {
|
|
384
|
+
method: "DELETE";
|
|
385
|
+
}, {
|
|
386
|
+
success: boolean;
|
|
387
|
+
}>;
|
|
388
|
+
readonly moveTask: better_call.StrictEndpoint<"/tasks/move", {
|
|
389
|
+
method: "POST";
|
|
390
|
+
body: z.ZodObject<{
|
|
391
|
+
taskId: z.ZodString;
|
|
392
|
+
targetColumnId: z.ZodString;
|
|
393
|
+
targetOrder: z.ZodNumber;
|
|
394
|
+
}, z.core.$strip>;
|
|
395
|
+
}, Task>;
|
|
396
|
+
readonly reorderTasks: better_call.StrictEndpoint<"/tasks/reorder", {
|
|
397
|
+
method: "POST";
|
|
398
|
+
body: z.ZodObject<{
|
|
399
|
+
columnId: z.ZodString;
|
|
400
|
+
taskIds: z.ZodArray<z.ZodString>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
}, {
|
|
403
|
+
success: boolean;
|
|
404
|
+
}>;
|
|
405
|
+
}, {
|
|
406
|
+
getAllBoards: (params?: Parameters<typeof getAllBoards>[1]) => Promise<BoardListResult>;
|
|
407
|
+
getBoardById: (id: string) => Promise<BoardWithColumns | null>;
|
|
408
|
+
prefetchForRoute: KanbanPrefetchForRoute;
|
|
409
|
+
}>;
|
|
410
|
+
type KanbanApiRouter = ReturnType<ReturnType<typeof kanbanBackendPlugin>["routes"]>;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Internal query key constants for the Kanban plugin.
|
|
414
|
+
* Shared between query-keys.ts (HTTP path) and prefetchForRoute (DB path)
|
|
415
|
+
* to prevent key drift between SSR loaders and SSG prefetching.
|
|
416
|
+
*/
|
|
417
|
+
interface BoardsListDiscriminator {
|
|
418
|
+
slug: string | undefined;
|
|
419
|
+
ownerId: string | undefined;
|
|
420
|
+
organizationId: string | undefined;
|
|
421
|
+
limit: number;
|
|
422
|
+
offset: number;
|
|
423
|
+
}
|
|
424
|
+
/** Full query key builders — use these with queryClient.setQueryData() */
|
|
425
|
+
declare const KANBAN_QUERY_KEYS: {
|
|
426
|
+
/**
|
|
427
|
+
* Key for boards.list(params) query.
|
|
428
|
+
* Full key: ["boards", "list", { slug, ownerId, organizationId, limit, offset }]
|
|
429
|
+
*/
|
|
430
|
+
boardsList: (params?: {
|
|
431
|
+
slug?: string;
|
|
432
|
+
ownerId?: string;
|
|
433
|
+
organizationId?: string;
|
|
434
|
+
limit?: number;
|
|
435
|
+
offset?: number;
|
|
436
|
+
}) => readonly ["boards", "list", BoardsListDiscriminator];
|
|
437
|
+
/**
|
|
438
|
+
* Key for boards.detail(boardId) query.
|
|
439
|
+
* Full key: ["boards", "detail", boardId]
|
|
440
|
+
*/
|
|
441
|
+
boardDetail: (boardId: string) => readonly ["boards", "detail", string];
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
export { getBoardById as d, KANBAN_QUERY_KEYS as e, getAllBoards as g, kanbanBackendPlugin as k };
|
|
445
|
+
export type { BoardListResult as B, KanbanApiRouter as K, KanbanRouteKey as a, KanbanApiContext as b, KanbanBackendHooks as c, BoardsListDiscriminator as f };
|