@btst/stack 2.2.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.
Files changed (159) hide show
  1. package/dist/packages/stack/src/plugins/blog/api/plugin.cjs +52 -1
  2. package/dist/packages/stack/src/plugins/blog/api/plugin.mjs +52 -1
  3. package/dist/packages/stack/src/plugins/blog/api/query-key-defs.cjs +18 -0
  4. package/dist/packages/stack/src/plugins/blog/api/query-key-defs.mjs +15 -0
  5. package/dist/packages/stack/src/plugins/blog/api/serializers.cjs +21 -0
  6. package/dist/packages/stack/src/plugins/blog/api/serializers.mjs +18 -0
  7. package/dist/packages/stack/src/plugins/blog/client/plugin.cjs +15 -0
  8. package/dist/packages/stack/src/plugins/blog/client/plugin.mjs +16 -1
  9. package/dist/packages/stack/src/plugins/cms/api/getters.cjs +10 -0
  10. package/dist/packages/stack/src/plugins/cms/api/getters.mjs +10 -1
  11. package/dist/packages/stack/src/plugins/cms/api/plugin.cjs +70 -1
  12. package/dist/packages/stack/src/plugins/cms/api/plugin.mjs +71 -2
  13. package/dist/packages/stack/src/plugins/cms/api/query-key-defs.cjs +29 -0
  14. package/dist/packages/stack/src/plugins/cms/api/query-key-defs.mjs +26 -0
  15. package/dist/packages/stack/src/plugins/cms/client/plugin.cjs +15 -0
  16. package/dist/packages/stack/src/plugins/cms/client/plugin.mjs +16 -1
  17. package/dist/packages/stack/src/plugins/form-builder/api/getters.cjs +9 -0
  18. package/dist/packages/stack/src/plugins/form-builder/api/getters.mjs +9 -1
  19. package/dist/packages/stack/src/plugins/form-builder/api/plugin.cjs +62 -1
  20. package/dist/packages/stack/src/plugins/form-builder/api/plugin.mjs +63 -2
  21. package/dist/packages/stack/src/plugins/form-builder/api/query-key-defs.cjs +37 -0
  22. package/dist/packages/stack/src/plugins/form-builder/api/query-key-defs.mjs +33 -0
  23. package/dist/packages/stack/src/plugins/form-builder/client/plugin.cjs +15 -0
  24. package/dist/packages/stack/src/plugins/form-builder/client/plugin.mjs +16 -1
  25. package/dist/packages/stack/src/plugins/kanban/api/plugin.cjs +29 -1
  26. package/dist/packages/stack/src/plugins/kanban/api/plugin.mjs +29 -1
  27. package/dist/packages/stack/src/plugins/kanban/api/query-key-defs.cjs +26 -0
  28. package/dist/packages/stack/src/plugins/kanban/api/query-key-defs.mjs +23 -0
  29. package/dist/packages/stack/src/plugins/kanban/api/serializers.cjs +30 -0
  30. package/dist/packages/stack/src/plugins/kanban/api/serializers.mjs +26 -0
  31. package/dist/packages/stack/src/plugins/kanban/client/plugin.cjs +10 -0
  32. package/dist/packages/stack/src/plugins/kanban/client/plugin.mjs +11 -1
  33. package/dist/packages/stack/src/plugins/utils.cjs +6 -0
  34. package/dist/packages/stack/src/plugins/utils.mjs +6 -1
  35. package/dist/plugins/blog/api/index.cjs +5 -0
  36. package/dist/plugins/blog/api/index.d.cts +19 -4
  37. package/dist/plugins/blog/api/index.d.mts +19 -4
  38. package/dist/plugins/blog/api/index.d.ts +19 -4
  39. package/dist/plugins/blog/api/index.mjs +2 -0
  40. package/dist/plugins/blog/client/hooks/index.d.cts +4 -4
  41. package/dist/plugins/blog/client/hooks/index.d.mts +4 -4
  42. package/dist/plugins/blog/client/hooks/index.d.ts +4 -4
  43. package/dist/plugins/blog/client/index.d.cts +1 -1
  44. package/dist/plugins/blog/client/index.d.mts +1 -1
  45. package/dist/plugins/blog/client/index.d.ts +1 -1
  46. package/dist/plugins/blog/query-keys.cjs +6 -5
  47. package/dist/plugins/blog/query-keys.d.cts +8 -387
  48. package/dist/plugins/blog/query-keys.d.mts +8 -387
  49. package/dist/plugins/blog/query-keys.d.ts +8 -387
  50. package/dist/plugins/blog/query-keys.mjs +6 -5
  51. package/dist/plugins/client/index.cjs +1 -0
  52. package/dist/plugins/client/index.d.cts +8 -1
  53. package/dist/plugins/client/index.d.mts +8 -1
  54. package/dist/plugins/client/index.d.ts +8 -1
  55. package/dist/plugins/client/index.mjs +1 -1
  56. package/dist/plugins/cms/api/index.cjs +6 -0
  57. package/dist/plugins/cms/api/index.d.cts +7 -219
  58. package/dist/plugins/cms/api/index.d.mts +7 -219
  59. package/dist/plugins/cms/api/index.d.ts +7 -219
  60. package/dist/plugins/cms/api/index.mjs +2 -1
  61. package/dist/plugins/cms/client/hooks/index.d.cts +1 -1
  62. package/dist/plugins/cms/client/hooks/index.d.mts +1 -1
  63. package/dist/plugins/cms/client/hooks/index.d.ts +1 -1
  64. package/dist/plugins/cms/query-keys.cjs +2 -1
  65. package/dist/plugins/cms/query-keys.d.cts +5 -9
  66. package/dist/plugins/cms/query-keys.d.mts +5 -9
  67. package/dist/plugins/cms/query-keys.d.ts +5 -9
  68. package/dist/plugins/cms/query-keys.mjs +2 -1
  69. package/dist/plugins/form-builder/api/index.cjs +6 -0
  70. package/dist/plugins/form-builder/api/index.d.cts +7 -211
  71. package/dist/plugins/form-builder/api/index.d.mts +7 -211
  72. package/dist/plugins/form-builder/api/index.d.ts +7 -211
  73. package/dist/plugins/form-builder/api/index.mjs +2 -1
  74. package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
  75. package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
  76. package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
  77. package/dist/plugins/form-builder/client/hooks/index.d.cts +1 -1
  78. package/dist/plugins/form-builder/client/hooks/index.d.mts +1 -1
  79. package/dist/plugins/form-builder/client/hooks/index.d.ts +1 -1
  80. package/dist/plugins/form-builder/query-keys.cjs +3 -2
  81. package/dist/plugins/form-builder/query-keys.d.cts +6 -6
  82. package/dist/plugins/form-builder/query-keys.d.mts +6 -6
  83. package/dist/plugins/form-builder/query-keys.d.ts +6 -6
  84. package/dist/plugins/form-builder/query-keys.mjs +3 -2
  85. package/dist/plugins/kanban/api/index.cjs +6 -0
  86. package/dist/plugins/kanban/api/index.d.cts +17 -392
  87. package/dist/plugins/kanban/api/index.d.mts +17 -392
  88. package/dist/plugins/kanban/api/index.d.ts +17 -392
  89. package/dist/plugins/kanban/api/index.mjs +2 -0
  90. package/dist/plugins/kanban/client/components/index.d.cts +1 -1
  91. package/dist/plugins/kanban/client/components/index.d.mts +1 -1
  92. package/dist/plugins/kanban/client/components/index.d.ts +1 -1
  93. package/dist/plugins/kanban/client/hooks/index.d.cts +1 -1
  94. package/dist/plugins/kanban/client/hooks/index.d.mts +1 -1
  95. package/dist/plugins/kanban/client/hooks/index.d.ts +1 -1
  96. package/dist/plugins/kanban/client/index.d.cts +1 -1
  97. package/dist/plugins/kanban/client/index.d.mts +1 -1
  98. package/dist/plugins/kanban/client/index.d.ts +1 -1
  99. package/dist/plugins/kanban/query-keys.cjs +2 -9
  100. package/dist/plugins/kanban/query-keys.d.cts +4 -16
  101. package/dist/plugins/kanban/query-keys.d.mts +4 -16
  102. package/dist/plugins/kanban/query-keys.d.ts +4 -16
  103. package/dist/plugins/kanban/query-keys.mjs +2 -9
  104. package/dist/plugins/ui-builder/index.d.cts +1 -1
  105. package/dist/plugins/ui-builder/index.d.mts +1 -1
  106. package/dist/plugins/ui-builder/index.d.ts +1 -1
  107. package/dist/shared/stack.B1EeBt1b.d.ts +297 -0
  108. package/dist/shared/stack.BIXEI6v_.d.mts +419 -0
  109. package/dist/shared/stack.BKfolAyK.d.ts +419 -0
  110. package/dist/shared/stack.BpolpQpf.d.cts +445 -0
  111. package/dist/shared/stack.C5dtIncc.d.mts +293 -0
  112. package/dist/shared/stack.CIP6QS9l.d.ts +293 -0
  113. package/dist/shared/stack.CP68pFEH.d.mts +297 -0
  114. package/dist/shared/{stack.CXjzTMsb.d.mts → stack.CVDTkMoO.d.cts} +7 -1
  115. package/dist/shared/{stack.CXjzTMsb.d.ts → stack.CVDTkMoO.d.mts} +7 -1
  116. package/dist/shared/{stack.CXjzTMsb.d.cts → stack.CVDTkMoO.d.ts} +7 -1
  117. package/dist/shared/{stack.QD1y_7NY.d.mts → stack.DJaKVY7v.d.cts} +1 -1
  118. package/dist/shared/{stack.QD1y_7NY.d.ts → stack.DJaKVY7v.d.mts} +1 -1
  119. package/dist/shared/{stack.QD1y_7NY.d.cts → stack.DJaKVY7v.d.ts} +1 -1
  120. package/dist/shared/{stack.CIrIsc-A.d.mts → stack.DdI5W6MB.d.cts} +7 -1
  121. package/dist/shared/{stack.CIrIsc-A.d.ts → stack.DdI5W6MB.d.mts} +7 -1
  122. package/dist/shared/{stack.CIrIsc-A.d.cts → stack.DdI5W6MB.d.ts} +7 -1
  123. package/dist/shared/stack.Dw0Ly2TM.d.cts +293 -0
  124. package/dist/shared/stack.IdtKDRka.d.cts +297 -0
  125. package/dist/shared/stack.TIBF2AOx.d.ts +445 -0
  126. package/dist/shared/stack.rTy7-wQU.d.mts +445 -0
  127. package/dist/shared/stack.snB1EDP7.d.cts +419 -0
  128. package/package.json +3 -3
  129. package/src/plugins/blog/api/index.ts +2 -0
  130. package/src/plugins/blog/api/plugin.ts +85 -0
  131. package/src/plugins/blog/api/query-key-defs.ts +46 -0
  132. package/src/plugins/blog/api/serializers.ts +27 -0
  133. package/src/plugins/blog/client/plugin.tsx +19 -0
  134. package/src/plugins/blog/query-keys.ts +5 -7
  135. package/src/plugins/client/index.ts +1 -1
  136. package/src/plugins/cms/api/getters.ts +24 -0
  137. package/src/plugins/cms/api/index.ts +10 -1
  138. package/src/plugins/cms/api/plugin.ts +105 -0
  139. package/src/plugins/cms/api/query-key-defs.ts +53 -0
  140. package/src/plugins/cms/api/serializers.ts +12 -0
  141. package/src/plugins/cms/client/plugin.tsx +19 -0
  142. package/src/plugins/cms/query-keys.ts +2 -1
  143. package/src/plugins/form-builder/api/getters.ts +23 -0
  144. package/src/plugins/form-builder/api/index.ts +15 -2
  145. package/src/plugins/form-builder/api/plugin.ts +91 -0
  146. package/src/plugins/form-builder/api/query-key-defs.ts +79 -0
  147. package/src/plugins/form-builder/api/serializers.ts +12 -0
  148. package/src/plugins/form-builder/client/plugin.tsx +19 -0
  149. package/src/plugins/form-builder/query-keys.ts +6 -2
  150. package/src/plugins/kanban/api/index.ts +3 -0
  151. package/src/plugins/kanban/api/plugin.ts +49 -0
  152. package/src/plugins/kanban/api/query-key-defs.ts +54 -0
  153. package/src/plugins/kanban/api/serializers.ts +49 -0
  154. package/src/plugins/kanban/client/plugin.tsx +13 -0
  155. package/src/plugins/kanban/query-keys.ts +2 -9
  156. package/src/plugins/utils.ts +19 -0
  157. package/dist/shared/{stack.BkYlUT_8.d.cts → stack.CBON0dWL.d.cts} +6 -6
  158. package/dist/shared/{stack.BkYlUT_8.d.mts → stack.CBON0dWL.d.mts} +6 -6
  159. package/dist/shared/{stack.BkYlUT_8.d.ts → stack.CBON0dWL.d.ts} +6 -6
