@btst/stack 2.11.3 → 2.11.5

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 (68) 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/packages/stack/src/plugins/cms/client/components/forms/content-form.cjs +58 -34
  8. package/dist/packages/stack/src/plugins/cms/client/components/forms/content-form.mjs +58 -34
  9. package/dist/packages/stack/src/plugins/cms/client/components/inverse-relations-panel.cjs +29 -7
  10. package/dist/packages/stack/src/plugins/cms/client/components/inverse-relations-panel.mjs +29 -7
  11. package/dist/packages/ui/src/components/auto-form/helpers.cjs +24 -1
  12. package/dist/packages/ui/src/components/auto-form/helpers.mjs +24 -1
  13. package/dist/plugins/blog/api/index.d.cts +3 -2
  14. package/dist/plugins/blog/api/index.d.mts +3 -2
  15. package/dist/plugins/blog/api/index.d.ts +3 -2
  16. package/dist/plugins/blog/client/components/index.cjs +21 -0
  17. package/dist/plugins/blog/client/components/index.d.cts +71 -1
  18. package/dist/plugins/blog/client/components/index.d.mts +71 -1
  19. package/dist/plugins/blog/client/components/index.d.ts +71 -1
  20. package/dist/plugins/blog/client/components/index.mjs +15 -1
  21. package/dist/plugins/blog/client/hooks/index.d.cts +3 -2
  22. package/dist/plugins/blog/client/hooks/index.d.mts +3 -2
  23. package/dist/plugins/blog/client/hooks/index.d.ts +3 -2
  24. package/dist/plugins/blog/client/index.d.cts +3 -2
  25. package/dist/plugins/blog/client/index.d.mts +3 -2
  26. package/dist/plugins/blog/client/index.d.ts +3 -2
  27. package/dist/plugins/blog/query-keys.d.cts +3 -2
  28. package/dist/plugins/blog/query-keys.d.mts +3 -2
  29. package/dist/plugins/blog/query-keys.d.ts +3 -2
  30. package/dist/plugins/cms/api/index.d.cts +1 -1
  31. package/dist/plugins/cms/api/index.d.mts +1 -1
  32. package/dist/plugins/cms/api/index.d.ts +1 -1
  33. package/dist/plugins/cms/query-keys.d.cts +1 -1
  34. package/dist/plugins/cms/query-keys.d.mts +1 -1
  35. package/dist/plugins/cms/query-keys.d.ts +1 -1
  36. package/dist/plugins/kanban/api/index.d.cts +1 -1
  37. package/dist/plugins/kanban/api/index.d.mts +1 -1
  38. package/dist/plugins/kanban/api/index.d.ts +1 -1
  39. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  40. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  41. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  42. package/dist/shared/{stack.DGsFF5qb.d.cts → stack.BnSAhKJi.d.ts} +6 -5
  43. package/dist/shared/{stack.CntKf20s.d.cts → stack.CLWhMntf.d.cts} +12 -11
  44. package/dist/shared/{stack.Sod_PZhB.d.cts → stack.CuhcFsAx.d.cts} +7 -42
  45. package/dist/shared/{stack.Sod_PZhB.d.mts → stack.CuhcFsAx.d.mts} +7 -42
  46. package/dist/shared/{stack.Sod_PZhB.d.ts → stack.CuhcFsAx.d.ts} +7 -42
  47. package/dist/shared/{stack.QrBE0Bc8.d.ts → stack.DNLuzDb3.d.cts} +6 -5
  48. package/dist/shared/{stack.BX7MHi0J.d.mts → stack.DbnCLdNF.d.mts} +34 -7
  49. package/dist/shared/{stack.NtflNnnH.d.mts → stack.Dfc44JiE.d.mts} +6 -5
  50. package/dist/shared/{stack.CLrGRIj0.d.mts → stack.DiodAFAa.d.mts} +12 -11
  51. package/dist/shared/stack.Dsatjh0B.d.cts +35 -0
  52. package/dist/shared/stack.Dsatjh0B.d.mts +35 -0
  53. package/dist/shared/stack.Dsatjh0B.d.ts +35 -0
  54. package/dist/shared/{stack.fQjVhw5a.d.ts → stack.fXlShnhv.d.ts} +34 -7
  55. package/dist/shared/{stack.C9zoS1TN.d.cts → stack.r6HohbyX.d.cts} +34 -7
  56. package/dist/shared/{stack.BQSy-NDc.d.ts → stack.ufcExQIR.d.ts} +12 -11
  57. package/package.json +14 -1
  58. package/src/plugins/blog/client/components/index.tsx +52 -0
  59. package/src/plugins/cms/__tests__/auto-form-nested-config.test.ts +177 -0
  60. package/src/plugins/cms/api/index.ts +1 -0
  61. package/src/plugins/cms/api/mutations.ts +48 -3
  62. package/src/plugins/cms/api/plugin.ts +11 -101
  63. package/src/plugins/cms/api/relations.ts +174 -0
  64. package/src/plugins/cms/client/components/forms/content-form.tsx +93 -47
  65. package/src/plugins/cms/client/components/inverse-relations-panel.tsx +49 -1
  66. package/dist/shared/{stack.CMbX8Q5C.d.ts → stack.D4Cea8II.d.ts} +13 -13
  67. package/dist/shared/{stack.Dj04W2c3.d.mts → stack.HE_IvqV5.d.mts} +13 -13
  68. package/dist/shared/{stack.eq5eg1yt.d.cts → stack.Rtcvl8sS.d.cts} +13 -13
