@lobehub/lobehub 2.0.0-next.157 → 2.0.0-next.158
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 +25 -0
- package/changelog/v1.json +9 -0
- package/docs/development/database-schema.dbml +1 -0
- package/package.json +1 -1
- package/packages/database/migrations/0058_add_source_into_user_plugins.sql +1 -0
- package/packages/database/migrations/meta/0058_snapshot.json +8432 -0
- package/packages/database/migrations/meta/_journal.json +7 -0
- package/packages/database/src/core/migrations.json +19 -32
- package/packages/database/src/schemas/user.ts +2 -2
- package/src/app/(backend)/api/auth/check-user/route.ts +0 -6
|
@@ -406,6 +406,13 @@
|
|
|
406
406
|
"when": 1764734167674,
|
|
407
407
|
"tag": "0057_add_topic_user_memory_extract_status",
|
|
408
408
|
"breakpoints": true
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"idx": 58,
|
|
412
|
+
"version": "7",
|
|
413
|
+
"when": 1764842015809,
|
|
414
|
+
"tag": "0058_add_source_into_user_plugins",
|
|
415
|
+
"breakpoints": true
|
|
409
416
|
}
|
|
410
417
|
],
|
|
411
418
|
"version": "6"
|
|
@@ -223,10 +223,7 @@
|
|
|
223
223
|
"hash": "9646161fa041354714f823d726af27247bcd6e60fa3be5698c0d69f337a5700b"
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
|
-
"sql": [
|
|
227
|
-
"DROP TABLE \"user_budgets\";",
|
|
228
|
-
"\nDROP TABLE \"user_subscriptions\";"
|
|
229
|
-
],
|
|
226
|
+
"sql": ["DROP TABLE \"user_budgets\";", "\nDROP TABLE \"user_subscriptions\";"],
|
|
230
227
|
"bps": true,
|
|
231
228
|
"folderMillis": 1729699958471,
|
|
232
229
|
"hash": "7dad43a2a25d1aec82124a4e53f8d82f8505c3073f23606c1dc5d2a4598eacf9"
|
|
@@ -298,9 +295,7 @@
|
|
|
298
295
|
"hash": "845a692ceabbfc3caf252a97d3e19a213bc0c433df2689900135f9cfded2cf49"
|
|
299
296
|
},
|
|
300
297
|
{
|
|
301
|
-
"sql": [
|
|
302
|
-
"ALTER TABLE \"messages\" ADD COLUMN \"reasoning\" jsonb;"
|
|
303
|
-
],
|
|
298
|
+
"sql": ["ALTER TABLE \"messages\" ADD COLUMN \"reasoning\" jsonb;"],
|
|
304
299
|
"bps": true,
|
|
305
300
|
"folderMillis": 1737609172353,
|
|
306
301
|
"hash": "2cb36ae4fcdd7b7064767e04bfbb36ae34518ff4bb1b39006f2dd394d1893868"
|
|
@@ -515,9 +510,7 @@
|
|
|
515
510
|
"hash": "a7ccf007fd185ff922823148d1eae6fafe652fc98d2fd2793f84a84f29e93cd1"
|
|
516
511
|
},
|
|
517
512
|
{
|
|
518
|
-
"sql": [
|
|
519
|
-
"ALTER TABLE \"ai_providers\" ADD COLUMN \"config\" jsonb;"
|
|
520
|
-
],
|
|
513
|
+
"sql": ["ALTER TABLE \"ai_providers\" ADD COLUMN \"config\" jsonb;"],
|
|
521
514
|
"bps": true,
|
|
522
515
|
"folderMillis": 1749309388370,
|
|
523
516
|
"hash": "39cea379f08ee4cb944875c0b67f7791387b508c2d47958bb4cd501ed1ef33eb"
|
|
@@ -635,9 +628,7 @@
|
|
|
635
628
|
"hash": "1ba9b1f74ea13348da98d6fcdad7867ab4316ed565bf75d84d160c526cdac14b"
|
|
636
629
|
},
|
|
637
630
|
{
|
|
638
|
-
"sql": [
|
|
639
|
-
"ALTER TABLE \"agents\" ADD COLUMN IF NOT EXISTS \"virtual\" boolean DEFAULT false;"
|
|
640
|
-
],
|
|
631
|
+
"sql": ["ALTER TABLE \"agents\" ADD COLUMN IF NOT EXISTS \"virtual\" boolean DEFAULT false;"],
|
|
641
632
|
"bps": true,
|
|
642
633
|
"folderMillis": 1759116400580,
|
|
643
634
|
"hash": "433ddae88e785f2db734e49a4c115eee93e60afe389f7919d66e5ba9aa159a37"
|
|
@@ -687,17 +678,13 @@
|
|
|
687
678
|
"hash": "4bdc6505797d7a33b622498c138cfd47f637239f6905e1c484cd01d9d5f21d6b"
|
|
688
679
|
},
|
|
689
680
|
{
|
|
690
|
-
"sql": [
|
|
691
|
-
"ALTER TABLE \"user_settings\" ADD COLUMN IF NOT EXISTS \"image\" jsonb;"
|
|
692
|
-
],
|
|
681
|
+
"sql": ["ALTER TABLE \"user_settings\" ADD COLUMN IF NOT EXISTS \"image\" jsonb;"],
|
|
693
682
|
"bps": true,
|
|
694
683
|
"folderMillis": 1760108430562,
|
|
695
684
|
"hash": "ce09b301abb80f6563abc2f526bdd20b4f69bae430f09ba2179b9e3bfec43067"
|
|
696
685
|
},
|
|
697
686
|
{
|
|
698
|
-
"sql": [
|
|
699
|
-
"ALTER TABLE \"documents\" ADD COLUMN IF NOT EXISTS \"editor_data\" jsonb;"
|
|
700
|
-
],
|
|
687
|
+
"sql": ["ALTER TABLE \"documents\" ADD COLUMN IF NOT EXISTS \"editor_data\" jsonb;"],
|
|
701
688
|
"bps": true,
|
|
702
689
|
"folderMillis": 1761554153406,
|
|
703
690
|
"hash": "bf2f21293e90e11cf60a784cf3ec219eafa95f7545d7d2f9d1449c0b0949599a"
|
|
@@ -777,17 +764,13 @@
|
|
|
777
764
|
"hash": "923ccbdf46c32be9a981dabd348e6923b4a365444241e9b8cc174bf5b914cbc5"
|
|
778
765
|
},
|
|
779
766
|
{
|
|
780
|
-
"sql": [
|
|
781
|
-
"ALTER TABLE \"agents\" ADD COLUMN IF NOT EXISTS \"market_identifier\" text;\n"
|
|
782
|
-
],
|
|
767
|
+
"sql": ["ALTER TABLE \"agents\" ADD COLUMN IF NOT EXISTS \"market_identifier\" text;\n"],
|
|
783
768
|
"bps": true,
|
|
784
769
|
"folderMillis": 1762870034882,
|
|
785
770
|
"hash": "4178aacb4b8892b7fd15d29209bbf9b1d1f9d7c406ba796f27542c0bcd919680"
|
|
786
771
|
},
|
|
787
772
|
{
|
|
788
|
-
"sql": [
|
|
789
|
-
"ALTER TABLE \"message_plugins\" ADD COLUMN IF NOT EXISTS \"intervention\" jsonb;\n"
|
|
790
|
-
],
|
|
773
|
+
"sql": ["ALTER TABLE \"message_plugins\" ADD COLUMN IF NOT EXISTS \"intervention\" jsonb;\n"],
|
|
791
774
|
"bps": true,
|
|
792
775
|
"folderMillis": 1762911968658,
|
|
793
776
|
"hash": "552a032cc0e595277232e70b5f9338658585bafe9481ae8346a5f322b673a68b"
|
|
@@ -816,9 +799,7 @@
|
|
|
816
799
|
"hash": "f823b521f4d25e5dc5ab238b372727d2d2d7f0aed27b5eabc8a9608ce4e50568"
|
|
817
800
|
},
|
|
818
801
|
{
|
|
819
|
-
"sql": [
|
|
820
|
-
"ALTER TABLE \"agents\" ADD COLUMN IF NOT EXISTS \"editor_data\" jsonb;"
|
|
821
|
-
],
|
|
802
|
+
"sql": ["ALTER TABLE \"agents\" ADD COLUMN IF NOT EXISTS \"editor_data\" jsonb;"],
|
|
822
803
|
"bps": true,
|
|
823
804
|
"folderMillis": 1764215503726,
|
|
824
805
|
"hash": "4188893a9083b3c7baebdbad0dd3f9d9400ede7584ca2394f5c64305dc9ec7b0"
|
|
@@ -859,9 +840,7 @@
|
|
|
859
840
|
"hash": "2c103eee82bdf329944fb622dd9c2b9f20df80eb54f23eb9254d2285de413099"
|
|
860
841
|
},
|
|
861
842
|
{
|
|
862
|
-
"sql": [
|
|
863
|
-
"ALTER TABLE \"user_settings\" ADD COLUMN IF NOT EXISTS \"market\" jsonb;"
|
|
864
|
-
],
|
|
843
|
+
"sql": ["ALTER TABLE \"user_settings\" ADD COLUMN IF NOT EXISTS \"market\" jsonb;"],
|
|
865
844
|
"bps": true,
|
|
866
845
|
"folderMillis": 1764335703306,
|
|
867
846
|
"hash": "28c0d738c0b1fdf5fd871363be1a1477b4accbabdc140fe8dc6e9b339aae2c89"
|
|
@@ -939,5 +918,13 @@
|
|
|
939
918
|
"bps": true,
|
|
940
919
|
"folderMillis": 1764734167674,
|
|
941
920
|
"hash": "89c134be2948d3afc360d6bac11dea0c6fd5c902bf6093ed077033adb920fd02"
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"sql": [
|
|
924
|
+
"ALTER TABLE \"user_installed_plugins\" ADD COLUMN IF NOT EXISTS \"source\" varchar(255);"
|
|
925
|
+
],
|
|
926
|
+
"bps": true,
|
|
927
|
+
"folderMillis": 1764842015809,
|
|
928
|
+
"hash": "276514dc101fffc66794156f4ba644599a4ae5997a68b9e7f54452ee374bfa61"
|
|
942
929
|
}
|
|
943
|
-
]
|
|
930
|
+
]
|
|
@@ -4,7 +4,7 @@ import type { CustomPluginParams } from '@lobechat/types';
|
|
|
4
4
|
import { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
|
|
5
5
|
import { boolean, jsonb, pgTable, primaryKey, text } from 'drizzle-orm/pg-core';
|
|
6
6
|
|
|
7
|
-
import { timestamps, timestamptz } from './_helpers';
|
|
7
|
+
import { timestamps, timestamptz, varchar255 } from './_helpers';
|
|
8
8
|
|
|
9
9
|
export const users = pgTable('users', {
|
|
10
10
|
id: text('id').primaryKey().notNull(),
|
|
@@ -76,7 +76,7 @@ export const userInstalledPlugins = pgTable(
|
|
|
76
76
|
manifest: jsonb('manifest').$type<LobeChatPluginManifest>(),
|
|
77
77
|
settings: jsonb('settings'),
|
|
78
78
|
customParams: jsonb('custom_params').$type<CustomPluginParams>(),
|
|
79
|
-
|
|
79
|
+
source: varchar255('source'),
|
|
80
80
|
...timestamps,
|
|
81
81
|
},
|
|
82
82
|
(self) => ({
|
|
@@ -6,10 +6,8 @@ import { users } from '@/database/schemas/user';
|
|
|
6
6
|
import { serverDB } from '@/database/server';
|
|
7
7
|
|
|
8
8
|
export interface CheckUserResponseData {
|
|
9
|
-
emailVerified?: boolean;
|
|
10
9
|
exists: boolean;
|
|
11
10
|
hasPassword?: boolean;
|
|
12
|
-
providers?: string[];
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
/**
|
|
@@ -47,18 +45,14 @@ export async function POST(req: NextRequest) {
|
|
|
47
45
|
})
|
|
48
46
|
.from(account)
|
|
49
47
|
.where(and(eq(account.userId, user.id)));
|
|
50
|
-
|
|
51
|
-
const providers = Array.from(new Set(accounts.map((a) => a.providerId).filter(Boolean)));
|
|
52
48
|
const hasPassword = accounts.some(
|
|
53
49
|
(a) =>
|
|
54
50
|
a.providerId === 'credential' && typeof a.password === 'string' && a.password.length > 0,
|
|
55
51
|
);
|
|
56
52
|
|
|
57
53
|
return NextResponse.json({
|
|
58
|
-
emailVerified: user.emailVerified,
|
|
59
54
|
exists: true,
|
|
60
55
|
hasPassword,
|
|
61
|
-
providers,
|
|
62
56
|
} satisfies CheckUserResponseData);
|
|
63
57
|
} catch (error) {
|
|
64
58
|
console.error('Error checking user existence:', error);
|