@btst/stack 2.11.3 → 2.11.4

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 (50) hide show
  1. package/dist/packages/stack/src/plugins/cms/api/mutations.cjs +12 -1
  2. package/dist/packages/stack/src/plugins/cms/api/mutations.mjs +12 -1
  3. package/dist/packages/stack/src/plugins/cms/api/plugin.cjs +11 -51
  4. package/dist/packages/stack/src/plugins/cms/api/plugin.mjs +3 -43
  5. package/dist/packages/stack/src/plugins/cms/api/relations.cjs +76 -0
  6. package/dist/packages/stack/src/plugins/cms/api/relations.mjs +70 -0
  7. package/dist/plugins/blog/api/index.d.cts +2 -2
  8. package/dist/plugins/blog/api/index.d.mts +2 -2
  9. package/dist/plugins/blog/api/index.d.ts +2 -2
  10. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  11. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  12. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  13. package/dist/plugins/blog/client/index.d.cts +2 -2
  14. package/dist/plugins/blog/client/index.d.mts +2 -2
  15. package/dist/plugins/blog/client/index.d.ts +2 -2
  16. package/dist/plugins/blog/query-keys.d.cts +2 -2
  17. package/dist/plugins/blog/query-keys.d.mts +2 -2
  18. package/dist/plugins/blog/query-keys.d.ts +2 -2
  19. package/dist/plugins/cms/api/index.d.cts +1 -1
  20. package/dist/plugins/cms/api/index.d.mts +1 -1
  21. package/dist/plugins/cms/api/index.d.ts +1 -1
  22. package/dist/plugins/cms/query-keys.d.cts +1 -1
  23. package/dist/plugins/cms/query-keys.d.mts +1 -1
  24. package/dist/plugins/cms/query-keys.d.ts +1 -1
  25. package/dist/plugins/kanban/api/index.d.cts +1 -1
  26. package/dist/plugins/kanban/api/index.d.mts +1 -1
  27. package/dist/plugins/kanban/api/index.d.ts +1 -1
  28. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  29. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  30. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  31. package/dist/shared/{stack.DGsFF5qb.d.cts → stack.6mEHS2WH.d.mts} +6 -6
  32. package/dist/shared/{stack.NtflNnnH.d.mts → stack.AJTXI7kw.d.cts} +6 -6
  33. package/dist/shared/{stack.CntKf20s.d.cts → stack.C1jLzFZ6.d.mts} +13 -13
  34. package/dist/shared/{stack.BQSy-NDc.d.ts → stack.DF1ewpVE.d.ts} +13 -13
  35. package/dist/shared/{stack.BX7MHi0J.d.mts → stack.DbnCLdNF.d.mts} +34 -7
  36. package/dist/shared/{stack.QrBE0Bc8.d.ts → stack.QYn-Px94.d.ts} +6 -6
  37. package/dist/shared/{stack.CLrGRIj0.d.mts → stack.XulPeAD3.d.cts} +13 -13
  38. package/dist/shared/{stack.fQjVhw5a.d.ts → stack.fXlShnhv.d.ts} +34 -7
  39. package/dist/shared/{stack.C9zoS1TN.d.cts → stack.r6HohbyX.d.cts} +34 -7
  40. package/package.json +1 -1
  41. package/src/plugins/cms/api/index.ts +1 -0
  42. package/src/plugins/cms/api/mutations.ts +48 -3
  43. package/src/plugins/cms/api/plugin.ts +11 -101
  44. package/src/plugins/cms/api/relations.ts +174 -0
  45. package/dist/shared/{stack.eq5eg1yt.d.cts → stack.B6S3cgwN.d.cts} +6 -6
  46. package/dist/shared/{stack.Sod_PZhB.d.cts → stack.BQmuNl5p.d.cts} +9 -9
  47. package/dist/shared/{stack.Sod_PZhB.d.mts → stack.BQmuNl5p.d.mts} +9 -9
  48. package/dist/shared/{stack.Sod_PZhB.d.ts → stack.BQmuNl5p.d.ts} +9 -9
  49. package/dist/shared/{stack.Dj04W2c3.d.mts → stack.Bzfx-_lq.d.mts} +6 -6
  50. package/dist/shared/{stack.CMbX8Q5C.d.ts → stack.j5SFLC1d.d.ts} +6 -6
