@btst/stack 3.0.2 → 3.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 (76) hide show
  1. package/dist/context/index.d.cts +3 -1
  2. package/dist/context/index.d.mts +3 -1
  3. package/dist/context/index.d.ts +3 -1
  4. package/dist/packages/stack/src/context/auth.cjs +20 -14
  5. package/dist/packages/stack/src/context/auth.mjs +20 -14
  6. package/dist/packages/stack/src/context/provider.cjs +42 -22
  7. package/dist/packages/stack/src/context/provider.mjs +43 -23
  8. package/dist/packages/stack/src/plugins/blog/client/components/pages/home-page.cjs +32 -28
  9. package/dist/packages/stack/src/plugins/blog/client/components/pages/home-page.mjs +32 -29
  10. package/dist/packages/stack/src/plugins/blog/client/components/pages/post-page.cjs +53 -47
  11. package/dist/packages/stack/src/plugins/blog/client/components/pages/post-page.mjs +53 -48
  12. package/dist/packages/stack/src/plugins/blog/client/components/pages/tag-page.cjs +30 -24
  13. package/dist/packages/stack/src/plugins/blog/client/components/pages/tag-page.mjs +30 -25
  14. package/dist/plugins/blog/api/index.d.cts +2 -2
  15. package/dist/plugins/blog/api/index.d.mts +2 -2
  16. package/dist/plugins/blog/api/index.d.ts +2 -2
  17. package/dist/plugins/blog/client/components/index.d.cts +6 -10
  18. package/dist/plugins/blog/client/components/index.d.mts +6 -10
  19. package/dist/plugins/blog/client/components/index.d.ts +6 -10
  20. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  21. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  22. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  23. package/dist/plugins/blog/client/index.d.cts +2 -2
  24. package/dist/plugins/blog/client/index.d.mts +2 -2
  25. package/dist/plugins/blog/client/index.d.ts +2 -2
  26. package/dist/plugins/blog/client/pages/post.cjs +9 -0
  27. package/dist/plugins/blog/client/pages/post.d.cts +8 -0
  28. package/dist/plugins/blog/client/pages/post.d.mts +8 -0
  29. package/dist/plugins/blog/client/pages/post.d.ts +8 -0
  30. package/dist/plugins/blog/client/pages/post.mjs +7 -0
  31. package/dist/plugins/blog/client/pages/posts.cjs +9 -0
  32. package/dist/plugins/blog/client/pages/posts.d.cts +8 -0
  33. package/dist/plugins/blog/client/pages/posts.d.mts +8 -0
  34. package/dist/plugins/blog/client/pages/posts.d.ts +8 -0
  35. package/dist/plugins/blog/client/pages/posts.mjs +7 -0
  36. package/dist/plugins/blog/client/pages/tag.cjs +9 -0
  37. package/dist/plugins/blog/client/pages/tag.d.cts +8 -0
  38. package/dist/plugins/blog/client/pages/tag.d.mts +8 -0
  39. package/dist/plugins/blog/client/pages/tag.d.ts +8 -0
  40. package/dist/plugins/blog/client/pages/tag.mjs +7 -0
  41. package/dist/plugins/blog/query-keys.d.cts +2 -2
  42. package/dist/plugins/blog/query-keys.d.mts +2 -2
  43. package/dist/plugins/blog/query-keys.d.ts +2 -2
  44. package/dist/plugins/form-builder/api/index.d.cts +1 -1
  45. package/dist/plugins/form-builder/api/index.d.mts +1 -1
  46. package/dist/plugins/form-builder/api/index.d.ts +1 -1
  47. package/dist/plugins/form-builder/client/hooks/index.d.cts +1 -1
  48. package/dist/plugins/form-builder/client/hooks/index.d.mts +1 -1
  49. package/dist/plugins/form-builder/client/hooks/index.d.ts +1 -1
  50. package/dist/plugins/form-builder/query-keys.d.cts +1 -1
  51. package/dist/plugins/form-builder/query-keys.d.mts +1 -1
  52. package/dist/plugins/form-builder/query-keys.d.ts +1 -1
  53. package/dist/shared/{stack.BTStHVTy.d.cts → stack.BGzgFx3R.d.cts} +5 -5
  54. package/dist/shared/{stack.94kN3pEK.d.mts → stack.CjCSDfWy.d.mts} +5 -5
  55. package/dist/shared/{stack.lPKwd_v0.d.ts → stack.Clil75lW.d.ts} +37 -37
  56. package/dist/shared/{stack.CtrnoQgH.d.cts → stack.DNw6Hv5o.d.cts} +37 -37
  57. package/dist/shared/{stack.BggTHKlo.d.mts → stack.DhZtP2JZ.d.mts} +37 -37
  58. package/dist/shared/{stack.DfrRYOIl.d.ts → stack.Dpg_JjIo.d.ts} +5 -5
  59. package/package.json +41 -2
  60. package/src/__tests__/provider-hydration.test.tsx +164 -0
  61. package/src/context/auth.tsx +21 -14
  62. package/src/context/provider.tsx +51 -28
  63. package/src/plugins/blog/__tests__/page-load-error.test.tsx +53 -0
  64. package/src/plugins/blog/__tests__/page-loading.test.tsx +106 -0
  65. package/src/plugins/blog/client/components/pages/home-page.tsx +39 -35
  66. package/src/plugins/blog/client/components/pages/post-page.tsx +62 -54
  67. package/src/plugins/blog/client/components/pages/tag-page.tsx +35 -29
  68. package/src/plugins/blog/client/pages/post.tsx +7 -0
  69. package/src/plugins/blog/client/pages/posts.tsx +7 -0
  70. package/src/plugins/blog/client/pages/tag.tsx +7 -0
  71. package/dist/shared/{stack.D20bOqfr.d.ts → stack.BuxUQqL8.d.ts} +20 -20
  72. package/dist/shared/{stack.AWSs6TXN.d.cts → stack.CX83YNuS.d.cts} +20 -20
  73. package/dist/shared/{stack.CKc_Bais.d.cts → stack.Csi-4Mgz.d.cts} +7 -7
  74. package/dist/shared/{stack.CKc_Bais.d.mts → stack.Csi-4Mgz.d.mts} +7 -7
  75. package/dist/shared/{stack.CKc_Bais.d.ts → stack.Csi-4Mgz.d.ts} +7 -7
  76. package/dist/shared/{stack.HB5uGLpE.d.mts → stack.Egr3RWhA.d.mts} +20 -20