@@ -0,0 +1,297 @@
1
+ import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
+ import { a as SerializedContentItemWithType, S as SerializedContentType, b as ContentType, c as ContentItem, d as SerializedContentItem, e as ContentItemWithType, f as CMSBackendConfig, I as InverseRelation } from './stack.CVDTkMoO.mjs';
3
+ import * as better_call from 'better-call';
4
+ import { z } from 'zod';
5
+ import { Adapter } from '@btst/db';
6
+ import { QueryClient } from '@tanstack/react-query';
7
+
8
+ /**
9
+ * Serialize a ContentType for SSR/SSG use (convert dates to strings).
10
+ * Applies lazy migration for legacy schemas (version 1 → 2).
11
+ */
12
+ declare function serializeContentType(ct: ContentType): SerializedContentType;
13
+ /**
14
+ * Serialize a ContentItem for SSR/SSG use (convert dates to strings).
15
+ */
16
+ declare function serializeContentItem(item: ContentItem): SerializedContentItem;
17
+ /**
18
+ * Serialize a ContentItem with parsed data and joined ContentType.
19
+ * Throws a SyntaxError if `item.data` is not valid JSON, so corrupted rows
20
+ * produce a visible, debuggable error rather than silently returning null.
21
+ */
22
+ declare function serializeContentItemWithType(item: ContentItemWithType): SerializedContentItemWithType;
23
+ /**
24
+ * Retrieve all content types.
25
+ * Pure DB function — no hooks, no HTTP context. Safe for SSG and server-side use.
26
+ *
27
+ * @remarks **Security:** Authorization hooks are NOT called. The caller is
28
+ * responsible for any access-control checks before invoking this function.
29
+ *
30
+ * @param adapter - The database adapter
31
+ */
32
+ declare function getAllContentTypes(adapter: Adapter): Promise<SerializedContentType[]>;
33
+ /**
34
+ * Retrieve all content items for a given content type, with optional pagination.
35
+ * Pure DB function — no hooks, no HTTP context. Safe for SSG and server-side use.
36
+ *
37
+ * @remarks **Security:** Authorization hooks (e.g. `onBeforeListItems`) are NOT
38
+ * called. The caller is responsible for any access-control checks before
39
+ * invoking this function.
40
+ *
41
+ * @param adapter - The database adapter
42
+ * @param contentTypeSlug - The slug of the content type to query
43
+ * @param params - Optional filter/pagination parameters
44
+ */
45
+ declare function getAllContentItems(adapter: Adapter, contentTypeSlug: string, params?: {
46
+ slug?: string;
47
+ limit?: number;
48
+ offset?: number;
49
+ }): Promise<{
50
+ items: SerializedContentItemWithType[];
51
+ total: number;
52
+ limit?: number;
53
+ offset?: number;
54
+ }>;
55
+ /**
56
+ * Retrieve a single content item by its ID.
57
+ * Returns null if the item is not found.
58
+ * Pure DB function — no hooks, no HTTP context. Safe for SSG and server-side use.
59
+ *
60
+ * @remarks **Security:** Authorization hooks are NOT called. The caller is
61
+ * responsible for any access-control checks before invoking this function.
62
+ *
63
+ * @param adapter - The database adapter
64
+ * @param id - The content item ID (UUID)
65
+ */
66
+ declare function getContentItemById(adapter: Adapter, id: string): Promise<SerializedContentItemWithType | null>;
67
+ /**
68
+ * Retrieve a single content item by its slug within a content type.
69
+ * Returns null if the content type or item is not found.
70
+ * Pure DB function — no hooks, no HTTP context. Safe for SSG and server-side use.
71
+ *
72
+ * @remarks **Security:** Authorization hooks are NOT called. The caller is
73
+ * responsible for any access-control checks before invoking this function.
74
+ *
75
+ * @param adapter - The database adapter
76
+ * @param contentTypeSlug - The slug of the content type
77
+ * @param slug - The slug of the content item
78
+ */
79
+ declare function getContentItemBySlug(adapter: Adapter, contentTypeSlug: string, slug: string): Promise<SerializedContentItemWithType | null>;
80
+
81
+ /**
82
+ * Route keys for the CMS plugin — matches the keys returned by
83
+ * `stackClient.router.getRoute(path).routeKey`.
84
+ */
85
+ type CMSRouteKey = "dashboard" | "contentList" | "newContent" | "editContent";
86
+ interface CMSPrefetchForRoute {
87
+ (key: "dashboard" | "newContent", qc: QueryClient): Promise<void>;
88
+ (key: "contentList", qc: QueryClient, params: {
89
+ typeSlug: string;
90
+ }): Promise<void>;
91
+ (key: "editContent", qc: QueryClient, params: {
92
+ typeSlug: string;
93
+ id: string;
94
+ }): Promise<void>;
95
+ }
96
+ /**
97
+ * CMS backend plugin
98
+ * Provides API endpoints for managing content types and content items
99
+ *
100
+ * @param config - Configuration with content types and optional hooks
101
+ */
102
+ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
103
+ listContentTypes: better_call.StrictEndpoint<"/content-types", {
104
+ method: "GET";
105
+ }, {
106
+ itemCount: number;
107
+ createdAt: string;
108
+ updatedAt: string;
109
+ name: string;
110
+ id: string;
111
+ slug: string;
112
+ description?: string | undefined;
113
+ jsonSchema: string;
114
+ fieldConfig?: string | undefined;
115
+ autoFormVersion?: number | undefined;
116
+ }[]>;
117
+ getContentTypeBySlug: better_call.StrictEndpoint<"/content-types/:slug", {
118
+ method: "GET";
119
+ params: z.ZodObject<{
120
+ slug: z.ZodString;
121
+ }, z.core.$strip>;
122
+ }, SerializedContentType>;
123
+ listContentItems: better_call.StrictEndpoint<"/content/:typeSlug", {
124
+ method: "GET";
125
+ params: z.ZodObject<{
126
+ typeSlug: z.ZodString;
127
+ }, z.core.$strip>;
128
+ query: z.ZodObject<{
129
+ slug: z.ZodOptional<z.ZodString>;
130
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
131
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
132
+ }, z.core.$strip>;
133
+ }, {
134
+ items: SerializedContentItemWithType[];
135
+ total: number;
136
+ limit?: number;
137
+ offset?: number;
138
+ }>;
139
+ getContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
140
+ method: "GET";
141
+ params: z.ZodObject<{
142
+ typeSlug: z.ZodString;
143
+ id: z.ZodString;
144
+ }, z.core.$strip>;
145
+ }, SerializedContentItemWithType<Record<string, unknown>>>;
146
+ createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
147
+ method: "POST";
148
+ params: z.ZodObject<{
149
+ typeSlug: z.ZodString;
150
+ }, z.core.$strip>;
151
+ body: z.ZodObject<{
152
+ slug: z.ZodString;
153
+ data: z.ZodObject<{}, z.core.$loose>;
154
+ }, z.core.$strip>;
155
+ }, {
156
+ parsedData: Record<string, unknown>;
157
+ createdAt: string;
158
+ updatedAt: string;
159
+ id: string;
160
+ slug: string;
161
+ contentTypeId: string;
162
+ data: string;
163
+ authorId?: string | undefined;
164
+ }>;
165
+ updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
166
+ method: "PUT";
167
+ params: z.ZodObject<{
168
+ typeSlug: z.ZodString;
169
+ id: z.ZodString;
170
+ }, z.core.$strip>;
171
+ body: z.ZodObject<{
172
+ slug: z.ZodOptional<z.ZodString>;
173
+ data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
174
+ }, z.core.$strip>;
175
+ }, SerializedContentItemWithType<Record<string, unknown>>>;
176
+ deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
177
+ method: "DELETE";
178
+ params: z.ZodObject<{
179
+ typeSlug: z.ZodString;
180
+ id: z.ZodString;
181
+ }, z.core.$strip>;
182
+ }, {
183
+ success: boolean;
184
+ }>;
185
+ getContentItemPopulated: better_call.StrictEndpoint<"/content/:typeSlug/:id/populated", {
186
+ method: "GET";
187
+ params: z.ZodObject<{
188
+ typeSlug: z.ZodString;
189
+ id: z.ZodString;
190
+ }, z.core.$strip>;
191
+ }, {
192
+ _relations: Record<string, SerializedContentItemWithType<Record<string, unknown>>[]>;
193
+ parsedData: Record<string, unknown>;
194
+ contentType?: SerializedContentType;
195
+ createdAt: string;
196
+ updatedAt: string;
197
+ id: string;
198
+ slug: string;
199
+ contentTypeId: string;
200
+ data: string;
201
+ authorId?: string | undefined;
202
+ }>;
203
+ listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
204
+ method: "GET";
205
+ params: z.ZodObject<{
206
+ typeSlug: z.ZodString;
207
+ }, z.core.$strip>;
208
+ query: z.ZodObject<{
209
+ field: z.ZodString;
210
+ targetId: z.ZodString;
211
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
212
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
213
+ }, z.core.$strip>;
214
+ }, {
215
+ items: SerializedContentItemWithType<Record<string, unknown>>[];
216
+ total: number;
217
+ limit: number;
218
+ offset: number;
219
+ }>;
220
+ getInverseRelations: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations", {
221
+ method: "GET";
222
+ params: z.ZodObject<{
223
+ slug: z.ZodString;
224
+ }, z.core.$strip>;
225
+ query: z.ZodObject<{
226
+ itemId: z.ZodOptional<z.ZodString>;
227
+ }, z.core.$strip>;
228
+ }, {
229
+ inverseRelations: InverseRelation[];
230
+ }>;
231
+ listInverseRelationItems: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations/:sourceType", {
232
+ method: "GET";
233
+ params: z.ZodObject<{
234
+ slug: z.ZodString;
235
+ sourceType: z.ZodString;
236
+ }, z.core.$strip>;
237
+ query: z.ZodObject<{
238
+ itemId: z.ZodString;
239
+ fieldName: z.ZodString;
240
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
241
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
242
+ }, z.core.$strip>;
243
+ }, {
244
+ items: SerializedContentItemWithType<Record<string, unknown>>[];
245
+ total: number;
246
+ limit: number;
247
+ offset: number;
248
+ }>;
249
+ }, {
250
+ getAllContentTypes: () => Promise<SerializedContentType[]>;
251
+ getAllContentItems: (contentTypeSlug: string, params?: Parameters<typeof getAllContentItems>[2]) => Promise<{
252
+ items: SerializedContentItemWithType[];
253
+ total: number;
254
+ limit?: number;
255
+ offset?: number;
256
+ }>;
257
+ getContentItemBySlug: (contentTypeSlug: string, slug: string) => Promise<SerializedContentItemWithType<Record<string, unknown>> | null>;
258
+ getContentItemById: (id: string) => Promise<SerializedContentItemWithType<Record<string, unknown>> | null>;
259
+ prefetchForRoute: CMSPrefetchForRoute;
260
+ }>;
261
+ type CMSApiRouter = ReturnType<ReturnType<typeof cmsBackendPlugin>["routes"]>;
262
+
263
+ /**
264
+ * Internal query key constants for the CMS plugin.
265
+ * Shared between query-keys.ts (HTTP path) and prefetchForRoute (DB path)
266
+ * to prevent key drift between SSR loaders and SSG prefetching.
267
+ */
268
+ interface ContentListDiscriminator {
269
+ typeSlug: string;
270
+ limit: number;
271
+ offset: number;
272
+ }
273
+ /** Full query key builders — use these with queryClient.setQueryData() */
274
+ declare const CMS_QUERY_KEYS: {
275
+ /**
276
+ * Key for the cmsTypes.list() query.
277
+ * Full key: ["cmsTypes", "list", "list"]
278
+ */
279
+ typesList: () => readonly ["cmsTypes", "list", "list"];
280
+ /**
281
+ * Key for the cmsContent.list({ typeSlug, limit, offset }) query.
282
+ * Full key: ["cmsContent", "list", { typeSlug, limit, offset }]
283
+ */
284
+ contentList: (params: {
285
+ typeSlug: string;
286
+ limit?: number;
287
+ offset?: number;
288
+ }) => readonly ["cmsContent", "list", ContentListDiscriminator];
289
+ /**
290
+ * Key for the cmsContent.detail(typeSlug, id) query.
291
+ * Full key: ["cmsContent", "detail", typeSlug, id]
292
+ */
293
+ contentDetail: (typeSlug: string, id: string) => readonly ["cmsContent", "detail", string, string];
294
+ };
295
+
296
+ export { cmsBackendPlugin as c, getAllContentItems as d, getContentItemBySlug as e, getContentItemById as f, getAllContentTypes as g, serializeContentItem as h, serializeContentItemWithType as i, CMS_QUERY_KEYS as j, serializeContentType as s };
297
+ export type { CMSApiRouter as C, ContentListDiscriminator as a, CMSRouteKey as b };
@@ -58,6 +58,12 @@ type ContentItem = {
58
58
  createdAt: Date;
59
59
  updatedAt: Date;
60
60
  };