@@ -15,7 +15,6 @@ import type {
15
15
  CMSBackendConfig,
16
16
  CMSHookContext,
17
17
  SerializedContentItemWithType,
18
- RelationConfig,
19
18
  RelationValue,
20
19
  InverseRelation,
21
20
  } from "../types";
@@ -31,6 +30,12 @@ import {
31
30
  serializeContentItemWithType,
32
31
  } from "./getters";
33
32
  import { createCMSContentItem } from "./mutations";
33
+ import {
34
+ extractRelationFields,
35
+ isExistingRelationValue,
36
+ isNewRelationValue,
37
+ syncRelations,
38
+ } from "./relations";
34
39
  import type { QueryClient } from "@tanstack/react-query";
35
40
  import { CMS_QUERY_KEYS } from "./query-key-defs";
36
41
  import { runHookWithShim } from "../../utils";
@@ -145,67 +150,9 @@ function getContentTypeZodSchema(contentType: ContentType): z.ZodTypeAny {
145
150
  }
146
151
 
147
152
  // ========== Relation Helpers ==========
148
-
149
- interface JsonSchemaProperty {
150
- fieldType?: string;
151
- relation?: RelationConfig;
152
- type?: string;
153
- items?: JsonSchemaProperty;
154
- [key: string]: unknown;
155
- }
156
-
157
- interface JsonSchemaWithProperties {
158
- properties?: Record<string, JsonSchemaProperty>;
159
- [key: string]: unknown;
160
- }
161
-
162
- /**
163
- * Extract relation field configurations from a content type's JSON Schema
164
- */
165
- function extractRelationFields(
166
- contentType: ContentType,
167
- ): Record<string, RelationConfig> {
168
- const jsonSchema = JSON.parse(
169
- contentType.jsonSchema,
170
- ) as JsonSchemaWithProperties;
171
- const properties = jsonSchema.properties || {};
172
- const relationFields: Record<string, RelationConfig> = {};
173
-
174
- for (const [fieldName, fieldSchema] of Object.entries(properties)) {
175
- if (fieldSchema.fieldType === "relation" && fieldSchema.relation) {
176
- relationFields[fieldName] = fieldSchema.relation;
177
- }
178
- }
179
-
180
- return relationFields;
181
- }
182
-
183
- /**
184
- * Check if a value is a "new" relation item (to be created)
185
- */
186
- function isNewRelationValue(
187
- value: unknown,
188
- ): value is { _new: true; data: Record<string, unknown> } {
189
- return (
190
- typeof value === "object" &&
191
- value !== null &&
192
- "_new" in value &&
193
- (value as { _new: unknown })._new === true &&
194
- "data" in value
195
- );
196
- }
197
-
198
- /**
199
- * Check if a value is an existing relation reference
200
- */
201
- function isExistingRelationValue(value: unknown): value is { id: string } {
202
- return (
203
- typeof value === "object" &&
204
- value !== null &&
205
- "id" in value &&
206
- typeof (value as { id: unknown }).id === "string"
207
- );
208
- }
153
+ // `extractRelationFields`, `isNewRelationValue`, `isExistingRelationValue`,
154
+ // and `syncRelations` live in ./relations so both this HTTP route module
155
+ // and the programmatic mutations helper can share them.
209
156
 