@@ -0,0 +1,106 @@
1
+ import { renderToString } from "react-dom/server";
2
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3
+ import { describe, expect, it, vi } from "vitest";
4
+ import { StackProvider } from "@btst/stack/context";
5
+ import { createClientStack } from "@btst/stack/client";
6
+ import { blogClientPlugin } from "@btst/stack/plugins/blog/client";
7
+ import { PostListPage } from "@btst/stack/plugins/blog/client/pages/posts";
8
+ import { PostPage } from "@btst/stack/plugins/blog/client/pages/post";
9
+ import { TagPage } from "@btst/stack/plugins/blog/client/pages/tag";
10
+ import { defineAuthorization } from "@btst/stack/authorization";
11
+ import { createClientAuth } from "@btst/stack/authorization/client";
12
+ import { blogPermissions } from "@btst/stack/plugins/blog/permissions";
13
+ import { z } from "zod";
14
+ import { BLOG_QUERY_KEYS } from "../api/query-key-defs";
15
+
16
+ const post = {
17
+ id: "prefetched-post",
18
+ slug: "prefetched-post",
19
+ title: "Prefetched article",
20
+ content: "Article available before hydration.",
21
+ excerpt: "Article excerpt",
22
+ published: true,
23
+ tags: [],
24
+ image: null,
25
+ authorId: null,
26
+ createdAt: "2026-09-16T12:00:00.000Z",
27
+ updatedAt: "2026-09-16T12:00:00.000Z",
28
+ publishedAt: "2026-09-16T12:00:00.000Z",
29
+ };
30
+
31
+ const authorization = defineAuthorization({
32
+ identity: z.object({ id: z.string() }),
33
+ permissions: [blogPermissions] as const,
34
+ rules: ({ blog }) => [
35
+ blog.post.read.when(
36
+ ({ facts }) =>
37
+ facts.scope === "published" ||
38
+ (facts.scope === "post" && (!facts.exists || facts.published)),
39
+ ),
40
+ blog.tag.read.allow(),
41
+ ],
42
+ });
43
+ const auth = createClientAuth({ authorization, getIdentity: () => null });
44
+
45
+ describe("blog pages in native framework routes", () => {
46
+ it.each(["list", "post", "tag", "draft list", "draft post", "missing post"])(
47
+ "renders prefetched %s with the existing public-access rules",
48
+ (page) => {
49
+ const fetch = vi
50
+ .spyOn(globalThis, "fetch")
51
+ .mockRejectedValue(new Error("Unexpected fetch"));
52
+ const published = !page.startsWith("draft");
53
+ const queryClient = new QueryClient({
54
+ defaultOptions: { queries: { retry: false, staleTime: Infinity } },
55
+ });
56
+ queryClient.setQueryData(
57
+ BLOG_QUERY_KEYS.postDetail(post.slug),
58
+ page === "missing post" ? null : { ...post, published },
59
+ );
60
+ queryClient.setQueryData(
61
+ BLOG_QUERY_KEYS.postsList({
62
+ published,
63
+ ...(page === "tag" ? { tagSlug: "news" } : {}),
64
+ }),
65
+ {
66
+ pages: [[post]],
67
+ pageParams: [0],
68
+ },
69
+ );
70
+ queryClient.setQueryData(BLOG_QUERY_KEYS.tagsList(), [
71
+ { id: "news", slug: "news", name: "News" },
72
+ ]);
73
+ const stack = createClientStack({
74
+ api: { baseURL: "http://test.local", basePath: "/api/data" },
75
+ site: { baseURL: "http://test.local", basePath: "/pages" },
76
+ queryClient,
77
+ plugins: { blog: blogClientPlugin() },
78
+ });
79
+ try {
80
+ const html = renderToString(
81
+ <QueryClientProvider client={queryClient}>
82
+ <StackProvider stack={stack} auth={auth} initialIdentity={null}>
83
+ {page.endsWith("list") ? (
84
+ <PostListPage published={published} />
85
+ ) : page === "tag" ? (
86
+ <TagPage tagSlug="news" />
87
+ ) : (
88
+ <PostPage slug={post.slug} />
89
+ )}
90
+ </StackProvider>
91
+ </QueryClientProvider>,
92
+ );
93
+ if (published && page !== "missing post")
94
+ expect(html).toContain(post.title);
95
+ else expect(html).not.toContain(post.title);
96
+ if (page === "missing post") expect(html).toContain("does not exist");
97
+ if (published)
98
+ expect(html).not.toMatch(/data-testid="(?:posts|post)-skeleton"/);
99
+ expect(fetch).not.toHaveBeenCalled();
100
+ } finally {
101
+ queryClient.clear();
102
+ fetch.mockRestore();
103
+ }
104
+ },
105
+ );
106
+ });
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { lazy } from "react";
3
+ import { lazy, type ComponentType } from "react";
4
4
  import { usePluginOverrides } from "@btst/stack/context";
