@btst/stack 2.9.3 → 2.10.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.
- package/README.md +12 -0
- package/dist/packages/stack/src/plugins/blog/client/plugin.cjs +22 -11
- package/dist/packages/stack/src/plugins/blog/client/plugin.mjs +22 -11
- package/dist/packages/stack/src/plugins/cms/client/plugin.cjs +71 -39
- package/dist/packages/stack/src/plugins/cms/client/plugin.mjs +71 -39
- package/dist/packages/stack/src/plugins/comments/client/plugin.cjs +62 -2
- package/dist/packages/stack/src/plugins/comments/client/plugin.mjs +63 -3
- package/dist/packages/stack/src/plugins/comments/client/utils.cjs +2 -11
- package/dist/packages/stack/src/plugins/comments/client/utils.mjs +2 -11
- package/dist/packages/stack/src/plugins/comments/error-utils.cjs +15 -0
- package/dist/packages/stack/src/plugins/comments/error-utils.mjs +13 -0
- package/dist/packages/stack/src/plugins/form-builder/client/plugin.cjs +59 -31
- package/dist/packages/stack/src/plugins/form-builder/client/plugin.mjs +59 -31
- package/dist/packages/stack/src/plugins/ui-builder/client/plugin.cjs +52 -25
- package/dist/packages/stack/src/plugins/ui-builder/client/plugin.mjs +53 -26
- package/dist/packages/stack/src/plugins/utils.cjs +6 -0
- package/dist/packages/stack/src/plugins/utils.mjs +5 -1
- package/dist/plugins/blog/api/index.d.cts +2 -2
- package/dist/plugins/blog/api/index.d.mts +2 -2
- package/dist/plugins/blog/api/index.d.ts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
- package/dist/plugins/blog/client/index.d.cts +2 -2
- package/dist/plugins/blog/client/index.d.mts +2 -2
- package/dist/plugins/blog/client/index.d.ts +2 -2
- package/dist/plugins/blog/query-keys.d.cts +2 -2
- package/dist/plugins/blog/query-keys.d.mts +2 -2
- package/dist/plugins/blog/query-keys.d.ts +2 -2
- package/dist/plugins/client/index.cjs +2 -0
- package/dist/plugins/client/index.d.cts +15 -1
- package/dist/plugins/client/index.d.mts +15 -1
- package/dist/plugins/client/index.d.ts +15 -1
- package/dist/plugins/client/index.mjs +1 -1
- package/dist/plugins/comments/client/index.d.cts +5 -0
- package/dist/plugins/comments/client/index.d.mts +5 -0
- package/dist/plugins/comments/client/index.d.ts +5 -0
- package/dist/plugins/comments/query-keys.cjs +4 -4
- package/dist/plugins/comments/query-keys.mjs +1 -1
- package/dist/plugins/kanban/api/index.d.cts +1 -1
- package/dist/plugins/kanban/api/index.d.mts +1 -1
- package/dist/plugins/kanban/api/index.d.ts +1 -1
- package/dist/plugins/kanban/query-keys.d.cts +1 -1
- package/dist/plugins/kanban/query-keys.d.mts +1 -1
- package/dist/plugins/kanban/query-keys.d.ts +1 -1
- package/dist/shared/{stack.IUeyQKrm.d.mts → stack.BSqJrCTM.d.cts} +5 -5
- package/dist/shared/{stack.D7HSzZdG.d.ts → stack.BXxrFL9R.d.ts} +5 -5
- package/dist/shared/{stack.6mEHS2WH.d.mts → stack.DOZ1EXjM.d.mts} +3 -3
- package/dist/shared/{stack.AJTXI7kw.d.cts → stack.DX-tQ93o.d.cts} +3 -3
- package/dist/shared/{stack.DjgpFWq3.d.cts → stack.DzOhpIYM.d.mts} +5 -5
- package/dist/shared/{stack.QYn-Px94.d.ts → stack.VF6FhyZw.d.ts} +3 -3
- package/package.json +1 -1
- package/src/__tests__/client-plugin-ssr-loaders.test.ts +329 -0
- package/src/plugins/blog/client/plugin.tsx +23 -14
- package/src/plugins/client/index.ts +2 -0
- package/src/plugins/cms/client/plugin.tsx +73 -42
- package/src/plugins/comments/client/plugin.tsx +82 -2
- package/src/plugins/comments/client/utils.ts +2 -14
- package/src/plugins/comments/error-utils.ts +17 -0
- package/src/plugins/comments/query-keys.ts +1 -1
- package/src/plugins/form-builder/client/plugin.tsx +59 -35
- package/src/plugins/ui-builder/client/plugin.tsx +57 -27
- package/src/plugins/utils.ts +18 -0
- package/dist/shared/{stack.eq5eg1yt.d.cts → stack.BOokfhZD.d.cts} +13 -13
- package/dist/shared/{stack.BQmuNl5p.d.ts → stack.BWp0hcm9.d.cts} +3 -3
- package/dist/shared/{stack.BQmuNl5p.d.cts → stack.BWp0hcm9.d.mts} +3 -3
- package/dist/shared/{stack.BQmuNl5p.d.mts → stack.BWp0hcm9.d.ts} +3 -3
- package/dist/shared/{stack.CMbX8Q5C.d.ts → stack.BvCR4-9H.d.ts} +13 -13
- package/dist/shared/{stack.Dj04W2c3.d.mts → stack.CWxAl9K3.d.mts} +13 -13
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { lazy } from 'react';
|
|
3
|
-
import { defineClientPlugin, createApiClient, runClientHookWithShim } from '@btst/stack/plugins/client';
|
|
3
|
+
import { defineClientPlugin, createApiClient, runClientHookWithShim, isConnectionError } from '@btst/stack/plugins/client';
|
|
4
4
|
import { createRoute } from '@btst/yar';
|
|
5
5
|
import { createCMSQueryKeys } from '../../../../../../plugins/cms/query-keys.mjs';
|
|
6
|
+
import { createSanitizedSSRLoaderError } from '../../utils.mjs';
|
|
6
7
|
import { UI_BUILDER_TYPE_SLUG } from '../schemas.mjs';
|
|
7
8
|
|
|
8
9
|
const PageListPageComponent = lazy(
|
|
@@ -27,6 +28,18 @@ function createPageListLoader(config) {
|
|
|
27
28
|
apiBasePath,
|
|
28
29
|
headers
|
|
29
30
|
};
|
|
31
|
+
const client = createApiClient({
|
|
32
|
+
baseURL: apiBaseURL,
|
|
33
|
+
basePath: apiBasePath
|
|
34
|
+
});
|
|
35
|
+
const queries = createCMSQueryKeys(client, headers);
|
|
36
|
+
const limit = 20;
|
|
37
|
+
const listQuery = queries.cmsContent.list({
|
|
38
|
+
typeSlug,
|
|
39
|
+
limit,
|
|
40
|
+
offset: 0
|
|
41
|
+
});
|
|
42
|
+
const uiBuilderListQueryKey = [...listQuery.queryKey, "ui-builder"];
|
|
30
43
|
try {
|
|
31
44
|
if (hooks?.beforeLoadPageList) {
|
|
32
45
|
await runClientHookWithShim(
|
|
@@ -34,19 +47,8 @@ function createPageListLoader(config) {
|
|
|
34
47
|
"Load prevented by beforeLoadPageList hook"
|
|
35
48
|
);
|
|
36
49
|
}
|
|
37
|
-
const client = createApiClient({
|
|
38
|
-
baseURL: apiBaseURL,
|
|
39
|
-
basePath: apiBasePath
|
|
40
|
-
});
|
|
41
|
-
const queries = createCMSQueryKeys(client, headers);
|
|
42
|
-
const limit = 20;
|
|
43
|
-
const listQuery = queries.cmsContent.list({
|
|
44
|
-
typeSlug,
|
|
45
|
-
limit,
|
|
46
|
-
offset: 0
|
|
47
|
-
});
|
|
48
50
|
await queryClient.prefetchInfiniteQuery({
|
|
49
|
-
queryKey:
|
|
51
|
+
queryKey: uiBuilderListQueryKey,
|
|
50
52
|
queryFn: async ({ pageParam = 0 }) => {
|
|
51
53
|
const response = await client("/content/:typeSlug", {
|
|
52
54
|
method: "GET",
|
|
@@ -65,14 +67,28 @@ function createPageListLoader(config) {
|
|
|
65
67
|
await hooks.afterLoadPageList(context);
|
|
66
68
|
}
|
|
67
69
|
const queryState = queryClient.getQueryState([
|
|
68
|
-
...
|
|
69
|
-
"ui-builder"
|
|
70
|
+
...uiBuilderListQueryKey
|
|
70
71
|
]);
|
|
71
72
|
if (queryState?.error && hooks?.onLoadError) {
|
|
72
73
|
const error = queryState.error instanceof Error ? queryState.error : new Error(String(queryState.error));
|
|
73
74
|
await hooks.onLoadError(error, context);
|
|
74
75
|
}
|
|
75
76
|
} catch (error) {
|
|
77
|
+
if (isConnectionError(error)) {
|
|
78
|
+
console.warn(
|
|
79
|
+
"[btst/ui-builder] route.loader() failed \u2014 no server running at build time. Use myStack.api.uiBuilder.prefetchForRoute() for SSG data prefetching."
|
|
80
|
+
);
|
|
81
|
+
} else {
|
|
82
|
+
const errToStore = createSanitizedSSRLoaderError();
|
|
83
|
+
await queryClient.prefetchInfiniteQuery({
|
|
84
|
+
queryKey: uiBuilderListQueryKey,
|
|
85
|
+
queryFn: () => {
|
|
86
|
+
throw errToStore;
|
|
87
|
+
},
|
|
88
|
+
initialPageParam: 0,
|
|
89
|
+
retry: false
|
|
90
|
+
});
|
|
91
|
+
}
|
|
76
92
|
if (hooks?.onLoadError) {
|
|
77
93
|
await hooks.onLoadError(error, context);
|
|
78
94
|
}
|
|
@@ -93,6 +109,12 @@ function createPageBuilderLoader(id, config) {
|
|
|
93
109
|
apiBasePath,
|
|
94
110
|
headers
|
|
95
111
|
};
|
|
112
|
+
const client = createApiClient({
|
|
113
|
+
baseURL: apiBaseURL,
|
|
114
|
+
basePath: apiBasePath
|
|
115
|
+
});
|
|
116
|
+
const queries = createCMSQueryKeys(client, headers);
|
|
117
|
+
const pageQuery = id ? queries.cmsContent.detail(typeSlug, id) : void 0;
|
|
96
118
|
try {
|
|
97
119
|
if (hooks?.beforeLoadPageBuilder) {
|
|
98
120
|
await runClientHookWithShim(
|
|
@@ -100,29 +122,34 @@ function createPageBuilderLoader(id, config) {
|
|
|
100
122
|
"Load prevented by beforeLoadPageBuilder hook"
|
|
101
123
|
);
|
|
102
124
|
}
|
|
103
|
-
const client = createApiClient({
|
|
104
|
-
baseURL: apiBaseURL,
|
|
105
|
-
basePath: apiBasePath
|
|
106
|
-
});
|
|
107
|
-
const queries = createCMSQueryKeys(client, headers);
|
|
108
125
|
if (id) {
|
|
109
|
-
await queryClient.prefetchQuery(
|
|
110
|
-
queries.cmsContent.detail(typeSlug, id)
|
|
111
|
-
);
|
|
126
|
+
await queryClient.prefetchQuery(pageQuery);
|
|
112
127
|
}
|
|
113
128
|
if (hooks?.afterLoadPageBuilder) {
|
|
114
129
|
await hooks.afterLoadPageBuilder(id, context);
|
|
115
130
|
}
|
|
116
131
|
if (id) {
|
|
117
|
-
const queryState = queryClient.getQueryState(
|
|
118
|
-
queries.cmsContent.detail(typeSlug, id).queryKey
|
|
119
|
-
);
|
|
132
|
+
const queryState = queryClient.getQueryState(pageQuery.queryKey);
|
|
120
133
|
if (queryState?.error && hooks?.onLoadError) {
|
|
121
134
|
const error = queryState.error instanceof Error ? queryState.error : new Error(String(queryState.error));
|
|
122
135
|
await hooks.onLoadError(error, context);
|
|
123
136
|
}
|
|
124
137
|
}
|
|
125
138
|
} catch (error) {
|
|
139
|
+
if (isConnectionError(error)) {
|
|
140
|
+
console.warn(
|
|
141
|
+
"[btst/ui-builder] route.loader() failed \u2014 no server running at build time. Use myStack.api.uiBuilder.prefetchForRoute() for SSG data prefetching."
|
|
142
|
+
);
|
|
143
|
+
} else if (pageQuery) {
|
|
144
|
+
const errToStore = createSanitizedSSRLoaderError();
|
|
145
|
+
await queryClient.prefetchQuery({
|
|
146
|
+
queryKey: pageQuery.queryKey,
|
|
147
|
+
queryFn: () => {
|
|
148
|
+
throw errToStore;
|
|
149
|
+
},
|
|
150
|
+
retry: false
|
|
151
|
+
});
|
|
152
|
+
}
|
|
126
153
|
if (hooks?.onLoadError) {
|
|
127
154
|
await hooks.onLoadError(error, context);
|
|
128
155
|
}
|
|
@@ -47,6 +47,10 @@ function isConnectionError(err) {
|
|
|
47
47
|
const code = err.cause?.code ?? err.code;
|
|
48
48
|
return err.message.includes("ECONNREFUSED") || err.message.includes("fetch failed") || err.message.includes("ERR_CONNECTION_REFUSED") || code === "ECONNREFUSED" || code === "ERR_CONNECTION_REFUSED";
|
|
49
49
|
}
|
|
50
|
+
const SSR_LOADER_ERROR_MESSAGE = "Failed to load data.";
|
|
51
|
+
function createSanitizedSSRLoaderError() {
|
|
52
|
+
return new Error(SSR_LOADER_ERROR_MESSAGE);
|
|
53
|
+
}
|
|
50
54
|
function createApiClient(options) {
|
|
51
55
|
const { baseURL = "", basePath = "/" } = options ?? {};
|
|
52
56
|
const normalizedBaseURL = baseURL ? baseURL.replace(/\/$/, "") : "";
|
|
@@ -58,7 +62,9 @@ function createApiClient(options) {
|
|
|
58
62
|
});
|
|
59
63
|
}
|
|
60
64
|
|
|
65
|
+
exports.SSR_LOADER_ERROR_MESSAGE = SSR_LOADER_ERROR_MESSAGE;
|
|
61
66
|
exports.createApiClient = createApiClient;
|
|
67
|
+
exports.createSanitizedSSRLoaderError = createSanitizedSSRLoaderError;
|
|
62
68
|
exports.isConnectionError = isConnectionError;
|
|
63
69
|
exports.runClientHookWithShim = runClientHookWithShim;
|
|
64
70
|
exports.runHookWithShim = runHookWithShim;
|
|
@@ -45,6 +45,10 @@ function isConnectionError(err) {
|
|
|
45
45
|
const code = err.cause?.code ?? err.code;
|
|
46
46
|
return err.message.includes("ECONNREFUSED") || err.message.includes("fetch failed") || err.message.includes("ERR_CONNECTION_REFUSED") || code === "ECONNREFUSED" || code === "ERR_CONNECTION_REFUSED";
|
|
47
47
|
}
|
|
48
|
+
const SSR_LOADER_ERROR_MESSAGE = "Failed to load data.";
|
|
49
|
+
function createSanitizedSSRLoaderError() {
|
|
50
|
+
return new Error(SSR_LOADER_ERROR_MESSAGE);
|
|
51
|
+
}
|
|
48
52
|
function createApiClient(options) {
|
|
49
53
|
const { baseURL = "", basePath = "/" } = options ?? {};
|
|
50
54
|
const normalizedBaseURL = baseURL ? baseURL.replace(/\/$/, "") : "";
|
|
@@ -56,4 +60,4 @@ function createApiClient(options) {
|
|
|
56
60
|
});
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
export { createApiClient, isConnectionError, runClientHookWithShim, runHookWithShim };
|
|
63
|
+
export { SSR_LOADER_ERROR_MESSAGE, createApiClient, createSanitizedSSRLoaderError, isConnectionError, runClientHookWithShim, runHookWithShim };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.
|
|
2
|
-
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.
|
|
1
|
+
export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.BSqJrCTM.cjs';
|
|
2
|
+
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BWp0hcm9.cjs';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import '@btst/stack/plugins/client';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.
|
|
2
|
-
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.
|
|
1
|
+
export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.DzOhpIYM.mjs';
|
|
2
|
+
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BWp0hcm9.mjs';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import '@btst/stack/plugins/client';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.
|
|
2
|
-
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.
|
|
1
|
+
export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.BXxrFL9R.js';
|
|
2
|
+
import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BWp0hcm9.js';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import '@btst/stack/plugins/client';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
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.DX-tQ93o.cjs';
|
|
2
2
|
import '@tanstack/react-query';
|
|
3
|
-
import '../../../../shared/stack.
|
|
3
|
+
import '../../../../shared/stack.BWp0hcm9.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
declare function useDebounce<T>(value: T, delay?: number): T;
|
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
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.DOZ1EXjM.mjs';
|
|
2
2
|
import '@tanstack/react-query';
|
|
3
|
-
import '../../../../shared/stack.
|
|
3
|
+
import '../../../../shared/stack.BWp0hcm9.mjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
declare function useDebounce<T>(value: T, delay?: number): T;
|
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
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.VF6FhyZw.js';
|
|
2
2
|
import '@tanstack/react-query';
|
|
3
|
-
import '../../../../shared/stack.
|
|
3
|
+
import '../../../../shared/stack.BWp0hcm9.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
declare function useDebounce<T>(value: T, delay?: number): T;
|
|
@@ -2,8 +2,8 @@ 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.
|
|
6
|
-
export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.
|
|
5
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.BWp0hcm9.cjs';
|
|
6
|
+
export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.DX-tQ93o.cjs';
|
|
7
7
|
import 'zod';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -2,8 +2,8 @@ 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.
|
|
6
|
-
export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.
|
|
5
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.BWp0hcm9.mjs';
|
|
6
|
+
export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.DOZ1EXjM.mjs';
|
|
7
7
|
import 'zod';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -2,8 +2,8 @@ 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.
|
|
6
|
-
export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.
|
|
5
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.BWp0hcm9.js';
|
|
6
|
+
export { U as UsePostsOptions, a as UsePostsResult } from '../../../shared/stack.VF6FhyZw.js';
|
|
7
7
|
import 'zod';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@tanstack/react-query';
|
|
2
|
-
export { d as createBlogQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { d as createBlogQueryKeys } from '../../shared/stack.BSqJrCTM.cjs';
|
|
3
3
|
import '@btst/stack/plugins/client';
|
|
4
|
-
import '../../shared/stack.
|
|
4
|
+
import '../../shared/stack.BWp0hcm9.cjs';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
6
6
|
import '@btst/db';
|
|
7
7
|
import 'better-call';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@tanstack/react-query';
|
|
2
|
-
export { d as createBlogQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { d as createBlogQueryKeys } from '../../shared/stack.DzOhpIYM.mjs';
|
|
3
3
|
import '@btst/stack/plugins/client';
|
|
4
|
-
import '../../shared/stack.
|
|
4
|
+
import '../../shared/stack.BWp0hcm9.mjs';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
6
6
|
import '@btst/db';
|
|
7
7
|
import 'better-call';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@tanstack/react-query';
|
|
2
|
-
export { d as createBlogQueryKeys } from '../../shared/stack.
|
|
2
|
+
export { d as createBlogQueryKeys } from '../../shared/stack.BXxrFL9R.js';
|
|
3
3
|
import '@btst/stack/plugins/client';
|
|
4
|
-
import '../../shared/stack.
|
|
4
|
+
import '../../shared/stack.BWp0hcm9.js';
|
|
5
5
|
import '@btst/stack/plugins/api';
|
|
6
6
|
import '@btst/db';
|
|
7
7
|
import 'better-call';
|
|
@@ -8,7 +8,9 @@ function defineClientPlugin(plugin) {
|
|
|
8
8
|
return plugin;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
exports.SSR_LOADER_ERROR_MESSAGE = utils.SSR_LOADER_ERROR_MESSAGE;
|
|
11
12
|
exports.createApiClient = utils.createApiClient;
|
|
13
|
+
exports.createSanitizedSSRLoaderError = utils.createSanitizedSSRLoaderError;
|
|
12
14
|
exports.isConnectionError = utils.isConnectionError;
|
|
13
15
|
exports.runClientHookWithShim = utils.runClientHookWithShim;
|
|
14
16
|
exports.createRoute = yar.createRoute;
|
|
@@ -20,6 +20,20 @@ declare function runClientHookWithShim<T>(hookFn: () => Promise<T> | T, defaultM
|
|
|
20
20
|
* `route.loader()` is called during `next build` with no HTTP server running.
|
|
21
21
|
*/
|
|
22
22
|
declare function isConnectionError(err: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Public-safe message used when SSR loader failures are intentionally seeded
|
|
25
|
+
* into React Query so Error Boundaries can render on the client.
|
|
26
|
+
*
|
|
27
|
+
* Never include raw server error text here because dehydrated query state can
|
|
28
|
+
* be serialized into HTML.
|
|
29
|
+
*/
|
|
30
|
+
declare const SSR_LOADER_ERROR_MESSAGE = "Failed to load data.";
|
|
31
|
+
/**
|
|
32
|
+
* Creates a sanitized Error for SSR loader cache seeding.
|
|
33
|
+
*
|
|
34
|
+
* Use this instead of storing raw server errors in dehydrated query state.
|
|
35
|
+
*/
|
|
36
|
+
declare function createSanitizedSSRLoaderError(): Error;
|
|
23
37
|
|
|
24
38
|
interface CreateApiClientOptions {
|
|
25
39
|
baseURL?: string;
|
|
@@ -67,4 +81,4 @@ declare function createApiClient<TRouter extends Router | Record<string, Endpoin
|
|
|
67
81
|
*/
|
|
68
82
|
declare function defineClientPlugin<TOverrides = Record<string, never>, TRoutes extends Record<string, Route> = Record<string, Route>>(plugin: ClientPlugin<TOverrides, TRoutes>): ClientPlugin<TOverrides, TRoutes>;
|
|
69
83
|
|
|
70
|
-
export { ClientPlugin, createApiClient, defineClientPlugin, isConnectionError, runClientHookWithShim };
|
|
84
|
+
export { ClientPlugin, SSR_LOADER_ERROR_MESSAGE, createApiClient, createSanitizedSSRLoaderError, defineClientPlugin, isConnectionError, runClientHookWithShim };
|
|
@@ -20,6 +20,20 @@ declare function runClientHookWithShim<T>(hookFn: () => Promise<T> | T, defaultM
|
|
|
20
20
|
* `route.loader()` is called during `next build` with no HTTP server running.
|
|
21
21
|
*/
|
|
22
22
|
declare function isConnectionError(err: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Public-safe message used when SSR loader failures are intentionally seeded
|
|
25
|
+
* into React Query so Error Boundaries can render on the client.
|
|
26
|
+
*
|
|
27
|
+
* Never include raw server error text here because dehydrated query state can
|
|
28
|
+
* be serialized into HTML.
|
|
29
|
+
*/
|
|
30
|
+
declare const SSR_LOADER_ERROR_MESSAGE = "Failed to load data.";
|
|
31
|
+
/**
|
|
32
|
+
* Creates a sanitized Error for SSR loader cache seeding.
|
|
33
|
+
*
|
|
34
|
+
* Use this instead of storing raw server errors in dehydrated query state.
|
|
35
|
+
*/
|
|
36
|
+
declare function createSanitizedSSRLoaderError(): Error;
|
|
23
37
|
|
|
24
38
|
interface CreateApiClientOptions {
|
|
25
39
|
baseURL?: string;
|
|
@@ -67,4 +81,4 @@ declare function createApiClient<TRouter extends Router | Record<string, Endpoin
|
|
|
67
81
|
*/
|
|
68
82
|
declare function defineClientPlugin<TOverrides = Record<string, never>, TRoutes extends Record<string, Route> = Record<string, Route>>(plugin: ClientPlugin<TOverrides, TRoutes>): ClientPlugin<TOverrides, TRoutes>;
|
|
69
83
|
|
|
70
|
-
export { ClientPlugin, createApiClient, defineClientPlugin, isConnectionError, runClientHookWithShim };
|
|
84
|
+
export { ClientPlugin, SSR_LOADER_ERROR_MESSAGE, createApiClient, createSanitizedSSRLoaderError, defineClientPlugin, isConnectionError, runClientHookWithShim };
|
|
@@ -20,6 +20,20 @@ declare function runClientHookWithShim<T>(hookFn: () => Promise<T> | T, defaultM
|
|
|
20
20
|
* `route.loader()` is called during `next build` with no HTTP server running.
|
|
21
21
|
*/
|
|
22
22
|
declare function isConnectionError(err: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Public-safe message used when SSR loader failures are intentionally seeded
|
|
25
|
+
* into React Query so Error Boundaries can render on the client.
|
|
26
|
+
*
|
|
27
|
+
* Never include raw server error text here because dehydrated query state can
|
|
28
|
+
* be serialized into HTML.
|
|
29
|
+
*/
|
|
30
|
+
declare const SSR_LOADER_ERROR_MESSAGE = "Failed to load data.";
|
|
31
|
+
/**
|
|
32
|
+
* Creates a sanitized Error for SSR loader cache seeding.
|
|
33
|
+
*
|
|
34
|
+
* Use this instead of storing raw server errors in dehydrated query state.
|
|
35
|
+
*/
|
|
36
|
+
declare function createSanitizedSSRLoaderError(): Error;
|
|
23
37
|
|
|
24
38
|
interface CreateApiClientOptions {
|
|
25
39
|
baseURL?: string;
|
|
@@ -67,4 +81,4 @@ declare function createApiClient<TRouter extends Router | Record<string, Endpoin
|
|
|
67
81
|
*/
|
|
68
82
|
declare function defineClientPlugin<TOverrides = Record<string, never>, TRoutes extends Record<string, Route> = Record<string, Route>>(plugin: ClientPlugin<TOverrides, TRoutes>): ClientPlugin<TOverrides, TRoutes>;
|
|
69
83
|
|
|
70
|
-
export { ClientPlugin, createApiClient, defineClientPlugin, isConnectionError, runClientHookWithShim };
|
|
84
|
+
export { ClientPlugin, SSR_LOADER_ERROR_MESSAGE, createApiClient, createSanitizedSSRLoaderError, defineClientPlugin, isConnectionError, runClientHookWithShim };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createApiClient, isConnectionError, runClientHookWithShim } from '../../packages/stack/src/plugins/utils.mjs';
|
|
1
|
+
export { SSR_LOADER_ERROR_MESSAGE, createApiClient, createSanitizedSSRLoaderError, isConnectionError, runClientHookWithShim } from '../../packages/stack/src/plugins/utils.mjs';
|
|
2
2
|
export { createRoute, createRouter } from '@btst/yar';
|
|
3
3
|
export { createClient } from 'better-call/client';
|
|
4
4
|
|
|
@@ -21,6 +21,11 @@ interface LoaderContext {
|
|
|
21
21
|
apiBasePath: string;
|
|
22
22
|
/** Optional headers for the request */
|
|
23
23
|
headers?: Headers;
|
|
24
|
+
/**
|
|
25
|
+
* Optional current user ID for SSR loaders that need user-scoped query keys.
|
|
26
|
+
* Hooks (e.g. beforeLoadUserComments) may populate this.
|
|
27
|
+
*/
|
|
28
|
+
currentUserId?: string;
|
|
24
29
|
/** Additional context properties */
|
|
25
30
|
[key: string]: unknown;
|
|
26
31
|
}
|
|
@@ -21,6 +21,11 @@ interface LoaderContext {
|
|
|
21
21
|
apiBasePath: string;
|
|
22
22
|
/** Optional headers for the request */
|
|
23
23
|
headers?: Headers;
|
|
24
|
+
/**
|
|
25
|
+
* Optional current user ID for SSR loaders that need user-scoped query keys.
|
|
26
|
+
* Hooks (e.g. beforeLoadUserComments) may populate this.
|
|
27
|
+
*/
|
|
28
|
+
currentUserId?: string;
|
|
24
29
|
/** Additional context properties */
|
|
25
30
|
[key: string]: unknown;
|
|
26
31
|
}
|
|
@@ -21,6 +21,11 @@ interface LoaderContext {
|
|
|
21
21
|
apiBasePath: string;
|
|
22
22
|
/** Optional headers for the request */
|
|
23
23
|
headers?: Headers;
|
|
24
|
+
/**
|
|
25
|
+
* Optional current user ID for SSR loaders that need user-scoped query keys.
|
|
26
|
+
* Hooks (e.g. beforeLoadUserComments) may populate this.
|
|
27
|
+
*/
|
|
28
|
+
currentUserId?: string;
|
|
24
29
|
/** Additional context properties */
|
|
25
30
|
[key: string]: unknown;
|
|
26
31
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const queryKeyFactory = require('@lukemorales/query-key-factory');
|
|
4
4
|
const queryKeyDefs = require('../../packages/stack/src/plugins/comments/api/query-key-defs.cjs');
|
|
5
|
-
const
|
|
5
|
+
const errorUtils = require('../../packages/stack/src/plugins/comments/error-utils.cjs');
|
|
6
6
|
|
|
7
7
|
function isErrorResponse(response) {
|
|
8
8
|
return typeof response === "object" && response !== null && "error" in response && response.error !== null && response.error !== void 0;
|
|
@@ -40,7 +40,7 @@ function createCommentsQueries(client, headers) {
|
|
|
40
40
|
headers
|
|
41
41
|
});
|
|
42
42
|
if (isErrorResponse(response)) {
|
|
43
|
-
throw
|
|
43
|
+
throw errorUtils.toError(response.error);
|
|
44
44
|
}
|
|
45
45
|
const data = response.data;
|
|
46
46
|
return data ?? { items: [], total: 0, limit: 20, offset: 0 };
|
|
@@ -63,7 +63,7 @@ function createCommentCountQueries(client, headers) {
|
|
|
63
63
|
headers
|
|
64
64
|
});
|
|
65
65
|
if (isErrorResponse(response)) {
|
|
66
|
-
throw
|
|
66
|
+
throw errorUtils.toError(response.error);
|
|
67
67
|
}
|
|
68
68
|
const data = response.data;
|
|
69
69
|
return data?.count ?? 0;
|
|
@@ -96,7 +96,7 @@ function createCommentsThreadQueries(client, headers) {
|
|
|
96
96
|
headers
|
|
97
97
|
});
|
|
98
98
|
if (isErrorResponse(response)) {
|
|
99
|
-
throw
|
|
99
|
+
throw errorUtils.toError(response.error);
|
|
100
100
|
}
|
|
101
101
|
const data = response.data;
|
|
102
102
|
return data ?? {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mergeQueryKeys, createQueryKeys } from '@lukemorales/query-key-factory';
|
|
2
2
|
import { commentsListDiscriminator, commentCountDiscriminator, commentsThreadDiscriminator } from '../../packages/stack/src/plugins/comments/api/query-key-defs.mjs';
|
|
3
|
-
import { toError } from '../../packages/stack/src/plugins/comments/
|
|
3
|
+
import { toError } from '../../packages/stack/src/plugins/comments/error-utils.mjs';
|
|
4
4
|
|
|
5
5
|
function isErrorResponse(response) {
|
|
6
6
|
return typeof response === "object" && response !== null && "error" in response && response.error !== null && response.error !== void 0;
|
|
@@ -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.
|
|
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.BOokfhZD.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.
|
|
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.CWxAl9K3.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.
|
|
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.BvCR4-9H.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.
|
|
2
|
+
import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.BOokfhZD.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.
|
|
2
|
+
import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.CWxAl9K3.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.
|
|
2
|
+
import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.BvCR4-9H.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,7 +1,7 @@
|
|
|
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.
|
|
4
|
+
import { P as Post, T as Tag, c as createPostSchema, u as updatePostSchema, S as SerializedPost, a as SerializedTag } from './stack.BWp0hcm9.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';
|
|
@@ -244,11 +244,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
244
244
|
slug: string;
|
|
245
245
|
})[] | undefined;
|
|
246
246
|
slug?: string | undefined;
|
|
247
|
+
published?: boolean | undefined;
|
|
248
|
+
publishedAt?: unknown;
|
|
247
249
|
createdAt?: unknown;
|
|
248
250
|
updatedAt?: unknown;
|
|
249
|
-
publishedAt?: unknown;
|
|
250
251
|
image?: string | undefined;
|
|
251
|
-
published?: boolean | undefined;
|
|
252
252
|
}, {
|
|
253
253
|
title: string;
|
|
254
254
|
content: string;
|
|
@@ -261,11 +261,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
261
261
|
slug: string;
|
|
262
262
|
})[] | undefined;
|
|
263
263
|
slug?: string | undefined;
|
|
264
|
+
published?: boolean | undefined;
|
|
265
|
+
publishedAt?: unknown;
|
|
264
266
|
createdAt?: unknown;
|
|
265
267
|
updatedAt?: unknown;
|
|
266
|
-
publishedAt?: unknown;
|
|
267
268
|
image?: string | undefined;
|
|
268
|
-
published?: boolean | undefined;
|
|
269
269
|
}>;
|
|
270
270
|
}, Post>;
|
|
271
271
|
readonly updatePost: better_call.StrictEndpoint<"/posts/:id", {} & {
|
|
@@ -1,7 +1,7 @@
|
|
|
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.
|
|
4
|
+
import { P as Post, T as Tag, c as createPostSchema, u as updatePostSchema, S as SerializedPost, a as SerializedTag } from './stack.BWp0hcm9.js';
|
|
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';
|
|
@@ -244,11 +244,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
244
244
|
slug: string;
|
|
245
245
|
})[] | undefined;
|
|
246
246
|
slug?: string | undefined;
|
|
247
|
+
published?: boolean | undefined;
|
|
248
|
+
publishedAt?: unknown;
|
|
247
249
|
createdAt?: unknown;
|
|
248
250
|
updatedAt?: unknown;
|
|
249
|
-
publishedAt?: unknown;
|
|
250
251
|
image?: string | undefined;
|
|
251
|
-
published?: boolean | undefined;
|
|
252
252
|
}, {
|
|
253
253
|
title: string;
|
|
254
254
|
content: string;
|
|
@@ -261,11 +261,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
261
261
|
slug: string;
|
|
262
262
|
})[] | undefined;
|
|
263
263
|
slug?: string | undefined;
|
|
264
|
+
published?: boolean | undefined;
|
|
265
|
+
publishedAt?: unknown;
|
|
264
266
|
createdAt?: unknown;
|
|
265
267
|
updatedAt?: unknown;
|
|
266
|
-
publishedAt?: unknown;
|
|
267
268
|
image?: string | undefined;
|
|
268
|
-
published?: boolean | undefined;
|
|
269
269
|
}>;
|
|
270
270
|
}, Post>;
|
|
271
271
|
readonly updatePost: better_call.StrictEndpoint<"/posts/:id", {} & {
|