61
+ /**
62
+ * Content item with its content type joined
63
+ */
64
+ type ContentItemWithType = ContentItem & {
65
+ contentType?: ContentType;
66
+ };
61
67
  /**
62
68
  * Represents an inverse relation (content types that reference this type via belongsTo)
63
69
  */
@@ -154,4 +160,4 @@ interface CMSBackendConfig {
154
160
  hooks?: CMSBackendHooks;
155
161
  }
156
162
 
157
- export type { ContentTypeConfig as C, InverseRelation as I, PaginatedContentItems as P, SerializedContentType as S, SerializedContentItemWithType as a, CMSBackendConfig as b };
163
+ export type { ContentTypeConfig as C, InverseRelation as I, PaginatedContentItems as P, SerializedContentType as S, SerializedContentItemWithType as a, ContentType as b, ContentItem as c, SerializedContentItem as d, ContentItemWithType as e, CMSBackendConfig as f };
@@ -58,6 +58,12 @@ type ContentItem = {
58
58
  createdAt: Date;
59
59
  updatedAt: Date;
60
60
  };
61
+ /**
62
+ * Content item with its content type joined
63
+ */
64
+ type ContentItemWithType = ContentItem & {
65
+ contentType?: ContentType;
66
+ };
61
67
  /**
62
68
  * Represents an inverse relation (content types that reference this type via belongsTo)
63
69
  */