5
5
  import type { BlogPluginOverrides } from "../../overrides";
6
6
  import { BLOG_PLUGIN_ID } from "../../constants";
@@ -10,39 +10,43 @@ import { PostsLoading } from "../loading";
10
10
  import { NotFoundPage } from "./404-page";
11
11
  import { blogPermissions } from "../../../permissions";
12
12
 
13
- // Lazy load the internal component with actual page content
14
- const HomePage = lazy(() =>
15
- import("./home-page.internal").then((m) => ({ default: m.HomePage })),
16
- );
13
+ // Share the guarded page between the lazy registry and native route entry.
14
+ export function createHomePage(
15
+ HomePage: ComponentType<{ published: boolean }>,
16
+ ) {
17
+ // Exported wrapped component with error and loading boundaries
18
+ function HomePageComponent({ published = true }: { published?: boolean }) {
19
+ const { onRouteError } =
20
+ usePluginOverrides<BlogPluginOverrides>(BLOG_PLUGIN_ID);
21
+ return (
22
+ <ComposedRoute
23
+ path={published ? "/blog" : "/blog/drafts"}
24
+ PageComponent={HomePage}
25
+ ErrorComponent={DefaultError}
26
+ LoadingComponent={PostsLoading}
27
+ NotFoundComponent={NotFoundPage}
28
+ permission={blogPermissions.post.read({
29
+ scope: published ? "published" : "drafts",
30
+ })}
31
+ props={{ published }}
32
+ onError={(error) => {
33
+ if (onRouteError) {
34
+ onRouteError("posts", error, {
35
+ path: published ? "/blog" : "/blog/drafts",
36
+ isSSR: typeof window === "undefined",
37
+ published,
38
+ });
39
+ }
40
+ }}
41
+ />
42
+ );
43
+ }
17
44
 
18
- // Exported wrapped component with error and loading boundaries
19
- export function HomePageComponent({
20
- published = true,
21
- }: {
22
- published?: boolean;
23
- }) {
24
- const { onRouteError } =
25
- usePluginOverrides<BlogPluginOverrides>(BLOG_PLUGIN_ID);
26
- return (
27
- <ComposedRoute
28
- path={published ? "/blog" : "/blog/drafts"}
29
- PageComponent={HomePage}
30
- ErrorComponent={DefaultError}
31
- LoadingComponent={PostsLoading}
32
- NotFoundComponent={NotFoundPage}
33
- permission={blogPermissions.post.read({
34
- scope: published ? "published" : "drafts",
35
- })}
36
- props={{ published }}
37
- onError={(error) => {
38
- if (onRouteError) {
39
- onRouteError("posts", error, {
40
- path: published ? "/blog" : "/blog/drafts",
41
- isSSR: typeof window === "undefined",
42
- published,
43
- });
44
- }
45
- }}
46
- />
47
- );
45
+ return HomePageComponent;
48
46
  }
47
+
48
+ export const HomePageComponent = createHomePage(
49
+ lazy(() =>
50
+ import("./home-page.internal").then((m) => ({ default: m.HomePage })),
51
+ ),
52
+ );
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { lazy } from "react";
3
+ import { lazy, type ComponentType } from "react";
4
4
  import { usePluginOverrides } from "@btst/stack/context";
5
5
  import type { BlogPluginOverrides } from "../../overrides";
6
6
  import { BLOG_PLUGIN_ID } from "../../constants";
@@ -14,59 +14,67 @@ import { NotFoundPage } from "./404-page";
14
14
  import { useSuspensePost } from "../../hooks/blog-hooks";
15
15
  import { blogPermissions } from "../../../permissions";
16
16
 
17
- // Lazy load the internal component with actual page content
18
- const PostPageContent = lazy(() =>
19
- import("./post-page.internal").then((m) => ({ default: m.PostPage })),
20
- );
17
+ // Share the guarded page between the lazy registry and native route entry.
18
+ export function createPostPage(
19
+ PostPageContent: ComponentType<{ slug: string }>,
20
+ ) {
21
+ function AuthorizedPostPage({ slug }: { slug: string }) {
22
+ const { post } = useSuspensePost(slug);
23
+ const permission = post
24
+ ? blogPermissions.post.read({
25
+ scope: "post",
26
+ slug: post.slug,
27
+ exists: true,
28
+ id: post.id,
29
+ ...(post.authorId ? { authorId: post.authorId } : {}),
30
+ published: post.published,
31
+ })
32
+ : blogPermissions.post.read({
33
+ scope: "post",
34
+ slug,
35
+ exists: false,
36
+ published: false,
37
+ });
38
+ return (
39
+ <PermissionRouteAccess
40
+ permission={permission}
41
+ LoadingComponent={PostLoading}
42
+ >
43
+ <PostPageContent slug={slug} />
44
+ </PermissionRouteAccess>
45
+ );
46
+ }
21
47
 
22
- function AuthorizedPostPage({ slug }: { slug: string }) {
23
- const { post } = useSuspensePost(slug);
24
- const permission = post
25
- ? blogPermissions.post.read({
26
- scope: "post",
27
- slug: post.slug,
28
- exists: true,
29
- id: post.id,
30
- ...(post.authorId ? { authorId: post.authorId } : {}),
31
- published: post.published,
32
- })
33
- : blogPermissions.post.read({
34
- scope: "post",
35
- slug,
36
- exists: false,
37
- published: false,
38
- });
39
- return (
40
- <PermissionRouteAccess
41
- permission={permission}
42
- LoadingComponent={PostLoading}
43
- >
44
- <PostPageContent slug={slug} />
45
- </PermissionRouteAccess>
46
- );
47
- }
48
+ // Exported wrapped component with error and loading boundaries
49
+ function PostPageComponent({ slug }: { slug: string }) {
50
+ const { onRouteError } =
51
+ usePluginOverrides<BlogPluginOverrides>(BLOG_PLUGIN_ID);
52
+ return (
53
+ <ComposedRoute
54
+ path={`/blog/${slug}`}
55
+ PageComponent={AuthorizedPostPage}
56
+ ErrorComponent={DefaultError}
57
+ LoadingComponent={PostLoading}
58
+ NotFoundComponent={NotFoundPage}
59
+ props={{ slug }}
60
+ onError={(error) => {
61
+ if (onRouteError) {
62
+ onRouteError("post", error, {
63
+ path: `/blog/${slug}`,
64
+ isSSR: typeof window === "undefined",
65
+ slug,
66
+ });
67
+ }
68
+ }}
69
+ />
70
+ );
71
+ }
48
72
 
49
- // Exported wrapped component with error and loading boundaries
50
- export function PostPageComponent({ slug }: { slug: string }) {
51
- const { onRouteError } =
52
- usePluginOverrides<BlogPluginOverrides>(BLOG_PLUGIN_ID);
53
- return (
54
- <ComposedRoute
55
- path={`/blog/${slug}`}
56
- PageComponent={AuthorizedPostPage}
57
- ErrorComponent={DefaultError}
58
- LoadingComponent={PostLoading}
59
- NotFoundComponent={NotFoundPage}
60
- props={{ slug }}
61
- onError={(error) => {
62
- if (onRouteError) {
63
- onRouteError("post", error, {
64
- path: `/blog/${slug}`,
65
- isSSR: typeof window === "undefined",
66
- slug,
67
- });
68
- }
69
- }}
70
- />
71
- );
73
+ return PostPageComponent;
72
74
  }
75
+
76
+ export const PostPageComponent = createPostPage(
77
+ lazy(() =>
78
+ import("./post-page.internal").then((m) => ({ default: m.PostPage })),
79
+ ),
80
+ );
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { lazy } from "react";
3
+ import { lazy, type ComponentType } from "react";
4
4
  import { usePluginOverrides } from "@btst/stack/context";
5
5
  import type { BlogPluginOverrides } from "../../overrides";
6
6
  import { BLOG_PLUGIN_ID } from "../../constants";
@@ -10,33 +10,39 @@ import { PostsLoading } from "../loading";
10
10
  import { NotFoundPage } from "./404-page";
11
11
  import { blogPermissions } from "../../../permissions";
12
12
 
13
- // Lazy load the internal component with actual page content
14
- const TagPage = lazy(() =>
15
- import("./tag-page.internal").then((m) => ({ default: m.TagPage })),
16
- );
13
+ // Share the guarded page between the lazy registry and native route entry.
14
+ export function createTagPage(TagPage: ComponentType<{ tagSlug: string }>) {
15
+ // Exported wrapped component with error and loading boundaries
16
+ function TagPageComponent({ tagSlug }: { tagSlug: string }) {
17
+ const { onRouteError } =
18
+ usePluginOverrides<BlogPluginOverrides>(BLOG_PLUGIN_ID);
19
+ return (
20
+ <ComposedRoute
21
+ path={`/blog/tag/${tagSlug}`}
22
+ PageComponent={TagPage}
23
+ ErrorComponent={DefaultError}
24
+ LoadingComponent={PostsLoading}
25
+ NotFoundComponent={NotFoundPage}
26
+ permission={blogPermissions.tag.read()}
27
+ props={{ tagSlug }}
28
+ onError={(error) => {
29
+ if (onRouteError) {
30
+ onRouteError("tag", error, {
31
+ path: `/blog/tag/${tagSlug}`,
32
+ isSSR: typeof window === "undefined",
33
+ tagSlug,
34
+ });
35
+ }
36
+ }}
37
+ />
38
+ );
39
+ }
17
40
 
18
- // Exported wrapped component with error and loading boundaries
19
- export function TagPageComponent({ tagSlug }: { tagSlug: string }) {
20
- const { onRouteError } =
21
- usePluginOverrides<BlogPluginOverrides>(BLOG_PLUGIN_ID);
22
- return (
23
- <ComposedRoute
24
- path={`/blog/tag/${tagSlug}`}
25
- PageComponent={TagPage}
26
- ErrorComponent={DefaultError}
27
- LoadingComponent={PostsLoading}
28
- NotFoundComponent={NotFoundPage}
29
- permission={blogPermissions.tag.read()}
30
- props={{ tagSlug }}
31
- onError={(error) => {
32
- if (onRouteError) {
33
- onRouteError("tag", error, {
34
- path: `/blog/tag/${tagSlug}`,
35
- isSSR: typeof window === "undefined",
36
- tagSlug,
37
- });
38
- }
39
- }}
40
- />
41
- );
41
+ return TagPageComponent;
42
42
  }
43
+
44
+ export const TagPageComponent = createTagPage(
45
+ lazy(() =>
46
+ import("./tag-page.internal").then((m) => ({ default: m.TagPage })),
47
+ ),
48
+ );
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
3
+ import { createPostPage } from "../components/pages/post-page";
4
+ import { PostPage as Content } from "../components/pages/post-page.internal";
5
+
6
+ /** Complete guarded page for a native framework route; contains no lazy page import. */
7
+ export const PostPage = createPostPage(Content);
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
3
+ import { createHomePage } from "../components/pages/home-page";
4
+ import { HomePage as Content } from "../components/pages/home-page.internal";
5
+
6
+ /** Complete guarded page for a native framework route; contains no lazy page import. */
7
+ export const PostListPage = createHomePage(Content);
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
3
+ import { createTagPage } from "../components/pages/tag-page";
4
+ import { TagPage as Content } from "../components/pages/tag-page.internal";
5
+
6
+ /** Complete guarded page for a native framework route; contains no lazy page import. */
7
+ export const TagPage = createTagPage(Content);
@@ -127,11 +127,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
127
127
  readonly status: Form["status"];
128
128
  readonly createdAt: string;
129
129
  readonly updatedAt: string;
130
- readonly slug: string;
130
+ readonly schema: string;
131
131
  readonly id: string;
132
- readonly name: string;
133
132
  readonly description?: string | undefined;
134
- readonly schema: string;
133
+ readonly slug: string;
134
+ readonly name: string;
135
135
  readonly successMessage?: string | undefined;
136
136
  readonly redirectUrl?: string | undefined;
137
137
  readonly createdBy?: string | undefined;
@@ -151,11 +151,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
151
151
  readonly status: Form["status"];
152
152
  readonly createdAt: string;
153
153
  readonly updatedAt: string;
154
- readonly slug: string;
154
+ readonly schema: string;
155
155
  readonly id: string;
156
- readonly name: string;
157
156
  readonly description?: string | undefined;
158
- readonly schema: string;
157
+ readonly slug: string;
158
+ readonly name: string;
159
159
  readonly successMessage?: string | undefined;
160
160
  readonly redirectUrl?: string | undefined;
161
161
  readonly createdBy?: string | undefined;
@@ -171,11 +171,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
171
171
  readonly status: Form["status"];
172
172
  readonly createdAt: string;
173
173
  readonly updatedAt: string;
174
- readonly slug: string;
174
+ readonly schema: string;
175
175
  readonly id: string;
176
- readonly name: string;
177
176
  readonly description?: string | undefined;
178
- readonly schema: string;
177
+ readonly slug: string;
178
+ readonly name: string;
179
179
  readonly successMessage?: string | undefined;
180
180
  readonly redirectUrl?: string | undefined;
181
181
  readonly createdBy?: string | undefined;
@@ -191,11 +191,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
191
191
  readonly status: Form["status"];
192
192
  readonly createdAt: string;
193
193
  readonly updatedAt: string;
194
- readonly slug: string;
194
+ readonly schema: string;
195
195
  readonly id: string;
196
- readonly name: string;
197
196
  readonly description?: string | undefined;
198
- readonly schema: string;
197
+ readonly slug: string;
198
+ readonly name: string;
199
199
  readonly successMessage?: string | undefined;
200
200
  readonly redirectUrl?: string | undefined;
201
201
  readonly createdBy?: string | undefined;
@@ -225,11 +225,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
225
225
  readonly status: Form["status"];
226
226
  readonly createdAt: string;
227
227
  readonly updatedAt: string;
228
- readonly slug: string;
228
+ readonly schema: string;
229
229
  readonly id: string;
230
- readonly name: string;
231
230
  readonly description?: string | undefined;
232
- readonly schema: string;
231
+ readonly slug: string;
232
+ readonly name: string;
233
233
  readonly successMessage?: string | undefined;
234
234
  readonly redirectUrl?: string | undefined;
235
235
  readonly createdBy?: string | undefined;
@@ -259,11 +259,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
259
259
  readonly status: Form["status"];
260
260
  readonly createdAt: string;
261
261
  readonly updatedAt: string;
262
- readonly slug: string;
262
+ readonly schema: string;
263
263
  readonly id: string;
264
- readonly name: string;
265
264
  readonly description?: string | undefined;
266
- readonly schema: string;
265
+ readonly slug: string;
266
+ readonly name: string;
267
267
  readonly successMessage?: string | undefined;
268
268
  readonly redirectUrl?: string | undefined;
269
269
  readonly createdBy?: string | undefined;
@@ -291,10 +291,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
291
291
  readonly redirectUrl?: string | undefined;
292
292
  };
293
293
  readonly submittedAt: string;
294
- readonly data: string;
295
294
  readonly id: string;
296
295
  readonly formId: string;
297
296
  readonly submittedBy?: string | undefined;
297
+ readonly data: string;
298
298
  readonly ipAddress?: string | undefined;
299
299
  readonly userAgent?: string | undefined;
300
300
  }>;
@@ -335,10 +335,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
335
335
  readonly [x: string]: any;
336
336
  } | null;