210
157
  /**
211
158
  * Process relation fields in content data:
@@ -363,44 +310,6 @@ async function createRelatedItem(
363
310
  return item;
364
311
  }
365
312
 
366
- /**
367
- * Sync relations in the junction table for a content item.
368
- *
369
- * Only updates relations for fields explicitly present in relationIds.
370
- * Fields not in relationIds are left unchanged - this preserves existing
371
- * relations during partial updates.
372
- */
373
- async function syncRelations(
374
- adapter: Adapter,
375
- sourceId: string,
376
- relationIds: Record<string, string[]>,
377
- ): Promise<void> {
378
- // Only sync fields that are explicitly included in relationIds
379
- for (const [fieldName, targetIds] of Object.entries(relationIds)) {
380
- // Delete existing relations for this specific field only
381
- await adapter.delete({
382
- model: "contentRelation",
383
- where: [
384
- { field: "sourceId", value: sourceId, operator: "eq" as const },
385
- { field: "fieldName", value: fieldName, operator: "eq" as const },
386
- ],
387
- });
388
-
389
- // Create new relations for this field
390
- for (const targetId of targetIds) {
391
- await adapter.create<ContentRelation>({
392
- model: "contentRelation",
393
- data: {
394
- sourceId,
395
- targetId,
396
- fieldName,
397
- createdAt: new Date(),
398
- },
399
- });
400
- }
401
- }
402
- }
403
-
404
313
  /**
405
314
  * Populate relations for a content item by fetching related items
406
315
  */
@@ -575,9 +484,10 @@ export const cmsBackendPlugin = (config: CMSBackendConfig) => {
575
484
  createContentItem: async (
576
485
  typeSlug: string,
577
486
  input: Parameters<typeof createCMSContentItem>[2],
487
+ options?: Parameters<typeof createCMSContentItem>[3],
578
488
  ) => {
579
489
  await ensureSynced(adapter);
580
- return createCMSContentItem(adapter, typeSlug, input);
490
+ return createCMSContentItem(adapter, typeSlug, input, options);
581
491
  },
582
492
  }),
583
493
 
