@btst/plugin-cms 0.0.0-stage → 1.0.0-beta.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 (204) hide show
  1. package/LICENSE.md +17 -0
  2. package/dist/api/getters.cjs +328 -0
  3. package/dist/api/getters.mjs +314 -0
  4. package/dist/api/index.cjs +29 -0
  5. package/dist/api/index.d.cts +209 -0
  6. package/dist/api/index.d.mts +209 -0
  7. package/dist/api/index.d.ts +209 -0
  8. package/dist/api/index.mjs +7 -0
  9. package/dist/api/lifecycle-migrations.cjs +13 -0
  10. package/dist/api/lifecycle-migrations.mjs +11 -0
  11. package/dist/api/mutations.cjs +59 -0
  12. package/dist/api/mutations.mjs +57 -0
  13. package/dist/api/operations.cjs +1769 -0
  14. package/dist/api/operations.mjs +1762 -0
  15. package/dist/api/plugin.cjs +337 -0
  16. package/dist/api/plugin.mjs +331 -0
  17. package/dist/api/query-key-defs.cjs +44 -0
  18. package/dist/api/query-key-defs.mjs +39 -0
  19. package/dist/api/relations.cjs +76 -0
  20. package/dist/api/relations.mjs +70 -0
  21. package/dist/client/components/forms/content-form.cjs +286 -0
  22. package/dist/client/components/forms/content-form.mjs +284 -0
  23. package/dist/client/components/forms/file-upload.cjs +160 -0
  24. package/dist/client/components/forms/file-upload.mjs +158 -0
  25. package/dist/client/components/forms/relation-field.cjs +237 -0
  26. package/dist/client/components/forms/relation-field.mjs +235 -0
  27. package/dist/client/components/index.cjs +14 -0
  28. package/dist/client/components/index.d.cts +20 -0
  29. package/dist/client/components/index.d.mts +20 -0
  30. package/dist/client/components/index.d.ts +20 -0
  31. package/dist/client/components/index.mjs +10 -0
  32. package/dist/client/components/inverse-relations-panel.cjs +272 -0
  33. package/dist/client/components/inverse-relations-panel.mjs +270 -0
  34. package/dist/client/components/loading/dashboard-skeleton.cjs +18 -0
  35. package/dist/client/components/loading/dashboard-skeleton.mjs +16 -0
  36. package/dist/client/components/loading/editor-skeleton.cjs +32 -0
  37. package/dist/client/components/loading/editor-skeleton.mjs +30 -0
  38. package/dist/client/components/loading/list-skeleton.cjs +32 -0
  39. package/dist/client/components/loading/list-skeleton.mjs +30 -0
  40. package/dist/client/components/pages/404-page.cjs +26 -0
  41. package/dist/client/components/pages/404-page.mjs +24 -0
  42. package/dist/client/components/pages/content-editor-page.cjs +84 -0
  43. package/dist/client/components/pages/content-editor-page.internal.cjs +170 -0
  44. package/dist/client/components/pages/content-editor-page.internal.mjs +168 -0
  45. package/dist/client/components/pages/content-editor-page.mjs +82 -0
  46. package/dist/client/components/pages/content-list-page.cjs +49 -0
  47. package/dist/client/components/pages/content-list-page.internal.cjs +334 -0
  48. package/dist/client/components/pages/content-list-page.internal.mjs +332 -0
  49. package/dist/client/components/pages/content-list-page.mjs +47 -0
  50. package/dist/client/components/pages/dashboard-page.cjs +42 -0
  51. package/dist/client/components/pages/dashboard-page.internal.cjs +102 -0
  52. package/dist/client/components/pages/dashboard-page.internal.mjs +100 -0
  53. package/dist/client/components/pages/dashboard-page.mjs +40 -0
  54. package/dist/client/components/shared/default-error.cjs +17 -0
  55. package/dist/client/components/shared/default-error.mjs +15 -0
  56. package/dist/client/components/shared/empty-state.cjs +16 -0
  57. package/dist/client/components/shared/empty-state.mjs +14 -0
  58. package/dist/client/components/shared/page-wrapper.cjs +29 -0
  59. package/dist/client/components/shared/page-wrapper.mjs +27 -0
  60. package/dist/client/constants.cjs +5 -0
  61. package/dist/client/constants.mjs +3 -0
  62. package/dist/client/hooks/cms-hooks.cjs +300 -0
  63. package/dist/client/hooks/cms-hooks.mjs +280 -0
  64. package/dist/client/hooks/cms-resource.cjs +13 -0
  65. package/dist/client/hooks/cms-resource.mjs +11 -0
  66. package/dist/client/hooks/index.cjs +25 -0
  67. package/dist/client/hooks/index.d.cts +693 -0
  68. package/dist/client/hooks/index.d.mts +693 -0
  69. package/dist/client/hooks/index.d.ts +693 -0
  70. package/dist/client/hooks/index.mjs +1 -0
  71. package/dist/client/index.cjs +15 -0
  72. package/dist/client/index.d.cts +654 -0
  73. package/dist/client/index.d.mts +654 -0
  74. package/dist/client/index.d.ts +654 -0
  75. package/dist/client/index.mjs +3 -0
  76. package/dist/client/overrides.cjs +26 -0
  77. package/dist/client/overrides.mjs +24 -0
  78. package/dist/client/plugin.cjs +316 -0
  79. package/dist/client/plugin.mjs +314 -0
  80. package/dist/client.css +3 -0
  81. package/dist/db.cjs +118 -0
  82. package/dist/db.mjs +116 -0
  83. package/dist/permissions.cjs +46 -0
  84. package/dist/permissions.d.cts +42 -0
  85. package/dist/permissions.d.mts +42 -0
  86. package/dist/permissions.d.ts +42 -0
  87. package/dist/permissions.mjs +44 -0
  88. package/dist/query-keys.cjs +229 -0
  89. package/dist/query-keys.d.cts +8 -0
  90. package/dist/query-keys.d.mts +8 -0
  91. package/dist/query-keys.d.ts +8 -0
  92. package/dist/query-keys.mjs +225 -0
  93. package/dist/schemas.cjs +81 -0
  94. package/dist/schemas.mjs +72 -0
  95. package/dist/shared/plugin-cms.BBshPRkb.d.cts +6 -0
  96. package/dist/shared/plugin-cms.BBshPRkb.d.mts +6 -0
  97. package/dist/shared/plugin-cms.BBshPRkb.d.ts +6 -0
  98. package/dist/shared/plugin-cms.Bptwe33B.d.cts +1749 -0
  99. package/dist/shared/plugin-cms.Csx7tNDO.d.mts +1749 -0
  100. package/dist/shared/plugin-cms.eNW9_FO5.d.ts +1749 -0
  101. package/dist/style.css +6 -0
  102. package/dist/types.cjs +2 -0
  103. package/dist/types.d.cts +406 -0
  104. package/dist/types.d.mts +406 -0
  105. package/dist/types.d.ts +406 -0
  106. package/dist/types.mjs +1 -0
  107. package/dist/ui/src/components/accordion.cjs +81 -0
  108. package/dist/ui/src/components/accordion.mjs +62 -0
  109. package/dist/ui/src/components/alert-dialog.cjs +157 -0
  110. package/dist/ui/src/components/alert-dialog.mjs +132 -0
  111. package/dist/ui/src/components/auto-form/common/label.cjs +18 -0
  112. package/dist/ui/src/components/auto-form/common/label.mjs +16 -0
  113. package/dist/ui/src/components/auto-form/common/tooltip.cjs +9 -0
  114. package/dist/ui/src/components/auto-form/common/tooltip.mjs +7 -0
  115. package/dist/ui/src/components/auto-form/config.cjs +40 -0
  116. package/dist/ui/src/components/auto-form/config.mjs +37 -0
  117. package/dist/ui/src/components/auto-form/dependencies.cjs +48 -0
  118. package/dist/ui/src/components/auto-form/dependencies.mjs +46 -0
  119. package/dist/ui/src/components/auto-form/fields/array.cjs +266 -0
  120. package/dist/ui/src/components/auto-form/fields/array.mjs +264 -0
  121. package/dist/ui/src/components/auto-form/fields/checkbox.cjs +38 -0
  122. package/dist/ui/src/components/auto-form/fields/checkbox.mjs +36 -0
  123. package/dist/ui/src/components/auto-form/fields/date.cjs +67 -0
  124. package/dist/ui/src/components/auto-form/fields/date.mjs +65 -0
  125. package/dist/ui/src/components/auto-form/fields/enum.cjs +73 -0
  126. package/dist/ui/src/components/auto-form/fields/enum.mjs +71 -0
  127. package/dist/ui/src/components/auto-form/fields/input.cjs +32 -0
  128. package/dist/ui/src/components/auto-form/fields/input.mjs +30 -0
  129. package/dist/ui/src/components/auto-form/fields/number.cjs +31 -0
  130. package/dist/ui/src/components/auto-form/fields/number.mjs +29 -0
  131. package/dist/ui/src/components/auto-form/fields/object.cjs +233 -0
  132. package/dist/ui/src/components/auto-form/fields/object.mjs +217 -0
  133. package/dist/ui/src/components/auto-form/fields/radio-group.cjs +67 -0
  134. package/dist/ui/src/components/auto-form/fields/radio-group.mjs +65 -0
  135. package/dist/ui/src/components/auto-form/fields/switch.cjs +38 -0
  136. package/dist/ui/src/components/auto-form/fields/switch.mjs +36 -0
  137. package/dist/ui/src/components/auto-form/fields/textarea.cjs +31 -0
  138. package/dist/ui/src/components/auto-form/fields/textarea.mjs +29 -0
  139. package/dist/ui/src/components/auto-form/helpers.cjs +270 -0
  140. package/dist/ui/src/components/auto-form/helpers.mjs +259 -0
  141. package/dist/ui/src/components/auto-form/index.cjs +92 -0
  142. package/dist/ui/src/components/auto-form/index.mjs +86 -0
  143. package/dist/ui/src/components/auto-form/stepped-auto-form.cjs +374 -0
  144. package/dist/ui/src/components/auto-form/stepped-auto-form.mjs +368 -0
  145. package/dist/ui/src/components/auto-form/types.cjs +11 -0
  146. package/dist/ui/src/components/auto-form/types.mjs +9 -0
  147. package/dist/ui/src/components/badge.cjs +42 -0
  148. package/dist/ui/src/components/badge.mjs +39 -0
  149. package/dist/ui/src/components/button.cjs +56 -0
  150. package/dist/ui/src/components/button.mjs +53 -0
  151. package/dist/ui/src/components/calendar.cjs +207 -0
  152. package/dist/ui/src/components/calendar.mjs +190 -0
  153. package/dist/ui/src/components/card.cjs +56 -0
  154. package/dist/ui/src/components/card.mjs +51 -0
  155. package/dist/ui/src/components/checkbox.cjs +48 -0
  156. package/dist/ui/src/components/checkbox.mjs +32 -0
  157. package/dist/ui/src/components/command.cjs +78 -0
  158. package/dist/ui/src/components/command.mjs +73 -0
  159. package/dist/ui/src/components/date-picker.cjs +41 -0
  160. package/dist/ui/src/components/date-picker.mjs +39 -0
  161. package/dist/ui/src/components/dialog.cjs +119 -0
  162. package/dist/ui/src/components/dialog.mjs +97 -0
  163. package/dist/ui/src/components/form.cjs +120 -0
  164. package/dist/ui/src/components/form.mjs +98 -0
  165. package/dist/ui/src/components/input.cjs +23 -0
  166. package/dist/ui/src/components/input.mjs +21 -0
  167. package/dist/ui/src/components/label.cjs +39 -0
  168. package/dist/ui/src/components/label.mjs +23 -0
  169. package/dist/ui/src/components/multi-select.cjs +555 -0
  170. package/dist/ui/src/components/multi-select.mjs +540 -0
  171. package/dist/ui/src/components/page-layout.cjs +25 -0
  172. package/dist/ui/src/components/page-layout.mjs +23 -0
  173. package/dist/ui/src/components/page-wrapper.cjs +20 -0
  174. package/dist/ui/src/components/page-wrapper.mjs +18 -0
  175. package/dist/ui/src/components/popover.cjs +60 -0
  176. package/dist/ui/src/components/popover.mjs +42 -0
  177. package/dist/ui/src/components/radio-group.cjs +62 -0
  178. package/dist/ui/src/components/radio-group.mjs +45 -0
  179. package/dist/ui/src/components/select.cjs +161 -0
  180. package/dist/ui/src/components/select.mjs +139 -0
  181. package/dist/ui/src/components/separator.cjs +43 -0
  182. package/dist/ui/src/components/separator.mjs +27 -0
  183. package/dist/ui/src/components/skeleton.cjs +17 -0
  184. package/dist/ui/src/components/skeleton.mjs +15 -0
  185. package/dist/ui/src/components/stack-attribution.cjs +24 -0
  186. package/dist/ui/src/components/stack-attribution.mjs +22 -0
  187. package/dist/ui/src/components/switch.cjs +48 -0
  188. package/dist/ui/src/components/switch.mjs +32 -0
  189. package/dist/ui/src/components/table.cjs +89 -0
  190. package/dist/ui/src/components/table.mjs +82 -0
  191. package/dist/ui/src/components/textarea.cjs +20 -0
  192. package/dist/ui/src/components/textarea.mjs +18 -0
  193. package/dist/ui/src/hooks/use-debounce.cjs +16 -0
  194. package/dist/ui/src/hooks/use-debounce.mjs +14 -0
  195. package/dist/ui/src/hooks/use-route-lifecycle.cjs +31 -0
  196. package/dist/ui/src/hooks/use-route-lifecycle.mjs +29 -0
  197. package/dist/ui/src/lib/schema-converter.cjs +133 -0
  198. package/dist/ui/src/lib/schema-converter.mjs +127 -0
  199. package/dist/ui/src/lib/utils.cjs +10 -0
  200. package/dist/ui/src/lib/utils.mjs +8 -0
  201. package/dist/utils.cjs +19 -0
  202. package/dist/utils.mjs +12 -0
  203. package/package.json +170 -3
  204. package/README.md +0 -3
