@allbluecn/database 0.11.0 → 0.12.1

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 (111) hide show
  1. package/index.ts +19 -17
  2. package/migrations/20261030000000_sync_overlay/migration.sql +152 -0
  3. package/package.json +29 -21
  4. package/pglite-init.ts +92 -0
  5. package/LICENSE +0 -661
  6. package/desktop-init.ts +0 -162
  7. package/generated-sqlite/browser.ts +0 -499
  8. package/generated-sqlite/client.ts +0 -523
  9. package/generated-sqlite/commonInputTypes.ts +0 -722
  10. package/generated-sqlite/enums.ts +0 -15
  11. package/generated-sqlite/internal/class.ts +0 -1154
  12. package/generated-sqlite/internal/prismaNamespace.ts +0 -9576
  13. package/generated-sqlite/internal/prismaNamespaceBrowser.ts +0 -1761
  14. package/generated-sqlite/models/AgentConversation.ts +0 -1647
  15. package/generated-sqlite/models/AgentMessage.ts +0 -1406
  16. package/generated-sqlite/models/AiProvider.ts +0 -1605
  17. package/generated-sqlite/models/AiProviderConfig.ts +0 -1610
  18. package/generated-sqlite/models/AiStreamChunk.ts +0 -1157
  19. package/generated-sqlite/models/AiUsageLog.ts +0 -1905
  20. package/generated-sqlite/models/AnyHubApp.ts +0 -1908
  21. package/generated-sqlite/models/AnyHubMarketApp.ts +0 -1997
  22. package/generated-sqlite/models/AnyHubPermission.ts +0 -1419
  23. package/generated-sqlite/models/AnyHubRecommendation.ts +0 -1867
  24. package/generated-sqlite/models/AnyHubRecommender.ts +0 -1467
  25. package/generated-sqlite/models/ArticleFavorite.ts +0 -1349
  26. package/generated-sqlite/models/AuditLog.ts +0 -1287
  27. package/generated-sqlite/models/Blob.ts +0 -1425
  28. package/generated-sqlite/models/Block.ts +0 -1648
  29. package/generated-sqlite/models/BlockComponent.ts +0 -1730
  30. package/generated-sqlite/models/BlockInstance.ts +0 -2039
  31. package/generated-sqlite/models/BookmarkCategory.ts +0 -1667
  32. package/generated-sqlite/models/BusinessAgentBinding.ts +0 -1549
  33. package/generated-sqlite/models/ChatInterrupt.ts +0 -1736
  34. package/generated-sqlite/models/ChatMessage.ts +0 -1464
  35. package/generated-sqlite/models/ChatPersistenceMeta.ts +0 -1119
  36. package/generated-sqlite/models/ChatRun.ts +0 -1802
  37. package/generated-sqlite/models/ChatThread.ts +0 -2417
  38. package/generated-sqlite/models/CodeSnippet.ts +0 -1552
  39. package/generated-sqlite/models/Comment.ts +0 -2201
  40. package/generated-sqlite/models/CommentIgnore.ts +0 -1426
  41. package/generated-sqlite/models/ComplianceExport.ts +0 -1343
  42. package/generated-sqlite/models/Component.ts +0 -2132
  43. package/generated-sqlite/models/ComponentInstance.ts +0 -2097
  44. package/generated-sqlite/models/CustomRole.ts +0 -1209
  45. package/generated-sqlite/models/Design.ts +0 -2497
  46. package/generated-sqlite/models/DesignPage.ts +0 -2398
  47. package/generated-sqlite/models/DesignVersion.ts +0 -2117
  48. package/generated-sqlite/models/DesktopSetting.ts +0 -1057
  49. package/generated-sqlite/models/DeveloperLog.ts +0 -1281
  50. package/generated-sqlite/models/DictionaryTerm.ts +0 -1639
  51. package/generated-sqlite/models/EmailLog.ts +0 -1343
  52. package/generated-sqlite/models/EmailPreference.ts +0 -1255
  53. package/generated-sqlite/models/EmailSubscriber.ts +0 -1231
  54. package/generated-sqlite/models/EmailVerificationToken.ts +0 -1377
  55. package/generated-sqlite/models/GenerationRun.ts +0 -1732
  56. package/generated-sqlite/models/HarnessPlugin.ts +0 -1666
  57. package/generated-sqlite/models/HarnessWorkspace.ts +0 -1647
  58. package/generated-sqlite/models/IndustryCompliance.ts +0 -1794
  59. package/generated-sqlite/models/InvitationCode.ts +0 -1471
  60. package/generated-sqlite/models/InvitationUse.ts +0 -1420
  61. package/generated-sqlite/models/Invoice.ts +0 -1707
  62. package/generated-sqlite/models/Iteration.ts +0 -1874
  63. package/generated-sqlite/models/IterationAutoSchedule.ts +0 -1483
  64. package/generated-sqlite/models/KnowledgeBase.ts +0 -2238
  65. package/generated-sqlite/models/KnowledgeDocument.ts +0 -2450
  66. package/generated-sqlite/models/KnowledgeShareRecord.ts +0 -1349
  67. package/generated-sqlite/models/LegalRegulation.ts +0 -1905
  68. package/generated-sqlite/models/LicenseActivation.ts +0 -1203
  69. package/generated-sqlite/models/LicenseKey.ts +0 -1443
  70. package/generated-sqlite/models/LoginLog.ts +0 -1447
  71. package/generated-sqlite/models/NotificationPreference.ts +0 -1313
  72. package/generated-sqlite/models/OAuthProviderConfig.ts +0 -1225
  73. package/generated-sqlite/models/PageVersion.ts +0 -1520
  74. package/generated-sqlite/models/PasswordResetToken.ts +0 -1377
  75. package/generated-sqlite/models/Plan.ts +0 -2250
  76. package/generated-sqlite/models/Project.ts +0 -2628
  77. package/generated-sqlite/models/ProjectActivity.ts +0 -1578
  78. package/generated-sqlite/models/ProjectKnowledgeBase.ts +0 -1426
  79. package/generated-sqlite/models/ProjectMember.ts +0 -1508
  80. package/generated-sqlite/models/ProviderEvent.ts +0 -1225
  81. package/generated-sqlite/models/Reference.ts +0 -1175
  82. package/generated-sqlite/models/Review.ts +0 -1903
  83. package/generated-sqlite/models/ReviewComment.ts +0 -1899
  84. package/generated-sqlite/models/RoleAssignment.ts +0 -1125
  85. package/generated-sqlite/models/SandboxInstance.ts +0 -1283
  86. package/generated-sqlite/models/Share.ts +0 -1674
  87. package/generated-sqlite/models/ShareVersion.ts +0 -1385
  88. package/generated-sqlite/models/SsoMapping.ts +0 -1181
  89. package/generated-sqlite/models/SsoProvider.ts +0 -1266
  90. package/generated-sqlite/models/Story.ts +0 -3263
  91. package/generated-sqlite/models/Subscription.ts +0 -2137
  92. package/generated-sqlite/models/SystemPromptTemplate.ts +0 -1581
  93. package/generated-sqlite/models/SystemPromptVersion.ts +0 -1456
  94. package/generated-sqlite/models/SystemSetting.ts +0 -1215
  95. package/generated-sqlite/models/TeamInvitation.ts +0 -1758
  96. package/generated-sqlite/models/TeamJoinRequest.ts +0 -1793
  97. package/generated-sqlite/models/TeamMembership.ts +0 -1433
  98. package/generated-sqlite/models/Template.ts +0 -1389
  99. package/generated-sqlite/models/TemplateBlock.ts +0 -1660
  100. package/generated-sqlite/models/ThirdPartyDependency.ts +0 -1471
  101. package/generated-sqlite/models/UsageRecord.ts +0 -1498
  102. package/generated-sqlite/models/User.ts +0 -21247
  103. package/generated-sqlite/models/UserAgent.ts +0 -2146
  104. package/generated-sqlite/models/UserSkill.ts +0 -1453
  105. package/generated-sqlite/models/WebsiteBookmark.ts +0 -2215
  106. package/generated-sqlite/models/Workspace.ts +0 -2341
  107. package/generated-sqlite/models/WorkspaceFile.ts +0 -1532
  108. package/generated-sqlite/models/WorkspaceKnowledgeBase.ts +0 -1426
  109. package/generated-sqlite/models/WorkspaceQuickDoc.ts +0 -2025
  110. package/generated-sqlite/models.ts +0 -107
  111. package/schema.sqlite.prisma +0 -2045