@@ -0,0 +1,174 @@
1
+ import type { DBAdapter as Adapter } from "@btst/db";
2
+ import type {
3
+ ContentType,
4
+ ContentRelation,
5
+ RelationConfig,
6
+ RelationValue,
7
+ } from "../types";
8
+
9
+ /**
10
+ * Shape of a property inside a content type's stored JSON Schema.
11
+ * Relation fields carry `fieldType: "relation"` and a `relation` descriptor.
12
+ */
13
+ interface JsonSchemaProperty {
14
+ fieldType?: string;
15
+ relation?: RelationConfig;
16
+ type?: string;
17
+ items?: JsonSchemaProperty;
18
+ [key: string]: unknown;
19
+ }
20
+
21
+ interface JsonSchemaWithProperties {
22
+ properties?: Record<string, JsonSchemaProperty>;
23
+ [key: string]: unknown;
24
+ }
25
+
26
+ /**
27
+ * Extract relation field configurations from a content type's JSON Schema.
28
+ *
29
+ * Returns a map of field name -> RelationConfig for every field declared
30
+ * with `fieldType: "relation"` and a populated `relation` descriptor.
31
+ */
32
+ export function extractRelationFields(
33
+ contentType: ContentType,
34
+ ): Record<string, RelationConfig> {
35
+ const jsonSchema = JSON.parse(
36
+ contentType.jsonSchema,
37
+ ) as JsonSchemaWithProperties;
38
+ const properties = jsonSchema.properties || {};
39
+ const relationFields: Record<string, RelationConfig> = {};
40
+
41
+ for (const [fieldName, fieldSchema] of Object.entries(properties)) {
42
+ if (fieldSchema.fieldType === "relation" && fieldSchema.relation) {
43
+ relationFields[fieldName] = fieldSchema.relation;
44
+ }
45
+ }
46
+
47
+ return relationFields;
48
+ }
49
+
50
+ /**
51
+ * Type guard: value is a `{ _new: true, data: ... }` descriptor used by the
52
+ * HTTP endpoints to request inline creation of a related item on save.
53
+ */
54
+ export function isNewRelationValue(
55
+ value: unknown,
56
+ ): value is { _new: true; data: Record<string, unknown> } {
57
+ return (
58
+ typeof value === "object" &&
59
+ value !== null &&
60
+ "_new" in value &&
61
+ (value as { _new: unknown })._new === true &&
62
+ "data" in value
63
+ );
64
+ }
65
+
66
+ /**
67
+ * Type guard: value is an existing relation reference (`{ id: string }`).
68
+ */
69
+ export function isExistingRelationValue(
70
+ value: unknown,
71
+ ): value is { id: string } {
72
+ return (
73
+ typeof value === "object" &&
74
+ value !== null &&
75
+ "id" in value &&
76
+ typeof (value as { id: unknown }).id === "string"
77
+ );
78
+ }
79
+
80
+ /**
81
+ * Collect relation target IDs out of a content item's data payload,
82
+ * grouped by relation field name.
83
+ *
84
+ * Only processes fields that are:
85
+ * - present in `data`
86
+ * - declared as relations in `relationFields`
87
+ * - hold existing `{ id }` references (or arrays of them)
88
+ *
89
+ * Unlike `processRelationsInData` in the HTTP route, this does NOT create
90
+ * inline `_new` items — callers passing `_new` values will have them
91
+ * silently ignored. Programmatic callers (seeds, imports) are expected to
92
+ * supply pre-created IDs.
93
+ *
94
+ * Returns a map of `{ fieldName: targetIds[] }` ready to hand to
95
+ * {@link syncRelations}.
96
+ */
97
+ export function collectExistingRelationIds(
98
+ data: Record<string, unknown>,
99
+ relationFields: Record<string, RelationConfig>,
100
+ ): Record<string, string[]> {
101
+ const relationIds: Record<string, string[]> = {};
102
+
103
+ for (const [fieldName, relationConfig] of Object.entries(relationFields)) {
104
+ if (!(fieldName in data)) continue;
105
+
106
+ const fieldValue = data[fieldName];
107
+ if (!fieldValue) {
108
+ relationIds[fieldName] = [];
109
+ continue;
110
+ }
111
+
112
+ const ids: string[] = [];
113
+
114
+ if (relationConfig.type === "belongsTo") {
115
+ const value = fieldValue as RelationValue;
116
+ if (isExistingRelationValue(value)) {
117
+ ids.push(value.id);
118
+ }
119
+ } else {
120
+ // hasMany / manyToMany — expect an array of { id }
121
+ const values = (
122
+ Array.isArray(fieldValue) ? fieldValue : []
123
+ ) as RelationValue[];
124
+
125
+ for (const value of values) {
126
+ if (isExistingRelationValue(value)) {
127
+ ids.push(value.id);
128
+ }
129
+ }
130
+ }
131
+
132
+ relationIds[fieldName] = ids;
133
+ }
134
+
135
+ return relationIds;
136
+ }
137
+
138
+ /**
139
+ * Sync relations in the junction table for a content item.
140
+ *
141
+ * Only updates relations for fields explicitly present in `relationIds`.
142
+ * Fields not included are left untouched — this preserves existing
143
+ * relations during partial updates.
144
+ *
145
+ * For each included field, existing junction rows (matching sourceId +
146
+ * fieldName) are deleted and replaced with the provided target IDs.
147
+ */
148
+ export async function syncRelations(
149
+ adapter: Adapter,
150
+ sourceId: string,
151
+ relationIds: Record<string, string[]>,
152
+ ): Promise<void> {
153
+ for (const [fieldName, targetIds] of Object.entries(relationIds)) {
154
+ await adapter.delete({
155
+ model: "contentRelation",
156
+ where: [
157
+ { field: "sourceId", value: sourceId, operator: "eq" as const },
158
+ { field: "fieldName", value: fieldName, operator: "eq" as const },
159
+ ],
160
+ });
161
+
162
+ for (const targetId of targetIds) {
163
+ await adapter.create<ContentRelation>({
164
+ model: "contentRelation",
165
+ data: {
166
+ sourceId,
167
+ targetId,
168
+ fieldName,
169
+ createdAt: new Date(),
170
+ },
171
+ });
172
+ }
173
+ }
174
+ }
@@ -7,12 +7,12 @@ import { QueryClient } from '@tanstack/react-query';
7
7
 