337
337
  readonly submittedAt: string;
338
- readonly data: string;
339
338
  readonly id: string;
340
339
  readonly formId: string;
341
340
  readonly submittedBy?: string | undefined;
341
+ readonly data: string;
342
342
  readonly ipAddress?: string | undefined;
343
343
  readonly userAgent?: string | undefined;
344
344
  }>;
@@ -127,11 +127,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
127
127
  readonly status: Form["status"];
128
128
  readonly createdAt: string;
129
129
  readonly updatedAt: string;
130
- readonly slug: string;
130
+ readonly schema: string;
131
131
  readonly id: string;
132
- readonly name: string;
133
132
  readonly description?: string | undefined;
134
- readonly schema: string;
133
+ readonly slug: string;
134
+ readonly name: string;
135
135
  readonly successMessage?: string | undefined;
136
136
  readonly redirectUrl?: string | undefined;
137
137
  readonly createdBy?: string | undefined;
@@ -151,11 +151,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
151
151
  readonly status: Form["status"];
152
152
  readonly createdAt: string;
153
153
  readonly updatedAt: string;
154
- readonly slug: string;
154
+ readonly schema: string;
155
155
  readonly id: string;
156
- readonly name: string;
157
156
  readonly description?: string | undefined;
158
- readonly schema: string;
157
+ readonly slug: string;
158
+ readonly name: string;
159
159
  readonly successMessage?: string | undefined;
