@btst/stack 1.1.8 → 1.1.9
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/dist/packages/better-stack/src/plugins/blog/client/plugin.cjs +9 -5
- package/dist/packages/better-stack/src/plugins/blog/client/plugin.mjs +9 -5
- package/dist/plugins/blog/client/index.d.cts +2 -1
- package/dist/plugins/blog/client/index.d.mts +2 -1
- package/dist/plugins/blog/client/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/plugins/blog/client/plugin.tsx +7 -2
|
@@ -18,7 +18,8 @@ function createPostsLoader(published, config) {
|
|
|
18
18
|
path: published ? "/blog" : "/blog/drafts",
|
|
19
19
|
isSSR: true,
|
|
20
20
|
apiBaseURL,
|
|
21
|
-
apiBasePath
|
|
21
|
+
apiBasePath,
|
|
22
|
+
headers
|
|
22
23
|
};
|
|
23
24
|
try {
|
|
24
25
|
if (hooks?.beforeLoadPosts) {
|
|
@@ -79,7 +80,8 @@ function createPostLoader(slug, config) {
|
|
|
79
80
|
params: { slug },
|
|
80
81
|
isSSR: true,
|
|
81
82
|
apiBaseURL,
|
|
82
|
-
apiBasePath
|
|
83
|
+
apiBasePath,
|
|
84
|
+
headers
|
|
83
85
|
};
|
|
84
86
|
try {
|
|
85
87
|
if (hooks?.beforeLoadPost) {
|
|
@@ -120,12 +122,13 @@ function createPostLoader(slug, config) {
|
|
|
120
122
|
function createNewPostLoader(config) {
|
|
121
123
|
return async () => {
|
|
122
124
|
if (typeof window === "undefined") {
|
|
123
|
-
const { apiBasePath, apiBaseURL, hooks } = config;
|
|
125
|
+
const { apiBasePath, apiBaseURL, hooks, headers } = config;
|
|
124
126
|
const context = {
|
|
125
127
|
path: "/blog/new",
|
|
126
128
|
isSSR: true,
|
|
127
129
|
apiBaseURL,
|
|
128
|
-
apiBasePath
|
|
130
|
+
apiBasePath,
|
|
131
|
+
headers
|
|
129
132
|
};
|
|
130
133
|
try {
|
|
131
134
|
if (hooks?.beforeLoadNewPost) {
|
|
@@ -157,7 +160,8 @@ function createTagLoader(tagSlug, config) {
|
|
|
157
160
|
params: { tagSlug },
|
|
158
161
|
isSSR: true,
|
|
159
162
|
apiBaseURL,
|
|
160
|
-
apiBasePath
|
|
163
|
+
apiBasePath,
|
|
164
|
+
headers
|
|
161
165
|
};
|
|
162
166
|
try {
|
|
163
167
|
const limit = 10;
|
|
@@ -16,7 +16,8 @@ function createPostsLoader(published, config) {
|
|
|
16
16
|
path: published ? "/blog" : "/blog/drafts",
|
|
17
17
|
isSSR: true,
|
|
18
18
|
apiBaseURL,
|
|
19
|
-
apiBasePath
|
|
19
|
+
apiBasePath,
|
|
20
|
+
headers
|
|
20
21
|
};
|
|
21
22
|
try {
|
|
22
23
|
if (hooks?.beforeLoadPosts) {
|
|
@@ -77,7 +78,8 @@ function createPostLoader(slug, config) {
|
|
|
77
78
|
params: { slug },
|
|
78
79
|
isSSR: true,
|
|
79
80
|
apiBaseURL,
|
|
80
|
-
apiBasePath
|
|
81
|
+
apiBasePath,
|
|
82
|
+
headers
|
|
81
83
|
};
|
|
82
84
|
try {
|
|
83
85
|
if (hooks?.beforeLoadPost) {
|
|
@@ -118,12 +120,13 @@ function createPostLoader(slug, config) {
|
|
|
118
120
|
function createNewPostLoader(config) {
|
|
119
121
|
return async () => {
|
|
120
122
|
if (typeof window === "undefined") {
|
|
121
|
-
const { apiBasePath, apiBaseURL, hooks } = config;
|
|
123
|
+
const { apiBasePath, apiBaseURL, hooks, headers } = config;
|
|
122
124
|
const context = {
|
|
123
125
|
path: "/blog/new",
|
|
124
126
|
isSSR: true,
|
|
125
127
|
apiBaseURL,
|
|
126
|
-
apiBasePath
|
|
128
|
+
apiBasePath,
|
|
129
|
+
headers
|
|
127
130
|
};
|
|
128
131
|
try {
|
|
129
132
|
if (hooks?.beforeLoadNewPost) {
|
|
@@ -155,7 +158,8 @@ function createTagLoader(tagSlug, config) {
|
|
|
155
158
|
params: { tagSlug },
|
|
156
159
|
isSSR: true,
|
|
157
160
|
apiBaseURL,
|
|
158
|
-
apiBasePath
|
|
161
|
+
apiBasePath,
|
|
162
|
+
headers
|
|
159
163
|
};
|
|
160
164
|
try {
|
|
161
165
|
const limit = 10;
|
|
@@ -25,6 +25,7 @@ interface LoaderContext {
|
|
|
25
25
|
isSSR: boolean;
|
|
26
26
|
apiBaseURL: string;
|
|
27
27
|
apiBasePath: string;
|
|
28
|
+
headers?: Headers;
|
|
28
29
|
[key: string]: any;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
@@ -45,7 +46,7 @@ interface BlogClientConfig {
|
|
|
45
46
|
defaultImage?: string;
|
|
46
47
|
};
|
|
47
48
|
hooks?: BlogClientHooks;
|
|
48
|
-
headers?:
|
|
49
|
+
headers?: Headers;
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
52
|
* Hooks for blog client plugin
|
|
@@ -25,6 +25,7 @@ interface LoaderContext {
|
|
|
25
25
|
isSSR: boolean;
|
|
26
26
|
apiBaseURL: string;
|
|
27
27
|
apiBasePath: string;
|
|
28
|
+
headers?: Headers;
|
|
28
29
|
[key: string]: any;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
@@ -45,7 +46,7 @@ interface BlogClientConfig {
|
|
|
45
46
|
defaultImage?: string;
|
|
46
47
|
};
|
|
47
48
|
hooks?: BlogClientHooks;
|
|
48
|
-
headers?:
|
|
49
|
+
headers?: Headers;
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
52
|
* Hooks for blog client plugin
|
|
@@ -25,6 +25,7 @@ interface LoaderContext {
|
|
|
25
25
|
isSSR: boolean;
|
|
26
26
|
apiBaseURL: string;
|
|
27
27
|
apiBasePath: string;
|
|
28
|
+
headers?: Headers;
|
|
28
29
|
[key: string]: any;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
@@ -45,7 +46,7 @@ interface BlogClientConfig {
|
|
|
45
46
|
defaultImage?: string;
|
|
46
47
|
};
|
|
47
48
|
hooks?: BlogClientHooks;
|
|
48
|
-
headers?:
|
|
49
|
+
headers?: Headers;
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
52
|
* Hooks for blog client plugin
|
package/package.json
CHANGED
|
@@ -32,6 +32,7 @@ export interface LoaderContext {
|
|
|
32
32
|
isSSR: boolean;
|
|
33
33
|
apiBaseURL: string;
|
|
34
34
|
apiBasePath: string;
|
|
35
|
+
headers?: Headers;
|
|
35
36
|
[key: string]: any;
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -60,7 +61,7 @@ export interface BlogClientConfig {
|
|
|
60
61
|
hooks?: BlogClientHooks;
|
|
61
62
|
|
|
62
63
|
// Optional headers for SSR (e.g., forwarding cookies)
|
|
63
|
-
headers?:
|
|
64
|
+
headers?: Headers;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
/**
|
|
@@ -103,6 +104,7 @@ function createPostsLoader(published: boolean, config: BlogClientConfig) {
|
|
|
103
104
|
isSSR: true,
|
|
104
105
|
apiBaseURL,
|
|
105
106
|
apiBasePath,
|
|
107
|
+
headers,
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
try {
|
|
@@ -190,6 +192,7 @@ function createPostLoader(slug: string, config: BlogClientConfig) {
|
|
|
190
192
|
isSSR: true,
|
|
191
193
|
apiBaseURL,
|
|
192
194
|
apiBasePath,
|
|
195
|
+
headers,
|
|
193
196
|
};
|
|
194
197
|
|
|
195
198
|
try {
|
|
@@ -250,13 +253,14 @@ function createPostLoader(slug: string, config: BlogClientConfig) {
|
|
|
250
253
|
function createNewPostLoader(config: BlogClientConfig) {
|
|
251
254
|
return async () => {
|
|
252
255
|
if (typeof window === "undefined") {
|
|
253
|
-
const { apiBasePath, apiBaseURL, hooks } = config;
|
|
256
|
+
const { apiBasePath, apiBaseURL, hooks, headers } = config;
|
|
254
257
|
|
|
255
258
|
const context: LoaderContext = {
|
|
256
259
|
path: "/blog/new",
|
|
257
260
|
isSSR: true,
|
|
258
261
|
apiBaseURL,
|
|
259
262
|
apiBasePath,
|
|
263
|
+
headers,
|
|
260
264
|
};
|
|
261
265
|
|
|
262
266
|
try {
|
|
@@ -298,6 +302,7 @@ function createTagLoader(tagSlug: string, config: BlogClientConfig) {
|
|
|
298
302
|
isSSR: true,
|
|
299
303
|
apiBaseURL,
|
|
300
304
|
apiBasePath,
|
|
305
|
+
headers,
|
|
301
306
|
};
|
|
302
307
|
|
|
303
308
|
try {
|