8
8
  declare const createBoardSchema: z.ZodObject<{
9
9
  description: z.ZodOptional<z.ZodString>;
10
- name: z.ZodString;
11
10
  slug: z.ZodOptional<z.ZodString>;
12
11
  ownerId: z.ZodOptional<z.ZodString>;
13
12
  organizationId: z.ZodOptional<z.ZodString>;
14
13
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
14
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
+ name: z.ZodString;
16
16
  }, z.core.$strip>;
17
17
  declare const updateBoardSchema: z.ZodObject<{
18
18
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -26,10 +26,10 @@ declare const updateBoardSchema: z.ZodObject<{
26
26
  }, z.core.$strip>;
27
27
  declare const createColumnSchema: z.ZodObject<{
28
28
  title: z.ZodString;
29
- boardId: z.ZodString;
30
29
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
31
30
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
32
31
  order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
32
+ boardId: z.ZodString;
33
33
  }, z.core.$strip>;
34
34
  declare const updateColumnSchema: z.ZodObject<{
35
35
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -360,20 +360,20 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
360
360
  method: "PUT";
361
361
  body: better_call.StandardSchemaV1<{
362
362
  description?: string | undefined;
363
- name?: string | undefined;
364
363
  slug?: string | undefined;
365
364
  ownerId?: string | undefined;
366
365
  organizationId?: string | undefined;
367
366
  createdAt?: unknown;
368
367
  updatedAt?: unknown;
368
+ name?: string | undefined;
369
369
  }, {
370
370
  description?: string | undefined;
371
- name?: string | undefined;
372
371
  slug?: string | undefined;
373
372
  ownerId?: string | undefined;
374
373
  organizationId?: string | undefined;
375
374
  createdAt?: unknown;
376
375
  updatedAt?: unknown;
376
+ name?: string | undefined;
377
377
  }>;
378
378
  }, Board>;
379
379
  readonly deleteBoard: better_call.StrictEndpoint<"/boards/:id", {} & {
@@ -402,16 +402,16 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
402
402
  method: "PUT";
403
403
  body: better_call.StandardSchemaV1<{
404
404
  title?: string | undefined;
405
- boardId?: string | undefined;
406
405
  createdAt?: unknown;
407
406
  updatedAt?: unknown;
408
407
  order?: number | undefined;
408
+ boardId?: string | undefined;
409
409
  }, {
410
410
  title?: string | undefined;
411
- boardId?: string | undefined;
412
411
  createdAt?: unknown;
413
412
  updatedAt?: unknown;
414
413
  order?: number | undefined;
414
+ boardId?: string | undefined;
415
415
  }>;
416
416
  }, Column>;
417
417
  readonly deleteColumn: better_call.StrictEndpoint<"/columns/:id", {} & {
@@ -35,15 +35,6 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- slug: z.ZodOptional<z.ZodString>;
39
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
43
- title: z.ZodString;
44
- content: z.ZodString;
45
- excerpt: z.ZodString;
46
- image: z.ZodOptional<z.ZodString>;
47
38
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
39
  name: z.ZodString;
49
40
  }, z.core.$strip>, z.ZodObject<{
@@ -51,6 +42,15 @@ declare const createPostSchema: z.ZodObject<{
51
42
  name: z.ZodString;
52
43
  slug: z.ZodString;
53
44
  }, z.core.$strip>]>>>>;
45
+ title: z.ZodString;
46
+ slug: z.ZodOptional<z.ZodString>;
47
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
48
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
49
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
50
+ content: z.ZodString;
51
+ excerpt: z.ZodString;
52
+ image: z.ZodOptional<z.ZodString>;
53
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -35,15 +35,6 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- slug: z.ZodOptional<z.ZodString>;
39
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
43
- title: z.ZodString;
44
- content: z.ZodString;
45
- excerpt: z.ZodString;
46
- image: z.ZodOptional<z.ZodString>;
47
38
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
39
  name: z.ZodString;
49
40
  }, z.core.$strip>, z.ZodObject<{
@@ -51,6 +42,15 @@ declare const createPostSchema: z.ZodObject<{
51
42
  name: z.ZodString;
52
43
  slug: z.ZodString;
53
44
  }, z.core.$strip>]>>>>;