160
160
  readonly redirectUrl?: string | undefined;
161
161
  readonly createdBy?: string | undefined;
@@ -171,11 +171,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
171
171
  readonly status: Form["status"];
172
172
  readonly createdAt: string;
173
173
  readonly updatedAt: string;
174
- readonly slug: string;
174
+ readonly schema: string;
175
175
  readonly id: string;
176
- readonly name: string;
177
176
  readonly description?: string | undefined;
178
- readonly schema: string;
177
+ readonly slug: string;
178
+ readonly name: string;
179
179
  readonly successMessage?: string | undefined;
180
180
  readonly redirectUrl?: string | undefined;
181
181
  readonly createdBy?: string | undefined;
@@ -191,11 +191,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
191
191
  readonly status: Form["status"];
192
192
  readonly createdAt: string;
193
193
  readonly updatedAt: string;
194
- readonly slug: string;
194
+ readonly schema: string;
195
195
  readonly id: string;
196
- readonly name: string;
197
196
  readonly description?: string | undefined;
198
- readonly schema: string;
197
+ readonly slug: string;
198
+ readonly name: string;
199
199
  readonly successMessage?: string | undefined;
200
200
  readonly redirectUrl?: string | undefined;
201
201
  readonly createdBy?: string | undefined;
@@ -225,11 +225,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
225
225
  readonly status: Form["status"];