@@ -154,4 +160,4 @@ interface CMSBackendConfig {
154
160
  hooks?: CMSBackendHooks;
155
161
  }
156
162
 
157
- export type { ContentTypeConfig as C, InverseRelation as I, PaginatedContentItems as P, SerializedContentType as S, SerializedContentItemWithType as a, CMSBackendConfig as b };
163
+ export type { ContentTypeConfig as C, InverseRelation as I, PaginatedContentItems as P, SerializedContentType as S, SerializedContentItemWithType as a, ContentType as b, ContentItem as c, SerializedContentItem as d, ContentItemWithType as e, CMSBackendConfig as f };
@@ -58,6 +58,12 @@ type ContentItem = {
58
58
  createdAt: Date;
59
59
  updatedAt: Date;
60
60
  };
61
+ /**
62
+ * Content item with its content type joined
63
+ */
64
+ type ContentItemWithType = ContentItem & {
65
+ contentType?: ContentType;
66
+ };
61
67
  /**
62
68
  * Represents an inverse relation (content types that reference this type via belongsTo)
63
69
  */
@@ -154,4 +160,4 @@ interface CMSBackendConfig {
154
160
  hooks?: CMSBackendHooks;
155
161
  }
156
162
 
157
- export type { ContentTypeConfig as C, InverseRelation as I, PaginatedContentItems as P, SerializedContentType as S, SerializedContentItemWithType as a, CMSBackendConfig as b };
163
+ export type { ContentTypeConfig as C, InverseRelation as I, PaginatedContentItems as P, SerializedContentType as S, SerializedContentItemWithType as a, ContentType as b, ContentItem as c, SerializedContentItem as d, ContentItemWithType as e, CMSBackendConfig as f };
@@ -73,4 +73,4 @@ interface SerializedBoardWithColumns extends SerializedBoard {
73
73
  columns: SerializedColumn[];
74
74
  }
