@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
|
@@ -1,163 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Provides API endpoints for managing content types and content items
|
|
9
|
-
*
|
|
10
|
-
* @param config - Configuration with content types and optional hooks
|
|
11
|
-
*/
|
|
12
|
-
declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
|
|
13
|
-
listContentTypes: better_call.StrictEndpoint<"/content-types", {
|
|
14
|
-
method: "GET";
|
|
15
|
-
}, {
|
|
16
|
-
itemCount: number;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
updatedAt: string;
|
|
19
|
-
name: string;
|
|
20
|
-
id: string;
|
|
21
|
-
slug: string;
|
|
22
|
-
description?: string | undefined;
|
|
23
|
-
jsonSchema: string;
|
|
24
|
-
fieldConfig?: string | undefined;
|
|
25
|
-
autoFormVersion?: number | undefined;
|
|
26
|
-
}[]>;
|
|
27
|
-
getContentTypeBySlug: better_call.StrictEndpoint<"/content-types/:slug", {
|
|
28
|
-
method: "GET";
|
|
29
|
-
params: z.ZodObject<{
|
|
30
|
-
slug: z.ZodString;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
}, SerializedContentType>;
|
|
33
|
-
listContentItems: better_call.StrictEndpoint<"/content/:typeSlug", {
|
|
34
|
-
method: "GET";
|
|
35
|
-
params: z.ZodObject<{
|
|
36
|
-
typeSlug: z.ZodString;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
query: z.ZodObject<{
|
|
39
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
40
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
41
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
42
|
-
}, z.core.$strip>;
|
|
43
|
-
}, {
|
|
44
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
45
|
-
total: number;
|
|
46
|
-
limit: number;
|
|
47
|
-
offset: number;
|
|
48
|
-
}>;
|
|
49
|
-
getContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
50
|
-
method: "GET";
|
|
51
|
-
params: z.ZodObject<{
|
|
52
|
-
typeSlug: z.ZodString;
|
|
53
|
-
id: z.ZodString;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
}, SerializedContentItemWithType<Record<string, unknown>>>;
|
|
56
|
-
createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
|
|
57
|
-
method: "POST";
|
|
58
|
-
params: z.ZodObject<{
|
|
59
|
-
typeSlug: z.ZodString;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
|
-
body: z.ZodObject<{
|
|
62
|
-
slug: z.ZodString;
|
|
63
|
-
data: z.ZodObject<{}, z.core.$loose>;
|
|
64
|
-
}, z.core.$strip>;
|
|
65
|
-
}, {
|
|
66
|
-
parsedData: Record<string, unknown>;
|
|
67
|
-
createdAt: string;
|
|
68
|
-
updatedAt: string;
|
|
69
|
-
id: string;
|
|
70
|
-
slug: string;
|
|
71
|
-
contentTypeId: string;
|
|
72
|
-
data: string;
|
|
73
|
-
authorId?: string | undefined;
|
|
74
|
-
}>;
|
|
75
|
-
updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
76
|
-
method: "PUT";
|
|
77
|
-
params: z.ZodObject<{
|
|
78
|
-
typeSlug: z.ZodString;
|
|
79
|
-
id: z.ZodString;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
body: z.ZodObject<{
|
|
82
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
83
|
-
data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
84
|
-
}, z.core.$strip>;
|
|
85
|
-
}, SerializedContentItemWithType<Record<string, unknown>>>;
|
|
86
|
-
deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
87
|
-
method: "DELETE";
|
|
88
|
-
params: z.ZodObject<{
|
|
89
|
-
typeSlug: z.ZodString;
|
|
90
|
-
id: z.ZodString;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
}, {
|
|
93
|
-
success: boolean;
|
|
94
|
-
}>;
|
|
95
|
-
getContentItemPopulated: better_call.StrictEndpoint<"/content/:typeSlug/:id/populated", {
|
|
96
|
-
method: "GET";
|
|
97
|
-
params: z.ZodObject<{
|
|
98
|
-
typeSlug: z.ZodString;
|
|
99
|
-
id: z.ZodString;
|
|
100
|
-
}, z.core.$strip>;
|
|
101
|
-
}, {
|
|
102
|
-
_relations: Record<string, SerializedContentItemWithType<Record<string, unknown>>[]>;
|
|
103
|
-
parsedData: Record<string, unknown>;
|
|
104
|
-
contentType?: SerializedContentType;
|
|
105
|
-
createdAt: string;
|
|
106
|
-
updatedAt: string;
|
|
107
|
-
id: string;
|
|
108
|
-
slug: string;
|
|
109
|
-
contentTypeId: string;
|
|
110
|
-
data: string;
|
|
111
|
-
authorId?: string | undefined;
|
|
112
|
-
}>;
|
|
113
|
-
listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
|
|
114
|
-
method: "GET";
|
|
115
|
-
params: z.ZodObject<{
|
|
116
|
-
typeSlug: z.ZodString;
|
|
117
|
-
}, z.core.$strip>;
|
|
118
|
-
query: z.ZodObject<{
|
|
119
|
-
field: z.ZodString;
|
|
120
|
-
targetId: z.ZodString;
|
|
121
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
122
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
123
|
-
}, z.core.$strip>;
|
|
124
|
-
}, {
|
|
125
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
126
|
-
total: number;
|
|
127
|
-
limit: number;
|
|
128
|
-
offset: number;
|
|
129
|
-
}>;
|
|
130
|
-
getInverseRelations: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations", {
|
|
131
|
-
method: "GET";
|
|
132
|
-
params: z.ZodObject<{
|
|
133
|
-
slug: z.ZodString;
|
|
134
|
-
}, z.core.$strip>;
|
|
135
|
-
query: z.ZodObject<{
|
|
136
|
-
itemId: z.ZodOptional<z.ZodString>;
|
|
137
|
-
}, z.core.$strip>;
|
|
138
|
-
}, {
|
|
139
|
-
inverseRelations: InverseRelation[];
|
|
140
|
-
}>;
|
|
141
|
-
listInverseRelationItems: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations/:sourceType", {
|
|
142
|
-
method: "GET";
|
|
143
|
-
params: z.ZodObject<{
|
|
144
|
-
slug: z.ZodString;
|
|
145
|
-
sourceType: z.ZodString;
|
|
146
|
-
}, z.core.$strip>;
|
|
147
|
-
query: z.ZodObject<{
|
|
148
|
-
itemId: z.ZodString;
|
|
149
|
-
fieldName: z.ZodString;
|
|
150
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
151
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
152
|
-
}, z.core.$strip>;
|
|
153
|
-
}, {
|
|
154
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
155
|
-
total: number;
|
|
156
|
-
limit: number;
|
|
157
|
-
offset: number;
|
|
158
|
-
}>;
|
|
159
|
-
}>;
|
|
160
|
-
type CMSApiRouter = ReturnType<ReturnType<typeof cmsBackendPlugin>["routes"]>;
|
|
161
|
-
|
|
162
|
-
export { cmsBackendPlugin };
|
|
163
|
-
export type { CMSApiRouter };
|
|
1
|
+
export { C as CMSApiRouter, b as CMSRouteKey, j as CMS_QUERY_KEYS, c as cmsBackendPlugin, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.IdtKDRka.cjs';
|
|
2
|
+
import '@btst/stack/plugins/api';
|
|
3
|
+
import '../../../shared/stack.CVDTkMoO.cjs';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import 'better-call';
|
|
6
|
+
import '@btst/db';
|
|
7
|
+
import '@tanstack/react-query';
|
|
@@ -1,163 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Provides API endpoints for managing content types and content items
|
|
9
|
-
*
|
|
10
|
-
* @param config - Configuration with content types and optional hooks
|
|
11
|
-
*/
|
|
12
|
-
declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
|
|
13
|
-
listContentTypes: better_call.StrictEndpoint<"/content-types", {
|
|
14
|
-
method: "GET";
|
|
15
|
-
}, {
|
|
16
|
-
itemCount: number;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
updatedAt: string;
|
|
19
|
-
name: string;
|
|
20
|
-
id: string;
|
|
21
|
-
slug: string;
|
|
22
|
-
description?: string | undefined;
|
|
23
|
-
jsonSchema: string;
|
|
24
|
-
fieldConfig?: string | undefined;
|
|
25
|
-
autoFormVersion?: number | undefined;
|
|
26
|
-
}[]>;
|
|
27
|
-
getContentTypeBySlug: better_call.StrictEndpoint<"/content-types/:slug", {
|
|
28
|
-
method: "GET";
|
|
29
|
-
params: z.ZodObject<{
|
|
30
|
-
slug: z.ZodString;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
}, SerializedContentType>;
|
|
33
|
-
listContentItems: better_call.StrictEndpoint<"/content/:typeSlug", {
|
|
34
|
-
method: "GET";
|
|
35
|
-
params: z.ZodObject<{
|
|
36
|
-
typeSlug: z.ZodString;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
query: z.ZodObject<{
|
|
39
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
40
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
41
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
42
|
-
}, z.core.$strip>;
|
|
43
|
-
}, {
|
|
44
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
45
|
-
total: number;
|
|
46
|
-
limit: number;
|
|
47
|
-
offset: number;
|
|
48
|
-
}>;
|
|
49
|
-
getContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
50
|
-
method: "GET";
|
|
51
|
-
params: z.ZodObject<{
|
|
52
|
-
typeSlug: z.ZodString;
|
|
53
|
-
id: z.ZodString;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
}, SerializedContentItemWithType<Record<string, unknown>>>;
|
|
56
|
-
createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
|
|
57
|
-
method: "POST";
|
|
58
|
-
params: z.ZodObject<{
|
|
59
|
-
typeSlug: z.ZodString;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
|
-
body: z.ZodObject<{
|
|
62
|
-
slug: z.ZodString;
|
|
63
|
-
data: z.ZodObject<{}, z.core.$loose>;
|
|
64
|
-
}, z.core.$strip>;
|
|
65
|
-
}, {
|
|
66
|
-
parsedData: Record<string, unknown>;
|
|
67
|
-
createdAt: string;
|
|
68
|
-
updatedAt: string;
|
|
69
|
-
id: string;
|
|
70
|
-
slug: string;
|
|
71
|
-
contentTypeId: string;
|
|
72
|
-
data: string;
|
|
73
|
-
authorId?: string | undefined;
|
|
74
|
-
}>;
|
|
75
|
-
updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
76
|
-
method: "PUT";
|
|
77
|
-
params: z.ZodObject<{
|
|
78
|
-
typeSlug: z.ZodString;
|
|
79
|
-
id: z.ZodString;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
body: z.ZodObject<{
|
|
82
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
83
|
-
data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
84
|
-
}, z.core.$strip>;
|
|
85
|
-
}, SerializedContentItemWithType<Record<string, unknown>>>;
|
|
86
|
-
deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
87
|
-
method: "DELETE";
|
|
88
|
-
params: z.ZodObject<{
|
|
89
|
-
typeSlug: z.ZodString;
|
|
90
|
-
id: z.ZodString;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
}, {
|
|
93
|
-
success: boolean;
|
|
94
|
-
}>;
|
|
95
|
-
getContentItemPopulated: better_call.StrictEndpoint<"/content/:typeSlug/:id/populated", {
|
|
96
|
-
method: "GET";
|
|
97
|
-
params: z.ZodObject<{
|
|
98
|
-
typeSlug: z.ZodString;
|
|
99
|
-
id: z.ZodString;
|
|
100
|
-
}, z.core.$strip>;
|
|
101
|
-
}, {
|
|
102
|
-
_relations: Record<string, SerializedContentItemWithType<Record<string, unknown>>[]>;
|
|
103
|
-
parsedData: Record<string, unknown>;
|
|
104
|
-
contentType?: SerializedContentType;
|
|
105
|
-
createdAt: string;
|
|
106
|
-
updatedAt: string;
|
|
107
|
-
id: string;
|
|
108
|
-
slug: string;
|
|
109
|
-
contentTypeId: string;
|
|
110
|
-
data: string;
|
|
111
|
-
authorId?: string | undefined;
|
|
112
|
-
}>;
|
|
113
|
-
listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
|
|
114
|
-
method: "GET";
|
|
115
|
-
params: z.ZodObject<{
|
|
116
|
-
typeSlug: z.ZodString;
|
|
117
|
-
}, z.core.$strip>;
|
|
118
|
-
query: z.ZodObject<{
|
|
119
|
-
field: z.ZodString;
|
|
120
|
-
targetId: z.ZodString;
|
|
121
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
122
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
123
|
-
}, z.core.$strip>;
|
|
124
|
-
}, {
|
|
125
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
126
|
-
total: number;
|
|
127
|
-
limit: number;
|
|
128
|
-
offset: number;
|
|
129
|
-
}>;
|
|
130
|
-
getInverseRelations: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations", {
|
|
131
|
-
method: "GET";
|
|
132
|
-
params: z.ZodObject<{
|
|
133
|
-
slug: z.ZodString;
|
|
134
|
-
}, z.core.$strip>;
|
|
135
|
-
query: z.ZodObject<{
|
|
136
|
-
itemId: z.ZodOptional<z.ZodString>;
|
|
137
|
-
}, z.core.$strip>;
|
|
138
|
-
}, {
|
|
139
|
-
inverseRelations: InverseRelation[];
|
|
140
|
-
}>;
|
|
141
|
-
listInverseRelationItems: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations/:sourceType", {
|
|
142
|
-
method: "GET";
|
|
143
|
-
params: z.ZodObject<{
|
|
144
|
-
slug: z.ZodString;
|
|
145
|
-
sourceType: z.ZodString;
|
|
146
|
-
}, z.core.$strip>;
|
|
147
|
-
query: z.ZodObject<{
|
|
148
|
-
itemId: z.ZodString;
|
|
149
|
-
fieldName: z.ZodString;
|
|
150
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
151
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
152
|
-
}, z.core.$strip>;
|
|
153
|
-
}, {
|
|
154
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
155
|
-
total: number;
|
|
156
|
-
limit: number;
|
|
157
|
-
offset: number;
|
|
158
|
-
}>;
|
|
159
|
-
}>;
|
|
160
|
-
type CMSApiRouter = ReturnType<ReturnType<typeof cmsBackendPlugin>["routes"]>;
|
|
161
|
-
|
|
162
|
-
export { cmsBackendPlugin };
|
|
163
|
-
export type { CMSApiRouter };
|
|
1
|
+
export { C as CMSApiRouter, b as CMSRouteKey, j as CMS_QUERY_KEYS, c as cmsBackendPlugin, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.CP68pFEH.mjs';
|
|
2
|
+
import '@btst/stack/plugins/api';
|
|
3
|
+
import '../../../shared/stack.CVDTkMoO.mjs';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import 'better-call';
|
|
6
|
+
import '@btst/db';
|
|
7
|
+
import '@tanstack/react-query';
|
|
@@ -1,163 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Provides API endpoints for managing content types and content items
|
|
9
|
-
*
|
|
10
|
-
* @param config - Configuration with content types and optional hooks
|
|
11
|
-
*/
|
|
12
|
-
declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
|
|
13
|
-
listContentTypes: better_call.StrictEndpoint<"/content-types", {
|
|
14
|
-
method: "GET";
|
|
15
|
-
}, {
|
|
16
|
-
itemCount: number;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
updatedAt: string;
|
|
19
|
-
name: string;
|
|
20
|
-
id: string;
|
|
21
|
-
slug: string;
|
|
22
|
-
description?: string | undefined;
|
|
23
|
-
jsonSchema: string;
|
|
24
|
-
fieldConfig?: string | undefined;
|
|
25
|
-
autoFormVersion?: number | undefined;
|
|
26
|
-
}[]>;
|
|
27
|
-
getContentTypeBySlug: better_call.StrictEndpoint<"/content-types/:slug", {
|
|
28
|
-
method: "GET";
|
|
29
|
-
params: z.ZodObject<{
|
|
30
|
-
slug: z.ZodString;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
}, SerializedContentType>;
|
|
33
|
-
listContentItems: better_call.StrictEndpoint<"/content/:typeSlug", {
|
|
34
|
-
method: "GET";
|
|
35
|
-
params: z.ZodObject<{
|
|
36
|
-
typeSlug: z.ZodString;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
query: z.ZodObject<{
|
|
39
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
40
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
41
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
42
|
-
}, z.core.$strip>;
|
|
43
|
-
}, {
|
|
44
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
45
|
-
total: number;
|
|
46
|
-
limit: number;
|
|
47
|
-
offset: number;
|
|
48
|
-
}>;
|
|
49
|
-
getContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
50
|
-
method: "GET";
|
|
51
|
-
params: z.ZodObject<{
|
|
52
|
-
typeSlug: z.ZodString;
|
|
53
|
-
id: z.ZodString;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
}, SerializedContentItemWithType<Record<string, unknown>>>;
|
|
56
|
-
createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
|
|
57
|
-
method: "POST";
|
|
58
|
-
params: z.ZodObject<{
|
|
59
|
-
typeSlug: z.ZodString;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
|
-
body: z.ZodObject<{
|
|
62
|
-
slug: z.ZodString;
|
|
63
|
-
data: z.ZodObject<{}, z.core.$loose>;
|
|
64
|
-
}, z.core.$strip>;
|
|
65
|
-
}, {
|
|
66
|
-
parsedData: Record<string, unknown>;
|
|
67
|
-
createdAt: string;
|
|
68
|
-
updatedAt: string;
|
|
69
|
-
id: string;
|
|
70
|
-
slug: string;
|
|
71
|
-
contentTypeId: string;
|
|
72
|
-
data: string;
|
|
73
|
-
authorId?: string | undefined;
|
|
74
|
-
}>;
|
|
75
|
-
updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
76
|
-
method: "PUT";
|
|
77
|
-
params: z.ZodObject<{
|
|
78
|
-
typeSlug: z.ZodString;
|
|
79
|
-
id: z.ZodString;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
body: z.ZodObject<{
|
|
82
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
83
|
-
data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
84
|
-
}, z.core.$strip>;
|
|
85
|
-
}, SerializedContentItemWithType<Record<string, unknown>>>;
|
|
86
|
-
deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
|
|
87
|
-
method: "DELETE";
|
|
88
|
-
params: z.ZodObject<{
|
|
89
|
-
typeSlug: z.ZodString;
|
|
90
|
-
id: z.ZodString;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
}, {
|
|
93
|
-
success: boolean;
|
|
94
|
-
}>;
|
|
95
|
-
getContentItemPopulated: better_call.StrictEndpoint<"/content/:typeSlug/:id/populated", {
|
|
96
|
-
method: "GET";
|
|
97
|
-
params: z.ZodObject<{
|
|
98
|
-
typeSlug: z.ZodString;
|
|
99
|
-
id: z.ZodString;
|
|
100
|
-
}, z.core.$strip>;
|
|
101
|
-
}, {
|
|
102
|
-
_relations: Record<string, SerializedContentItemWithType<Record<string, unknown>>[]>;
|
|
103
|
-
parsedData: Record<string, unknown>;
|
|
104
|
-
contentType?: SerializedContentType;
|
|
105
|
-
createdAt: string;
|
|
106
|
-
updatedAt: string;
|
|
107
|
-
id: string;
|
|
108
|
-
slug: string;
|
|
109
|
-
contentTypeId: string;
|
|
110
|
-
data: string;
|
|
111
|
-
authorId?: string | undefined;
|
|
112
|
-
}>;
|
|
113
|
-
listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
|
|
114
|
-
method: "GET";
|
|
115
|
-
params: z.ZodObject<{
|
|
116
|
-
typeSlug: z.ZodString;
|
|
117
|
-
}, z.core.$strip>;
|
|
118
|
-
query: z.ZodObject<{
|
|
119
|
-
field: z.ZodString;
|
|
120
|
-
targetId: z.ZodString;
|
|
121
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
122
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
123
|
-
}, z.core.$strip>;
|
|
124
|
-
}, {
|
|
125
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
126
|
-
total: number;
|
|
127
|
-
limit: number;
|
|
128
|
-
offset: number;
|
|
129
|
-
}>;
|
|
130
|
-
getInverseRelations: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations", {
|
|
131
|
-
method: "GET";
|
|
132
|
-
params: z.ZodObject<{
|
|
133
|
-
slug: z.ZodString;
|
|
134
|
-
}, z.core.$strip>;
|
|
135
|
-
query: z.ZodObject<{
|
|
136
|
-
itemId: z.ZodOptional<z.ZodString>;
|
|
137
|
-
}, z.core.$strip>;
|
|
138
|
-
}, {
|
|
139
|
-
inverseRelations: InverseRelation[];
|
|
140
|
-
}>;
|
|
141
|
-
listInverseRelationItems: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations/:sourceType", {
|
|
142
|
-
method: "GET";
|
|
143
|
-
params: z.ZodObject<{
|
|
144
|
-
slug: z.ZodString;
|
|
145
|
-
sourceType: z.ZodString;
|
|
146
|
-
}, z.core.$strip>;
|
|
147
|
-
query: z.ZodObject<{
|
|
148
|
-
itemId: z.ZodString;
|
|
149
|
-
fieldName: z.ZodString;
|
|
150
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
151
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
152
|
-
}, z.core.$strip>;
|
|
153
|
-
}, {
|
|
154
|
-
items: SerializedContentItemWithType<Record<string, unknown>>[];
|
|
155
|
-
total: number;
|
|
156
|
-
limit: number;
|
|
157
|
-
offset: number;
|
|
158
|
-
}>;
|
|
159
|
-
}>;
|
|
160
|
-
type CMSApiRouter = ReturnType<ReturnType<typeof cmsBackendPlugin>["routes"]>;
|
|
161
|
-
|
|
162
|
-
export { cmsBackendPlugin };
|
|
163
|
-
export type { CMSApiRouter };
|
|
1
|
+
export { C as CMSApiRouter, b as CMSRouteKey, j as CMS_QUERY_KEYS, c as cmsBackendPlugin, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.B1EeBt1b.js';
|
|
2
|
+
import '@btst/stack/plugins/api';
|
|
3
|
+
import '../../../shared/stack.CVDTkMoO.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import 'better-call';
|
|
6
|
+
import '@btst/db';
|
|
7
|
+
import '@tanstack/react-query';
|
|
@@ -1 +1,3 @@
|
|
|
1
1
|
export { cmsBackendPlugin } from '../../../packages/stack/src/plugins/cms/api/plugin.mjs';
|
|
2
|
+
export { getAllContentItems, getAllContentTypes, getContentItemById, getContentItemBySlug, serializeContentItem, serializeContentItemWithType, serializeContentType } from '../../../packages/stack/src/plugins/cms/api/getters.mjs';
|
|
3
|
+
export { CMS_QUERY_KEYS } from '../../../packages/stack/src/plugins/cms/api/query-key-defs.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedContentType, a as SerializedContentItemWithType } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedContentType, a as SerializedContentItemWithType } from '../../../../shared/stack.CVDTkMoO.cjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
interface UseContentTypesResult {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedContentType, a as SerializedContentItemWithType } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedContentType, a as SerializedContentItemWithType } from '../../../../shared/stack.CVDTkMoO.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
interface UseContentTypesResult {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedContentType, a as SerializedContentItemWithType } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedContentType, a as SerializedContentItemWithType } from '../../../../shared/stack.CVDTkMoO.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
interface UseContentTypesResult {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const queryKeyFactory = require('@lukemorales/query-key-factory');
|
|
4
|
+
const queryKeyDefs = require('../../packages/stack/src/plugins/cms/api/query-key-defs.cjs');
|
|
4
5
|
|
|
5
6
|
function isErrorResponse(response) {
|
|
6
7
|
if (typeof response !== "object" || response === null) {
|
|
@@ -70,7 +71,7 @@ function createContentTypesQueries(client, headers) {
|
|
|
70
71
|
function createContentQueries(client, headers) {
|
|
71
72
|
return queryKeyFactory.createQueryKeys("cmsContent", {
|
|
72
73
|
list: (params) => ({
|
|
73
|
-
queryKey: [params],
|
|
74
|
+
queryKey: [queryKeyDefs.contentListDiscriminator(params)],
|
|
74
75
|
queryFn: async () => {
|
|
75
76
|
try {
|
|
76
77
|
const response = await client("/content/:typeSlug", {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.IdtKDRka.cjs';
|
|
1
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
3
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
3
|
-
import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.
|
|
4
|
-
import { CMSApiRouter } from './api/index.cjs';
|
|
5
|
-
import 'zod';
|
|
4
|
+
import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.CVDTkMoO.cjs';
|
|
6
5
|
import '@btst/stack/plugins/api';
|
|
7
6
|
import 'better-call';
|
|
7
|
+
import 'zod';
|
|
8
|
+
import '@btst/db';
|
|
8
9
|
|
|
9
10
|
interface ContentListParams {
|
|
10
11
|
limit?: number;
|
|
@@ -43,12 +44,8 @@ declare function createCMSQueryKeys(client: ReturnType<typeof createApiClient<CM
|
|
|
43
44
|
list: ((params: {
|
|
44
45
|
typeSlug: string;
|
|
45
46
|
} & ContentListParams) => Omit<{
|
|
46
|
-
queryKey: readonly ["cmsContent", "list",
|
|
47
|
-
|
|
48
|
-
} & ContentListParams];
|
|
49
|
-
queryFn: _tanstack_react_query.QueryFunction<PaginatedContentItems<Record<string, unknown>>, readonly ["cmsContent", "list", {
|
|
50
|
-
typeSlug: string;
|
|
51
|
-
} & ContentListParams]>;
|
|
47
|
+
queryKey: readonly ["cmsContent", "list", ContentListDiscriminator];
|
|
48
|
+
queryFn: _tanstack_react_query.QueryFunction<PaginatedContentItems<Record<string, unknown>>, readonly ["cmsContent", "list", ContentListDiscriminator]>;
|
|
52
49
|
} & {
|
|
53
50
|
_def: readonly ["cmsContent", "list"];
|
|
54
51
|
}, "_def">) & {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.CP68pFEH.mjs';
|
|
1
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
3
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
3
|
-
import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.
|
|
4
|
-
import { CMSApiRouter } from './api/index.mjs';
|
|
5
|
-
import 'zod';
|
|
4
|
+
import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.CVDTkMoO.mjs';
|
|
6
5
|
import '@btst/stack/plugins/api';
|
|
7
6
|
import 'better-call';
|
|
7
|
+
import 'zod';
|
|
8
|
+
import '@btst/db';
|
|
8
9
|
|
|
9
10
|
interface ContentListParams {
|
|
10
11
|
limit?: number;
|
|
@@ -43,12 +44,8 @@ declare function createCMSQueryKeys(client: ReturnType<typeof createApiClient<CM
|
|
|
43
44
|
list: ((params: {
|
|
44
45
|
typeSlug: string;
|
|
45
46
|
} & ContentListParams) => Omit<{
|
|
46
|
-
queryKey: readonly ["cmsContent", "list",
|
|
47
|
-
|
|
48
|
-
} & ContentListParams];
|
|
49
|
-
queryFn: _tanstack_react_query.QueryFunction<PaginatedContentItems<Record<string, unknown>>, readonly ["cmsContent", "list", {
|
|
50
|
-
typeSlug: string;
|
|
51
|
-
} & ContentListParams]>;
|
|
47
|
+
queryKey: readonly ["cmsContent", "list", ContentListDiscriminator];
|
|
48
|
+
queryFn: _tanstack_react_query.QueryFunction<PaginatedContentItems<Record<string, unknown>>, readonly ["cmsContent", "list", ContentListDiscriminator]>;
|
|
52
49
|
} & {
|
|
53
50
|
_def: readonly ["cmsContent", "list"];
|
|
54
51
|
}, "_def">) & {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.B1EeBt1b.js';
|
|
1
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
3
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
3
|
-
import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.
|
|
4
|
-
import { CMSApiRouter } from './api/index.js';
|
|
5
|
-
import 'zod';
|
|
4
|
+
import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.CVDTkMoO.js';
|
|
6
5
|
import '@btst/stack/plugins/api';
|
|
7
6
|
import 'better-call';
|
|
7
|
+
import 'zod';
|
|
8
|
+
import '@btst/db';
|
|
8
9
|
|
|
9
10
|
interface ContentListParams {
|
|
10
11
|
limit?: number;
|
|
@@ -43,12 +44,8 @@ declare function createCMSQueryKeys(client: ReturnType<typeof createApiClient<CM
|
|
|
43
44
|
list: ((params: {
|
|
44
45
|
typeSlug: string;
|
|
45
46
|
} & ContentListParams) => Omit<{
|
|
46
|
-
queryKey: readonly ["cmsContent", "list",
|
|
47
|
-
|
|
48
|
-
} & ContentListParams];
|
|
49
|
-
queryFn: _tanstack_react_query.QueryFunction<PaginatedContentItems<Record<string, unknown>>, readonly ["cmsContent", "list", {
|
|
50
|
-
typeSlug: string;
|
|
51
|
-
} & ContentListParams]>;
|
|
47
|
+
queryKey: readonly ["cmsContent", "list", ContentListDiscriminator];
|
|
48
|
+
queryFn: _tanstack_react_query.QueryFunction<PaginatedContentItems<Record<string, unknown>>, readonly ["cmsContent", "list", ContentListDiscriminator]>;
|
|
52
49
|
} & {
|
|
53
50
|
_def: readonly ["cmsContent", "list"];
|
|
54
51
|
}, "_def">) & {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mergeQueryKeys, createQueryKeys } from '@lukemorales/query-key-factory';
|
|
2
|
+
import { contentListDiscriminator } from '../../packages/stack/src/plugins/cms/api/query-key-defs.mjs';
|
|
2
3
|
|
|
3
4
|
function isErrorResponse(response) {
|
|
4
5
|
if (typeof response !== "object" || response === null) {
|
|
@@ -68,7 +69,7 @@ function createContentTypesQueries(client, headers) {
|
|
|
68
69
|
function createContentQueries(client, headers) {
|
|
69
70
|
return createQueryKeys("cmsContent", {
|
|
70
71
|
list: (params) => ({
|
|
71
|
-
queryKey: [params],
|
|
72
|
+
queryKey: [contentListDiscriminator(params)],
|
|
72
73
|
queryFn: async () => {
|
|
73
74
|
try {
|
|
74
75
|
const response = await client("/content/:typeSlug", {
|