@@ -1,7 +1,8 @@
1
- export { P as PostCreateInput, e as PostUpdateInput, o as UseNextPreviousPostsOptions, p as UseNextPreviousPostsResult, d as UsePostResult, b as UsePostSearchOptions, c as UsePostSearchResult, U as UsePostsOptions, a as UsePostsResult, r as UseRecentPostsOptions, s as UseRecentPostsResult, k as useCreatePost, m as useDeletePost, q as useNextPreviousPosts, g as usePost, n as usePostSearch, u as usePosts, t as useRecentPosts, h as useSuspensePost, f as useSuspensePosts, j as useSuspenseTags, i as useTags, l as useUpdatePost } from '../../../../shared/stack.QrBE0Bc8.js';
1
+ export { P as PostCreateInput, e as PostUpdateInput, o as UseNextPreviousPostsOptions, p as UseNextPreviousPostsResult, d as UsePostResult, b as UsePostSearchOptions, c as UsePostSearchResult, U as UsePostsOptions, a as UsePostsResult, r as UseRecentPostsOptions, s as UseRecentPostsResult, k as useCreatePost, m as useDeletePost, q as useNextPreviousPosts, g as usePost, n as usePostSearch, u as usePosts, t as useRecentPosts, h as useSuspensePost, f as useSuspensePosts, j as useSuspenseTags, i as useTags, l as useUpdatePost } from '../../../../shared/stack.BnSAhKJi.js';
2
2
  import '@tanstack/react-query';
3
- import '../../../../shared/stack.Sod_PZhB.js';
3
+ import '../../../../shared/stack.Dsatjh0B.js';
4
4
  import 'zod';
5
+ import '../../../../shared/stack.CuhcFsAx.js';
5
6
 
6
7
  declare function useDebounce<T>(value: T, delay?: number): T;
7
8
  declare function useThrottle<T>(value: T, wait?: number): T;
@@ -2,9 +2,10 @@ import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
2
2
  import * as _btst_yar from '@btst/yar';
3
3
  import { ComponentType, ReactNode } from 'react';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
- import { P as Post, S as SerializedPost } from '../../../shared/stack.Sod_PZhB.cjs';
6
- export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.DGsFF5qb.cjs';
5
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.Dsatjh0B.cjs';
6
+ export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.DNLuzDb3.cjs';
7
7
  import 'zod';
8
+ import '../../../shared/stack.CuhcFsAx.cjs';
8
9
 