75
75
 
76
- export type { BoardWithColumns as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, Board as d, ColumnWithTasks as e };
76
+ export type { BoardWithColumns as B, ColumnWithTasks as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedColumn as a, SerializedTask as b, SerializedBoard as c, Board as d, Column as e };
@@ -73,4 +73,4 @@ interface SerializedBoardWithColumns extends SerializedBoard {
73
73
  columns: SerializedColumn[];
74
74
  }
75
75
 
76
- export type { BoardWithColumns as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, Board as d, ColumnWithTasks as e };
76
+ export type { BoardWithColumns as B, ColumnWithTasks as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedColumn as a, SerializedTask as b, SerializedBoard as c, Board as d, Column as e };
@@ -73,4 +73,4 @@ interface SerializedBoardWithColumns extends SerializedBoard {
73
73
  columns: SerializedColumn[];
74
74
  }
75
75
 
76
- export type { BoardWithColumns as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, Board as d, ColumnWithTasks as e };
76
+ export type { BoardWithColumns as B, ColumnWithTasks as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedColumn as a, SerializedTask as b, SerializedBoard as c, Board as d, Column as e };
@@ -48,6 +48,12 @@ type FormSubmission = {
48
48
  /** User agent for analytics */
49
49
  userAgent?: string;
50
50
  };