226
226
  readonly createdAt: string;
227
227
  readonly updatedAt: string;
228
- readonly slug: string;
228
+ readonly schema: string;
229
229
  readonly id: string;
230
- readonly name: string;
231
230
  readonly description?: string | undefined;
232
- readonly schema: string;
231
+ readonly slug: string;
232
+ readonly name: string;
233
233
  readonly successMessage?: string | undefined;
234
234
  readonly redirectUrl?: string | undefined;
235
235
  readonly createdBy?: string | undefined;
@@ -259,11 +259,11 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
259
259
  readonly status: Form["status"];
260
260
  readonly createdAt: string;
261
261
  readonly updatedAt: string;
262
- readonly slug: string;
262
+ readonly schema: string;
263
263
  readonly id: string;
264
- readonly name: string;
265
264
  readonly description?: string | undefined;
266
- readonly schema: string;
265
+ readonly slug: string;
266
+ readonly name: string;
267
267
  readonly successMessage?: string | undefined;
268
268
  readonly redirectUrl?: string | undefined;
269
269
  readonly createdBy?: string | undefined;
@@ -291,10 +291,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
291
291
  readonly redirectUrl?: string | undefined;
292
292
  };
293
293
  readonly submittedAt: string;
294
- readonly data: string;
295
294
  readonly id: string;