@@ -0,0 +1,1749 @@
1
+ import { createApiClient, createResourceQueryKeys } from '@btst/stack/plugins/client';
2
+ import { CMSBackendConfig, CMSReadOptions, CMSContentFields, CMSSelectedData, SerializedContentType, InverseRelation, CMSReadView, SerializedContentItemWithType, PaginatedContentItems, CMSContentItemResult } from '../types.cjs';
3
+ import * as _btst_stack_authorization from '@btst/stack/authorization';
4
+ import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
5
+ import * as better_call from 'better-call';
6
+ import { QueryClient } from '@tanstack/react-query';
7
+ import { z } from 'zod';
8
+
9
+ /** Route keys returned by the CMS client plugin. */
10
+ type CMSRouteKey = "dashboard" | "contentList" | "newContent" | "editContent";
11
+ interface CMSPrefetchForRoute {
12
+ (key: "dashboard" | "newContent", qc: QueryClient): Promise<void>;
13
+ (key: "contentList", qc: QueryClient, params: {
14
+ typeSlug: string;
15
+ limit?: number;
16
+ search?: string;
17
+ } & CMSReadOptions): Promise<void>;
18
+ (key: "editContent", qc: QueryClient, params: {
19
+ typeSlug: string;
20
+ id: string;
21
+ } & CMSReadOptions): Promise<void>;
22
+ }
23
+ /** CMS backend plugin backed by one operation inventory for every transport. */
24
+ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
25
+ readonly listContentTypes: better_call.StrictEndpoint<"/content-types", {
26
+ requireRequest: true;
27
+ } & {
28
+ method: "GET";
29
+ }, readonly {
30
+ readonly itemCount: number;
31
+ readonly createdAt: string;
32
+ readonly updatedAt: string;
33
+ readonly id: string;
34
+ readonly name: string;
35
+ readonly slug: string;
36
+ readonly description?: string | undefined;
37
+ readonly jsonSchema: string;
38
+ readonly fieldConfig?: string | undefined;
39
+ readonly autoFormVersion?: number | undefined;
40
+ }[]>;
41
+ readonly getContentTypeBySlug: better_call.StrictEndpoint<"/content-types/:slug", {
42
+ params: z.ZodObject<{
43
+ slug: z.ZodString;
44
+ }, z.core.$strip>;
45
+ requireRequest: true;
46
+ } & {
47
+ method: "GET";
48
+ }, {
49
+ readonly createdAt: string;
50
+ readonly updatedAt: string;
51
+ readonly id: string;
52
+ readonly name: string;
53
+ readonly slug: string;
54
+ readonly description?: string | undefined;
55
+ readonly jsonSchema: string;
56
+ readonly fieldConfig?: string | undefined;
57
+ readonly autoFormVersion?: number | undefined;
58
+ }>;
59
+ readonly listContentItems: better_call.StrictEndpoint<"/content/:typeSlug", {
60
+ params: z.ZodObject<{
61
+ typeSlug: z.ZodString;
62
+ }, z.core.$strip>;
63
+ requireRequest: true;
64
+ } & {
65
+ method: "GET";
66
+ } & {
67
+ query: better_call.StandardSchemaV1<{
68
+ slug?: string | undefined;
69
+ search?: string | undefined;
70
+ limit?: unknown;
71
+ offset?: unknown;
72
+ view?: "content" | undefined;
73
+ fields?: unknown;
74
+ }, {
75
+ slug?: string | undefined;
76
+ search?: string | undefined;
77
+ limit?: unknown;
78
+ offset?: unknown;
79
+ view?: "content" | undefined;
80
+ fields?: unknown;
81
+ }>;
82
+ }, {
83
+ offset?: number | undefined;
84
+ limit?: number | undefined;
85
+ items: ({
86
+ contentType?: {
87
+ createdAt: string;
88
+ updatedAt: string;
89
+ id: string;
90
+ name: string;
91
+ slug: string;
92
+ description?: string | undefined;
93
+ jsonSchema: string;
94
+ fieldConfig?: string | undefined;
95
+ autoFormVersion?: number | undefined;
96
+ } | undefined;
97
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
98
+ createdAt: string;
99
+ updatedAt: string;
100
+ id: string;
101
+ slug: string;
102
+ contentTypeId: string;
103
+ data: string;
104
+ authorId?: string | undefined;
105
+ } | (Omit<Pick<{
106
+ contentType?: {
107
+ createdAt: string;
108
+ updatedAt: string;
109
+ id: string;
110
+ name: string;
111
+ slug: string;
112
+ description?: string | undefined;
113
+ jsonSchema: string;
114
+ fieldConfig?: string | undefined;
115
+ autoFormVersion?: number | undefined;
116
+ } | undefined;
117
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
118
+ createdAt: string;
119
+ updatedAt: string;
120
+ id: string;
121
+ slug: string;
122
+ contentTypeId: string;
123
+ data: string;
124
+ authorId?: string | undefined;
125
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
126
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData> | Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
127
+ }))[];
128
+ total: number;
129
+ } | {
130
+ readonly offset?: number | undefined;
131
+ readonly limit?: number | undefined;
132
+ readonly items: readonly ({
133
+ readonly contentType?: {
134
+ readonly createdAt: string;
135
+ readonly updatedAt: string;
136
+ readonly id: string;
137
+ readonly name: string;
138
+ readonly slug: string;
139
+ readonly description?: string | undefined;
140
+ readonly jsonSchema: string;
141
+ readonly fieldConfig?: string | undefined;
142
+ readonly autoFormVersion?: number | undefined;
143
+ } | undefined;
144
+ readonly parsedData: {
145
+ readonly [x: string]: any;
146
+ };
147
+ readonly createdAt: string;
148
+ readonly updatedAt: string;
149
+ readonly id: string;
150
+ readonly slug: string;
151
+ readonly contentTypeId: string;
152
+ readonly data: string;
153
+ readonly authorId?: string | undefined;
154
+ } | {
155
+ readonly id: string;
156
+ readonly slug: string;
157
+ readonly createdAt: string;
158
+ readonly updatedAt: string;
159
+ readonly parsedData: {
160
+ readonly [x: string]: any;
161
+ } | {
162
+ readonly [x: string]: any;
163
+ };
164
+ })[];
165
+ readonly total: number;
166
+ }>;
167
+ readonly getContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
168
+ params: z.ZodObject<{
169
+ typeSlug: z.ZodString;
170
+ id: z.ZodString;
171
+ }, z.core.$strip>;
172
+ requireRequest: true;
173
+ } & {
174
+ method: "GET";
175
+ } & {
176
+ query: better_call.StandardSchemaV1<{
177
+ view?: "content" | undefined;
178
+ fields?: unknown;
179
+ }, {
180
+ view?: "content" | undefined;
181
+ fields?: unknown;
182
+ }>;
183
+ }, (Omit<Pick<{
184
+ contentType?: {
185
+ createdAt: string;
186
+ updatedAt: string;
187
+ id: string;
188
+ name: string;
189
+ slug: string;
190
+ description?: string | undefined;
191
+ jsonSchema: string;
192
+ fieldConfig?: string | undefined;
193
+ autoFormVersion?: number | undefined;
194
+ } | undefined;
195
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
196
+ createdAt: string;
197
+ updatedAt: string;
198
+ id: string;
199
+ slug: string;
200
+ contentTypeId: string;
201
+ data: string;
202
+ authorId?: string | undefined;
203
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
204
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
205
+ }) | {
206
+ readonly id: string;
207
+ readonly slug: string;
208
+ readonly createdAt: string;
209
+ readonly updatedAt: string;
210
+ readonly parsedData: {
211
+ readonly [x: string]: any;
212
+ };
213
+ }>;
214
+ readonly createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
215
+ params: z.ZodObject<{
216
+ typeSlug: z.ZodString;
217
+ }, z.core.$strip>;
218
+ requireRequest: true;
219
+ } & {
220
+ method: "POST";
221
+ body: better_call.StandardSchemaV1<{
222
+ slug: string;
223
+ data: unknown;
224
+ }, {
225
+ slug: string;
226
+ data: unknown;
227
+ }>;
228
+ }, {
229
+ readonly contentType?: {
230
+ readonly createdAt: string;
231
+ readonly updatedAt: string;
232
+ readonly id: string;
233
+ readonly name: string;
234
+ readonly slug: string;
235
+ readonly description?: string | undefined;
236
+ readonly jsonSchema: string;
237
+ readonly fieldConfig?: string | undefined;
238
+ readonly autoFormVersion?: number | undefined;
239
+ } | undefined;
240
+ readonly parsedData: {
241
+ readonly [x: string]: any;
242
+ };
243
+ readonly createdAt: string;
244
+ readonly updatedAt: string;
245
+ readonly id: string;
246
+ readonly slug: string;
247
+ readonly contentTypeId: string;
248
+ readonly data: string;
249
+ readonly authorId?: string | undefined;
250
+ }>;
251
+ readonly updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
252
+ params: z.ZodObject<{
253
+ typeSlug: z.ZodString;
254
+ id: z.ZodString;
255
+ }, z.core.$strip>;
256
+ requireRequest: true;
257
+ } & {
258
+ method: "PUT";
259
+ body: better_call.StandardSchemaV1<{
260
+ slug?: string | undefined;
261
+ data?: unknown;
262
+ }, {
263
+ slug?: string | undefined;
264
+ data?: unknown;
265
+ }>;
266
+ }, {
267
+ readonly contentType?: {
268
+ readonly createdAt: string;
269
+ readonly updatedAt: string;
270
+ readonly id: string;
271
+ readonly name: string;
272
+ readonly slug: string;
273
+ readonly description?: string | undefined;
274
+ readonly jsonSchema: string;
275
+ readonly fieldConfig?: string | undefined;
276
+ readonly autoFormVersion?: number | undefined;
277
+ } | undefined;
278
+ readonly parsedData: {
279
+ readonly [x: string]: any;
280
+ };
281
+ readonly createdAt: string;
282
+ readonly updatedAt: string;
283
+ readonly id: string;
284
+ readonly slug: string;
285
+ readonly contentTypeId: string;
286
+ readonly data: string;
287
+ readonly authorId?: string | undefined;
288
+ }>;
289
+ readonly deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
290
+ params: z.ZodObject<{
291
+ typeSlug: z.ZodString;
292
+ id: z.ZodString;
293
+ }, z.core.$strip>;
294
+ requireRequest: true;
295
+ } & {
296
+ method: "DELETE";
297
+ body: better_call.StandardSchemaV1<unknown, unknown>;
298
+ }, {
299
+ readonly success: true;
300
+ }>;
301
+ readonly getContentItemPopulated: better_call.StrictEndpoint<"/content/:typeSlug/:id/populated", {
302
+ params: z.ZodObject<{
303
+ typeSlug: z.ZodString;
304
+ id: z.ZodString;
305
+ }, z.core.$strip>;
306
+ requireRequest: true;
307
+ } & {
308
+ method: "GET";
309
+ }, {
310
+ readonly _relations: {
311
+ readonly [x: string]: readonly {
312
+ readonly contentType?: {
313
+ readonly createdAt: string;
314
+ readonly updatedAt: string;
315
+ readonly id: string;
316
+ readonly name: string;
317
+ readonly slug: string;
318
+ readonly description?: string | undefined;
319
+ readonly jsonSchema: string;
320
+ readonly fieldConfig?: string | undefined;
321
+ readonly autoFormVersion?: number | undefined;
322
+ } | undefined;
323
+ readonly parsedData: {
324
+ readonly [x: string]: any;
325
+ };
326
+ readonly createdAt: string;
327
+ readonly updatedAt: string;
328
+ readonly id: string;
329
+ readonly slug: string;
330
+ readonly contentTypeId: string;
331
+ readonly data: string;
332
+ readonly authorId?: string | undefined;
333
+ }[];
334
+ };
335
+ readonly contentType?: {
336
+ readonly createdAt: string;
337
+ readonly updatedAt: string;
338
+ readonly id: string;
339
+ readonly name: string;
340
+ readonly slug: string;
341
+ readonly description?: string | undefined;
342
+ readonly jsonSchema: string;
343
+ readonly fieldConfig?: string | undefined;
344
+ readonly autoFormVersion?: number | undefined;
345
+ } | undefined;
346
+ readonly parsedData: {
347
+ readonly [x: string]: any;
348
+ };
349
+ readonly createdAt: string;
350
+ readonly updatedAt: string;
351
+ readonly id: string;
352
+ readonly slug: string;
353
+ readonly contentTypeId: string;
354
+ readonly data: string;
355
+ readonly authorId?: string | undefined;
356
+ }>;
357
+ readonly listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
358
+ params: z.ZodObject<{
359
+ typeSlug: z.ZodString;
360
+ }, z.core.$strip>;
361
+ requireRequest: true;
362
+ } & {
363
+ method: "GET";
364
+ } & {
365
+ query: better_call.StandardSchemaV1<{
366
+ field: string;
367
+ targetId: string;
368
+ limit?: unknown;
369
+ offset?: unknown;
370
+ view?: "content" | undefined;
371
+ fields?: unknown;
372
+ }, {
373
+ field: string;
374
+ targetId: string;
375
+ limit?: unknown;
376
+ offset?: unknown;
377
+ view?: "content" | undefined;
378
+ fields?: unknown;
379
+ }>;
380
+ }, {
381
+ items: (Omit<Pick<{
382
+ contentType?: {
383
+ createdAt: string;
384
+ updatedAt: string;
385
+ id: string;
386
+ name: string;
387
+ slug: string;
388
+ description?: string | undefined;
389
+ jsonSchema: string;
390
+ fieldConfig?: string | undefined;
391
+ autoFormVersion?: number | undefined;
392
+ } | undefined;
393
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
394
+ createdAt: string;
395
+ updatedAt: string;
396
+ id: string;
397
+ slug: string;
398
+ contentTypeId: string;
399
+ data: string;
400
+ authorId?: string | undefined;
401
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
402
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
403
+ })[];
404
+ total: number;
405
+ limit: number;
406
+ offset: number;
407
+ } | {
408
+ readonly items: readonly {
409
+ readonly id: string;
410
+ readonly slug: string;
411
+ readonly createdAt: string;
412
+ readonly updatedAt: string;
413
+ readonly parsedData: {
414
+ readonly [x: string]: any;
415
+ };
416
+ }[];
417
+ readonly total: number;
418
+ readonly limit: number;
419
+ readonly offset: number;
420
+ }>;
421
+ readonly getInverseRelations: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations", {
422
+ params: z.ZodObject<{
423
+ slug: z.ZodString;
424
+ }, z.core.$strip>;
425
+ requireRequest: true;
426
+ } & {
427
+ method: "GET";
428
+ } & {
429
+ query: better_call.StandardSchemaV1<{
430
+ itemId?: string | undefined;
431
+ }, {
432
+ itemId?: string | undefined;
433
+ }>;
434
+ }, {
435
+ readonly inverseRelations: readonly {
436
+ readonly sourceType: string;
437
+ readonly sourceTypeName: string;
438
+ readonly fieldName: string;
439
+ readonly count: number;
440
+ }[];
441
+ }>;
442
+ readonly listInverseRelationItems: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations/:sourceType", {
443
+ params: z.ZodObject<{
444
+ slug: z.ZodString;
445
+ sourceType: z.ZodString;
446
+ }, z.core.$strip>;
447
+ requireRequest: true;
448
+ } & {
449
+ method: "GET";
450
+ } & {
451
+ query: better_call.StandardSchemaV1<{
452
+ itemId: string;
453
+ fieldName: string;
454
+ limit?: unknown;
455
+ offset?: unknown;
456
+ view?: "content" | undefined;
457
+ fields?: unknown;
458
+ }, {
459
+ itemId: string;
460
+ fieldName: string;
461
+ limit?: unknown;
462
+ offset?: unknown;
463
+ view?: "content" | undefined;
464
+ fields?: unknown;
465
+ }>;
466
+ }, {
467
+ items: (Omit<Pick<{
468
+ contentType?: {
469
+ createdAt: string;
470
+ updatedAt: string;
471
+ id: string;
472
+ name: string;
473
+ slug: string;
474
+ description?: string | undefined;
475
+ jsonSchema: string;
476
+ fieldConfig?: string | undefined;
477
+ autoFormVersion?: number | undefined;
478
+ } | undefined;
479
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
480
+ createdAt: string;
481
+ updatedAt: string;
482
+ id: string;
483
+ slug: string;
484
+ contentTypeId: string;
485
+ data: string;
486
+ authorId?: string | undefined;
487
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
488
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
489
+ })[];
490
+ total: number;
491
+ limit: number;
492
+ offset: number;
493
+ } | {
494
+ readonly items: readonly {
495
+ readonly id: string;
496
+ readonly slug: string;
497
+ readonly createdAt: string;
498
+ readonly updatedAt: string;
499
+ readonly parsedData: {
500
+ readonly [x: string]: any;
501
+ };
502
+ }[];
503
+ readonly total: number;
504
+ readonly limit: number;
505
+ readonly offset: number;
506
+ }>;
507
+ }, {
508
+ prefetchForRoute: CMSPrefetchForRoute;
509
+ }, {
510
+ readonly listContentTypes: _btst_stack_plugins_api.Operation<z.ZodObject<{}, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:contentType.read", z.ZodObject<{
511
+ contentType: z.ZodOptional<z.ZodString>;
512
+ }, z.core.$strip>>, {
513
+ itemCount: number;
514
+ createdAt: string;
515
+ updatedAt: string;
516
+ id: string;
517
+ name: string;
518
+ slug: string;
519
+ description?: string | undefined;
520
+ jsonSchema: string;
521
+ fieldConfig?: string | undefined;
522
+ autoFormVersion?: number | undefined;
523
+ }[], false>;
524
+ readonly getContentTypeBySlug: _btst_stack_plugins_api.Operation<z.ZodObject<{
525
+ slug: z.ZodString;
526
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:contentType.read", z.ZodObject<{
527
+ contentType: z.ZodOptional<z.ZodString>;
528
+ }, z.core.$strip>>, {
529
+ createdAt: string;
530
+ updatedAt: string;
531
+ id: string;
532
+ name: string;
533
+ slug: string;
534
+ description?: string | undefined;
535
+ jsonSchema: string;
536
+ fieldConfig?: string | undefined;
537
+ autoFormVersion?: number | undefined;
538
+ }, false>;
539
+ readonly listContentItems: _btst_stack_plugins_api.Operation<z.ZodObject<{
540
+ typeSlug: z.ZodString;
541
+ query: z.ZodObject<{
542
+ slug: z.ZodOptional<z.ZodString>;
543
+ search: z.ZodOptional<z.ZodString>;
544
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
545
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
546
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
547
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
548
+ }, z.core.$strip>;
549
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:record.read", z.ZodObject<{
550
+ contentType: z.ZodString;
551
+ scope: z.ZodEnum<{
552
+ record: "record";
553
+ collection: "collection";
554
+ }>;
555
+ recordId: z.ZodOptional<z.ZodString>;
556
+ authorId: z.ZodOptional<z.ZodString>;
557
+ }, z.core.$strip>>, {
558
+ offset?: number | undefined;
559
+ limit?: number | undefined;
560
+ items: ({
561
+ contentType?: {
562
+ createdAt: string;
563
+ updatedAt: string;
564
+ id: string;
565
+ name: string;
566
+ slug: string;
567
+ description?: string | undefined;
568
+ jsonSchema: string;
569
+ fieldConfig?: string | undefined;
570
+ autoFormVersion?: number | undefined;
571
+ } | undefined;
572
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
573
+ createdAt: string;
574
+ updatedAt: string;
575
+ id: string;
576
+ slug: string;
577
+ contentTypeId: string;
578
+ data: string;
579
+ authorId?: string | undefined;
580
+ } | (Omit<Pick<{
581
+ contentType?: {
582
+ createdAt: string;
583
+ updatedAt: string;
584
+ id: string;
585
+ name: string;
586
+ slug: string;
587
+ description?: string | undefined;
588
+ jsonSchema: string;
589
+ fieldConfig?: string | undefined;
590
+ autoFormVersion?: number | undefined;
591
+ } | undefined;
592
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
593
+ createdAt: string;
594
+ updatedAt: string;
595
+ id: string;
596
+ slug: string;
597
+ contentTypeId: string;
598
+ data: string;
599
+ authorId?: string | undefined;
600
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
601
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData> | Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
602
+ }))[];
603
+ total: number;
604
+ }, false> & _btst_stack_plugins_api.OperationCallSignature<(<const TInput extends _btst_stack_plugins_api.DeepReadonly<z.input<z.ZodObject<{
605
+ typeSlug: z.ZodString;
606
+ query: z.ZodObject<{
607
+ slug: z.ZodOptional<z.ZodString>;
608
+ search: z.ZodOptional<z.ZodString>;
609
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
610
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
611
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
612
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
613
+ }, z.core.$strip>;
614
+ }, z.core.$strip>>>>(input: TInput) => Promise<_btst_stack_plugins_api.DeepReadonly<{
615
+ items: (TInput["query"] extends infer T ? T extends TInput["query"] ? T extends {
616
+ view: "content";
617
+ } ? Omit<Pick<{
618
+ contentType?: {
619
+ createdAt: string;
620
+ updatedAt: string;
621
+ id: string;
622
+ name: string;
623
+ slug: string;
624
+ description?: string | undefined;
625
+ jsonSchema: string;
626
+ fieldConfig?: string | undefined;
627
+ autoFormVersion?: number | undefined;
628
+ } | undefined;
629
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
630
+ createdAt: string;
631
+ updatedAt: string;
632
+ id: string;
633
+ slug: string;
634
+ contentTypeId: string;
635
+ data: string;
636
+ authorId?: string | undefined;
637
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
638
+ parsedData: T extends infer T_1 ? T_1 extends T ? T_1 extends {
639
+ fields?: infer TFields extends CMSContentFields;
640
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData> : never : never;
641
+ } : T extends {
642
+ view?: undefined;
643
+ } ? {
644
+ contentType?: {
645
+ createdAt: string;
646
+ updatedAt: string;
647
+ id: string;
648
+ name: string;
649
+ slug: string;
650
+ description?: string | undefined;
651
+ jsonSchema: string;
652
+ fieldConfig?: string | undefined;
653
+ autoFormVersion?: number | undefined;
654
+ } | undefined;
655
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
656
+ createdAt: string;
657
+ updatedAt: string;
658
+ id: string;
659
+ slug: string;
660
+ contentTypeId: string;
661
+ data: string;
662
+ authorId?: string | undefined;
663
+ } : "view" extends keyof T ? {
664
+ contentType?: {
665
+ createdAt: string;
666
+ updatedAt: string;
667
+ id: string;
668
+ name: string;
669
+ slug: string;
670
+ description?: string | undefined;
671
+ jsonSchema: string;
672
+ fieldConfig?: string | undefined;
673
+ autoFormVersion?: number | undefined;
674
+ } | undefined;
675
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
676
+ createdAt: string;
677
+ updatedAt: string;
678
+ id: string;
679
+ slug: string;
680
+ contentTypeId: string;
681
+ data: string;
682
+ authorId?: string | undefined;
683
+ } | (Omit<Pick<{
684
+ contentType?: {
685
+ createdAt: string;
686
+ updatedAt: string;
687
+ id: string;
688
+ name: string;
689
+ slug: string;
690
+ description?: string | undefined;
691
+ jsonSchema: string;
692
+ fieldConfig?: string | undefined;
693
+ autoFormVersion?: number | undefined;
694
+ } | undefined;
695
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
696
+ createdAt: string;
697
+ updatedAt: string;
698
+ id: string;
699
+ slug: string;
700
+ contentTypeId: string;
701
+ data: string;
702
+ authorId?: string | undefined;
703
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
704
+ parsedData: T extends {
705
+ fields?: infer TFields extends CMSContentFields;
706
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData>;
707
+ }) : {
708
+ contentType?: {
709
+ createdAt: string;
710
+ updatedAt: string;
711
+ id: string;
712
+ name: string;
713
+ slug: string;
714
+ description?: string | undefined;
715
+ jsonSchema: string;
716
+ fieldConfig?: string | undefined;
717
+ autoFormVersion?: number | undefined;
718
+ } | undefined;
719
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
720
+ createdAt: string;
721
+ updatedAt: string;
722
+ id: string;
723
+ slug: string;
724
+ contentTypeId: string;
725
+ data: string;
726
+ authorId?: string | undefined;
727
+ } : never : never)[];
728
+ total: number;
729
+ limit: number;
730
+ offset: number;
731
+ }>>)>;
732
+ readonly getContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
733
+ typeSlug: z.ZodString;
734
+ id: z.ZodString;
735
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
736
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
737
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:record.read", z.ZodObject<{
738
+ contentType: z.ZodString;
739
+ scope: z.ZodEnum<{
740
+ record: "record";
741
+ collection: "collection";
742
+ }>;
743
+ recordId: z.ZodOptional<z.ZodString>;
744
+ authorId: z.ZodOptional<z.ZodString>;
745
+ }, z.core.$strip>>, Omit<Pick<{
746
+ contentType?: {
747
+ createdAt: string;
748
+ updatedAt: string;
749
+ id: string;
750
+ name: string;
751
+ slug: string;
752
+ description?: string | undefined;
753
+ jsonSchema: string;
754
+ fieldConfig?: string | undefined;
755
+ autoFormVersion?: number | undefined;
756
+ } | undefined;
757
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
758
+ createdAt: string;
759
+ updatedAt: string;
760
+ id: string;
761
+ slug: string;
762
+ contentTypeId: string;
763
+ data: string;
764
+ authorId?: string | undefined;
765
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
766
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
767
+ }, false> & _btst_stack_plugins_api.OperationCallSignature<(<const TInput extends _btst_stack_plugins_api.DeepReadonly<z.input<z.ZodObject<{
768
+ typeSlug: z.ZodString;
769
+ id: z.ZodString;
770
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
771
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
772
+ }, z.core.$strip>>>>(input: TInput) => Promise<_btst_stack_plugins_api.DeepReadonly<TInput extends {
773
+ view: "content";
774
+ } ? Omit<Pick<{
775
+ contentType?: {
776
+ createdAt: string;
777
+ updatedAt: string;
778
+ id: string;
779
+ name: string;
780
+ slug: string;
781
+ description?: string | undefined;
782
+ jsonSchema: string;
783
+ fieldConfig?: string | undefined;
784
+ autoFormVersion?: number | undefined;
785
+ } | undefined;
786
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
787
+ createdAt: string;
788
+ updatedAt: string;
789
+ id: string;
790
+ slug: string;
791
+ contentTypeId: string;
792
+ data: string;
793
+ authorId?: string | undefined;
794
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
795
+ parsedData: TInput extends infer T ? T extends TInput ? T extends {
796
+ fields?: infer TFields extends CMSContentFields;
797
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData> : never : never;
798
+ } : TInput extends {
799
+ view?: undefined;
800
+ } ? {
801
+ contentType?: {
802
+ createdAt: string;
803
+ updatedAt: string;
804
+ id: string;
805
+ name: string;
806
+ slug: string;
807
+ description?: string | undefined;
808
+ jsonSchema: string;
809
+ fieldConfig?: string | undefined;
810
+ autoFormVersion?: number | undefined;
811
+ } | undefined;
812
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
813
+ createdAt: string;
814
+ updatedAt: string;
815
+ id: string;
816
+ slug: string;
817
+ contentTypeId: string;
818
+ data: string;
819
+ authorId?: string | undefined;
820
+ } : "view" extends keyof TInput ? {
821
+ contentType?: {
822
+ createdAt: string;
823
+ updatedAt: string;
824
+ id: string;
825
+ name: string;
826
+ slug: string;
827
+ description?: string | undefined;
828
+ jsonSchema: string;
829
+ fieldConfig?: string | undefined;
830
+ autoFormVersion?: number | undefined;
831
+ } | undefined;
832
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
833
+ createdAt: string;
834
+ updatedAt: string;
835
+ id: string;
836
+ slug: string;
837
+ contentTypeId: string;
838
+ data: string;
839
+ authorId?: string | undefined;
840
+ } | (Omit<Pick<{
841
+ contentType?: {
842
+ createdAt: string;
843
+ updatedAt: string;
844
+ id: string;
845
+ name: string;
846
+ slug: string;
847
+ description?: string | undefined;
848
+ jsonSchema: string;
849
+ fieldConfig?: string | undefined;
850
+ autoFormVersion?: number | undefined;
851
+ } | undefined;
852
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
853
+ createdAt: string;
854
+ updatedAt: string;
855
+ id: string;
856
+ slug: string;
857
+ contentTypeId: string;
858
+ data: string;
859
+ authorId?: string | undefined;
860
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
861
+ parsedData: TInput extends {
862
+ fields?: infer TFields extends CMSContentFields;
863
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData>;
864
+ }) : {
865
+ contentType?: {
866
+ createdAt: string;
867
+ updatedAt: string;
868
+ id: string;
869
+ name: string;
870
+ slug: string;
871
+ description?: string | undefined;
872
+ jsonSchema: string;
873
+ fieldConfig?: string | undefined;
874
+ autoFormVersion?: number | undefined;
875
+ } | undefined;
876
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
877
+ createdAt: string;
878
+ updatedAt: string;
879
+ id: string;
880
+ slug: string;
881
+ contentTypeId: string;
882
+ data: string;
883
+ authorId?: string | undefined;
884
+ }>>)>;
885
+ readonly createContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
886
+ typeSlug: z.ZodString;
887
+ body: z.ZodObject<{
888
+ slug: z.ZodString;
889
+ data: z.ZodType<Record<string, any>, unknown, z.core.$ZodTypeInternals<Record<string, any>, unknown>>;
890
+ }, z.core.$strip>;
891
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:record.create", z.ZodObject<{
892
+ contentType: z.ZodString;
893
+ }, z.core.$strip>>, {
894
+ contentType?: {
895
+ createdAt: string;
896
+ updatedAt: string;
897
+ id: string;
898
+ name: string;
899
+ slug: string;
900
+ description?: string | undefined;
901
+ jsonSchema: string;
902
+ fieldConfig?: string | undefined;
903
+ autoFormVersion?: number | undefined;
904
+ } | undefined;
905
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
906
+ createdAt: string;
907
+ updatedAt: string;
908
+ id: string;
909
+ slug: string;
910
+ contentTypeId: string;
911
+ data: string;
912
+ authorId?: string | undefined;
913
+ }, false>;
914
+ readonly updateContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
915
+ typeSlug: z.ZodString;
916
+ id: z.ZodString;
917
+ body: z.ZodObject<{
918
+ slug: z.ZodOptional<z.ZodString>;
919
+ data: z.ZodOptional<z.ZodType<Record<string, any>, unknown, z.core.$ZodTypeInternals<Record<string, any>, unknown>>>;
920
+ }, z.core.$strip>;
921
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:record.update", z.ZodObject<{
922
+ contentType: z.ZodString;
923
+ recordId: z.ZodString;
924
+ authorId: z.ZodOptional<z.ZodString>;
925
+ }, z.core.$strip>>, {
926
+ contentType?: {
927
+ createdAt: string;
928
+ updatedAt: string;
929
+ id: string;
930
+ name: string;
931
+ slug: string;
932
+ description?: string | undefined;
933
+ jsonSchema: string;
934
+ fieldConfig?: string | undefined;
935
+ autoFormVersion?: number | undefined;
936
+ } | undefined;
937
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
938
+ createdAt: string;
939
+ updatedAt: string;
940
+ id: string;
941
+ slug: string;
942
+ contentTypeId: string;
943
+ data: string;
944
+ authorId?: string | undefined;
945
+ }, false>;
946
+ readonly deleteContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
947
+ typeSlug: z.ZodString;
948
+ id: z.ZodString;
949
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:record.delete", z.ZodObject<{
950
+ contentType: z.ZodString;
951
+ recordId: z.ZodString;
952
+ authorId: z.ZodOptional<z.ZodString>;
953
+ }, z.core.$strip>>, {
954
+ readonly success: true;
955
+ }, false>;
956
+ readonly getContentItemPopulated: _btst_stack_plugins_api.Operation<z.ZodObject<{
957
+ typeSlug: z.ZodString;
958
+ id: z.ZodString;
959
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:record.read", z.ZodObject<{
960
+ contentType: z.ZodString;
961
+ scope: z.ZodEnum<{
962
+ record: "record";
963
+ collection: "collection";
964
+ }>;
965
+ recordId: z.ZodOptional<z.ZodString>;
966
+ authorId: z.ZodOptional<z.ZodString>;
967
+ }, z.core.$strip>>, {
968
+ _relations: {
969
+ [k: string]: {
970
+ contentType?: {
971
+ createdAt: string;
972
+ updatedAt: string;
973
+ id: string;
974
+ name: string;
975
+ slug: string;
976
+ description?: string | undefined;
977
+ jsonSchema: string;
978
+ fieldConfig?: string | undefined;
979
+ autoFormVersion?: number | undefined;
980
+ } | undefined;
981
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
982
+ createdAt: string;
983
+ updatedAt: string;
984
+ id: string;
985
+ slug: string;
986
+ contentTypeId: string;
987
+ data: string;
988
+ authorId?: string | undefined;
989
+ }[];
990
+ };
991
+ contentType?: {
992
+ createdAt: string;
993
+ updatedAt: string;
994
+ id: string;
995
+ name: string;
996
+ slug: string;
997
+ description?: string | undefined;
998
+ jsonSchema: string;
999
+ fieldConfig?: string | undefined;
1000
+ autoFormVersion?: number | undefined;
1001
+ } | undefined;
1002
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1003
+ createdAt: string;
1004
+ updatedAt: string;
1005
+ id: string;
1006
+ slug: string;
1007
+ contentTypeId: string;
1008
+ data: string;
1009
+ authorId?: string | undefined;
1010
+ }, false>;
1011
+ readonly listContentByRelation: _btst_stack_plugins_api.Operation<z.ZodObject<{
1012
+ typeSlug: z.ZodString;
1013
+ query: z.ZodObject<{
1014
+ field: z.ZodString;
1015
+ targetId: z.ZodString;
1016
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1017
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1018
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
1019
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
1020
+ }, z.core.$strip>;
1021
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:record.read", z.ZodObject<{
1022
+ contentType: z.ZodString;
1023
+ scope: z.ZodEnum<{
1024
+ record: "record";
1025
+ collection: "collection";
1026
+ }>;
1027
+ recordId: z.ZodOptional<z.ZodString>;
1028
+ authorId: z.ZodOptional<z.ZodString>;
1029
+ }, z.core.$strip>>, {
1030
+ items: (Omit<Pick<{
1031
+ contentType?: {
1032
+ createdAt: string;
1033
+ updatedAt: string;
1034
+ id: string;
1035
+ name: string;
1036
+ slug: string;
1037
+ description?: string | undefined;
1038
+ jsonSchema: string;
1039
+ fieldConfig?: string | undefined;
1040
+ autoFormVersion?: number | undefined;
1041
+ } | undefined;
1042
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1043
+ createdAt: string;
1044
+ updatedAt: string;
1045
+ id: string;
1046
+ slug: string;
1047
+ contentTypeId: string;
1048
+ data: string;
1049
+ authorId?: string | undefined;
1050
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1051
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
1052
+ })[];
1053
+ total: number;
1054
+ limit: number;
1055
+ offset: number;
1056
+ }, false> & _btst_stack_plugins_api.OperationCallSignature<(<const TInput extends _btst_stack_plugins_api.DeepReadonly<z.input<z.ZodObject<{
1057
+ typeSlug: z.ZodString;
1058
+ query: z.ZodObject<{
1059
+ field: z.ZodString;
1060
+ targetId: z.ZodString;
1061
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1062
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1063
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
1064
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
1065
+ }, z.core.$strip>;
1066
+ }, z.core.$strip>>>>(input: TInput) => Promise<{
1067
+ readonly items: readonly _btst_stack_plugins_api.DeepReadonly<TInput["query"] extends infer T ? T extends TInput["query"] ? T extends {
1068
+ view: "content";
1069
+ } ? Omit<Pick<{
1070
+ contentType?: {
1071
+ createdAt: string;
1072
+ updatedAt: string;
1073
+ id: string;
1074
+ name: string;
1075
+ slug: string;
1076
+ description?: string | undefined;
1077
+ jsonSchema: string;
1078
+ fieldConfig?: string | undefined;
1079
+ autoFormVersion?: number | undefined;
1080
+ } | undefined;
1081
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1082
+ createdAt: string;
1083
+ updatedAt: string;
1084
+ id: string;
1085
+ slug: string;
1086
+ contentTypeId: string;
1087
+ data: string;
1088
+ authorId?: string | undefined;
1089
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1090
+ parsedData: T extends infer T_1 ? T_1 extends T ? T_1 extends {
1091
+ fields?: infer TFields extends CMSContentFields;
1092
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData> : never : never;
1093
+ } : T extends {
1094
+ view?: undefined;
1095
+ } ? {
1096
+ contentType?: {
1097
+ createdAt: string;
1098
+ updatedAt: string;
1099
+ id: string;
1100
+ name: string;
1101
+ slug: string;
1102
+ description?: string | undefined;
1103
+ jsonSchema: string;
1104
+ fieldConfig?: string | undefined;
1105
+ autoFormVersion?: number | undefined;
1106
+ } | undefined;
1107
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1108
+ createdAt: string;
1109
+ updatedAt: string;
1110
+ id: string;
1111
+ slug: string;
1112
+ contentTypeId: string;
1113
+ data: string;
1114
+ authorId?: string | undefined;
1115
+ } : "view" extends keyof T ? {
1116
+ contentType?: {
1117
+ createdAt: string;
1118
+ updatedAt: string;
1119
+ id: string;
1120
+ name: string;
1121
+ slug: string;
1122
+ description?: string | undefined;
1123
+ jsonSchema: string;
1124
+ fieldConfig?: string | undefined;
1125
+ autoFormVersion?: number | undefined;
1126
+ } | undefined;
1127
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1128
+ createdAt: string;
1129
+ updatedAt: string;
1130
+ id: string;
1131
+ slug: string;
1132
+ contentTypeId: string;
1133
+ data: string;
1134
+ authorId?: string | undefined;
1135
+ } | (Omit<Pick<{
1136
+ contentType?: {
1137
+ createdAt: string;
1138
+ updatedAt: string;
1139
+ id: string;
1140
+ name: string;
1141
+ slug: string;
1142
+ description?: string | undefined;
1143
+ jsonSchema: string;
1144
+ fieldConfig?: string | undefined;
1145
+ autoFormVersion?: number | undefined;
1146
+ } | undefined;
1147
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1148
+ createdAt: string;
1149
+ updatedAt: string;
1150
+ id: string;
1151
+ slug: string;
1152
+ contentTypeId: string;
1153
+ data: string;
1154
+ authorId?: string | undefined;
1155
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1156
+ parsedData: T extends {
1157
+ fields?: infer TFields extends CMSContentFields;
1158
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData>;
1159
+ }) : {
1160
+ contentType?: {
1161
+ createdAt: string;
1162
+ updatedAt: string;
1163
+ id: string;
1164
+ name: string;
1165
+ slug: string;
1166
+ description?: string | undefined;
1167
+ jsonSchema: string;
1168
+ fieldConfig?: string | undefined;
1169
+ autoFormVersion?: number | undefined;
1170
+ } | undefined;
1171
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1172
+ createdAt: string;
1173
+ updatedAt: string;
1174
+ id: string;
1175
+ slug: string;
1176
+ contentTypeId: string;
1177
+ data: string;
1178
+ authorId?: string | undefined;
1179
+ } : never : never>[];
1180
+ readonly total: number;
1181
+ readonly limit: number;
1182
+ readonly offset: number;
1183
+ }>)>;
1184
+ readonly getInverseRelations: _btst_stack_plugins_api.Operation<z.ZodObject<{
1185
+ slug: z.ZodString;
1186
+ query: z.ZodObject<{
1187
+ itemId: z.ZodOptional<z.ZodString>;
1188
+ }, z.core.$strip>;
1189
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:contentType.read", z.ZodObject<{
1190
+ contentType: z.ZodOptional<z.ZodString>;
1191
+ }, z.core.$strip>>, {
1192
+ inverseRelations: {
1193
+ sourceType: string;
1194
+ sourceTypeName: string;
1195
+ fieldName: string;
1196
+ count: number;
1197
+ }[];
1198
+ }, false>;
1199
+ readonly listInverseRelationItems: _btst_stack_plugins_api.Operation<z.ZodObject<{
1200
+ slug: z.ZodString;
1201
+ sourceType: z.ZodString;
1202
+ query: z.ZodObject<{
1203
+ itemId: z.ZodString;
1204
+ fieldName: z.ZodString;
1205
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1206
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1207
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
1208
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
1209
+ }, z.core.$strip>;
1210
+ }, z.core.$strip>, _btst_stack_authorization.PermissionDescriptor<"cms:record.read", z.ZodObject<{
1211
+ contentType: z.ZodString;
1212
+ scope: z.ZodEnum<{
1213
+ record: "record";
1214
+ collection: "collection";
1215
+ }>;
1216
+ recordId: z.ZodOptional<z.ZodString>;
1217
+ authorId: z.ZodOptional<z.ZodString>;
1218
+ }, z.core.$strip>>, {
1219
+ items: (Omit<Pick<{
1220
+ contentType?: {
1221
+ createdAt: string;
1222
+ updatedAt: string;
1223
+ id: string;
1224
+ name: string;
1225
+ slug: string;
1226
+ description?: string | undefined;
1227
+ jsonSchema: string;
1228
+ fieldConfig?: string | undefined;
1229
+ autoFormVersion?: number | undefined;
1230
+ } | undefined;
1231
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1232
+ createdAt: string;
1233
+ updatedAt: string;
1234
+ id: string;
1235
+ slug: string;
1236
+ contentTypeId: string;
1237
+ data: string;
1238
+ authorId?: string | undefined;
1239
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1240
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
1241
+ })[];
1242
+ total: number;
1243
+ limit: number;
1244
+ offset: number;
1245
+ }, false> & _btst_stack_plugins_api.OperationCallSignature<(<const TInput extends _btst_stack_plugins_api.DeepReadonly<z.input<z.ZodObject<{
1246
+ slug: z.ZodString;
1247
+ sourceType: z.ZodString;
1248
+ query: z.ZodObject<{
1249
+ itemId: z.ZodString;
1250
+ fieldName: z.ZodString;
1251
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1252
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1253
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
1254
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
1255
+ }, z.core.$strip>;
1256
+ }, z.core.$strip>>>>(input: TInput) => Promise<{
1257
+ readonly items: readonly _btst_stack_plugins_api.DeepReadonly<TInput["query"] extends infer T ? T extends TInput["query"] ? T extends {
1258
+ view: "content";
1259
+ } ? Omit<Pick<{
1260
+ contentType?: {
1261
+ createdAt: string;
1262
+ updatedAt: string;
1263
+ id: string;
1264
+ name: string;
1265
+ slug: string;
1266
+ description?: string | undefined;
1267
+ jsonSchema: string;
1268
+ fieldConfig?: string | undefined;
1269
+ autoFormVersion?: number | undefined;
1270
+ } | undefined;
1271
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1272
+ createdAt: string;
1273
+ updatedAt: string;
1274
+ id: string;
1275
+ slug: string;
1276
+ contentTypeId: string;
1277
+ data: string;
1278
+ authorId?: string | undefined;
1279
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1280
+ parsedData: T extends infer T_1 ? T_1 extends T ? T_1 extends {
1281
+ fields?: infer TFields extends CMSContentFields;
1282
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData> : never : never;
1283
+ } : T extends {
1284
+ view?: undefined;
1285
+ } ? {
1286
+ contentType?: {
1287
+ createdAt: string;
1288
+ updatedAt: string;
1289
+ id: string;
1290
+ name: string;
1291
+ slug: string;
1292
+ description?: string | undefined;
1293
+ jsonSchema: string;
1294
+ fieldConfig?: string | undefined;
1295
+ autoFormVersion?: number | undefined;
1296
+ } | undefined;
1297
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1298
+ createdAt: string;
1299
+ updatedAt: string;
1300
+ id: string;
1301
+ slug: string;
1302
+ contentTypeId: string;
1303
+ data: string;
1304
+ authorId?: string | undefined;
1305
+ } : "view" extends keyof T ? {
1306
+ contentType?: {
1307
+ createdAt: string;
1308
+ updatedAt: string;
1309
+ id: string;
1310
+ name: string;
1311
+ slug: string;
1312
+ description?: string | undefined;
1313
+ jsonSchema: string;
1314
+ fieldConfig?: string | undefined;
1315
+ autoFormVersion?: number | undefined;
1316
+ } | undefined;
1317
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1318
+ createdAt: string;
1319
+ updatedAt: string;
1320
+ id: string;
1321
+ slug: string;
1322
+ contentTypeId: string;
1323
+ data: string;
1324
+ authorId?: string | undefined;
1325
+ } | (Omit<Pick<{
1326
+ contentType?: {
1327
+ createdAt: string;
1328
+ updatedAt: string;
1329
+ id: string;
1330
+ name: string;
1331
+ slug: string;
1332
+ description?: string | undefined;
1333
+ jsonSchema: string;
1334
+ fieldConfig?: string | undefined;
1335
+ autoFormVersion?: number | undefined;
1336
+ } | undefined;
1337
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1338
+ createdAt: string;
1339
+ updatedAt: string;
1340
+ id: string;
1341
+ slug: string;
1342
+ contentTypeId: string;
1343
+ data: string;
1344
+ authorId?: string | undefined;
1345
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1346
+ parsedData: T extends {
1347
+ fields?: infer TFields extends CMSContentFields;
1348
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData>;
1349
+ }) : {
1350
+ contentType?: {
1351
+ createdAt: string;
1352
+ updatedAt: string;
1353
+ id: string;
1354
+ name: string;
1355
+ slug: string;
1356
+ description?: string | undefined;
1357
+ jsonSchema: string;
1358
+ fieldConfig?: string | undefined;
1359
+ autoFormVersion?: number | undefined;
1360
+ } | undefined;
1361
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1362
+ createdAt: string;
1363
+ updatedAt: string;
1364
+ id: string;
1365
+ slug: string;
1366
+ contentTypeId: string;
1367
+ data: string;
1368
+ authorId?: string | undefined;
1369
+ } : never : never>[];
1370
+ readonly total: number;
1371
+ readonly limit: number;
1372
+ readonly offset: number;
1373
+ }>)>;
1374
+ }, "cms">;
1375
+ type CMSApiRouter = ReturnType<ReturnType<typeof cmsBackendPlugin>["routes"]>;
1376
+
1377
+ /**
1378
+ * Internal query key constants for the CMS plugin.
1379
+ * Shared between query-keys.ts (HTTP path) and prefetchForRoute (DB path)
1380
+ * to prevent key drift between SSR loaders and SSG prefetching.
1381
+ */
1382
+
1383
+ interface ContentListDiscriminator {
1384
+ typeSlug: string;
1385
+ limit: number;
1386
+ offset: number;
1387
+ search: string | undefined;
1388
+ view?: "content";
1389
+ fields?: readonly string[];
1390
+ }
1391
+ /**
1392
+ * Builds the discriminator object used as the cache key for the content list.
1393
+ * Mirrors the params object used in the cmsContent.list resource declaration
1394
+ * so both paths stay in sync. An empty/whitespace search term is normalized
1395
+ * to `undefined` so it hashes identically to "no search".
1396
+ */
1397
+ declare function contentListDiscriminator(params: {
1398
+ typeSlug: string;
1399
+ limit?: number;
1400
+ offset?: number;
1401
+ search?: string;
1402
+ view?: "content";
1403
+ fields?: readonly string[];
1404
+ }): ContentListDiscriminator;
1405
+ /** Full query key builders — use these with queryClient.setQueryData() */
1406
+ declare const CMS_QUERY_KEYS: {
1407
+ /**
1408
+ * Key for the cmsTypes.list() query.
1409
+ * Full key: ["cmsTypes", "list", "list"]
1410
+ */
1411
+ typesList: () => readonly ["cmsTypes", "list", "list"];
1412
+ /**
1413
+ * Key for the cmsContent.list({ typeSlug, limit, offset }) query.
1414
+ * Full key: ["cmsContent", "list", { typeSlug, limit, offset, search }]
1415
+ */
1416
+ contentList: (params: {
1417
+ typeSlug: string;
1418
+ limit?: number;
1419
+ offset?: number;
1420
+ search?: string;
1421
+ view?: "content";
1422
+ fields?: readonly string[];
1423
+ }) => readonly ["cmsContent", "list", ContentListDiscriminator];
1424
+ /**
1425
+ * Key for the cmsContent.detail(typeSlug, id) query.
1426
+ * Full key: ["cmsContent", "detail", typeSlug, id]
1427
+ */
1428
+ contentDetail: (typeSlug: string, id: string, options?: CMSReadOptions) => readonly ["cmsContent", "detail", string, string, ...{
1429
+ fields?: string[] | undefined;
1430
+ view?: "content" | undefined;
1431
+ }[]];
1432
+ };
1433
+
1434
+ /** Params for the paginated content list (one page per `limit`). */
1435
+ interface ContentListParams extends CMSReadOptions {
1436
+ typeSlug: string;
1437
+ limit?: number;
1438
+ /**
1439
+ * Included in the query key discriminator for compatibility with
1440
+ * callers that pass it explicitly; the infinite query itself injects
1441
+ * the page offset per page (always starting at 0).
1442
+ */
1443
+ offset?: number;
1444
+ /** Free-text search across item slugs and data values */
1445
+ search?: string;
1446
+ }
1447
+ interface ContentOptionsParams extends CMSReadOptions {
1448
+ typeSlug: string;
1449
+ search?: string;
1450
+ limit?: number;
1451
+ }
1452
+ interface ContentByRelationParams extends CMSReadOptions {
1453
+ typeSlug: string;
1454
+ field: string;
1455
+ targetId: string;
1456
+ limit?: number;
1457
+ }
1458
+ interface InverseRelationsParams {
1459
+ slug: string;
1460
+ itemId: string;
1461
+ }
1462
+ interface InverseRelationItemsParams extends CMSReadOptions {
1463
+ slug: string;
1464
+ sourceType: string;
1465
+ itemId: string;
1466
+ fieldName: string;
1467
+ limit?: number;
1468
+ offset?: number;
1469
+ }
1470
+ /**
1471
+ * CMS resource declaration — the single source of truth for query keys,
1472
+ * HTTP mappings and mutations. Feeds both `createCMSQueryKeys` (SSR
1473
+ * loaders) and `createResource` (client hooks, see `client/hooks`).
1474
+ *
1475
+ * Key shapes intentionally match `CMS_QUERY_KEYS` in
1476
+ * `api/query-key-defs.ts` so SSG `prefetchForRoute` hydration keeps working.
1477
+ * List pages stay as `{ items, total, limit, offset }` envelopes (via
1478
+ * `nextPageParam`) so `total` survives SSG dehydration.
1479
+ */
1480
+ declare const cmsResources: {
1481
+ cmsTypes: {
1482
+ queries: {
1483
+ list: {
1484
+ path: string;
1485
+ key: () => string[];
1486
+ select: (data: any) => (SerializedContentType & {
1487
+ itemCount: number;
1488
+ })[];
1489
+ };
1490
+ detail: {
1491
+ path: string;
1492
+ params: (slug: string) => {
1493
+ slug: string;
1494
+ };
1495
+ key: (slug: string) => string[];
1496
+ select: (data: any, _slug: string) => SerializedContentType | null;
1497
+ skip: (slug: string) => boolean;
1498
+ };
1499
+ inverseRelations: {
1500
+ path: string;
1501
+ params: (p: InverseRelationsParams) => {
1502
+ slug: string;
1503
+ };
1504
+ query: (p: InverseRelationsParams) => {
1505
+ itemId: string;
1506
+ };
1507
+ key: (p: InverseRelationsParams) => string[];
1508
+ select: (data: any) => InverseRelation[];
1509
+ };
1510
+ inverseRelationItems: {
1511
+ path: string;
1512
+ params: (p: InverseRelationItemsParams) => {
1513
+ slug: string;
1514
+ sourceType: string;
1515
+ };
1516
+ query: (p: InverseRelationItemsParams) => {
1517
+ itemId: string;
1518
+ fieldName: string;
1519
+ limit: number;
1520
+ offset: number;
1521
+ view: CMSReadView;
1522
+ fields: string | undefined;
1523
+ };
1524
+ key: (p: InverseRelationItemsParams) => (string | {
1525
+ fields?: string[] | undefined;
1526
+ view?: "content" | undefined;
1527
+ limit: number;
1528
+ offset: number;
1529
+ })[];
1530
+ select: (data: any) => {
1531
+ items: SerializedContentItemWithType[];
1532
+ total: number;
1533
+ };
1534
+ };
1535
+ };
1536
+ };
1537
+ cmsContent: {
1538
+ queries: {
1539
+ list: {
1540
+ path: string;
1541
+ params: (p: ContentListParams) => {
1542
+ typeSlug: string;
1543
+ };
1544
+ query: (p: ContentListParams) => {
1545
+ limit: number;
1546
+ search: string | undefined;
1547
+ view: CMSReadView;
1548
+ fields: string | undefined;
1549
+ };
1550
+ key: (p: ContentListParams) => ContentListDiscriminator[];
1551
+ select: (data: any, _p: ContentListParams) => PaginatedContentItems;
1552
+ infinite: true;
1553
+ pageSize: (p: ContentListParams) => number;
1554
+ nextPageParam: (lastPage: PaginatedContentItems, allPages: PaginatedContentItems[], p: ContentListParams) => number | undefined;
1555
+ };
1556
+ detail: {
1557
+ path: string;
1558
+ params: (typeSlug: string, id: string, _options?: CMSReadOptions) => {
1559
+ typeSlug: string;
1560
+ id: string;
1561
+ };
1562
+ query: (_typeSlug: string, _id: string, options?: CMSReadOptions) => {
1563
+ view: CMSReadView;
1564
+ fields: string | undefined;
1565
+ };
1566
+ key: (typeSlug: string, id: string, options?: CMSReadOptions) => (string | {
1567
+ fields?: string[] | undefined;
1568
+ view?: "content" | undefined;
1569
+ })[];
1570
+ select: (data: any, _typeSlug: string, _id: string, _options?: CMSReadOptions) => SerializedContentItemWithType | null;
1571
+ skip: (typeSlug: string, id: string) => boolean;
1572
+ };
1573
+ bySlug: {
1574
+ path: string;
1575
+ params: (typeSlug: string, _slug: string, _options?: CMSReadOptions) => {
1576
+ typeSlug: string;
1577
+ };
1578
+ query: (_typeSlug: string, slug: string, options?: CMSReadOptions) => {
1579
+ view: CMSReadView;
1580
+ fields: string | undefined;
1581
+ slug: string;
1582
+ limit: number;
1583
+ };
1584
+ key: (typeSlug: string, slug: string, options?: CMSReadOptions) => (string | {
1585
+ fields?: string[] | undefined;
1586
+ view?: "content" | undefined;
1587
+ })[];
1588
+ select: (data: any) => SerializedContentItemWithType | null;
1589
+ skip: (typeSlug: string, slug: string) => boolean;
1590
+ };
1591
+ populated: {
1592
+ path: string;
1593
+ params: (typeSlug: string, id: string) => {
1594
+ typeSlug: string;
1595
+ id: string;
1596
+ };
1597
+ key: (typeSlug: string, id: string) => string[];
1598
+ select: (data: any) => SerializedContentItemWithType | null;
1599
+ skip: (typeSlug: string, id: string) => boolean;
1600
+ };
1601
+ byRelation: {
1602
+ path: string;
1603
+ params: (p: ContentByRelationParams) => {
1604
+ typeSlug: string;
1605
+ };
1606
+ query: (p: ContentByRelationParams) => {
1607
+ field: string;
1608
+ targetId: string;
1609
+ limit: number;
1610
+ view: CMSReadView;
1611
+ fields: string | undefined;
1612
+ };
1613
+ key: (p: ContentByRelationParams) => (string | {
1614
+ fields?: string[] | undefined;
1615
+ view?: "content" | undefined;
1616
+ limit: number;
1617
+ offset: number;
1618
+ })[];
1619
+ select: (data: any, _p: ContentByRelationParams) => PaginatedContentItems;
1620
+ infinite: true;
1621
+ pageSize: (p: ContentByRelationParams) => number;
1622
+ nextPageParam: (lastPage: PaginatedContentItems, allPages: PaginatedContentItems[], p: ContentByRelationParams) => number | undefined;
1623
+ };
1624
+ options: {
1625
+ path: string;
1626
+ params: (p: ContentOptionsParams) => {
1627
+ typeSlug: string;
1628
+ };
1629
+ query: (p: ContentOptionsParams) => {
1630
+ search: string | undefined;
1631
+ limit: number;
1632
+ view: CMSReadView;
1633
+ fields: string | undefined;
1634
+ };
1635
+ key: (p: ContentOptionsParams) => (string | number | {
1636
+ fields?: string[] | undefined;
1637
+ view?: "content" | undefined;
1638
+ } | undefined)[];
1639
+ select: (data: any, _p: ContentOptionsParams) => SerializedContentItemWithType[];
1640
+ };
1641
+ };
1642
+ mutations: {
1643
+ create: {
1644
+ path: string;
1645
+ method: "POST";
1646
+ input: (vars: {
1647
+ typeSlug: string;
1648
+ slug: string;
1649
+ data: Record<string, unknown>;
1650
+ }) => {
1651
+ params: {
1652
+ typeSlug: string;
1653
+ };
1654
+ body: {
1655
+ slug: string;
1656
+ data: Record<string, unknown>;
1657
+ };
1658
+ };
1659
+ select: (data: any) => SerializedContentItemWithType | null;
1660
+ invalidates: string[];
1661
+ };
1662
+ update: {
1663
+ path: string;
1664
+ method: "PUT";
1665
+ input: (vars: {
1666
+ typeSlug: string;
1667
+ id: string;
1668
+ data: {
1669
+ slug?: string;
1670
+ data?: Record<string, unknown>;
1671
+ };
1672
+ }) => {
1673
+ params: {
1674
+ typeSlug: string;
1675
+ id: string;
1676
+ };
1677
+ body: {
1678
+ slug?: string;
1679
+ data?: Record<string, unknown>;
1680
+ };
1681
+ };
1682
+ select: (data: any) => SerializedContentItemWithType | null;
1683
+ invalidates: string[];
1684
+ setData: {
1685
+ query: string;
1686
+ args: (updated: SerializedContentItemWithType | null) => string[] | null;
1687
+ };
1688
+ };
1689
+ delete: {
1690
+ path: string;
1691
+ method: "DELETE";
1692
+ input: (vars: {
1693
+ typeSlug: string;
1694
+ id: string;
1695
+ }) => {
1696
+ params: {
1697
+ typeSlug: string;
1698
+ id: string;
1699
+ };
1700
+ };
1701
+ select: (data: any) => {
1702
+ success: boolean;
1703
+ };
1704
+ invalidates: string[];
1705
+ };
1706
+ };
1707
+ };
1708
+ };
1709
+ type CMSResourceQueryKeys = ReturnType<typeof createResourceQueryKeys<typeof cmsResources>>;
1710
+ type ContentQueryResult<TData> = {
1711
+ queryKey: readonly unknown[];
1712
+ queryFn: (context?: {
1713
+ pageParam?: unknown;
1714
+ }) => Promise<TData>;
1715
+ };
1716
+ type CMSItemQueryEntry = {
1717
+ <TView extends CMSReadView = undefined, const TFields extends CMSContentFields = undefined>(typeSlug: string, identity: string, options?: CMSReadOptions<TView, TFields>): ContentQueryResult<CMSContentItemResult<Record<string, unknown>, TView, TFields> | null>;
1718
+ _def: readonly [string, string];
1719
+ };
1720
+ type CMSRelationQueryEntry<TParams> = {
1721
+ <TView extends CMSReadView = undefined, const TFields extends CMSContentFields = undefined>(params: Omit<TParams, "view" | "fields"> & CMSReadOptions<TView, TFields>): ContentQueryResult<PaginatedContentItems<Record<string, unknown>, TView, TFields>>;
1722
+ _def: readonly [string, string];
1723
+ };
1724
+ type CMSQueryKeys = Omit<CMSResourceQueryKeys, "cmsContent" | "cmsTypes"> & {
1725
+ cmsTypes: Omit<CMSResourceQueryKeys["cmsTypes"], "inverseRelationItems"> & {
1726
+ inverseRelationItems: CMSRelationQueryEntry<InverseRelationItemsParams>;
1727
+ };
1728
+ cmsContent: Omit<CMSResourceQueryKeys["cmsContent"], "list" | "detail" | "bySlug" | "byRelation" | "options"> & {
1729
+ list: {
1730
+ <TView extends CMSReadView = undefined, const TFields extends CMSContentFields = undefined>(params: Omit<ContentListParams, "view" | "fields"> & CMSReadOptions<TView, TFields>): ContentQueryResult<PaginatedContentItems<Record<string, unknown>, TView, TFields>>;
1731
+ _def: readonly [string, string];
1732
+ };
1733
+ options: {
1734
+ <TView extends CMSReadView = undefined, const TFields extends CMSContentFields = undefined>(params: Omit<ContentOptionsParams, "view" | "fields"> & CMSReadOptions<TView, TFields>): ContentQueryResult<CMSContentItemResult<Record<string, unknown>, TView, TFields>[]>;
1735
+ _def: readonly [string, string];
1736
+ };
1737
+ detail: CMSItemQueryEntry;
1738
+ bySlug: CMSItemQueryEntry;
1739
+ byRelation: CMSRelationQueryEntry<ContentByRelationParams>;
1740
+ };
1741
+ };
1742
+ /**
1743
+ * Create CMS query keys for React Query
1744
+ * Used by consumers and SSR loaders to fetch content types and content items
1745
+ */
1746
+ declare function createCMSQueryKeys(client: ReturnType<typeof createApiClient<CMSApiRouter>>, headers?: HeadersInit): CMSQueryKeys;
1747
+
1748
+ export { CMS_QUERY_KEYS as b, cmsBackendPlugin as c, createCMSQueryKeys as d, cmsResources as g, contentListDiscriminator as h };
1749
+ export type { CMSApiRouter as C, CMSRouteKey as a, ContentListDiscriminator as e, ContentListParams as f };