51
+ /**
52
+ * Form submission with its parent form joined
53
+ */
54
+ type FormSubmissionWithForm = FormSubmission & {
55
+ form?: Form;
56
+ };
51
57
  /**
52
58
  * Serialized form for API responses (dates as strings)
53
59
  */
@@ -192,4 +198,4 @@ interface FormBuilderBackendConfig {
192
198
  hooks?: FormBuilderBackendHooks;
193
199
  }
194
200
 
195
- export type { FormBuilderBackendConfig as F, PaginatedForms as P, SerializedForm as S, SerializedFormSubmission as a, SerializedFormSubmissionWithData as b, PaginatedFormSubmissions as c };
201
+ export type { Form as F, PaginatedForms as P, SerializedForm as S, SerializedFormSubmission as a, SerializedFormSubmissionWithData as b, PaginatedFormSubmissions as c, FormSubmission as d, FormSubmissionWithForm as e, FormBuilderBackendConfig as f };
@@ -48,6 +48,12 @@ type FormSubmission = {
48
48
  /** User agent for analytics */
49
49
  userAgent?: string;
50
50
  };
51
+ /**
52
+ * Form submission with its parent form joined
53
+ */
54
+ type FormSubmissionWithForm = FormSubmission & {
55
+ form?: Form;
56
+ };
51
57
  /**
52
58
  * Serialized form for API responses (dates as strings)
53
59
  */