45
+ title: z.ZodString;
46
+ slug: z.ZodOptional<z.ZodString>;
47
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
48
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
49
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
50
+ content: z.ZodString;
51
+ excerpt: z.ZodString;
52
+ image: z.ZodOptional<z.ZodString>;
53
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -35,15 +35,6 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- slug: z.ZodOptional<z.ZodString>;
39
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
43
- title: z.ZodString;
44
- content: z.ZodString;
45
- excerpt: z.ZodString;
46
- image: z.ZodOptional<z.ZodString>;
47
38
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
39
  name: z.ZodString;
49
40
  }, z.core.$strip>, z.ZodObject<{
@@ -51,6 +42,15 @@ declare const createPostSchema: z.ZodObject<{
51
42
  name: z.ZodString;
52
43
  slug: z.ZodString;
53
44
  }, z.core.$strip>]>>>>;
45
+ title: z.ZodString;
46
+ slug: z.ZodOptional<z.ZodString>;
47
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
48
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
49
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
50
+ content: z.ZodString;
51
+ excerpt: z.ZodString;
52
+ image: z.ZodOptional<z.ZodString>;
53
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -7,12 +7,12 @@ import { QueryClient } from '@tanstack/react-query';
7
7
 
8
8
  declare const createBoardSchema: z.ZodObject<{
9
9
  description: z.ZodOptional<z.ZodString>;
10
- name: z.ZodString;
11
10
  slug: z.ZodOptional<z.ZodString>;
12
11
  ownerId: z.ZodOptional<z.ZodString>;
13
12
  organizationId: z.ZodOptional<z.ZodString>;
14
13
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
14
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
+ name: z.ZodString;
16
16
  }, z.core.$strip>;