9
10
  /**
10
11
  * Context passed to route hooks
@@ -2,9 +2,10 @@ import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
2
2
  import * as _btst_yar from '@btst/yar';
3
3
  import { ComponentType, ReactNode } from 'react';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
- import { P as Post, S as SerializedPost } from '../../../shared/stack.Sod_PZhB.mjs';
6
- export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.NtflNnnH.mjs';
5
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.Dsatjh0B.mjs';
6
+ export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.Dfc44JiE.mjs';
7
7
  import 'zod';
8
+ import '../../../shared/stack.CuhcFsAx.mjs';
8
9
 
9
10
  /**
10
11
  * Context passed to route hooks
@@ -2,9 +2,10 @@ import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
2
2
  import * as _btst_yar from '@btst/yar';
3
3
  import { ComponentType, ReactNode } from 'react';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
- import { P as Post, S as SerializedPost } from '../../../shared/stack.Sod_PZhB.js';
6
- export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.QrBE0Bc8.js';
5
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.Dsatjh0B.js';
6
+ export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.BnSAhKJi.js';
7
7
  import 'zod';
8
+ import '../../../shared/stack.CuhcFsAx.js';
8
9
 
9
10
  /**
10
11
  * Context passed to route hooks
@@ -1,8 +1,9 @@
1
1
  import '@tanstack/react-query';
2
- export { f as createBlogQueryKeys } from '../../shared/stack.CntKf20s.cjs';
2
+ export { f as createBlogQueryKeys } from '../../shared/stack.CLWhMntf.cjs';
3
3
  import '@btst/stack/plugins/client';
4
- import '../../shared/stack.Sod_PZhB.cjs';
4
+ import '../../shared/stack.Dsatjh0B.cjs';
5
5
  import '@btst/stack/plugins/api';
6
6
  import '@btst/db';
7
7
  import 'better-call';
8
8
  import 'zod';
9
+ import '../../shared/stack.CuhcFsAx.cjs';
@@ -1,8 +1,9 @@
1
1
  import '@tanstack/react-query';
2
- export { f as createBlogQueryKeys } from '../../shared/stack.CLrGRIj0.mjs';
2
+ export { f as createBlogQueryKeys } from '../../shared/stack.DiodAFAa.mjs';
3
3
  import '@btst/stack/plugins/client';
4
- import '../../shared/stack.Sod_PZhB.mjs';
4
+ import '../../shared/stack.Dsatjh0B.mjs';
5
5
  import '@btst/stack/plugins/api';
6
6
  import '@btst/db';
7
7
  import 'better-call';
8
8
  import 'zod';
9
+ import '../../shared/stack.CuhcFsAx.mjs';
@@ -1,8 +1,9 @@
1
1
  import '@tanstack/react-query';
2
- export { f as createBlogQueryKeys } from '../../shared/stack.BQSy-NDc.js';
2
+ export { f as createBlogQueryKeys } from '../../shared/stack.ufcExQIR.js';
3
3
  import '@btst/stack/plugins/client';
4
- import '../../shared/stack.Sod_PZhB.js';
4
+ import '../../shared/stack.Dsatjh0B.js';
5
5
  import '@btst/stack/plugins/api';
6
6
  import '@btst/db';
7
7
  import 'better-call';
8
8
  import 'zod';
9
+ import '../../shared/stack.CuhcFsAx.js';
@@ -1,4 +1,4 @@
1
- export { C as CMSApiRouter, b as CMSRouteKey, l as CMS_QUERY_KEYS, k as CreateCMSContentItemInput, c as cmsBackendPlugin, j as createCMSContentItem, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.C9zoS1TN.cjs';
1
+ export { C as CMSApiRouter, b as CMSRouteKey, m as CMS_QUERY_KEYS, k as CreateCMSContentItemInput, l as CreateCMSContentItemOptions, c as cmsBackendPlugin, j as createCMSContentItem, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.r6HohbyX.cjs';
2
2
  import '@btst/stack/plugins/api';
3
3
  import '../../../shared/stack.B8QD11QU.cjs';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- export { C as CMSApiRouter, b as CMSRouteKey, l as CMS_QUERY_KEYS, k as CreateCMSContentItemInput, c as cmsBackendPlugin, j as createCMSContentItem, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.BX7MHi0J.mjs';
1
+ export { C as CMSApiRouter, b as CMSRouteKey, m as CMS_QUERY_KEYS, k as CreateCMSContentItemInput, l as CreateCMSContentItemOptions, c as cmsBackendPlugin, j as createCMSContentItem, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.DbnCLdNF.mjs';
2
2
  import '@btst/stack/plugins/api';
3
3
  import '../../../shared/stack.B8QD11QU.mjs';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- export { C as CMSApiRouter, b as CMSRouteKey, l as CMS_QUERY_KEYS, k as CreateCMSContentItemInput, c as cmsBackendPlugin, j as createCMSContentItem, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.fQjVhw5a.js';
1
+ export { C as CMSApiRouter, b as CMSRouteKey, m as CMS_QUERY_KEYS, k as CreateCMSContentItemInput, l as CreateCMSContentItemOptions, c as cmsBackendPlugin, j as createCMSContentItem, d as getAllContentItems, g as getAllContentTypes, f as getContentItemById, e as getContentItemBySlug, h as serializeContentItem, i as serializeContentItemWithType, s as serializeContentType } from '../../../shared/stack.fXlShnhv.js';
2
2
  import '@btst/stack/plugins/api';
3
3
  import '../../../shared/stack.B8QD11QU.js';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.C9zoS1TN.cjs';
1
+ import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.r6HohbyX.cjs';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.B8QD11QU.cjs';
@@ -1,4 +1,4 @@
1
- import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.BX7MHi0J.mjs';
1
+ import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.DbnCLdNF.mjs';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.B8QD11QU.mjs';
@@ -1,4 +1,4 @@
1
- import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.fQjVhw5a.js';
1
+ import { C as CMSApiRouter, a as ContentListDiscriminator } from '../../shared/stack.fXlShnhv.js';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedContentType, P as PaginatedContentItems, a as SerializedContentItemWithType } from '../../shared/stack.B8QD11QU.js';
@@ -1,4 +1,4 @@
1
- export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.eq5eg1yt.cjs';
1
+ export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.Rtcvl8sS.cjs';
2
2
  import { B as BoardWithColumns, S as SerializedBoardWithColumns, C as ColumnWithTasks, a as SerializedColumn, T as Task, b as SerializedTask } from '../../../shared/stack.DJaKVY7v.cjs';
3
3
  import '@btst/stack/plugins/api';
4
4
  import '@btst/db';
@@ -1,4 +1,4 @@
1
- export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.Dj04W2c3.mjs';
1
+ export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.HE_IvqV5.mjs';
2
2
  import { B as BoardWithColumns, S as SerializedBoardWithColumns, C as ColumnWithTasks, a as SerializedColumn, T as Task, b as SerializedTask } from '../../../shared/stack.DJaKVY7v.mjs';
3
3
  import '@btst/stack/plugins/api';
4
4
  import '@btst/db';
@@ -1,4 +1,4 @@
1
- export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.CMbX8Q5C.js';
1
+ export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.D4Cea8II.js';
2
2
  import { B as BoardWithColumns, S as SerializedBoardWithColumns, C as ColumnWithTasks, a as SerializedColumn, T as Task, b as SerializedTask } from '../../../shared/stack.DJaKVY7v.js';
3
3
  import '@btst/stack/plugins/api';
4
4
  import '@btst/db';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.eq5eg1yt.cjs';
2
+ import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.Rtcvl8sS.cjs';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedBoardWithColumns } from '../../shared/stack.DJaKVY7v.cjs';
5
5
  import '@btst/stack/plugins/api';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.Dj04W2c3.mjs';
2
+ import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.HE_IvqV5.mjs';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedBoardWithColumns } from '../../shared/stack.DJaKVY7v.mjs';
5
5
  import '@btst/stack/plugins/api';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.CMbX8Q5C.js';
2
+ import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.D4Cea8II.js';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedBoardWithColumns } from '../../shared/stack.DJaKVY7v.js';
5
5
  import '@btst/stack/plugins/api';
@@ -1,6 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from './stack.Sod_PZhB.cjs';
2
+ import { S as SerializedPost, a as SerializedTag } from './stack.Dsatjh0B.js';
3
3
  import { z } from 'zod';
4
+ import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.js';
4
5
 
5
6
  /**
6
7
  * Options for the usePosts hook
@@ -128,10 +129,6 @@ declare function useSuspenseTags(): {
128
129
  };
129
130
  /** Create a new post */