@@ -192,4 +198,4 @@ interface FormBuilderBackendConfig {
192
198
  hooks?: FormBuilderBackendHooks;
193
199
  }
194
200
 
195
- export type { FormBuilderBackendConfig as F, PaginatedForms as P, SerializedForm as S, SerializedFormSubmission as a, SerializedFormSubmissionWithData as b, PaginatedFormSubmissions as c };
201
+ export type { Form as F, PaginatedForms as P, SerializedForm as S, SerializedFormSubmission as a, SerializedFormSubmissionWithData as b, PaginatedFormSubmissions as c, FormSubmission as d, FormSubmissionWithForm as e, FormBuilderBackendConfig as f };
@@ -48,6 +48,12 @@ type FormSubmission = {
48
48
  /** User agent for analytics */
49
49
  userAgent?: string;
50
50
  };
51
+ /**
52
+ * Form submission with its parent form joined
53
+ */
54
+ type FormSubmissionWithForm = FormSubmission & {
55
+ form?: Form;
56
+ };
51
57
  /**
52
58
  * Serialized form for API responses (dates as strings)
53
59
  */
@@ -192,4 +198,4 @@ interface FormBuilderBackendConfig {
192
198
  hooks?: FormBuilderBackendHooks;
193
199
  }
194
200
 
195
- export type { FormBuilderBackendConfig as F, PaginatedForms as P, SerializedForm as S, SerializedFormSubmission as a, SerializedFormSubmissionWithData as b, PaginatedFormSubmissions as c };
201
+ export type { Form as F, PaginatedForms as P, SerializedForm as S, SerializedFormSubmission as a, SerializedFormSubmissionWithData as b, PaginatedFormSubmissions as c, FormSubmission as d, FormSubmissionWithForm as e, FormBuilderBackendConfig as f };