package/desktop-init.ts DELETED
@@ -1,162 +0,0 @@
1
- // SPDX-License-Identifier: AGPL-3.0-or-later
2
- // AllBlue - 理想之海
3
- // Copyright (C) 2026 AllBlue Contributors
4
- //
5
- // This program is free software: you can redistribute it and/or modify
6
- // it under the terms of the GNU Affero General Public License as published by
7
- // the Free Software Foundation, either version 3 of the License, or
8
- // (at your option) any later version.
9
- //
10
- // This program is distributed in the hope that it will be useful,
11
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- // GNU Affero General Public License for more details.
14
- //
15
- // You should have received a copy of the GNU Affero General Public License
16
- // along with this program. If not, see <https://www.gnu.org/licenses/>.
17
-
18
- // 桌面端 SQLite 首次启动初始化:建关系表(schema-sqlite.sql)+ 建 vec0 向量虚拟表
19
- // 幂等:表已存在则跳过。仅 DATABASE_PROVIDER=sqlite 时被调用。
20
- // better-sqlite3/sqlite-vec 动态 import,不进 postgresql 服务器 bundle。
21
- import { accessSync, readFileSync } from "node:fs";
22
- import { join } from "node:path";
23
- import { VEC_TABLES } from "./src/lib/vec-tables.ts";
24
-
25
- let initPromise: Promise<void> | null = null;
26
- let initialized = false;
27
-
28
- /**
29
- * 桌面端首次启动初始化本地 SQLite。
30
- * - 关系表:sqlite_master 表数为 0 时执行 schema-sqlite.sql(Prisma migrate diff 产物)
31
- * - 向量表:sqliteVec.load + 建 vec0 虚拟表(cosine 列级语法)
32
- * 幂等:已初始化或表已存在则跳过。
33
- * 并发安全:module-level promise 缓存,并发调用共享同一次初始化;
34
- * 失败时清空缓存允许重试(成功后 never retry)。
35
- */
36
- export function initDesktopDb(dbPath: string): Promise<void> {
37
- if (!initPromise) {
38
- initPromise = doInit(dbPath).catch((err) => {
39
- initPromise = null;
40
- throw err;
41
- });
42
- }
43
- return initPromise;
44
- }
45
-
46
- async function doInit(dbPath: string): Promise<void> {
47
- const Database = (await import("better-sqlite3")).default;
48
- const sqliteVec = await import("sqlite-vec");
49
-
50
- const db = new Database(dbPath);
51
- try {
52
- db.pragma("journal_mode = WAL");
53
-
54
- const { c: tableCount } = db
55
- .prepare("SELECT count(*) AS c FROM sqlite_master WHERE type='table'")
56
- .get() as { c: number };
57
-
58
- if (tableCount === 0) {
59
- const sqlPath = locateSchemaSql();
60
- const sql = readFileSync(sqlPath, "utf-8");
61
- // 事务包裹:SQLite DDL 可回滚,建表中途崩溃不再留下「部分表」残库
62
- // (历史缺陷:tableCount>0 即跳过 schema 执行,部分初始化的库永远无法自愈)
63
- db.exec("BEGIN");
64
- try {
65
- db.exec(sql);
66
- db.exec("COMMIT");
67
- } catch (err) {
68
- try {
69
- db.exec("ROLLBACK");
70
- } catch {
71
- // ROLLBACK 失败(如连接已损坏)时保留原始建表错误
72
- }
73
- throw err;
74
- }
75
- console.log("[desktop] 关系表初始化完成");
76
- } else if (!hasUsersTable(db)) {
77
- // 历史部分初始化残库:有表但缺关键表 users,显式报错替代下游晦涩的
78
- // "no such table: users"(schema-sqlite.sql 非幂等,无法在残库上补跑)
79
- throw new Error(
80
- `[desktop] 检测到部分初始化的数据库(存在表但缺 users 表,共 ${tableCount} 张)。` +
81
- "请删除该数据库文件后重启应用重新初始化: " +
82
- dbPath,
83
- );
84
- }
85
-
86
- sqliteVec.load(db);
87
- for (const t of VEC_TABLES) {
88
- db.exec(
89
- `CREATE VIRTUAL TABLE IF NOT EXISTS vec_${t} USING vec0(embedding float[1536] distance_metric=cosine);`
90
- );
91
- }
92
- console.log("[desktop] 向量虚拟表就绪");
93
-
94
- seedLocalGuestUser(db);
95
-
96
- initialized = true;
97
- } finally {
98
- db.close();
99
- }
100
- }
101
-
102
- function hasUsersTable(db: import("better-sqlite3").Database): boolean {
103
- const row = db
104
- .prepare(
105
- "SELECT count(*) AS c FROM sqlite_master WHERE type='table' AND name='users'"
106
- )
107
- .get() as { c: number };
108
- return row.c > 0;
109
- }
110
-
111
- function seedLocalGuestUser(db: import("better-sqlite3").Database): void {
112
- const existing = db
113
- .prepare("SELECT id FROM users WHERE id = ?")
114
- .get("local-guest") as { id: string } | undefined;
115
- if (existing) return;
116
-
117
- const now = new Date().toISOString();
118
- // bcrypt 占位:与 auth.ts 的 verify 逻辑对齐(`***NO_PASSWORD***` 标记),
119
- // 明文 guest 密码无法通过验证——游客模式无登录路径,仅满足 FK 约束。
120
- const guestHash =
121
- "$2a$10$NO_SECRET_HASH_PLACEHOLDER_guest_local_mode_no_login_needed";
122
- db.prepare(
123
- `INSERT INTO users (id, username, email, password, role, status, "createdAt", "updatedAt")
124
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)`
125
- ).run(
126
- "local-guest",
127
- "本地用户",
128
- "guest@localhost",
129
- guestHash,
130
- "USER",
131
- "ACTIVE",
132
- now,
133
- now
134
- );
135
- console.log("[desktop] local-guest 用户已创建");
136
- }
137
-
138
- /** 定位 schema-sqlite.sql:候选路径列表,首个可读的胜出 */
139
- function locateSchemaSql(): string {
140
- const candidates = [
141
- process.env.DESKTOP_SCHEMA_SQL,
142
- join(process.cwd(), "sidecars/schema-sqlite.sql"),
143
- join(process.cwd(), "src-tauri/sidecars/schema-sqlite.sql"),
144
- join(process.cwd(), "apps/desktop/src-tauri/sidecars/schema-sqlite.sql"),
145
- join(process.cwd(), "../schema-sqlite.sql"),
146
- ].filter(Boolean) as string[];
147
-
148
- for (const p of candidates) {
149
- try {
150
- // accessSync 仅探测存在性,文件内容由调用方单次读取(避免双读)
151
- accessSync(p);
152
- return p;
153
- } catch {}
154
- }
155
- throw new Error(
156
- "[desktop] 找不到 schema-sqlite.sql,已尝试候选路径: " + candidates.join(", ")
157
- );
158
- }
159
-
160
- export function isDesktopDbInitialized(): boolean {
161
- return initialized;
162
- }
@@ -1,499 +0,0 @@
1
-
2
- /* !!! This is code generated by Prisma. Do not edit directly. !!! */
3
- /* eslint-disable */
4
- // biome-ignore-all lint: generated file
5
- // @ts-nocheck
6
- /*
7
- * This file should be your main import to use Prisma-related types and utilities in a browser.
8
- * Use it to get access to models, enums, and input types.
9
- *
10
- * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
11
- * See `client.ts` for the standard, server-side entry point.
12
- *
13
- * 🟢 You can import this file directly.
14
- */
15
-
16
- import * as Prisma from './internal/prismaNamespaceBrowser.ts'
17
- export { Prisma }
18
- export * as $Enums from './enums.ts'
19
- export * from './enums.ts';
20
- /**
21
- * Model SystemSetting
22
- *
23
- */
24
- export type SystemSetting = Prisma.SystemSettingModel
25
- /**
26
- * Model User
27
- *
28
- */
29
- export type User = Prisma.UserModel
30
- /**
31
- * Model Project
32
- *
33
- */
34
- export type Project = Prisma.ProjectModel
35
- /**
36
- * Model ProjectMember
37
- *
38
- */
39
- export type ProjectMember = Prisma.ProjectMemberModel
40
- /**
41
- * Model Workspace
42
- *
43
- */
44
- export type Workspace = Prisma.WorkspaceModel
45
- /**
46
- * Model TeamMembership
47
- *
48
- */
49
- export type TeamMembership = Prisma.TeamMembershipModel
50
- /**
51
- * Model TeamInvitation
52
- *
53
- */
54
- export type TeamInvitation = Prisma.TeamInvitationModel
55
- /**
56
- * Model TeamJoinRequest
57
- *
58
- */
59
- export type TeamJoinRequest = Prisma.TeamJoinRequestModel
60
- /**
61
- * Model ProjectActivity
62
- *
63
- */
64
- export type ProjectActivity = Prisma.ProjectActivityModel
65
- /**
66
- * Model ChatThread
67
- *
68
- */
69
- export type ChatThread = Prisma.ChatThreadModel
70
- /**
71
- * Model ChatMessage
72
- *
73
- */
74
- export type ChatMessage = Prisma.ChatMessageModel
75
- /**
76
- * Model ChatRun
77
- *
78
- */
79
- export type ChatRun = Prisma.ChatRunModel
80
- /**
81
- * Model ChatInterrupt
82
- *
83
- */
84
- export type ChatInterrupt = Prisma.ChatInterruptModel
85
- /**
86
- * Model ChatPersistenceMeta
87
- *
88
- */
89
- export type ChatPersistenceMeta = Prisma.ChatPersistenceMetaModel
90
- /**
91
- * Model HarnessPlugin
92
- *
93
- */
94
- export type HarnessPlugin = Prisma.HarnessPluginModel
95
- /**
96
- * Model SystemPromptTemplate
97
- *
98
- */
99
- export type SystemPromptTemplate = Prisma.SystemPromptTemplateModel
100
- /**
101
- * Model SystemPromptVersion
102
- *
103
- */
104
- export type SystemPromptVersion = Prisma.SystemPromptVersionModel
105
- /**
106
- * Model BusinessAgentBinding
107
- *
108
- */
109
- export type BusinessAgentBinding = Prisma.BusinessAgentBindingModel
110
- /**
111
- * Model GenerationRun
112
- *
113
- */
114
- export type GenerationRun = Prisma.GenerationRunModel
115
- /**
116
- * Model LoginLog
117
- *
118
- */
119
- export type LoginLog = Prisma.LoginLogModel
120
- /**
121
- * Model InvitationCode
122
- *
123
- */
124
- export type InvitationCode = Prisma.InvitationCodeModel
125
- /**
126
- * Model InvitationUse
127
- *
128
- */
129
- export type InvitationUse = Prisma.InvitationUseModel
130
- /**
131
- * Model PasswordResetToken
132
- *
133
- */
134
- export type PasswordResetToken = Prisma.PasswordResetTokenModel
135
- /**
136
- * Model EmailVerificationToken
137
- *
138
- */
139
- export type EmailVerificationToken = Prisma.EmailVerificationTokenModel
140
- /**
141
- * Model EmailLog
142
- *
143
- */
144
- export type EmailLog = Prisma.EmailLogModel
145
- /**
146
- * Model EmailPreference
147
- *
148
- */
149
- export type EmailPreference = Prisma.EmailPreferenceModel
150
- /**
151
- * Model OAuthProviderConfig
152
- *
153
- */
154
- export type OAuthProviderConfig = Prisma.OAuthProviderConfigModel
155
- /**
156
- * Model EmailSubscriber
157
- *
158
- */
159
- export type EmailSubscriber = Prisma.EmailSubscriberModel
160
- /**
161
- * Model KnowledgeBase
162
- *
163
- */
164
- export type KnowledgeBase = Prisma.KnowledgeBaseModel
165
- /**
166
- * Model ProjectKnowledgeBase
167
- *
168
- */
169
- export type ProjectKnowledgeBase = Prisma.ProjectKnowledgeBaseModel
170
- /**
171
- * Model WorkspaceKnowledgeBase
172
- *
173
- */
174
- export type WorkspaceKnowledgeBase = Prisma.WorkspaceKnowledgeBaseModel
175
- /**
176
- * Model WorkspaceQuickDoc
177
- *
178
- */
179
- export type WorkspaceQuickDoc = Prisma.WorkspaceQuickDocModel
180
- /**
181
- * Model KnowledgeDocument
182
- *
183
- */
184
- export type KnowledgeDocument = Prisma.KnowledgeDocumentModel
185
- /**
186
- * Model Design
187
- *
188
- */
189
- export type Design = Prisma.DesignModel
190
- /**
191
- * Model AgentConversation
192
- *
193
- */
194
- export type AgentConversation = Prisma.AgentConversationModel
195
- /**
196
- * Model AgentMessage
197
- *
198
- */
199
- export type AgentMessage = Prisma.AgentMessageModel
200
- /**
201
- * Model Component
202
- *
203
- */
204
- export type Component = Prisma.ComponentModel
205
- /**
206
- * Model Block
207
- *
208
- */
209
- export type Block = Prisma.BlockModel
210
- /**
211
- * Model BlockComponent
212
- *
213
- */
214
- export type BlockComponent = Prisma.BlockComponentModel
215
- /**
216
- * Model Template
217
- *
218
- */
219
- export type Template = Prisma.TemplateModel
220
- /**
221
- * Model TemplateBlock
222
- *
223
- */
224
- export type TemplateBlock = Prisma.TemplateBlockModel
225
- /**
226
- * Model DesignPage
227
- *
228
- */
229
- export type DesignPage = Prisma.DesignPageModel
230
- /**
231
- * Model ComponentInstance
232
- *
233
- */
234
- export type ComponentInstance = Prisma.ComponentInstanceModel
235
- /**
236
- * Model BlockInstance
237
- *
238
- */
239
- export type BlockInstance = Prisma.BlockInstanceModel
240
- /**
241
- * Model DesignVersion
242
- *
243
- */
244
- export type DesignVersion = Prisma.DesignVersionModel
245
- /**
246
- * Model PageVersion
247
- *
248
- */
249
- export type PageVersion = Prisma.PageVersionModel
250
- /**
251
- * Model Review
252
- *
253
- */
254
- export type Review = Prisma.ReviewModel
255
- /**
256
- * Model ReviewComment
257
- *
258
- */
259
- export type ReviewComment = Prisma.ReviewCommentModel
260
- /**
261
- * Model Comment
262
- *
263
- */
264
- export type Comment = Prisma.CommentModel
265
- /**
266
- * Model CommentIgnore
267
- *
268
- */
269
- export type CommentIgnore = Prisma.CommentIgnoreModel
270
- /**
271
- * Model Share
272
- *
273
- */
274
- export type Share = Prisma.ShareModel
275
- /**
276
- * Model Reference
277
- *
278
- */
279
- export type Reference = Prisma.ReferenceModel
280
- /**
281
- * Model ShareVersion
282
- *
283
- */
284
- export type ShareVersion = Prisma.ShareVersionModel
285
- /**
286
- * Model AnyHubApp
287
- *
288
- */
289
- export type AnyHubApp = Prisma.AnyHubAppModel
290
- /**
291
- * Model AnyHubPermission
292
- *
293
- */
294
- export type AnyHubPermission = Prisma.AnyHubPermissionModel
295
- /**
296
- * Model AnyHubMarketApp
297
- *
298
- */
299
- export type AnyHubMarketApp = Prisma.AnyHubMarketAppModel
300
- /**
301
- * Model AnyHubRecommendation
302
- *
303
- */
304
- export type AnyHubRecommendation = Prisma.AnyHubRecommendationModel
305
- /**
306
- * Model AnyHubRecommender
307
- *
308
- */
309
- export type AnyHubRecommender = Prisma.AnyHubRecommenderModel
310
- /**
311
- * Model AiProvider
312
- *
313
- */
314
- export type AiProvider = Prisma.AiProviderModel
315
- /**
316
- * Model AiProviderConfig
317
- *
318
- */
319
- export type AiProviderConfig = Prisma.AiProviderConfigModel
320
- /**
321
- * Model ThirdPartyDependency
322
- *
323
- */
324
- export type ThirdPartyDependency = Prisma.ThirdPartyDependencyModel
325
- /**
326
- * Model LegalRegulation
327
- *
328
- */
329
- export type LegalRegulation = Prisma.LegalRegulationModel
330
- /**
331
- * Model IndustryCompliance
332
- *
333
- */
334
- export type IndustryCompliance = Prisma.IndustryComplianceModel
335
- /**
336
- * Model DictionaryTerm
337
- *
338
- */
339
- export type DictionaryTerm = Prisma.DictionaryTermModel
340
- /**
341
- * Model WebsiteBookmark
342
- *
343
- */
344
- export type WebsiteBookmark = Prisma.WebsiteBookmarkModel
345
- /**
346
- * Model BookmarkCategory
347
- *
348
- */
349
- export type BookmarkCategory = Prisma.BookmarkCategoryModel
350
- /**
351
- * Model KnowledgeShareRecord
352
- *
353
- */
354
- export type KnowledgeShareRecord = Prisma.KnowledgeShareRecordModel
355
- /**
356
- * Model ArticleFavorite
357
- *
358
- */
359
- export type ArticleFavorite = Prisma.ArticleFavoriteModel
360
- /**
361
- * Model Plan
362
- * 订阅计划定义(seed 数据)
363
- */
364
- export type Plan = Prisma.PlanModel
365
- /**
366
- * Model Subscription
367
- * 订阅记录(User 级,一人一订阅)
368
- */
369
- export type Subscription = Prisma.SubscriptionModel
370
- /**
371
- * Model UsageRecord
372
- * 用量记录(按月聚合,用于额度判断)
373
- */
374
- export type UsageRecord = Prisma.UsageRecordModel
375
- /**
376
- * Model AiUsageLog
377
- * AI 用量明细(按次扣减 + 成本审计)
378
- */
379
- export type AiUsageLog = Prisma.AiUsageLogModel
380
- /**
381
- * Model Invoice
382
- * 账单记录(Webhook 同步)
383
- */
384
- export type Invoice = Prisma.InvoiceModel
385
- /**
386
- * Model ProviderEvent
387
- * Provider Webhook 事件幂等记录
388
- */
389
- export type ProviderEvent = Prisma.ProviderEventModel
390
- /**
391
- * Model LicenseKey
392
- *
393
- */
394
- export type LicenseKey = Prisma.LicenseKeyModel
395
- /**
396
- * Model LicenseActivation
397
- *
398
- */
399
- export type LicenseActivation = Prisma.LicenseActivationModel
400
- /**
401
- * Model AuditLog
402
- *
403
- */
404
- export type AuditLog = Prisma.AuditLogModel
405
- /**
406
- * Model SsoProvider
407
- *
408
- */
409
- export type SsoProvider = Prisma.SsoProviderModel
410
- /**
411
- * Model SsoMapping
412
- *
413
- */
414
- export type SsoMapping = Prisma.SsoMappingModel
415
- /**
416
- * Model CustomRole
417
- *
418
- */
419
- export type CustomRole = Prisma.CustomRoleModel
420
- /**
421
- * Model RoleAssignment
422
- *
423
- */
424
- export type RoleAssignment = Prisma.RoleAssignmentModel
425
- /**
426
- * Model ComplianceExport
427
- *
428
- */
429
- export type ComplianceExport = Prisma.ComplianceExportModel
430
- /**
431
- * Model UserAgent
432
- *
433
- */
434
- export type UserAgent = Prisma.UserAgentModel
435
- /**
436
- * Model UserSkill
437
- *
438
- */
439
- export type UserSkill = Prisma.UserSkillModel
440
- /**
441
- * Model DeveloperLog
442
- *
443
- */
444
- export type DeveloperLog = Prisma.DeveloperLogModel
445
- /**
446
- * Model Story
447
- *
448
- */
449
- export type Story = Prisma.StoryModel
450
- /**
451
- * Model Iteration
452
- *
453
- */
454
- export type Iteration = Prisma.IterationModel
455
- /**
456
- * Model IterationAutoSchedule
457
- *
458
- */
459
- export type IterationAutoSchedule = Prisma.IterationAutoScheduleModel
460
- /**
461
- * Model NotificationPreference
462
- *
463
- */
464
- export type NotificationPreference = Prisma.NotificationPreferenceModel
465
- /**
466
- * Model CodeSnippet
467
- *
468
- */
469
- export type CodeSnippet = Prisma.CodeSnippetModel
470
- /**
471
- * Model SandboxInstance
472
- *
473
- */
474
- export type SandboxInstance = Prisma.SandboxInstanceModel
475
- /**
476
- * Model AiStreamChunk
477
- *
478
- */
479
- export type AiStreamChunk = Prisma.AiStreamChunkModel
480
- /**
481
- * Model DesktopSetting
482
- *
483
- */
484
- export type DesktopSetting = Prisma.DesktopSettingModel
485
- /**
486
- * Model HarnessWorkspace
487
- * Harness 工作区(云端持久化文件区 + 业务数据视图入口)
488
- */
489
- export type HarnessWorkspace = Prisma.HarnessWorkspaceModel
490
- /**
491
- * Model WorkspaceFile
492
- * 工作区文件(上传文件 + AI 生成物 + 沙箱产出)
493
- */
494
- export type WorkspaceFile = Prisma.WorkspaceFileModel
495
- /**
496
- * Model Blob
497
- *
498
- */
499
- export type Blob = Prisma.BlobModel