@btst/stack 5.0.0 → 5.1.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 (113) hide show
  1. package/dist/api/index.d.cts +2 -2
  2. package/dist/api/index.d.mts +2 -2
  3. package/dist/api/index.d.ts +2 -2
  4. package/dist/client/index.d.cts +2 -2
  5. package/dist/client/index.d.mts +2 -2
  6. package/dist/client/index.d.ts +2 -2
  7. package/dist/context/index.d.cts +1 -1
  8. package/dist/context/index.d.mts +1 -1
  9. package/dist/context/index.d.ts +1 -1
  10. package/dist/index.d.cts +1 -1
  11. package/dist/index.d.mts +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/packages/stack/src/plugins/cms/api/getters.cjs +142 -6
  14. package/dist/packages/stack/src/plugins/cms/api/getters.mjs +139 -8
  15. package/dist/packages/stack/src/plugins/cms/api/operations.cjs +67 -61
  16. package/dist/packages/stack/src/plugins/cms/api/operations.mjs +69 -63
  17. package/dist/packages/stack/src/plugins/cms/api/plugin.cjs +26 -8
  18. package/dist/packages/stack/src/plugins/cms/api/plugin.mjs +27 -9
  19. package/dist/packages/stack/src/plugins/cms/api/query-key-defs.cjs +15 -1
  20. package/dist/packages/stack/src/plugins/cms/api/query-key-defs.mjs +14 -2
  21. package/dist/packages/stack/src/plugins/cms/client/hooks/cms-hooks.cjs +45 -24
  22. package/dist/packages/stack/src/plugins/cms/client/hooks/cms-hooks.mjs +45 -24
  23. package/dist/packages/stack/src/plugins/cms/schemas.cjs +22 -0
  24. package/dist/packages/stack/src/plugins/cms/schemas.mjs +20 -1
  25. package/dist/plugins/api/index.d.cts +2 -2
  26. package/dist/plugins/api/index.d.mts +2 -2
  27. package/dist/plugins/api/index.d.ts +2 -2
  28. package/dist/plugins/blog/api/index.d.cts +2 -2
  29. package/dist/plugins/blog/api/index.d.mts +2 -2
  30. package/dist/plugins/blog/api/index.d.ts +2 -2
  31. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  32. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  33. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  34. package/dist/plugins/blog/client/index.d.cts +2 -2
  35. package/dist/plugins/blog/client/index.d.mts +2 -2
  36. package/dist/plugins/blog/client/index.d.ts +2 -2
  37. package/dist/plugins/blog/query-keys.d.cts +2 -2
  38. package/dist/plugins/blog/query-keys.d.mts +2 -2
  39. package/dist/plugins/blog/query-keys.d.ts +2 -2
  40. package/dist/plugins/client/index.d.cts +2 -2
  41. package/dist/plugins/client/index.d.mts +2 -2
  42. package/dist/plugins/client/index.d.ts +2 -2
  43. package/dist/plugins/cms/api/index.cjs +1 -0
  44. package/dist/plugins/cms/api/index.d.cts +43 -11
  45. package/dist/plugins/cms/api/index.d.mts +43 -11
  46. package/dist/plugins/cms/api/index.d.ts +43 -11
  47. package/dist/plugins/cms/api/index.mjs +1 -1
  48. package/dist/plugins/cms/client/hooks/index.d.cts +90 -45
  49. package/dist/plugins/cms/client/hooks/index.d.mts +90 -45
  50. package/dist/plugins/cms/client/hooks/index.d.ts +90 -45
  51. package/dist/plugins/cms/client/index.d.cts +2 -1
  52. package/dist/plugins/cms/client/index.d.mts +2 -1
  53. package/dist/plugins/cms/client/index.d.ts +2 -1
  54. package/dist/plugins/cms/query-keys.cjs +69 -13
  55. package/dist/plugins/cms/query-keys.d.cts +89 -212
  56. package/dist/plugins/cms/query-keys.d.mts +89 -212
  57. package/dist/plugins/cms/query-keys.d.ts +89 -212
  58. package/dist/plugins/cms/query-keys.mjs +70 -14
  59. package/dist/plugins/kanban/client/index.d.cts +1 -1
  60. package/dist/plugins/kanban/client/index.d.mts +1 -1
  61. package/dist/plugins/kanban/client/index.d.ts +1 -1
  62. package/dist/plugins/route-docs/client/index.d.cts +1 -1
  63. package/dist/plugins/route-docs/client/index.d.mts +1 -1
  64. package/dist/plugins/route-docs/client/index.d.ts +1 -1
  65. package/dist/plugins/ui-builder/client/hooks/index.d.cts +3 -3
  66. package/dist/plugins/ui-builder/client/hooks/index.d.mts +3 -3
  67. package/dist/plugins/ui-builder/client/hooks/index.d.ts +3 -3
  68. package/dist/plugins/ui-builder/client/index.d.cts +3 -3
  69. package/dist/plugins/ui-builder/client/index.d.mts +3 -3
  70. package/dist/plugins/ui-builder/client/index.d.ts +3 -3
  71. package/dist/plugins/ui-builder/query-keys.d.cts +4 -3
  72. package/dist/plugins/ui-builder/query-keys.d.mts +4 -3
  73. package/dist/plugins/ui-builder/query-keys.d.ts +4 -3
  74. package/dist/shared/{stack.DMj68qY0.d.mts → stack.B2jlVVhD.d.mts} +5 -5
  75. package/dist/shared/{stack.Cvnj99cs.d.ts → stack.BB9tubJJ.d.ts} +9 -3
  76. package/dist/shared/{stack.Bt3WG2yb.d.cts → stack.BWduIMKG.d.cts} +35 -35
  77. package/dist/shared/stack.Bw09Lg2z.d.ts +1420 -0
  78. package/dist/shared/{stack.CkEz7vSt.d.mts → stack.C2Pvl-RS.d.mts} +9 -3
  79. package/dist/shared/{stack.C2l2wd_X.d.ts → stack.Ch9-ppmQ.d.ts} +35 -35
  80. package/dist/shared/{stack.Ht8mhDj5.d.cts → stack.D17yFglU.d.cts} +5 -5
  81. package/dist/shared/{stack.CiD115Ov.d.mts → stack.D6fPBfYe.d.mts} +35 -35
  82. package/dist/shared/stack.DFGj0gb7.d.mts +1420 -0
  83. package/dist/shared/{stack.pi0FxoEa.d.ts → stack.Dcfg4GNN.d.ts} +5 -5
  84. package/dist/shared/{stack.3rxARhgS.d.cts → stack.DrB3L7Ih.d.cts} +52 -3
  85. package/dist/shared/{stack.3rxARhgS.d.mts → stack.DrB3L7Ih.d.mts} +52 -3
  86. package/dist/shared/{stack.3rxARhgS.d.ts → stack.DrB3L7Ih.d.ts} +52 -3
  87. package/dist/shared/stack.NNrBKBkM.d.cts +1420 -0
  88. package/dist/shared/{stack.mRRyZBUg.d.cts → stack.Rb87lHqK.d.cts} +9 -3
  89. package/package.json +1 -1
  90. package/src/__tests__/cms-query-keys.test.ts +57 -0
  91. package/src/plugins/api/index.ts +1 -0
  92. package/src/plugins/api/operation.ts +16 -3
  93. package/src/plugins/cms/__tests__/authorization.test.ts +652 -187
  94. package/src/plugins/cms/__tests__/client-runtime.browser.test.tsx +655 -0
  95. package/src/plugins/cms/__tests__/content-read.typecheck.ts +351 -0
  96. package/src/plugins/cms/__tests__/getters.test.ts +286 -0
  97. package/src/plugins/cms/api/getters.ts +270 -12
  98. package/src/plugins/cms/api/index.ts +10 -0
  99. package/src/plugins/cms/api/operations.ts +163 -75
  100. package/src/plugins/cms/api/plugin.ts +50 -12
  101. package/src/plugins/cms/api/query-key-defs.ts +29 -2
  102. package/src/plugins/cms/client/hooks/cms-hooks.tsx +400 -91
  103. package/src/plugins/cms/client/index.ts +9 -0
  104. package/src/plugins/cms/query-keys.ts +171 -16
  105. package/src/plugins/cms/schemas.ts +30 -0
  106. package/src/plugins/cms/types.ts +49 -2
  107. package/src/plugins/media/__tests__/identity-partition.test.tsx +26 -16
  108. package/dist/shared/stack.CAmVUwjV.d.cts +0 -764
  109. package/dist/shared/stack.CQK02ujt.d.ts +0 -764
  110. package/dist/shared/stack.D9x1fR5a.d.mts +0 -764
  111. package/dist/shared/{stack.CKc_Bais.d.cts → stack.Csi-4Mgz.d.cts} +7 -7
  112. package/dist/shared/{stack.CKc_Bais.d.mts → stack.Csi-4Mgz.d.mts} +7 -7
  113. package/dist/shared/{stack.CKc_Bais.d.ts → stack.Csi-4Mgz.d.ts} +7 -7
