@shumai-one/shumai-transcode 0.3.8 → 0.3.10

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.
@@ -68,6 +68,12 @@ enum NotificationType {
68
68
  metadata_field_updated_status
69
69
  new_user_join_team
70
70
  new_user_join_project
71
+ kanban_task_created
72
+ kanban_task_assigned
73
+ kanban_task_status_updated
74
+ kanban_task_updated
75
+ kanban_task_deleted
76
+ kanban_task_comment_created
71
77
  }
72
78
 
73
79
  enum ProjectMemberRole {
@@ -112,6 +118,7 @@ enum WorkflowTaskType {
112
118
  ai_embedding
113
119
  query_embedding_for_search
114
120
  agent_tool_call
121
+ kanban_agent_run
115
122
  }
116
123
 
117
124
  enum WorkflowTaskStatus {
@@ -135,6 +142,58 @@ enum WatermarkFileStatus {
135
142
  failed
136
143
  }
137
144
 
145
+ enum QuotaScopeMode {
146
+ all_members
147
+ each_member
148
+ selected_members
149
+ }
150
+
151
+ enum QuotaPeriod {
152
+ one_hour @map("1hour")
153
+ five_hours @map("5hour")
154
+ one_day @map("1day")
155
+ seven_days @map("7day")
156
+ }
157
+
158
+ enum QuotaResourceType {
159
+ agent_total_tokens
160
+ agent_cost
161
+ agent_mcp_call_count
162
+ agent_bash_call_count
163
+ agent_tool_call_count
164
+ }
165
+
166
+ enum KanbanTaskStatus {
167
+ TODO
168
+ READY
169
+ IN_PROGRESS
170
+ BLOCKED
171
+ IN_REVIEW
172
+ DONE
173
+ }
174
+
175
+ enum KanbanTaskPriority {
176
+ LOW
177
+ MEDIUM
178
+ HIGH
179
+ URGENT
180
+ }
181
+
182
+ enum KanbanTaskEventType {
183
+ CREATED
184
+ STATUS_CHANGED
185
+ ASSIGNED
186
+ UNASSIGNED
187
+ COMMENTED
188
+ CHANGES_REQUESTED
189
+ BLOCKED
190
+ UNBLOCKED
191
+ PRIORITY_CHANGED
192
+ GOAL_CHANGED
193
+ DEPENDENCY_ADDED
194
+ DEPENDENCY_REMOVED
195
+ }
196
+
138
197
  // ----------------------------------------------------------------------
139
198
  // Models
140
199
  // ----------------------------------------------------------------------
@@ -172,6 +231,13 @@ model User {
172
231
  apiTokens ApiToken[] @relation("UserToApiToken")
173
232
  aiUsages AiUsage[] @relation("UserToAiUsage")
174
233
  auditLogs AuditLog[] @relation("UserToAuditLog")
234
+ quotaRecords QuotaRecord[] @relation("UserToQuotaRecord")
235
+ kanbanTasksCreated KanbanTask[] @relation("KanbanTaskCreator")
236
+ kanbanTasksReported KanbanTask[] @relation("KanbanTaskReporter")
237
+ kanbanTasksAssigned KanbanTask[] @relation("KanbanTaskAssignee")
238
+ kanbanGoalsCreated KanbanGoal[] @relation("UserToKanbanGoal")
239
+ kanbanTaskComments KanbanTaskComment[]
240
+ kanbanTaskEvents KanbanTaskEvent[]
175
241
 
176
242
  @@map("users")
177
243
  }
@@ -258,6 +324,10 @@ model Team {
258
324
  aiUsages AiUsage[] @relation("TeamToAiUsage")
259
325
  auditLogs AuditLog[] @relation("TeamToAuditLog")
260
326
  watermarkTemplates WatermarkTemplate[] @relation("TeamToWatermarkTemplate")
327
+ quotaRules QuotaRule[] @relation("TeamToQuotaRule")
328
+ quotaRecords QuotaRecord[] @relation("TeamToQuotaRecord")
329
+ kanbanGoals KanbanGoal[] @relation("TeamToKanbanGoal")
330
+ kanbanTasks KanbanTask[] @relation("TeamToKanbanTask")
261
331
 
262
332
  @@map("teams")
263
333
  }
@@ -343,6 +413,7 @@ model Project {
343
413
  shareLinks ShareLink[] @relation("ProjectToShareLink")
344
414
  collections Collection[] @relation("ProjectToCollection")
345
415
  auditLogs AuditLog[] @relation("ProjectToAuditLog")
416
+ kanbanTasks KanbanTask[] @relation("ProjectToKanbanTask")
346
417
 
347
418
  @@map("projects")
348
419
  @@index([createdAt])
@@ -491,6 +562,8 @@ model Asset {
491
562
  agentSessions AgentSession[] @relation("AssetToAgentSession")
492
563
  watermarkFiles WatermarkFile[] @relation("AssetToWatermarkFile")
493
564
  agentMd AssetAgentMd? @relation("AssetToAgentMd")
565
+ kanbanTargetTasks KanbanTask[] @relation("KanbanTaskTargetFolder")
566
+ kanbanTasks KanbanTaskAsset[]
494
567
 
495
568
  @@map("assets")
496
569
  @@index([type])
@@ -667,11 +740,15 @@ model Notification {
667
740
  taskId String? @map("task_id")
668
741
  task Task? @relation("TaskToNotification", fields: [taskId], references: [id])
669
742
 
743
+ kanbanTaskId String? @map("kanban_task_id")
744
+ kanbanTask KanbanTask? @relation("KanbanTaskToNotification", fields: [kanbanTaskId], references: [id], onDelete: Cascade)
745
+
670
746
  userId String? @map("user_id")
671
747
  user User? @relation("UserToNotification", fields: [userId], references: [id])
672
748
 
673
749
  readByMembers TeamMember? @relation("TeamMemberToLastReadNotification")
674
750
 
751
+ @@index([kanbanTaskId])
675
752
  @@map("notifications")
676
753
  }
677
754
 
@@ -751,6 +828,7 @@ model Agent {
751
828
  user User @relation(fields: [id], references: [id], onDelete: Cascade)
752
829
  type AgentType
753
830
  enabled Boolean @default(true)
831
+ permission TeamMemberRole @default(reviewer)
754
832
  soul String? @db.Text
755
833
  providerId String? @map("provider_id")
756
834
  provider Provider? @relation("ProviderToAgent", fields: [providerId], references: [id], onDelete: SetNull)
@@ -1017,4 +1095,183 @@ model AuditLog {
1017
1095
  @@map("audit_logs")
1018
1096
  }
1019
1097
 
1098
+ model QuotaRule {
1099
+ id String @id @default(ulid())
1100
+ teamId String @map("team_id")
1101
+ scopeMode QuotaScopeMode @map("scope_mode")
1102
+ role TeamMemberRole? @map("role")
1103
+ /// [QuotaUserIds]
1104
+ userIds Json? @map("user_ids")
1105
+ resource QuotaResourceType @map("resource")
1106
+ /// [QuotaResourceData]
1107
+ resourceData Json? @map("resource_data")
1108
+ limit Float @map("limit")
1109
+ period QuotaPeriod @map("period")
1110
+ enabled Boolean @default(true) @map("enabled")
1111
+ createdAt DateTime @default(now()) @map("created_at")
1112
+ updatedAt DateTime @updatedAt @map("updated_at")
1113
+
1114
+ team Team @relation("TeamToQuotaRule", fields: [teamId], references: [id], onDelete: Cascade)
1115
+ records QuotaRecord[] @relation("QuotaRuleToRecord")
1116
+
1117
+ @@index([teamId, enabled])
1118
+ @@index([teamId, resource])
1119
+ @@map("quota_rules")
1120
+ }
1121
+
1122
+ model QuotaRecord {
1123
+ id String @id @default(ulid())
1124
+ ruleId String @map("rule_id")
1125
+ teamId String @map("team_id")
1126
+ userId String? @map("user_id")
1127
+ periodStart DateTime? @map("period_start")
1128
+ periodEnd DateTime? @map("period_end")
1129
+ consumed Float @default(0) @map("consumed")
1130
+ createdAt DateTime @default(now()) @map("created_at")
1131
+ updatedAt DateTime @updatedAt @map("updated_at")
1132
+
1133
+ rule QuotaRule @relation("QuotaRuleToRecord", fields: [ruleId], references: [id], onDelete: Cascade)
1134
+ team Team @relation("TeamToQuotaRecord", fields: [teamId], references: [id], onDelete: Cascade)
1135
+ user User? @relation("UserToQuotaRecord", fields: [userId], references: [id], onDelete: Cascade)
1136
+
1137
+ @@unique([ruleId, userId])
1138
+ @@index([teamId, userId])
1139
+ @@index([ruleId])
1140
+ @@map("quota_records")
1141
+ }
1142
+
1143
+ model KanbanGoal {
1144
+ id String @id @default(ulid())
1145
+ title String
1146
+ description String? @db.Text
1147
+ teamId String @map("team_id")
1148
+ team Team @relation("TeamToKanbanGoal", fields: [teamId], references: [id], onDelete: Cascade)
1149
+ creatorId String? @map("creator_id")
1150
+ creator User? @relation("UserToKanbanGoal", fields: [creatorId], references: [id], onDelete: SetNull)
1151
+ tasks KanbanTask[]
1152
+
1153
+ createdAt DateTime @default(now()) @map("created_at")
1154
+ updatedAt DateTime @updatedAt @map("updated_at")
1155
+
1156
+ @@index([teamId])
1157
+ @@map("kanban_goals")
1158
+ }
1159
+
1160
+ model KanbanTask {
1161
+ id String @id @default(ulid())
1162
+ title String
1163
+ description String? @db.Text
1164
+ isAgentTask Boolean @default(false) @map("is_agent_task")
1165
+ status KanbanTaskStatus @default(TODO)
1166
+ priority KanbanTaskPriority @default(MEDIUM)
1167
+
1168
+ startDate DateTime? @map("start_date")
1169
+ dueDate DateTime? @map("due_date")
1170
+ startedAt DateTime? @map("started_at")
1171
+ completedAt DateTime? @map("completed_at")
1172
+
1173
+ goalId String? @map("goal_id")
1174
+ goal KanbanGoal? @relation(fields: [goalId], references: [id], onDelete: SetNull)
1175
+
1176
+ teamId String @map("team_id")
1177
+ team Team @relation("TeamToKanbanTask", fields: [teamId], references: [id], onDelete: Cascade)
1178
+ projectId String? @map("project_id")
1179
+ project Project? @relation("ProjectToKanbanTask", fields: [projectId], references: [id], onDelete: Cascade)
1180
+
1181
+ creatorId String @map("creator_id")
1182
+ creator User @relation("KanbanTaskCreator", fields: [creatorId], references: [id])
1183
+ reporterId String? @map("reporter_id")
1184
+ reporter User? @relation("KanbanTaskReporter", fields: [reporterId], references: [id])
1185
+ assigneeId String? @map("assignee_id")
1186
+ assignee User? @relation("KanbanTaskAssignee", fields: [assigneeId], references: [id])
1187
+
1188
+ targetFolderId String? @map("target_folder_id")
1189
+ targetFolder Asset? @relation("KanbanTaskTargetFolder", fields: [targetFolderId], references: [id], onDelete: SetNull)
1190
+
1191
+ dependencies KanbanTaskLink[] @relation("ChildLinks")
1192
+ dependents KanbanTaskLink[] @relation("ParentLinks")
1193
+ assets KanbanTaskAsset[]
1194
+
1195
+ comments KanbanTaskComment[]
1196
+ events KanbanTaskEvent[]
1197
+ notifications Notification[] @relation("KanbanTaskToNotification")
1198
+
1199
+ sortIndex String? @map("sort_index")
1200
+
1201
+ createdAt DateTime @default(now()) @map("created_at")
1202
+ updatedAt DateTime @updatedAt @map("updated_at")
1203
+
1204
+ @@index([teamId, status])
1205
+ @@index([teamId, status, sortIndex])
1206
+ @@index([teamId, isAgentTask, status])
1207
+ @@index([teamId, goalId, status])
1208
+ @@index([teamId, assigneeId, status])
1209
+ @@index([projectId, status])
1210
+ @@index([sortIndex])
1211
+ @@map("kanban_tasks")
1212
+ }
1213
+
1214
+ model KanbanTaskLink {
1215
+ parentId String @map("parent_id")
1216
+ childId String @map("child_id")
1217
+ parent KanbanTask @relation("ParentLinks", fields: [parentId], references: [id], onDelete: Cascade)
1218
+ child KanbanTask @relation("ChildLinks", fields: [childId], references: [id], onDelete: Cascade)
1219
+
1220
+ createdAt DateTime @default(now()) @map("created_at")
1221
+
1222
+ @@id([parentId, childId])
1223
+ @@index([childId])
1224
+ @@map("kanban_task_links")
1225
+ }
1226
+
1227
+ model KanbanTaskAsset {
1228
+ taskId String @map("task_id")
1229
+ assetId String @map("asset_id")
1230
+ task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
1231
+ asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
1232
+
1233
+ createdAt DateTime @default(now()) @map("created_at")
1234
+
1235
+ @@id([taskId, assetId])
1236
+ @@index([assetId])
1237
+ @@map("kanban_task_assets")
1238
+ }
1239
+
1240
+ model KanbanTaskComment {
1241
+ id String @id @default(ulid())
1242
+ taskId String @map("task_id")
1243
+ task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
1244
+ authorId String @map("author_id")
1245
+ author User @relation(fields: [authorId], references: [id])
1246
+ body String @db.Text
1247
+ /// [KanbanCommentAttachmentList]
1248
+ attachments Json?
1249
+
1250
+ createdAt DateTime @default(now()) @map("created_at")
1251
+ updatedAt DateTime @updatedAt @map("updated_at")
1252
+
1253
+ @@index([taskId, createdAt])
1254
+ @@map("kanban_task_comments")
1255
+ }
1256
+
1257
+ model KanbanTaskEvent {
1258
+ id String @id @default(ulid())
1259
+ taskId String @map("task_id")
1260
+ task KanbanTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
1261
+ actorId String? @map("actor_id")
1262
+ actor User? @relation(fields: [actorId], references: [id])
1263
+ type KanbanTaskEventType
1264
+ fromStatus KanbanTaskStatus? @map("from_status")
1265
+ toStatus KanbanTaskStatus? @map("to_status")
1266
+ /// [KanbanEventPayload]
1267
+ data Json?
1268
+
1269
+ createdAt DateTime @default(now()) @map("created_at")
1270
+
1271
+ @@index([taskId, createdAt])
1272
+ @@index([actorId, createdAt])
1273
+ @@map("kanban_task_events")
1274
+ }
1275
+
1276
+
1020
1277