130
131
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
- published: boolean;
132
- title: string;
133
- content: string;
134
- excerpt: string;
135
132
  tags: ({
136
133
  name: string;
137
134
  } | {
@@ -139,6 +136,10 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
139
136
  name: string;
140
137
  slug: string;
141
138
  })[];
139
+ published: boolean;
140
+ title: string;
141
+ content: string;
142
+ excerpt: string;
142
143
  slug?: string | undefined;
143
144
  publishedAt?: Date | undefined;
144
145
  createdAt?: Date | undefined;
@@ -1,11 +1,12 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { QueryClient } from '@tanstack/react-query';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
- import { P as Post, T as Tag, c as createPostSchema, u as updatePostSchema, S as SerializedPost, a as SerializedTag } from './stack.Sod_PZhB.cjs';
4
+ import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from './stack.Dsatjh0B.cjs';
5
5
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
6
6
  import { DBAdapter } from '@btst/db';
7
7
  import * as better_call from 'better-call';
8
8
  import { z } from 'zod';
9
+ import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.cjs';
9
10
 
10
11
  /**
11
12
  * Parameters for filtering/paginating posts.
@@ -316,12 +317,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
316
317
  title: string;
317
318
  content: string;
318
319
  excerpt: string;
319
- slug?: string | undefined;
320
- published?: boolean | undefined;
321
- publishedAt?: unknown;
322
- createdAt?: unknown;
323
- updatedAt?: unknown;
324
- image?: string | undefined;
325
320
  tags?: ({
326
321
  name: string;
327
322
  } | {
@@ -329,16 +324,16 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
329
324
  name: string;
330
325
  slug: string;
331
326
  })[] | undefined;
332
- }, {
333
- title: string;
334
- content: string;
335
- excerpt: string;
336
327
  slug?: string | undefined;
337
328
  published?: boolean | undefined;
338
329
  publishedAt?: unknown;
339
330
  createdAt?: unknown;
340
331
  updatedAt?: unknown;
341
332
  image?: string | undefined;
333
+ }, {
334
+ title: string;
335
+ content: string;
336
+ excerpt: string;
342
337
  tags?: ({
343
338
  name: string;
344
339
  } | {
@@ -346,6 +341,12 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
346
341
  name: string;
347
342
  slug: string;
348
343
  })[] | undefined;
344
+ slug?: string | undefined;
345
+ published?: boolean | undefined;
346
+ publishedAt?: unknown;
347
+ createdAt?: unknown;
348
+ updatedAt?: unknown;
349
+ image?: string | undefined;
349
350
  }>;
350
351
  }, Post>;
351
352
  readonly updatePost: better_call.StrictEndpoint<"/posts/:id", {} & {
@@ -1,40 +1,13 @@
1
1
  import { z } from 'zod';
2
2
 
3
- type Post = {
4
- id: string;
5
- authorId?: string;
6
- defaultLocale?: string;
7
- slug: string;
8
- title: string;
9
- content: string;
10
- excerpt: string;
11
- image?: string;
12
- published: boolean;
13
- status?: "DRAFT" | "PUBLISHED";
14
- tags: Tag[];
15
- publishedAt?: Date;
16
- createdAt: Date;
17
- updatedAt: Date;
18
- };
19
- type Tag = {
20
- id: string;
21
- slug: string;
22
- name: string;
23
- createdAt: Date;
24
- updatedAt: Date;
25
- };
26
- interface SerializedPost extends Omit<Post, "createdAt" | "updatedAt" | "publishedAt" | "tags"> {
27
- tags: SerializedTag[];
28
- publishedAt?: string;
29
- createdAt: string;
30
- updatedAt: string;
31
- }
32
- interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
33
- createdAt: string;
34
- updatedAt: string;
35
- }
36
-
37
3
  declare const createPostSchema: z.ZodObject<{
4
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
5
+ name: z.ZodString;
6
+ }, z.core.$strip>, z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ slug: z.ZodString;
10
+ }, z.core.$strip>]>>>>;
38
11
  slug: z.ZodOptional<z.ZodString>;
39
12
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
13
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -44,13 +17,6 @@ declare const createPostSchema: z.ZodObject<{
44
17
  content: z.ZodString;
45
18
  excerpt: z.ZodString;
46
19
  image: z.ZodOptional<z.ZodString>;
47
- tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
- name: z.ZodString;
49
- }, z.core.$strip>, z.ZodObject<{
50
- id: z.ZodString;
51
- name: z.ZodString;
52
- slug: z.ZodString;
53
- }, z.core.$strip>]>>>>;
54
20
  }, z.core.$strip>;
55
21
  declare const updatePostSchema: z.ZodObject<{
56
22
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -73,4 +39,3 @@ declare const updatePostSchema: z.ZodObject<{
73
39
  }, z.core.$strip>;
74
40
 
75
41
  export { createPostSchema as c, updatePostSchema as u };
76
- export type { Post as P, SerializedPost as S, Tag as T, SerializedTag as a };
@@ -1,40 +1,13 @@
1
1
  import { z } from 'zod';
2
2
 
3
- type Post = {
4
- id: string;
5
- authorId?: string;
6
- defaultLocale?: string;
7
- slug: string;
8
- title: string;
9
- content: string;
10
- excerpt: string;
11
- image?: string;
12
- published: boolean;
13
- status?: "DRAFT" | "PUBLISHED";
14
- tags: Tag[];
15
- publishedAt?: Date;
16
- createdAt: Date;
17
- updatedAt: Date;
18
- };
19
- type Tag = {
20
- id: string;
21
- slug: string;
22
- name: string;
23
- createdAt: Date;
24
- updatedAt: Date;
25
- };
26
- interface SerializedPost extends Omit<Post, "createdAt" | "updatedAt" | "publishedAt" | "tags"> {
27
- tags: SerializedTag[];
28
- publishedAt?: string;
29
- createdAt: string;
30
- updatedAt: string;
31
- }
32
- interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
33
- createdAt: string;
34
- updatedAt: string;
35
- }
36
-
37
3
  declare const createPostSchema: z.ZodObject<{
4
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
5
+ name: z.ZodString;
6
+ }, z.core.$strip>, z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ slug: z.ZodString;
10
+ }, z.core.$strip>]>>>>;
38
11
  slug: z.ZodOptional<z.ZodString>;
39
12
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
13
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -44,13 +17,6 @@ declare const createPostSchema: z.ZodObject<{
44
17
  content: z.ZodString;
45
18
  excerpt: z.ZodString;
46
19
  image: z.ZodOptional<z.ZodString>;
47
- tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
- name: z.ZodString;
49
- }, z.core.$strip>, z.ZodObject<{
50
- id: z.ZodString;
51
- name: z.ZodString;
52
- slug: z.ZodString;
53
- }, z.core.$strip>]>>>>;
54
20
  }, z.core.$strip>;
55
21
  declare const updatePostSchema: z.ZodObject<{
56
22
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -73,4 +39,3 @@ declare const updatePostSchema: z.ZodObject<{
73
39
  }, z.core.$strip>;
74
40
 
75
41
  export { createPostSchema as c, updatePostSchema as u };
76
- export type { Post as P, SerializedPost as S, Tag as T, SerializedTag as a };
@@ -1,40 +1,13 @@
1
1
  import { z } from 'zod';
2
2
 
3
- type Post = {
4
- id: string;
5
- authorId?: string;
6
- defaultLocale?: string;
7
- slug: string;
8
- title: string;
9
- content: string;
10
- excerpt: string;
11
- image?: string;
12
- published: boolean;
13
- status?: "DRAFT" | "PUBLISHED";
14
- tags: Tag[];
15
- publishedAt?: Date;
16
- createdAt: Date;
17
- updatedAt: Date;
18
- };
19
- type Tag = {
20
- id: string;
21
- slug: string;
22
- name: string;
23
- createdAt: Date;
24
- updatedAt: Date;
25
- };
26
- interface SerializedPost extends Omit<Post, "createdAt" | "updatedAt" | "publishedAt" | "tags"> {
27
- tags: SerializedTag[];
28
- publishedAt?: string;
29
- createdAt: string;
30
- updatedAt: string;
31
- }
32
- interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
33
- createdAt: string;
34
- updatedAt: string;
35
- }
36
-
37
3
  declare const createPostSchema: z.ZodObject<{
4
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
5
+ name: z.ZodString;
6
+ }, z.core.$strip>, z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ slug: z.ZodString;
10
+ }, z.core.$strip>]>>>>;
38
11
  slug: z.ZodOptional<z.ZodString>;
39
12
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
13
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -44,13 +17,6 @@ declare const createPostSchema: z.ZodObject<{
44
17
  content: z.ZodString;
45
18
  excerpt: z.ZodString;
46
19
  image: z.ZodOptional<z.ZodString>;
47
- tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
- name: z.ZodString;
49
- }, z.core.$strip>, z.ZodObject<{
50
- id: z.ZodString;
51
- name: z.ZodString;
52
- slug: z.ZodString;
53
- }, z.core.$strip>]>>>>;
54
20
  }, z.core.$strip>;
55
21
  declare const updatePostSchema: z.ZodObject<{
56
22
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -73,4 +39,3 @@ declare const updatePostSchema: z.ZodObject<{
73
39
  }, z.core.$strip>;
74
40
 
75
41
  export { createPostSchema as c, updatePostSchema as u };
76
- export type { Post as P, SerializedPost as S, Tag as T, SerializedTag as a };
@@ -1,6 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from './stack.Sod_PZhB.js';
2
+ import { S as SerializedPost, a as SerializedTag } from './stack.Dsatjh0B.cjs';
3
3
  import { z } from 'zod';
4
+ import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.cjs';
4
5
 
5
6
  /**
6
7
  * Options for the usePosts hook
@@ -128,10 +129,6 @@ declare function useSuspenseTags(): {
128
129
  };
129
130
  /** Create a new post */