17
17
  declare const updateBoardSchema: z.ZodObject<{
18
18
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -26,10 +26,10 @@ declare const updateBoardSchema: z.ZodObject<{
26
26
  }, z.core.$strip>;
27
27
  declare const createColumnSchema: z.ZodObject<{
28
28
  title: z.ZodString;
29
- boardId: z.ZodString;
30
29
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
31
30
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
32
31
  order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
32
+ boardId: z.ZodString;
33
33
  }, z.core.$strip>;
34
34
  declare const updateColumnSchema: z.ZodObject<{
35
35
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -360,20 +360,20 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
360
360
  method: "PUT";
361
361
  body: better_call.StandardSchemaV1<{
362
362
  description?: string | undefined;
363
- name?: string | undefined;
364
363
  slug?: string | undefined;
365
364
  ownerId?: string | undefined;
366
365
  organizationId?: string | undefined;
367
366
  createdAt?: unknown;
368
367
  updatedAt?: unknown;
368
+ name?: string | undefined;
369
369
  }, {
370
370
  description?: string | undefined;
371
- name?: string | undefined;
372
371
  slug?: string | undefined;
373
372
  ownerId?: string | undefined;
374
373
  organizationId?: string | undefined;
375
374
  createdAt?: unknown;
376
375
  updatedAt?: unknown;
376
+ name?: string | undefined;
377
377
  }>;
378
378
  }, Board>;
379
379
  readonly deleteBoard: better_call.StrictEndpoint<"/boards/:id", {} & {
@@ -402,16 +402,16 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
402
402
  method: "PUT";
403
403
  body: better_call.StandardSchemaV1<{
404
404
  title?: string | undefined;
405
- boardId?: string | undefined;
406
405
  createdAt?: unknown;
407
406
  updatedAt?: unknown;
408
407
  order?: number | undefined;
408
+ boardId?: string | undefined;
409
409
  }, {
410
410
  title?: string | undefined;
411
- boardId?: string | undefined;
412
411
  createdAt?: unknown;
413
412
  updatedAt?: unknown;
414
413
  order?: number | undefined;
414
+ boardId?: string | undefined;
415
415
  }>;
416
416
  }, Column>;
417
417
  readonly deleteColumn: better_call.StrictEndpoint<"/columns/:id", {} & {
@@ -7,12 +7,12 @@ import { QueryClient } from '@tanstack/react-query';
7
7
 
8
8
  declare const createBoardSchema: z.ZodObject<{
9
9
  description: z.ZodOptional<z.ZodString>;
10
- name: z.ZodString;
11
10
  slug: z.ZodOptional<z.ZodString>;
12
11
  ownerId: z.ZodOptional<z.ZodString>;
13
12
  organizationId: z.ZodOptional<z.ZodString>;
14
13
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
14
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
+ name: z.ZodString;
16
16
  }, z.core.$strip>;
17
17
  declare const updateBoardSchema: z.ZodObject<{
18
18
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -26,10 +26,10 @@ declare const updateBoardSchema: z.ZodObject<{
26
26
  }, z.core.$strip>;
27
27
  declare const createColumnSchema: z.ZodObject<{
28
28
  title: z.ZodString;
29
- boardId: z.ZodString;
30
29
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
31
30
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
32
31
  order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
32
+ boardId: z.ZodString;
33
33
  }, z.core.$strip>;
34
34
  declare const updateColumnSchema: z.ZodObject<{
35
35
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -360,20 +360,20 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
360
360
  method: "PUT";
361
361
  body: better_call.StandardSchemaV1<{
362
362
  description?: string | undefined;
363
- name?: string | undefined;
364
363
  slug?: string | undefined;
365
364
  ownerId?: string | undefined;
366
365
  organizationId?: string | undefined;
367
366
  createdAt?: unknown;
368
367
  updatedAt?: unknown;
368
+ name?: string | undefined;
369
369
  }, {
370
370
  description?: string | undefined;
371
- name?: string | undefined;
372
371
  slug?: string | undefined;
373
372
  ownerId?: string | undefined;
374
373
  organizationId?: string | undefined;
375
374
  createdAt?: unknown;
376
375
  updatedAt?: unknown;
376
+ name?: string | undefined;
377
377
  }>;
378
378
  }, Board>;
379
379
  readonly deleteBoard: better_call.StrictEndpoint<"/boards/:id", {} & {
@@ -402,16 +402,16 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
402
402
  method: "PUT";
403
403
  body: better_call.StandardSchemaV1<{
404
404
  title?: string | undefined;
405
- boardId?: string | undefined;
406
405
  createdAt?: unknown;
407
406
  updatedAt?: unknown;
408
407
  order?: number | undefined;
408
+ boardId?: string | undefined;
409
409
  }, {
410
410
  title?: string | undefined;
411
- boardId?: string | undefined;
412
411
  createdAt?: unknown;
413
412
  updatedAt?: unknown;
414
413
  order?: number | undefined;
414
+ boardId?: string | undefined;
415
415
  }>;
416
416
  }, Column>;
417
417
  readonly deleteColumn: better_call.StrictEndpoint<"/columns/:id", {} & {