@lobehub/chat 1.51.10 → 1.51.11

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/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.51.11](https://github.com/lobehub/lobe-chat/compare/v1.51.10...v1.51.11)
6
+
7
+ <sup>Released on **2025-02-06**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix `/file/[id]` 500 issue.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix `/file/[id]` 500 issue, closes [#5812](https://github.com/lobehub/lobe-chat/issues/5812) ([9bb387e](https://github.com/lobehub/lobe-chat/commit/9bb387e))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.51.10](https://github.com/lobehub/lobe-chat/compare/v1.51.9...v1.51.10)
6
31
 
7
32
  <sup>Released on **2025-02-06**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Fix /file/[id] 500 issue."
6
+ ]
7
+ },
8
+ "date": "2025-02-06",
9
+ "version": "1.51.11"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.51.10",
3
+ "version": "1.51.11",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -10,5 +10,3 @@ export default ({ children }: PropsWithChildren) => {
10
10
 
11
11
  return children;
12
12
  };
13
-
14
- export const dynamic = 'force-static';
@@ -1,14 +1,14 @@
1
- // import { redirect } from 'next/navigation';
1
+ import { redirect } from 'next/navigation';
2
+
2
3
  import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
3
- // import { isServerMode } from '@/const/version';
4
- // import { AiInfraRepos } from '@/database/repositories/aiInfra';
5
- // import { serverDB } from '@/database/server';
6
- // import { getServerGlobalConfig } from '@/server/globalConfig';
7
- // import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt';
4
+ import { isServerMode } from '@/const/version';
5
+ import { AiInfraRepos } from '@/database/repositories/aiInfra';
6
+ import { serverDB } from '@/database/server';
7
+ import { getServerGlobalConfig } from '@/server/globalConfig';
8
+ import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt';
8
9
  import { PagePropsWithId } from '@/types/next';
9
-
10
- // import { ProviderConfig } from '@/types/user/settings';
11
- // import { getUserAuth } from '@/utils/server/auth';
10
+ import { ProviderConfig } from '@/types/user/settings';
11
+ import { getUserAuth } from '@/utils/server/auth';
12
12
 
13
13
  import ClientMode from './ClientMode';
14
14
  import ProviderDetail from './index';
@@ -21,25 +21,25 @@ const Page = async (props: PagePropsWithId) => {
21
21
  if (!!builtinProviderCard) return <ProviderDetail source={'builtin'} {...builtinProviderCard} />;
22
22
 
23
23
  // if user custom provider
24
- // if (isServerMode) {
25
- // const { userId } = await getUserAuth();
26
- //
27
- // const { aiProvider } = getServerGlobalConfig();
28
- // const aiInfraRepos = new AiInfraRepos(
29
- // serverDB,
30
- // userId!,
31
- // aiProvider as Record<string, ProviderConfig>,
32
- // );
33
- //
34
- // const userCard = await aiInfraRepos.getAiProviderDetail(
35
- // params.id,
36
- // KeyVaultsGateKeeper.getUserKeyVaults,
37
- // );
38
- //
39
- // if (!userCard) return redirect('/settings/provider');
40
-
41
- // return <ProviderDetail {...userCard} />;
42
- // }
24
+ if (isServerMode) {
25
+ const { userId } = await getUserAuth();
26
+
27
+ const { aiProvider } = getServerGlobalConfig();
28
+ const aiInfraRepos = new AiInfraRepos(
29
+ serverDB,
30
+ userId!,
31
+ aiProvider as Record<string, ProviderConfig>,
32
+ );
33
+
34
+ const userCard = await aiInfraRepos.getAiProviderDetail(
35
+ params.id,
36
+ KeyVaultsGateKeeper.getUserKeyVaults,
37
+ );
38
+
39
+ if (!userCard) return redirect('/settings/provider');
40
+
41
+ return <ProviderDetail {...userCard} />;
42
+ }
43
43
 
44
44
  return <ClientMode id={params.id} />;
45
45
  };
@@ -19,3 +19,5 @@ const ProviderSettingsLayout = ({ children, ...res }: PropsWithChildren) => {
19
19
  ProviderSettingsLayout.displayName = 'ProviderSettingsLayout';
20
20
 
21
21
  export default ProviderSettingsLayout;
22
+
23
+ export const dynamic = 'auto';