130
131
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
- published: boolean;
132
- title: string;
133
- content: string;
134
- excerpt: string;
135
132
  tags: ({
136
133
  name: string;
137
134
  } | {
@@ -139,6 +136,10 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
139
136
  name: string;
140
137
  slug: string;
141
138
  })[];
139
+ published: boolean;
140
+ title: string;
141
+ content: string;
142
+ excerpt: string;
142
143
  slug?: string | undefined;
143
144
  publishedAt?: Date | undefined;
144
145
  createdAt?: Date | undefined;
@@ -87,12 +87,36 @@ interface CreateCMSContentItemInput {
87
87
  /** Arbitrary data payload — should match the content type schema */
88
88
  data: Record<string, unknown>;
89
89
  }
90
+ /**
91
+ * Options for {@link createCMSContentItem}.
92
+ */
93
+ interface CreateCMSContentItemOptions {
94
+ /**
95
+ * When `true`, persist relation fields (`belongsTo`, `hasMany`,
96
+ * `manyToMany`) into the `contentRelation` junction table in addition to
97
+ * the item's JSON payload.
98
+ *
99
+ * This is what the HTTP `POST /content/:typeSlug` route does, and is
100
+ * required for the admin "Related Items" panel / inverse-relation queries
101
+ * to find the item.
102
+ *
103
+ * Seeds and other programmatic callers that want the admin UI to work
104
+ * should enable this flag. Callers are still expected to pass
105
+ * pre-created target IDs (`{ id }` or `[{ id }, ...]`) — inline `_new`
106
+ * creation is only supported via the HTTP route.
107
+ *
108
+ * Defaults to `false` for backwards compatibility (a no-op for content
109
+ * types without relations).
110
+ */
111
+ syncRelations?: boolean;
112
+ }
90
113
  /**
91
114
  * Create a new content item for a content type (looked up by slug).
92
115
  *
93
- * Bypasses Zod schema validation and relation processing — the caller is
94
- * responsible for providing valid, relation-free data. For relation fields or
95
- * schema validation, use the HTTP endpoint instead.
116
+ * Bypasses Zod schema validation and inline `_new` relation creation — the
117
+ * caller is responsible for providing valid data and pre-created relation
118
+ * IDs. For schema validation or inline creation of related items, use the
119
+ * HTTP endpoint instead.
96
120
  *
97
121
  * Throws if the content type is not found or the slug is already taken within
98
122
  * that content type.
@@ -104,8 +128,11 @@ interface CreateCMSContentItemInput {
104
128
  * @param adapter - The database adapter
105
129
  * @param contentTypeSlug - Slug of the target content type
106
130
  * @param input - Item slug and data payload
131
+ * @param options - See {@link CreateCMSContentItemOptions}. Pass
132
+ * `{ syncRelations: true }` to also populate the `contentRelation`
133
+ * junction table for relation fields in the payload.
107
134
  */
