@lobehub/chat 1.61.3 → 1.61.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 (53) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +18 -0
  3. package/locales/ar/auth.json +10 -1
  4. package/locales/ar/models.json +3 -0
  5. package/locales/bg-BG/auth.json +10 -1
  6. package/locales/bg-BG/models.json +3 -0
  7. package/locales/de-DE/auth.json +10 -1
  8. package/locales/de-DE/models.json +3 -0
  9. package/locales/en-US/auth.json +10 -1
  10. package/locales/en-US/models.json +3 -0
  11. package/locales/es-ES/auth.json +10 -1
  12. package/locales/es-ES/models.json +3 -0
  13. package/locales/fa-IR/auth.json +10 -1
  14. package/locales/fa-IR/models.json +3 -0
  15. package/locales/fr-FR/auth.json +10 -1
  16. package/locales/fr-FR/models.json +3 -0
  17. package/locales/it-IT/auth.json +10 -1
  18. package/locales/it-IT/models.json +3 -0
  19. package/locales/ja-JP/auth.json +10 -1
  20. package/locales/ja-JP/models.json +3 -0
  21. package/locales/ko-KR/auth.json +10 -1
  22. package/locales/ko-KR/models.json +3 -0
  23. package/locales/nl-NL/auth.json +10 -1
  24. package/locales/nl-NL/models.json +3 -0
  25. package/locales/pl-PL/auth.json +10 -1
  26. package/locales/pl-PL/models.json +3 -0
  27. package/locales/pt-BR/auth.json +10 -1
  28. package/locales/pt-BR/models.json +3 -0
  29. package/locales/ru-RU/auth.json +10 -1
  30. package/locales/ru-RU/models.json +3 -0
  31. package/locales/tr-TR/auth.json +10 -1
  32. package/locales/tr-TR/models.json +3 -0
  33. package/locales/vi-VN/auth.json +10 -1
  34. package/locales/vi-VN/models.json +3 -0
  35. package/locales/zh-CN/auth.json +9 -0
  36. package/locales/zh-CN/models.json +3 -0
  37. package/locales/zh-TW/auth.json +10 -1
  38. package/locales/zh-TW/models.json +3 -0
  39. package/package.json +1 -1
  40. package/src/app/[variants]/(main)/profile/(home)/Client.tsx +9 -0
  41. package/src/app/[variants]/(main)/profile/(home)/features/SSOProvidersList/AuthIcons.tsx +37 -0
  42. package/src/app/[variants]/(main)/profile/(home)/features/SSOProvidersList/index.tsx +93 -0
  43. package/src/config/aiModels/perplexity.ts +16 -6
  44. package/src/config/modelProviders/perplexity.ts +9 -6
  45. package/src/database/server/models/user.ts +24 -1
  46. package/src/libs/agent-runtime/perplexity/index.test.ts +10 -222
  47. package/src/locales/default/auth.ts +10 -0
  48. package/src/server/routers/lambda/user.ts +32 -2
  49. package/src/services/user/_deprecated.ts +9 -0
  50. package/src/services/user/client.ts +9 -0
  51. package/src/services/user/server.ts +11 -0
  52. package/src/services/user/type.ts +3 -0
  53. package/src/types/user/index.ts +5 -0
@@ -37,6 +37,15 @@ export class ClientService implements IUserService {
37
37
  };
38
38
  }
39
39
 
40
+ getUserSSOProviders = async () => {
41
+ // Account not exist on next-auth in client mode, no need to implement this method
42
+ return [];
43
+ };
44
+
45
+ unlinkSSOProvider = async () => {
46
+ // Account not exist on next-auth in client mode, no need to implement this method
47
+ };
48
+
40
49
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
41
50
  updateUserSettings = async (patch: DeepPartial<UserSettings>, _?: any) => {
42
51
  return UserModel.updateSettings(patch);
@@ -54,6 +54,15 @@ export class ClientService extends BaseClientService implements IUserService {
54
54
  };
55
55
  };
56
56
 
57
+ getUserSSOProviders: IUserService['getUserSSOProviders'] = async () => {
58
+ // Account not exist on next-auth in client mode, no need to implement this method
59
+ return [];
60
+ };
61
+
62
+ unlinkSSOProvider: IUserService['unlinkSSOProvider'] = async () => {
63
+ // Account not exist on next-auth in client mode, no need to implement this method
64
+ };
65
+
57
66
  updateUserSettings: IUserService['updateUserSettings'] = async (value) => {
58
67
  const { keyVaults, ...res } = value;
59
68
 
@@ -10,6 +10,17 @@ export class ServerService implements IUserService {
10
10
  return lambdaClient.user.getUserState.query();
11
11
  };
12
12
 
13
+ getUserSSOProviders: IUserService['getUserSSOProviders'] = async () => {
14
+ return lambdaClient.user.getUserSSOProviders.query();
15
+ };
16
+
17
+ unlinkSSOProvider: IUserService['unlinkSSOProvider'] = async (
18
+ provider: string,
19
+ providerAccountId: string,
20
+ ) => {
21
+ return lambdaClient.user.unlinkSSOProvider.mutate({ provider, providerAccountId });
22
+ };
23
+
13
24
  makeUserOnboarded = async () => {
14
25
  return lambdaClient.user.makeUserOnboarded.mutate();
15
26
  };
@@ -1,3 +1,4 @@
1
+ import type { AdapterAccount } from 'next-auth/adapters';
1
2
  import { DeepPartial } from 'utility-types';
2
3
 
3
4
  import { UserGuide, UserInitializationState, UserPreference } from '@/types/user';
@@ -9,8 +10,10 @@ export interface IUserService {
9
10
  duration: number;
10
11
  updatedAt: string;
11
12
  }>;
13
+ getUserSSOProviders: () => Promise<AdapterAccount[]>;
12
14
  getUserState: () => Promise<UserInitializationState>;
13
15
  resetUserSettings: () => Promise<any>;
16
+ unlinkSSOProvider: (provider: string, providerAccountId: string) => Promise<any>;
14
17
  updateGuide: (guide: Partial<UserGuide>) => Promise<any>;
15
18
  updatePreference: (preference: Partial<UserPreference>) => Promise<any>;
16
19
  updateUserSettings: (value: DeepPartial<UserSettings>, signal?: AbortSignal) => Promise<any>;
@@ -54,3 +54,8 @@ export interface UserInitializationState {
54
54
  settings: DeepPartial<UserSettings>;
55
55
  userId?: string;
56
56
  }
57
+
58
+ export const NextAuthAccountSchame = z.object({
59
+ provider: z.string(),
60
+ providerAccountId: z.string(),
61
+ });