@@ -0,0 +1,1420 @@
1
+ import { PermissionDescriptor } from '../authorization/index.mjs';
2
+ import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
3
+ import * as better_call from 'better-call';
4
+ import { QueryClient } from '@tanstack/react-query';
5
+ import { z } from 'zod';
6
+ import { f as CMSBackendConfig, C as CMSReadOptions, c as CMSContentFields, g as CMSSelectedData } from './stack.DrB3L7Ih.mjs';
7
+
8
+ /** Route keys returned by the CMS client plugin. */
9
+ type CMSRouteKey = "dashboard" | "contentList" | "newContent" | "editContent";
10
+ interface CMSPrefetchForRoute {
11
+ (key: "dashboard" | "newContent", qc: QueryClient): Promise<void>;
12
+ (key: "contentList", qc: QueryClient, params: {
13
+ typeSlug: string;
14
+ limit?: number;
15
+ search?: string;
16
+ } & CMSReadOptions): Promise<void>;
17
+ (key: "editContent", qc: QueryClient, params: {
18
+ typeSlug: string;
19
+ id: string;
20
+ } & CMSReadOptions): Promise<void>;
21
+ }
22
+ /** CMS backend plugin backed by one operation inventory for every transport. */
23
+ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
24
+ readonly listContentTypes: better_call.StrictEndpoint<"/content-types", {
25
+ requireRequest: true;
26
+ } & {
27
+ method: "GET";
28
+ }, readonly {
29
+ readonly itemCount: number;
30
+ readonly createdAt: string;
31
+ readonly updatedAt: string;
32
+ readonly id: string;
33
+ readonly name: string;
34
+ readonly slug: string;
35
+ readonly description?: string | undefined;
36
+ readonly jsonSchema: string;
37
+ readonly fieldConfig?: string | undefined;
38
+ readonly autoFormVersion?: number | undefined;
39
+ }[]>;
40
+ readonly getContentTypeBySlug: better_call.StrictEndpoint<"/content-types/:slug", {
41
+ params: z.ZodObject<{
42
+ slug: z.ZodString;
43
+ }, z.core.$strip>;
44
+ requireRequest: true;
45
+ } & {
46
+ method: "GET";
47
+ }, {
48
+ readonly createdAt: string;
49
+ readonly updatedAt: string;
50
+ readonly id: string;
51
+ readonly name: string;
52
+ readonly slug: string;
53
+ readonly description?: string | undefined;
54
+ readonly jsonSchema: string;
55
+ readonly fieldConfig?: string | undefined;
56
+ readonly autoFormVersion?: number | undefined;
57
+ }>;
58
+ readonly listContentItems: better_call.StrictEndpoint<"/content/:typeSlug", {
59
+ params: z.ZodObject<{
60
+ typeSlug: z.ZodString;
61
+ }, z.core.$strip>;
62
+ requireRequest: true;
63
+ } & {
64
+ method: "GET";
65
+ } & {
66
+ query: better_call.StandardSchemaV1<{
67
+ slug?: string | undefined;
68
+ search?: string | undefined;
69
+ limit?: unknown;
70
+ offset?: unknown;
71
+ view?: "content" | undefined;
72
+ fields?: unknown;
73
+ }, {
74
+ slug?: string | undefined;
75
+ search?: string | undefined;
76
+ limit?: unknown;
77
+ offset?: unknown;
78
+ view?: "content" | undefined;
79
+ fields?: unknown;
80
+ }>;
81
+ }, {
82
+ offset?: number | undefined;
83
+ limit?: number | undefined;
84
+ items: ({
85
+ contentType?: {
86
+ createdAt: string;
87
+ updatedAt: string;
88
+ id: string;
89
+ name: string;
90
+ slug: string;
91
+ description?: string | undefined;
92
+ jsonSchema: string;
93
+ fieldConfig?: string | undefined;
94
+ autoFormVersion?: number | undefined;
95
+ } | undefined;
96
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
97
+ createdAt: string;
98
+ updatedAt: string;
99
+ id: string;
100
+ slug: string;
101
+ contentTypeId: string;
102
+ data: string;
103
+ authorId?: string | undefined;
104
+ } | (Omit<Pick<{
105
+ contentType?: {
106
+ createdAt: string;
107
+ updatedAt: string;
108
+ id: string;
109
+ name: string;
110
+ slug: string;
111
+ description?: string | undefined;
112
+ jsonSchema: string;
113
+ fieldConfig?: string | undefined;
114
+ autoFormVersion?: number | undefined;
115
+ } | undefined;
116
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
117
+ createdAt: string;
118
+ updatedAt: string;
119
+ id: string;
120
+ slug: string;
121
+ contentTypeId: string;
122
+ data: string;
123
+ authorId?: string | undefined;
124
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
125
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData> | Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
126
+ }))[];
127
+ total: number;
128
+ } | {
129
+ readonly offset?: number | undefined;
130
+ readonly limit?: number | undefined;
131
+ readonly items: readonly ({
132
+ readonly contentType?: {
133
+ readonly createdAt: string;
134
+ readonly updatedAt: string;
135
+ readonly id: string;
136
+ readonly name: string;
137
+ readonly slug: string;
138
+ readonly description?: string | undefined;
139
+ readonly jsonSchema: string;
140
+ readonly fieldConfig?: string | undefined;
141
+ readonly autoFormVersion?: number | undefined;
142
+ } | undefined;
143
+ readonly parsedData: {
144
+ readonly [x: string]: any;
145
+ };
146
+ readonly createdAt: string;
147
+ readonly updatedAt: string;
148
+ readonly id: string;
149
+ readonly slug: string;
150
+ readonly contentTypeId: string;
151
+ readonly data: string;
152
+ readonly authorId?: string | undefined;
153
+ } | {
154
+ readonly id: string;
155
+ readonly slug: string;
156
+ readonly createdAt: string;
157
+ readonly updatedAt: string;
158
+ readonly parsedData: {
159
+ readonly [x: string]: any;
160
+ } | {
161
+ readonly [x: string]: any;
162
+ };
163
+ })[];
164
+ readonly total: number;
165
+ }>;
166
+ readonly getContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
167
+ params: z.ZodObject<{
168
+ typeSlug: z.ZodString;
169
+ id: z.ZodString;
170
+ }, z.core.$strip>;
171
+ requireRequest: true;
172
+ } & {
173
+ method: "GET";
174
+ } & {
175
+ query: better_call.StandardSchemaV1<{
176
+ view?: "content" | undefined;
177
+ fields?: unknown;
178
+ }, {
179
+ view?: "content" | undefined;
180
+ fields?: unknown;
181
+ }>;
182
+ }, (Omit<Pick<{
183
+ contentType?: {
184
+ createdAt: string;
185
+ updatedAt: string;
186
+ id: string;
187
+ name: string;
188
+ slug: string;
189
+ description?: string | undefined;
190
+ jsonSchema: string;
191
+ fieldConfig?: string | undefined;
192
+ autoFormVersion?: number | undefined;
193
+ } | undefined;
194
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
195
+ createdAt: string;
196
+ updatedAt: string;
197
+ id: string;
198
+ slug: string;
199
+ contentTypeId: string;
200
+ data: string;
201
+ authorId?: string | undefined;
202
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
203
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
204
+ }) | {
205
+ readonly id: string;
206
+ readonly slug: string;
207
+ readonly createdAt: string;
208
+ readonly updatedAt: string;
209
+ readonly parsedData: {
210
+ readonly [x: string]: any;
211
+ };
212
+ }>;
213
+ readonly createContentItem: better_call.StrictEndpoint<"/content/:typeSlug", {
214
+ params: z.ZodObject<{
215
+ typeSlug: z.ZodString;
216
+ }, z.core.$strip>;
217
+ requireRequest: true;
218
+ } & {
219
+ method: "POST";
220
+ body: better_call.StandardSchemaV1<{
221
+ slug: string;
222
+ data: unknown;
223
+ }, {
224
+ slug: string;
225
+ data: unknown;
226
+ }>;
227
+ }, {
228
+ readonly contentType?: {
229
+ readonly createdAt: string;
230
+ readonly updatedAt: string;
231
+ readonly id: string;
232
+ readonly name: string;
233
+ readonly slug: string;
234
+ readonly description?: string | undefined;
235
+ readonly jsonSchema: string;
236
+ readonly fieldConfig?: string | undefined;
237
+ readonly autoFormVersion?: number | undefined;
238
+ } | undefined;
239
+ readonly parsedData: {
240
+ readonly [x: string]: any;
241
+ };
242
+ readonly createdAt: string;
243
+ readonly updatedAt: string;
244
+ readonly id: string;
245
+ readonly slug: string;
246
+ readonly contentTypeId: string;
247
+ readonly data: string;
248
+ readonly authorId?: string | undefined;
249
+ }>;
250
+ readonly updateContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
251
+ params: z.ZodObject<{
252
+ typeSlug: z.ZodString;
253
+ id: z.ZodString;
254
+ }, z.core.$strip>;
255
+ requireRequest: true;
256
+ } & {
257
+ method: "PUT";
258
+ body: better_call.StandardSchemaV1<{
259
+ slug?: string | undefined;
260
+ data?: unknown;
261
+ }, {
262
+ slug?: string | undefined;
263
+ data?: unknown;
264
+ }>;
265
+ }, {
266
+ readonly contentType?: {
267
+ readonly createdAt: string;
268
+ readonly updatedAt: string;
269
+ readonly id: string;
270
+ readonly name: string;
271
+ readonly slug: string;
272
+ readonly description?: string | undefined;
273
+ readonly jsonSchema: string;
274
+ readonly fieldConfig?: string | undefined;
275
+ readonly autoFormVersion?: number | undefined;
276
+ } | undefined;
277
+ readonly parsedData: {
278
+ readonly [x: string]: any;
279
+ };
280
+ readonly createdAt: string;
281
+ readonly updatedAt: string;
282
+ readonly id: string;
283
+ readonly slug: string;
284
+ readonly contentTypeId: string;
285
+ readonly data: string;
286
+ readonly authorId?: string | undefined;
287
+ }>;
288
+ readonly deleteContentItem: better_call.StrictEndpoint<"/content/:typeSlug/:id", {
289
+ params: z.ZodObject<{
290
+ typeSlug: z.ZodString;
291
+ id: z.ZodString;
292
+ }, z.core.$strip>;
293
+ requireRequest: true;
294
+ } & {
295
+ method: "DELETE";
296
+ body: better_call.StandardSchemaV1<unknown, unknown>;
297
+ }, {
298
+ readonly success: true;
299
+ }>;
300
+ readonly getContentItemPopulated: better_call.StrictEndpoint<"/content/:typeSlug/:id/populated", {
301
+ params: z.ZodObject<{
302
+ typeSlug: z.ZodString;
303
+ id: z.ZodString;
304
+ }, z.core.$strip>;
305
+ requireRequest: true;
306
+ } & {
307
+ method: "GET";
308
+ }, {
309
+ readonly _relations: {
310
+ readonly [x: string]: readonly {
311
+ readonly contentType?: {
312
+ readonly createdAt: string;
313
+ readonly updatedAt: string;
314
+ readonly id: string;
315
+ readonly name: string;
316
+ readonly slug: string;
317
+ readonly description?: string | undefined;
318
+ readonly jsonSchema: string;
319
+ readonly fieldConfig?: string | undefined;
320
+ readonly autoFormVersion?: number | undefined;
321
+ } | undefined;
322
+ readonly parsedData: {
323
+ readonly [x: string]: any;
324
+ };
325
+ readonly createdAt: string;
326
+ readonly updatedAt: string;
327
+ readonly id: string;
328
+ readonly slug: string;
329
+ readonly contentTypeId: string;
330
+ readonly data: string;
331
+ readonly authorId?: string | undefined;
332
+ }[];
333
+ };
334
+ readonly contentType?: {
335
+ readonly createdAt: string;
336
+ readonly updatedAt: string;
337
+ readonly id: string;
338
+ readonly name: string;
339
+ readonly slug: string;
340
+ readonly description?: string | undefined;
341
+ readonly jsonSchema: string;
342
+ readonly fieldConfig?: string | undefined;
343
+ readonly autoFormVersion?: number | undefined;
344
+ } | undefined;
345
+ readonly parsedData: {
346
+ readonly [x: string]: any;
347
+ };
348
+ readonly createdAt: string;
349
+ readonly updatedAt: string;
350
+ readonly id: string;
351
+ readonly slug: string;
352
+ readonly contentTypeId: string;
353
+ readonly data: string;
354
+ readonly authorId?: string | undefined;
355
+ }>;
356
+ readonly listContentByRelation: better_call.StrictEndpoint<"/content/:typeSlug/by-relation", {
357
+ params: z.ZodObject<{
358
+ typeSlug: z.ZodString;
359
+ }, z.core.$strip>;
360
+ requireRequest: true;
361
+ } & {
362
+ method: "GET";
363
+ } & {
364
+ query: better_call.StandardSchemaV1<{
365
+ field: string;
366
+ targetId: string;
367
+ limit?: unknown;
368
+ offset?: unknown;
369
+ view?: "content" | undefined;
370
+ fields?: unknown;
371
+ }, {
372
+ field: string;
373
+ targetId: string;
374
+ limit?: unknown;
375
+ offset?: unknown;
376
+ view?: "content" | undefined;
377
+ fields?: unknown;
378
+ }>;
379
+ }, {
380
+ items: (Omit<Pick<{
381
+ contentType?: {
382
+ createdAt: string;
383
+ updatedAt: string;
384
+ id: string;
385
+ name: string;
386
+ slug: string;
387
+ description?: string | undefined;
388
+ jsonSchema: string;
389
+ fieldConfig?: string | undefined;
390
+ autoFormVersion?: number | undefined;
391
+ } | undefined;
392
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
393
+ createdAt: string;
394
+ updatedAt: string;
395
+ id: string;
396
+ slug: string;
397
+ contentTypeId: string;
398
+ data: string;
399
+ authorId?: string | undefined;
400
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
401
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
402
+ })[];
403
+ total: number;
404
+ limit: number;
405
+ offset: number;
406
+ } | {
407
+ readonly items: readonly {
408
+ readonly id: string;
409
+ readonly slug: string;
410
+ readonly createdAt: string;
411
+ readonly updatedAt: string;
412
+ readonly parsedData: {
413
+ readonly [x: string]: any;
414
+ };
415
+ }[];
416
+ readonly total: number;
417
+ readonly limit: number;
418
+ readonly offset: number;
419
+ }>;
420
+ readonly getInverseRelations: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations", {
421
+ params: z.ZodObject<{
422
+ slug: z.ZodString;
423
+ }, z.core.$strip>;
424
+ requireRequest: true;
425
+ } & {
426
+ method: "GET";
427
+ } & {
428
+ query: better_call.StandardSchemaV1<{
429
+ itemId?: string | undefined;
430
+ }, {
431
+ itemId?: string | undefined;
432
+ }>;
433
+ }, {
434
+ readonly inverseRelations: readonly {
435
+ readonly sourceType: string;
436
+ readonly sourceTypeName: string;
437
+ readonly fieldName: string;
438
+ readonly count: number;
439
+ }[];
440
+ }>;
441
+ readonly listInverseRelationItems: better_call.StrictEndpoint<"/content-types/:slug/inverse-relations/:sourceType", {
442
+ params: z.ZodObject<{
443
+ slug: z.ZodString;
444
+ sourceType: z.ZodString;
445
+ }, z.core.$strip>;
446
+ requireRequest: true;
447
+ } & {
448
+ method: "GET";
449
+ } & {
450
+ query: better_call.StandardSchemaV1<{
451
+ itemId: string;
452
+ fieldName: string;
453
+ limit?: unknown;
454
+ offset?: unknown;
455
+ view?: "content" | undefined;
456
+ fields?: unknown;
457
+ }, {
458
+ itemId: string;
459
+ fieldName: string;
460
+ limit?: unknown;
461
+ offset?: unknown;
462
+ view?: "content" | undefined;
463
+ fields?: unknown;
464
+ }>;
465
+ }, {
466
+ items: (Omit<Pick<{
467
+ contentType?: {
468
+ createdAt: string;
469
+ updatedAt: string;
470
+ id: string;
471
+ name: string;
472
+ slug: string;
473
+ description?: string | undefined;
474
+ jsonSchema: string;
475
+ fieldConfig?: string | undefined;
476
+ autoFormVersion?: number | undefined;
477
+ } | undefined;
478
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
479
+ createdAt: string;
480
+ updatedAt: string;
481
+ id: string;
482
+ slug: string;
483
+ contentTypeId: string;
484
+ data: string;
485
+ authorId?: string | undefined;
486
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
487
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
488
+ })[];
489
+ total: number;
490
+ limit: number;
491
+ offset: number;
492
+ } | {
493
+ readonly items: readonly {
494
+ readonly id: string;
495
+ readonly slug: string;
496
+ readonly createdAt: string;
497
+ readonly updatedAt: string;
498
+ readonly parsedData: {
499
+ readonly [x: string]: any;
500
+ };
501
+ }[];
502
+ readonly total: number;
503
+ readonly limit: number;
504
+ readonly offset: number;
505
+ }>;
506
+ }, {
507
+ prefetchForRoute: CMSPrefetchForRoute;
508
+ }, {
509
+ readonly listContentTypes: _btst_stack_plugins_api.Operation<z.ZodObject<{}, z.core.$strip>, PermissionDescriptor<"cms:contentType.read", z.ZodObject<{
510
+ contentType: z.ZodOptional<z.ZodString>;
511
+ }, z.core.$strip>>, {
512
+ itemCount: number;
513
+ createdAt: string;
514
+ updatedAt: string;
515
+ id: string;
516
+ name: string;
517
+ slug: string;
518
+ description?: string | undefined;
519
+ jsonSchema: string;
520
+ fieldConfig?: string | undefined;
521
+ autoFormVersion?: number | undefined;
522
+ }[], false>;
523
+ readonly getContentTypeBySlug: _btst_stack_plugins_api.Operation<z.ZodObject<{
524
+ slug: z.ZodString;
525
+ }, z.core.$strip>, PermissionDescriptor<"cms:contentType.read", z.ZodObject<{
526
+ contentType: z.ZodOptional<z.ZodString>;
527
+ }, z.core.$strip>>, {
528
+ createdAt: string;
529
+ updatedAt: string;
530
+ id: string;
531
+ name: string;
532
+ slug: string;
533
+ description?: string | undefined;
534
+ jsonSchema: string;
535
+ fieldConfig?: string | undefined;
536
+ autoFormVersion?: number | undefined;
537
+ }, false>;
538
+ readonly listContentItems: _btst_stack_plugins_api.Operation<z.ZodObject<{
539
+ typeSlug: z.ZodString;
540
+ query: z.ZodObject<{
541
+ slug: z.ZodOptional<z.ZodString>;
542
+ search: z.ZodOptional<z.ZodString>;
543
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
544
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
545
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
546
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
547
+ }, z.core.$strip>;
548
+ }, z.core.$strip>, PermissionDescriptor<"cms:record.read", z.ZodObject<{
549
+ contentType: z.ZodString;
550
+ scope: z.ZodEnum<{
551
+ record: "record";
552
+ collection: "collection";
553
+ }>;
554
+ recordId: z.ZodOptional<z.ZodString>;
555
+ authorId: z.ZodOptional<z.ZodString>;
556
+ }, z.core.$strip>>, {
557
+ offset?: number | undefined;
558
+ limit?: number | undefined;
559
+ items: ({
560
+ contentType?: {
561
+ createdAt: string;
562
+ updatedAt: string;
563
+ id: string;
564
+ name: string;
565
+ slug: string;
566
+ description?: string | undefined;
567
+ jsonSchema: string;
568
+ fieldConfig?: string | undefined;
569
+ autoFormVersion?: number | undefined;
570
+ } | undefined;
571
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
572
+ createdAt: string;
573
+ updatedAt: string;
574
+ id: string;
575
+ slug: string;
576
+ contentTypeId: string;
577
+ data: string;
578
+ authorId?: string | undefined;
579
+ } | (Omit<Pick<{
580
+ contentType?: {
581
+ createdAt: string;
582
+ updatedAt: string;
583
+ id: string;
584
+ name: string;
585
+ slug: string;
586
+ description?: string | undefined;
587
+ jsonSchema: string;
588
+ fieldConfig?: string | undefined;
589
+ autoFormVersion?: number | undefined;
590
+ } | undefined;
591
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
592
+ createdAt: string;
593
+ updatedAt: string;
594
+ id: string;
595
+ slug: string;
596
+ contentTypeId: string;
597
+ data: string;
598
+ authorId?: string | undefined;
599
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
600
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData> | Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
601
+ }))[];
602
+ total: number;
603
+ }, false> & _btst_stack_plugins_api.OperationCallSignature<(<const TInput extends _btst_stack_plugins_api.DeepReadonly<z.input<z.ZodObject<{
604
+ typeSlug: z.ZodString;
605
+ query: z.ZodObject<{
606
+ slug: z.ZodOptional<z.ZodString>;
607
+ search: z.ZodOptional<z.ZodString>;
608
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
609
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
610
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
611
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
612
+ }, z.core.$strip>;
613
+ }, z.core.$strip>>>>(input: TInput) => Promise<_btst_stack_plugins_api.DeepReadonly<{
614
+ items: (TInput["query"] extends infer T ? T extends TInput["query"] ? T extends {
615
+ view: "content";
616
+ } ? Omit<Pick<{
617
+ contentType?: {
618
+ createdAt: string;
619
+ updatedAt: string;
620
+ id: string;
621
+ name: string;
622
+ slug: string;
623
+ description?: string | undefined;
624
+ jsonSchema: string;
625
+ fieldConfig?: string | undefined;
626
+ autoFormVersion?: number | undefined;
627
+ } | undefined;
628
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
629
+ createdAt: string;
630
+ updatedAt: string;
631
+ id: string;
632
+ slug: string;
633
+ contentTypeId: string;
634
+ data: string;
635
+ authorId?: string | undefined;
636
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
637
+ parsedData: T extends infer T_1 ? T_1 extends T ? T_1 extends {
638
+ fields?: infer TFields extends CMSContentFields;
639
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData> : never : never;
640
+ } : T extends {
641
+ view?: undefined;
642
+ } ? {
643
+ contentType?: {
644
+ createdAt: string;
645
+ updatedAt: string;
646
+ id: string;
647
+ name: string;
648
+ slug: string;
649
+ description?: string | undefined;
650
+ jsonSchema: string;
651
+ fieldConfig?: string | undefined;
652
+ autoFormVersion?: number | undefined;
653
+ } | undefined;
654
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
655
+ createdAt: string;
656
+ updatedAt: string;
657
+ id: string;
658
+ slug: string;
659
+ contentTypeId: string;
660
+ data: string;
661
+ authorId?: string | undefined;
662
+ } : "view" extends keyof T ? {
663
+ contentType?: {
664
+ createdAt: string;
665
+ updatedAt: string;
666
+ id: string;
667
+ name: string;
668
+ slug: string;
669
+ description?: string | undefined;
670
+ jsonSchema: string;
671
+ fieldConfig?: string | undefined;
672
+ autoFormVersion?: number | undefined;
673
+ } | undefined;
674
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
675
+ createdAt: string;
676
+ updatedAt: string;
677
+ id: string;
678
+ slug: string;
679
+ contentTypeId: string;
680
+ data: string;
681
+ authorId?: string | undefined;
682
+ } | (Omit<Pick<{
683
+ contentType?: {
684
+ createdAt: string;
685
+ updatedAt: string;
686
+ id: string;
687
+ name: string;
688
+ slug: string;
689
+ description?: string | undefined;
690
+ jsonSchema: string;
691
+ fieldConfig?: string | undefined;
692
+ autoFormVersion?: number | undefined;
693
+ } | undefined;
694
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
695
+ createdAt: string;
696
+ updatedAt: string;
697
+ id: string;
698
+ slug: string;
699
+ contentTypeId: string;
700
+ data: string;
701
+ authorId?: string | undefined;
702
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
703
+ parsedData: T extends {
704
+ fields?: infer TFields extends CMSContentFields;
705
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData>;
706
+ }) : {
707
+ contentType?: {
708
+ createdAt: string;
709
+ updatedAt: string;
710
+ id: string;
711
+ name: string;
712
+ slug: string;
713
+ description?: string | undefined;
714
+ jsonSchema: string;
715
+ fieldConfig?: string | undefined;
716
+ autoFormVersion?: number | undefined;
717
+ } | undefined;
718
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
719
+ createdAt: string;
720
+ updatedAt: string;
721
+ id: string;
722
+ slug: string;
723
+ contentTypeId: string;
724
+ data: string;
725
+ authorId?: string | undefined;
726
+ } : never : never)[];
727
+ total: number;
728
+ limit: number;
729
+ offset: number;
730
+ }>>)>;
731
+ readonly getContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
732
+ typeSlug: z.ZodString;
733
+ id: z.ZodString;
734
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
735
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
736
+ }, z.core.$strip>, PermissionDescriptor<"cms:record.read", z.ZodObject<{
737
+ contentType: z.ZodString;
738
+ scope: z.ZodEnum<{
739
+ record: "record";
740
+ collection: "collection";
741
+ }>;
742
+ recordId: z.ZodOptional<z.ZodString>;
743
+ authorId: z.ZodOptional<z.ZodString>;
744
+ }, z.core.$strip>>, Omit<Pick<{
745
+ contentType?: {
746
+ createdAt: string;
747
+ updatedAt: string;
748
+ id: string;
749
+ name: string;
750
+ slug: string;
751
+ description?: string | undefined;
752
+ jsonSchema: string;
753
+ fieldConfig?: string | undefined;
754
+ autoFormVersion?: number | undefined;
755
+ } | undefined;
756
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
757
+ createdAt: string;
758
+ updatedAt: string;
759
+ id: string;
760
+ slug: string;
761
+ contentTypeId: string;
762
+ data: string;
763
+ authorId?: string | undefined;
764
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
765
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
766
+ }, false> & _btst_stack_plugins_api.OperationCallSignature<(<const TInput extends _btst_stack_plugins_api.DeepReadonly<z.input<z.ZodObject<{
767
+ typeSlug: z.ZodString;
768
+ id: z.ZodString;
769
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
770
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
771
+ }, z.core.$strip>>>>(input: TInput) => Promise<_btst_stack_plugins_api.DeepReadonly<TInput extends {
772
+ view: "content";
773
+ } ? Omit<Pick<{
774
+ contentType?: {
775
+ createdAt: string;
776
+ updatedAt: string;
777
+ id: string;
778
+ name: string;
779
+ slug: string;
780
+ description?: string | undefined;
781
+ jsonSchema: string;
782
+ fieldConfig?: string | undefined;
783
+ autoFormVersion?: number | undefined;
784
+ } | undefined;
785
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
786
+ createdAt: string;
787
+ updatedAt: string;
788
+ id: string;
789
+ slug: string;
790
+ contentTypeId: string;
791
+ data: string;
792
+ authorId?: string | undefined;
793
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
794
+ parsedData: TInput extends infer T ? T extends TInput ? T extends {
795
+ fields?: infer TFields extends CMSContentFields;
796
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData> : never : never;
797
+ } : TInput extends {
798
+ view?: undefined;
799
+ } ? {
800
+ contentType?: {
801
+ createdAt: string;
802
+ updatedAt: string;
803
+ id: string;
804
+ name: string;
805
+ slug: string;
806
+ description?: string | undefined;
807
+ jsonSchema: string;
808
+ fieldConfig?: string | undefined;
809
+ autoFormVersion?: number | undefined;
810
+ } | undefined;
811
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
812
+ createdAt: string;
813
+ updatedAt: string;
814
+ id: string;
815
+ slug: string;
816
+ contentTypeId: string;
817
+ data: string;
818
+ authorId?: string | undefined;
819
+ } : "view" extends keyof TInput ? {
820
+ contentType?: {
821
+ createdAt: string;
822
+ updatedAt: string;
823
+ id: string;
824
+ name: string;
825
+ slug: string;
826
+ description?: string | undefined;
827
+ jsonSchema: string;
828
+ fieldConfig?: string | undefined;
829
+ autoFormVersion?: number | undefined;
830
+ } | undefined;
831
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
832
+ createdAt: string;
833
+ updatedAt: string;
834
+ id: string;
835
+ slug: string;
836
+ contentTypeId: string;
837
+ data: string;
838
+ authorId?: string | undefined;
839
+ } | (Omit<Pick<{
840
+ contentType?: {
841
+ createdAt: string;
842
+ updatedAt: string;
843
+ id: string;
844
+ name: string;
845
+ slug: string;
846
+ description?: string | undefined;
847
+ jsonSchema: string;
848
+ fieldConfig?: string | undefined;
849
+ autoFormVersion?: number | undefined;
850
+ } | undefined;
851
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
852
+ createdAt: string;
853
+ updatedAt: string;
854
+ id: string;
855
+ slug: string;
856
+ contentTypeId: string;
857
+ data: string;
858
+ authorId?: string | undefined;
859
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
860
+ parsedData: TInput extends {
861
+ fields?: infer TFields extends CMSContentFields;
862
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData>;
863
+ }) : {
864
+ contentType?: {
865
+ createdAt: string;
866
+ updatedAt: string;
867
+ id: string;
868
+ name: string;
869
+ slug: string;
870
+ description?: string | undefined;
871
+ jsonSchema: string;
872
+ fieldConfig?: string | undefined;
873
+ autoFormVersion?: number | undefined;
874
+ } | undefined;
875
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
876
+ createdAt: string;
877
+ updatedAt: string;
878
+ id: string;
879
+ slug: string;
880
+ contentTypeId: string;
881
+ data: string;
882
+ authorId?: string | undefined;
883
+ }>>)>;
884
+ readonly createContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
885
+ typeSlug: z.ZodString;
886
+ body: z.ZodObject<{
887
+ slug: z.ZodString;
888
+ data: z.ZodType<Record<string, any>, unknown, z.core.$ZodTypeInternals<Record<string, any>, unknown>>;
889
+ }, z.core.$strip>;
890
+ }, z.core.$strip>, PermissionDescriptor<"cms:record.create", z.ZodObject<{
891
+ contentType: z.ZodString;
892
+ }, z.core.$strip>>, {
893
+ contentType?: {
894
+ createdAt: string;
895
+ updatedAt: string;
896
+ id: string;
897
+ name: string;
898
+ slug: string;
899
+ description?: string | undefined;
900
+ jsonSchema: string;
901
+ fieldConfig?: string | undefined;
902
+ autoFormVersion?: number | undefined;
903
+ } | undefined;
904
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
905
+ createdAt: string;
906
+ updatedAt: string;
907
+ id: string;
908
+ slug: string;
909
+ contentTypeId: string;
910
+ data: string;
911
+ authorId?: string | undefined;
912
+ }, false>;
913
+ readonly updateContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
914
+ typeSlug: z.ZodString;
915
+ id: z.ZodString;
916
+ body: z.ZodObject<{
917
+ slug: z.ZodOptional<z.ZodString>;
918
+ data: z.ZodOptional<z.ZodType<Record<string, any>, unknown, z.core.$ZodTypeInternals<Record<string, any>, unknown>>>;
919
+ }, z.core.$strip>;
920
+ }, z.core.$strip>, PermissionDescriptor<"cms:record.update", z.ZodObject<{
921
+ contentType: z.ZodString;
922
+ recordId: z.ZodString;
923
+ authorId: z.ZodOptional<z.ZodString>;
924
+ }, z.core.$strip>>, {
925
+ contentType?: {
926
+ createdAt: string;
927
+ updatedAt: string;
928
+ id: string;
929
+ name: string;
930
+ slug: string;
931
+ description?: string | undefined;
932
+ jsonSchema: string;
933
+ fieldConfig?: string | undefined;
934
+ autoFormVersion?: number | undefined;
935
+ } | undefined;
936
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
937
+ createdAt: string;
938
+ updatedAt: string;
939
+ id: string;
940
+ slug: string;
941
+ contentTypeId: string;
942
+ data: string;
943
+ authorId?: string | undefined;
944
+ }, false>;
945
+ readonly deleteContentItem: _btst_stack_plugins_api.Operation<z.ZodObject<{
946
+ typeSlug: z.ZodString;
947
+ id: z.ZodString;
948
+ }, z.core.$strip>, PermissionDescriptor<"cms:record.delete", z.ZodObject<{
949
+ contentType: z.ZodString;
950
+ recordId: z.ZodString;
951
+ authorId: z.ZodOptional<z.ZodString>;
952
+ }, z.core.$strip>>, {
953
+ readonly success: true;
954
+ }, false>;
955
+ readonly getContentItemPopulated: _btst_stack_plugins_api.Operation<z.ZodObject<{
956
+ typeSlug: z.ZodString;
957
+ id: z.ZodString;
958
+ }, z.core.$strip>, PermissionDescriptor<"cms:record.read", z.ZodObject<{
959
+ contentType: z.ZodString;
960
+ scope: z.ZodEnum<{
961
+ record: "record";
962
+ collection: "collection";
963
+ }>;
964
+ recordId: z.ZodOptional<z.ZodString>;
965
+ authorId: z.ZodOptional<z.ZodString>;
966
+ }, z.core.$strip>>, {
967
+ _relations: {
968
+ [k: string]: {
969
+ contentType?: {
970
+ createdAt: string;
971
+ updatedAt: string;
972
+ id: string;
973
+ name: string;
974
+ slug: string;
975
+ description?: string | undefined;
976
+ jsonSchema: string;
977
+ fieldConfig?: string | undefined;
978
+ autoFormVersion?: number | undefined;
979
+ } | undefined;
980
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
981
+ createdAt: string;
982
+ updatedAt: string;
983
+ id: string;
984
+ slug: string;
985
+ contentTypeId: string;
986
+ data: string;
987
+ authorId?: string | undefined;
988
+ }[];
989
+ };
990
+ contentType?: {
991
+ createdAt: string;
992
+ updatedAt: string;
993
+ id: string;
994
+ name: string;
995
+ slug: string;
996
+ description?: string | undefined;
997
+ jsonSchema: string;
998
+ fieldConfig?: string | undefined;
999
+ autoFormVersion?: number | undefined;
1000
+ } | undefined;
1001
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1002
+ createdAt: string;
1003
+ updatedAt: string;
1004
+ id: string;
1005
+ slug: string;
1006
+ contentTypeId: string;
1007
+ data: string;
1008
+ authorId?: string | undefined;
1009
+ }, false>;
1010
+ readonly listContentByRelation: _btst_stack_plugins_api.Operation<z.ZodObject<{
1011
+ typeSlug: z.ZodString;
1012
+ query: z.ZodObject<{
1013
+ field: z.ZodString;
1014
+ targetId: z.ZodString;
1015
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1016
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1017
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
1018
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
1019
+ }, z.core.$strip>;
1020
+ }, z.core.$strip>, PermissionDescriptor<"cms:record.read", z.ZodObject<{
1021
+ contentType: z.ZodString;
1022
+ scope: z.ZodEnum<{
1023
+ record: "record";
1024
+ collection: "collection";
1025
+ }>;
1026
+ recordId: z.ZodOptional<z.ZodString>;
1027
+ authorId: z.ZodOptional<z.ZodString>;
1028
+ }, z.core.$strip>>, {
1029
+ items: (Omit<Pick<{
1030
+ contentType?: {
1031
+ createdAt: string;
1032
+ updatedAt: string;
1033
+ id: string;
1034
+ name: string;
1035
+ slug: string;
1036
+ description?: string | undefined;
1037
+ jsonSchema: string;
1038
+ fieldConfig?: string | undefined;
1039
+ autoFormVersion?: number | undefined;
1040
+ } | undefined;
1041
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1042
+ createdAt: string;
1043
+ updatedAt: string;
1044
+ id: string;
1045
+ slug: string;
1046
+ contentTypeId: string;
1047
+ data: string;
1048
+ authorId?: string | undefined;
1049
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1050
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
1051
+ })[];
1052
+ total: number;
1053
+ limit: number;
1054
+ offset: number;
1055
+ }, false> & _btst_stack_plugins_api.OperationCallSignature<(<const TInput extends _btst_stack_plugins_api.DeepReadonly<z.input<z.ZodObject<{
1056
+ typeSlug: z.ZodString;
1057
+ query: z.ZodObject<{
1058
+ field: z.ZodString;
1059
+ targetId: z.ZodString;
1060
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1061
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1062
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
1063
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
1064
+ }, z.core.$strip>;
1065
+ }, z.core.$strip>>>>(input: TInput) => Promise<{
1066
+ readonly items: readonly _btst_stack_plugins_api.DeepReadonly<TInput["query"] extends infer T ? T extends TInput["query"] ? T extends {
1067
+ view: "content";
1068
+ } ? Omit<Pick<{
1069
+ contentType?: {
1070
+ createdAt: string;
1071
+ updatedAt: string;
1072
+ id: string;
1073
+ name: string;
1074
+ slug: string;
1075
+ description?: string | undefined;
1076
+ jsonSchema: string;
1077
+ fieldConfig?: string | undefined;
1078
+ autoFormVersion?: number | undefined;
1079
+ } | undefined;
1080
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1081
+ createdAt: string;
1082
+ updatedAt: string;
1083
+ id: string;
1084
+ slug: string;
1085
+ contentTypeId: string;
1086
+ data: string;
1087
+ authorId?: string | undefined;
1088
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1089
+ parsedData: T extends infer T_1 ? T_1 extends T ? T_1 extends {
1090
+ fields?: infer TFields extends CMSContentFields;
1091
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData> : never : never;
1092
+ } : T extends {
1093
+ view?: undefined;
1094
+ } ? {
1095
+ contentType?: {
1096
+ createdAt: string;
1097
+ updatedAt: string;
1098
+ id: string;
1099
+ name: string;
1100
+ slug: string;
1101
+ description?: string | undefined;
1102
+ jsonSchema: string;
1103
+ fieldConfig?: string | undefined;
1104
+ autoFormVersion?: number | undefined;
1105
+ } | undefined;
1106
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1107
+ createdAt: string;
1108
+ updatedAt: string;
1109
+ id: string;
1110
+ slug: string;
1111
+ contentTypeId: string;
1112
+ data: string;
1113
+ authorId?: string | undefined;
1114
+ } : "view" extends keyof T ? {
1115
+ contentType?: {
1116
+ createdAt: string;
1117
+ updatedAt: string;
1118
+ id: string;
1119
+ name: string;
1120
+ slug: string;
1121
+ description?: string | undefined;
1122
+ jsonSchema: string;
1123
+ fieldConfig?: string | undefined;
1124
+ autoFormVersion?: number | undefined;
1125
+ } | undefined;
1126
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1127
+ createdAt: string;
1128
+ updatedAt: string;
1129
+ id: string;
1130
+ slug: string;
1131
+ contentTypeId: string;
1132
+ data: string;
1133
+ authorId?: string | undefined;
1134
+ } | (Omit<Pick<{
1135
+ contentType?: {
1136
+ createdAt: string;
1137
+ updatedAt: string;
1138
+ id: string;
1139
+ name: string;
1140
+ slug: string;
1141
+ description?: string | undefined;
1142
+ jsonSchema: string;
1143
+ fieldConfig?: string | undefined;
1144
+ autoFormVersion?: number | undefined;
1145
+ } | undefined;
1146
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1147
+ createdAt: string;
1148
+ updatedAt: string;
1149
+ id: string;
1150
+ slug: string;
1151
+ contentTypeId: string;
1152
+ data: string;
1153
+ authorId?: string | undefined;
1154
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1155
+ parsedData: T extends {
1156
+ fields?: infer TFields extends CMSContentFields;
1157
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData>;
1158
+ }) : {
1159
+ contentType?: {
1160
+ createdAt: string;
1161
+ updatedAt: string;
1162
+ id: string;
1163
+ name: string;
1164
+ slug: string;
1165
+ description?: string | undefined;
1166
+ jsonSchema: string;
1167
+ fieldConfig?: string | undefined;
1168
+ autoFormVersion?: number | undefined;
1169
+ } | undefined;
1170
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1171
+ createdAt: string;
1172
+ updatedAt: string;
1173
+ id: string;
1174
+ slug: string;
1175
+ contentTypeId: string;
1176
+ data: string;
1177
+ authorId?: string | undefined;
1178
+ } : never : never>[];
1179
+ readonly total: number;
1180
+ readonly limit: number;
1181
+ readonly offset: number;
1182
+ }>)>;
1183
+ readonly getInverseRelations: _btst_stack_plugins_api.Operation<z.ZodObject<{
1184
+ slug: z.ZodString;
1185
+ query: z.ZodObject<{
1186
+ itemId: z.ZodOptional<z.ZodString>;
1187
+ }, z.core.$strip>;
1188
+ }, z.core.$strip>, PermissionDescriptor<"cms:contentType.read", z.ZodObject<{
1189
+ contentType: z.ZodOptional<z.ZodString>;
1190
+ }, z.core.$strip>>, {
1191
+ inverseRelations: {
1192
+ sourceType: string;
1193
+ sourceTypeName: string;
1194
+ fieldName: string;
1195
+ count: number;
1196
+ }[];
1197
+ }, false>;
1198
+ readonly listInverseRelationItems: _btst_stack_plugins_api.Operation<z.ZodObject<{
1199
+ slug: z.ZodString;
1200
+ sourceType: z.ZodString;
1201
+ query: z.ZodObject<{
1202
+ itemId: z.ZodString;
1203
+ fieldName: z.ZodString;
1204
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1205
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1206
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
1207
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
1208
+ }, z.core.$strip>;
1209
+ }, z.core.$strip>, PermissionDescriptor<"cms:record.read", z.ZodObject<{
1210
+ contentType: z.ZodString;
1211
+ scope: z.ZodEnum<{
1212
+ record: "record";
1213
+ collection: "collection";
1214
+ }>;
1215
+ recordId: z.ZodOptional<z.ZodString>;
1216
+ authorId: z.ZodOptional<z.ZodString>;
1217
+ }, z.core.$strip>>, {
1218
+ items: (Omit<Pick<{
1219
+ contentType?: {
1220
+ createdAt: string;
1221
+ updatedAt: string;
1222
+ id: string;
1223
+ name: string;
1224
+ slug: string;
1225
+ description?: string | undefined;
1226
+ jsonSchema: string;
1227
+ fieldConfig?: string | undefined;
1228
+ autoFormVersion?: number | undefined;
1229
+ } | undefined;
1230
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1231
+ createdAt: string;
1232
+ updatedAt: string;
1233
+ id: string;
1234
+ slug: string;
1235
+ contentTypeId: string;
1236
+ data: string;
1237
+ authorId?: string | undefined;
1238
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1239
+ parsedData: Partial<Record<string, _btst_stack_plugins_api.OperationData>>;
1240
+ })[];
1241
+ total: number;
1242
+ limit: number;
1243
+ offset: number;
1244
+ }, false> & _btst_stack_plugins_api.OperationCallSignature<(<const TInput extends _btst_stack_plugins_api.DeepReadonly<z.input<z.ZodObject<{
1245
+ slug: z.ZodString;
1246
+ sourceType: z.ZodString;
1247
+ query: z.ZodObject<{
1248
+ itemId: z.ZodString;
1249
+ fieldName: z.ZodString;
1250
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1251
+ offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1252
+ view: z.ZodOptional<z.ZodLiteral<"content">>;
1253
+ fields: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
1254
+ }, z.core.$strip>;
1255
+ }, z.core.$strip>>>>(input: TInput) => Promise<{
1256
+ readonly items: readonly _btst_stack_plugins_api.DeepReadonly<TInput["query"] extends infer T ? T extends TInput["query"] ? T extends {
1257
+ view: "content";
1258
+ } ? Omit<Pick<{
1259
+ contentType?: {
1260
+ createdAt: string;
1261
+ updatedAt: string;
1262
+ id: string;
1263
+ name: string;
1264
+ slug: string;
1265
+ description?: string | undefined;
1266
+ jsonSchema: string;
1267
+ fieldConfig?: string | undefined;
1268
+ autoFormVersion?: number | undefined;
1269
+ } | undefined;
1270
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1271
+ createdAt: string;
1272
+ updatedAt: string;
1273
+ id: string;
1274
+ slug: string;
1275
+ contentTypeId: string;
1276
+ data: string;
1277
+ authorId?: string | undefined;
1278
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1279
+ parsedData: T extends infer T_1 ? T_1 extends T ? T_1 extends {
1280
+ fields?: infer TFields extends CMSContentFields;
1281
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData> : never : never;
1282
+ } : T extends {
1283
+ view?: undefined;
1284
+ } ? {
1285
+ contentType?: {
1286
+ createdAt: string;
1287
+ updatedAt: string;
1288
+ id: string;
1289
+ name: string;
1290
+ slug: string;
1291
+ description?: string | undefined;
1292
+ jsonSchema: string;
1293
+ fieldConfig?: string | undefined;
1294
+ autoFormVersion?: number | undefined;
1295
+ } | undefined;
1296
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1297
+ createdAt: string;
1298
+ updatedAt: string;
1299
+ id: string;
1300
+ slug: string;
1301
+ contentTypeId: string;
1302
+ data: string;
1303
+ authorId?: string | undefined;
1304
+ } : "view" extends keyof T ? {
1305
+ contentType?: {
1306
+ createdAt: string;
1307
+ updatedAt: string;
1308
+ id: string;
1309
+ name: string;
1310
+ slug: string;
1311
+ description?: string | undefined;
1312
+ jsonSchema: string;
1313
+ fieldConfig?: string | undefined;
1314
+ autoFormVersion?: number | undefined;
1315
+ } | undefined;
1316
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1317
+ createdAt: string;
1318
+ updatedAt: string;
1319
+ id: string;
1320
+ slug: string;
1321
+ contentTypeId: string;
1322
+ data: string;
1323
+ authorId?: string | undefined;
1324
+ } | (Omit<Pick<{
1325
+ contentType?: {
1326
+ createdAt: string;
1327
+ updatedAt: string;
1328
+ id: string;
1329
+ name: string;
1330
+ slug: string;
1331
+ description?: string | undefined;
1332
+ jsonSchema: string;
1333
+ fieldConfig?: string | undefined;
1334
+ autoFormVersion?: number | undefined;
1335
+ } | undefined;
1336
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1337
+ createdAt: string;
1338
+ updatedAt: string;
1339
+ id: string;
1340
+ slug: string;
1341
+ contentTypeId: string;
1342
+ data: string;
1343
+ authorId?: string | undefined;
1344
+ }, "id" | "slug" | "createdAt" | "updatedAt" | "parsedData">, "parsedData"> & {
1345
+ parsedData: T extends {
1346
+ fields?: infer TFields extends CMSContentFields;
1347
+ } ? CMSSelectedData<Record<string, unknown>, TFields> : Record<string, _btst_stack_plugins_api.OperationData>;
1348
+ }) : {
1349
+ contentType?: {
1350
+ createdAt: string;
1351
+ updatedAt: string;
1352
+ id: string;
1353
+ name: string;
1354
+ slug: string;
1355
+ description?: string | undefined;
1356
+ jsonSchema: string;
1357
+ fieldConfig?: string | undefined;
1358
+ autoFormVersion?: number | undefined;
1359
+ } | undefined;
1360
+ parsedData: Record<string, _btst_stack_plugins_api.OperationData>;
1361
+ createdAt: string;
1362
+ updatedAt: string;
1363
+ id: string;
1364
+ slug: string;
1365
+ contentTypeId: string;
1366
+ data: string;
1367
+ authorId?: string | undefined;
1368
+ } : never : never>[];
1369
+ readonly total: number;
1370
+ readonly limit: number;
1371
+ readonly offset: number;
1372
+ }>)>;
1373
+ }, "cms">;
1374
+ type CMSApiRouter = ReturnType<ReturnType<typeof cmsBackendPlugin>["routes"]>;
1375
+
1376
+ /**
1377
+ * Internal query key constants for the CMS plugin.
1378
+ * Shared between query-keys.ts (HTTP path) and prefetchForRoute (DB path)
1379
+ * to prevent key drift between SSR loaders and SSG prefetching.
1380
+ */
1381
+
1382
+ interface ContentListDiscriminator {
1383
+ typeSlug: string;
1384
+ limit: number;
1385
+ offset: number;
1386
+ search: string | undefined;
1387
+ view?: "content";
1388
+ fields?: readonly string[];
1389
+ }
1390
+ /** Full query key builders — use these with queryClient.setQueryData() */
1391
+ declare const CMS_QUERY_KEYS: {
1392
+ /**
1393
+ * Key for the cmsTypes.list() query.
1394
+ * Full key: ["cmsTypes", "list", "list"]
1395
+ */
1396
+ typesList: () => readonly ["cmsTypes", "list", "list"];
1397
+ /**
1398
+ * Key for the cmsContent.list({ typeSlug, limit, offset }) query.
1399
+ * Full key: ["cmsContent", "list", { typeSlug, limit, offset, search }]
1400
+ */
1401
+ contentList: (params: {
1402
+ typeSlug: string;
1403
+ limit?: number;
1404
+ offset?: number;
1405
+ search?: string;
1406
+ view?: "content";
1407
+ fields?: readonly string[];
1408
+ }) => readonly ["cmsContent", "list", ContentListDiscriminator];
1409
+ /**
1410
+ * Key for the cmsContent.detail(typeSlug, id) query.
1411
+ * Full key: ["cmsContent", "detail", typeSlug, id]
1412
+ */
1413
+ contentDetail: (typeSlug: string, id: string, options?: CMSReadOptions) => readonly ["cmsContent", "detail", string, string, ...{
1414
+ fields?: string[] | undefined;
1415
+ view?: "content" | undefined;
1416
+ }[]];
1417
+ };
1418
+
1419
+ export { CMS_QUERY_KEYS as c, cmsBackendPlugin as d };
1420
+ export type { CMSApiRouter as C, ContentListDiscriminator as a, CMSRouteKey as b };