108
- declare function createCMSContentItem(adapter: DBAdapter, contentTypeSlug: string, input: CreateCMSContentItemInput): Promise<SerializedContentItem>;
135
+ declare function createCMSContentItem(adapter: DBAdapter, contentTypeSlug: string, input: CreateCMSContentItemInput, options?: CreateCMSContentItemOptions): Promise<SerializedContentItem>;
109
136
 
110
137
  /**
111
138
  * Route keys for the CMS plugin — matches the keys returned by
@@ -331,7 +358,7 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
331
358
  getContentItemBySlug: (contentTypeSlug: string, slug: string) => Promise<SerializedContentItemWithType<Record<string, unknown>> | null>;
332
359
  getContentItemById: (id: string) => Promise<SerializedContentItemWithType<Record<string, unknown>> | null>;
333
360
  prefetchForRoute: CMSPrefetchForRoute;
334
- createContentItem: (typeSlug: string, input: Parameters<typeof createCMSContentItem>[2]) => Promise<SerializedContentItem>;
361
+ createContentItem: (typeSlug: string, input: Parameters<typeof createCMSContentItem>[2], options?: Parameters<typeof createCMSContentItem>[3]) => Promise<SerializedContentItem>;
335
362
  }>;
336
363
  type CMSApiRouter = ReturnType<ReturnType<typeof cmsBackendPlugin>["routes"]>;
337
364
 
@@ -368,5 +395,5 @@ declare const CMS_QUERY_KEYS: {
368
395
  contentDetail: (typeSlug: string, id: string) => readonly ["cmsContent", "detail", string, string];
369
396
  };
370
397
 
371
- export { cmsBackendPlugin as c, getAllContentItems as d, getContentItemBySlug as e, getContentItemById as f, getAllContentTypes as g, serializeContentItem as h, serializeContentItemWithType as i, createCMSContentItem as j, CMS_QUERY_KEYS as l, serializeContentType as s };
372
- export type { CMSApiRouter as C, ContentListDiscriminator as a, CMSRouteKey as b, CreateCMSContentItemInput as k };
398
+ export { cmsBackendPlugin as c, getAllContentItems as d, getContentItemBySlug as e, getContentItemById as f, getAllContentTypes as g, serializeContentItem as h, serializeContentItemWithType as i, createCMSContentItem as j, CMS_QUERY_KEYS as m, serializeContentType as s };
399
+ export type { CMSApiRouter as C, ContentListDiscriminator as a, CMSRouteKey as b, CreateCMSContentItemInput as k, CreateCMSContentItemOptions as l };
@@ -1,6 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from './stack.Sod_PZhB.mjs';
2
+ import { S as SerializedPost, a as SerializedTag } from './stack.Dsatjh0B.mjs';
3
3
  import { z } from 'zod';
4
+ import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.mjs';
4
5
 
5
6
  /**
6
7
  * Options for the usePosts hook
@@ -128,10 +129,6 @@ declare function useSuspenseTags(): {
128
129
  };
129
130
  /** Create a new post */
130
131
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
- published: boolean;
132
- title: string;
133
- content: string;
134
- excerpt: string;
135
132
  tags: ({
136
133
  name: string;
137
134
  } | {
@@ -139,6 +136,10 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
139
136
  name: string;
140
137
  slug: string;
141
138
  })[];
139
+ published: boolean;
140
+ title: string;
141
+ content: string;
142
+ excerpt: string;
142
143
  slug?: string | undefined;
143
144
  publishedAt?: Date | undefined;
144
145
  createdAt?: Date | undefined;