296
295
  readonly formId: string;
297
296
  readonly submittedBy?: string | undefined;
297
+ readonly data: string;
298
298
  readonly ipAddress?: string | undefined;
299
299
  readonly userAgent?: string | undefined;
300
300
  }>;
@@ -335,10 +335,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
335
335
  readonly [x: string]: any;
336
336
  } | null;
337
337
  readonly submittedAt: string;
338
- readonly data: string;
339
338
  readonly id: string;
340
339
  readonly formId: string;
341
340
  readonly submittedBy?: string | undefined;
341
+ readonly data: string;
342
342
  readonly ipAddress?: string | undefined;
343
343
  readonly userAgent?: string | undefined;
344
344
  }>;
@@ -1,6 +1,13 @@
1
1
  import { z } from 'zod';
2
2
 
3
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>]>>>>;
4
11
  slug: z.ZodOptional<z.ZodString>;
5
12
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
6
13
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -10,13 +17,6 @@ declare const createPostSchema: z.ZodObject<{
10
17
  excerpt: z.ZodString;
11
18
  image: z.ZodOptional<z.ZodString>;
12
19
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
13
- tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
14
- name: z.ZodString;
15
- }, z.core.$strip>, z.ZodObject<{
16
- id: z.ZodString;
17
- name: z.ZodString;
18
- slug: z.ZodString;
19
- }, z.core.$strip>]>>>>;
20
20
  }, z.core.$strip>;
21
21
  declare const updatePostSchema: z.ZodObject<{
22
22
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;