@goscribe/server 1.6.0 → 1.7.0

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 (281) hide show
  1. package/dist/generated/prisma/client.d.ts +224 -0
  2. package/dist/generated/prisma/client.js +34 -0
  3. package/dist/generated/prisma/commonInputTypes.d.ts +941 -0
  4. package/dist/generated/prisma/commonInputTypes.js +10 -0
  5. package/dist/generated/prisma/enums.d.ts +67 -0
  6. package/dist/generated/prisma/enums.js +66 -0
  7. package/dist/generated/prisma/internal/class.d.ts +539 -0
  8. package/dist/generated/prisma/internal/class.js +49 -0
  9. package/dist/generated/prisma/internal/prismaNamespace.d.ts +3924 -0
  10. package/dist/generated/prisma/internal/prismaNamespace.js +557 -0
  11. package/dist/generated/prisma/models/ActivityLog.d.ts +1847 -0
  12. package/dist/generated/prisma/models/ActivityLog.js +1 -0
  13. package/dist/generated/prisma/models/Artifact.d.ts +2345 -0
  14. package/dist/generated/prisma/models/Artifact.js +1 -0
  15. package/dist/generated/prisma/models/ArtifactVersion.d.ts +1550 -0
  16. package/dist/generated/prisma/models/ArtifactVersion.js +1 -0
  17. package/dist/generated/prisma/models/Channel.d.ts +1257 -0
  18. package/dist/generated/prisma/models/Channel.js +1 -0
  19. package/dist/generated/prisma/models/Chat.d.ts +1339 -0
  20. package/dist/generated/prisma/models/Chat.js +1 -0
  21. package/dist/generated/prisma/models/CopilotConversation.d.ts +1450 -0
  22. package/dist/generated/prisma/models/CopilotConversation.js +1 -0
  23. package/dist/generated/prisma/models/CopilotMessage.d.ts +1179 -0
  24. package/dist/generated/prisma/models/CopilotMessage.js +1 -0
  25. package/dist/generated/prisma/models/FileAsset.d.ts +1832 -0
  26. package/dist/generated/prisma/models/FileAsset.js +1 -0
  27. package/dist/generated/prisma/models/Flashcard.d.ts +1460 -0
  28. package/dist/generated/prisma/models/Flashcard.js +1 -0
  29. package/dist/generated/prisma/models/FlashcardProgress.d.ts +1782 -0
  30. package/dist/generated/prisma/models/FlashcardProgress.js +1 -0
  31. package/dist/generated/prisma/models/Folder.d.ts +1685 -0
  32. package/dist/generated/prisma/models/Folder.js +1 -0
  33. package/dist/generated/prisma/models/IdempotencyRecord.d.ts +1319 -0
  34. package/dist/generated/prisma/models/IdempotencyRecord.js +1 -0
  35. package/dist/generated/prisma/models/Invoice.d.ts +1586 -0
  36. package/dist/generated/prisma/models/Invoice.js +1 -0
  37. package/dist/generated/prisma/models/KnowledgeBase.d.ts +1721 -0
  38. package/dist/generated/prisma/models/KnowledgeBase.js +1 -0
  39. package/dist/generated/prisma/models/KnowledgeBaseChunk.d.ts +1333 -0
  40. package/dist/generated/prisma/models/KnowledgeBaseChunk.js +1 -0
  41. package/dist/generated/prisma/models/KnowledgeBaseDocument.d.ts +1695 -0
  42. package/dist/generated/prisma/models/KnowledgeBaseDocument.js +1 -0
  43. package/dist/generated/prisma/models/Notification.d.ts +1992 -0
  44. package/dist/generated/prisma/models/Notification.js +1 -0
  45. package/dist/generated/prisma/models/PasswordResetToken.d.ts +1210 -0
  46. package/dist/generated/prisma/models/PasswordResetToken.js +1 -0
  47. package/dist/generated/prisma/models/Plan.d.ts +1431 -0
  48. package/dist/generated/prisma/models/Plan.js +1 -0
  49. package/dist/generated/prisma/models/PlanLimit.d.ts +1328 -0
  50. package/dist/generated/prisma/models/PlanLimit.js +1 -0
  51. package/dist/generated/prisma/models/PodcastSegment.d.ts +1564 -0
  52. package/dist/generated/prisma/models/PodcastSegment.js +1 -0
  53. package/dist/generated/prisma/models/ResourcePrice.d.ts +1008 -0
  54. package/dist/generated/prisma/models/ResourcePrice.js +1 -0
  55. package/dist/generated/prisma/models/Role.d.ts +1065 -0
  56. package/dist/generated/prisma/models/Role.js +1 -0
  57. package/dist/generated/prisma/models/Session.d.ts +1105 -0
  58. package/dist/generated/prisma/models/Session.js +1 -0
  59. package/dist/generated/prisma/models/StripeEvent.d.ts +1081 -0
  60. package/dist/generated/prisma/models/StripeEvent.js +1 -0
  61. package/dist/generated/prisma/models/StudyGuideComment.d.ts +1321 -0
  62. package/dist/generated/prisma/models/StudyGuideComment.js +1 -0
  63. package/dist/generated/prisma/models/StudyGuideHighlight.d.ts +1629 -0
  64. package/dist/generated/prisma/models/StudyGuideHighlight.js +1 -0
  65. package/dist/generated/prisma/models/Subscription.d.ts +1677 -0
  66. package/dist/generated/prisma/models/Subscription.js +1 -0
  67. package/dist/generated/prisma/models/User.d.ts +7559 -0
  68. package/dist/generated/prisma/models/User.js +1 -0
  69. package/dist/generated/prisma/models/UserCredit.d.ts +1249 -0
  70. package/dist/generated/prisma/models/UserCredit.js +1 -0
  71. package/dist/generated/prisma/models/VerificationToken.d.ts +946 -0
  72. package/dist/generated/prisma/models/VerificationToken.js +1 -0
  73. package/dist/generated/prisma/models/WorksheetPreset.d.ts +1433 -0
  74. package/dist/generated/prisma/models/WorksheetPreset.js +1 -0
  75. package/dist/generated/prisma/models/WorksheetQuestion.d.ts +1491 -0
  76. package/dist/generated/prisma/models/WorksheetQuestion.js +1 -0
  77. package/dist/generated/prisma/models/WorksheetQuestionProgress.d.ts +1620 -0
  78. package/dist/generated/prisma/models/WorksheetQuestionProgress.js +1 -0
  79. package/dist/generated/prisma/models/Workspace.d.ts +3620 -0
  80. package/dist/generated/prisma/models/Workspace.js +1 -0
  81. package/dist/generated/prisma/models/WorkspaceInvitation.d.ts +1490 -0
  82. package/dist/generated/prisma/models/WorkspaceInvitation.js +1 -0
  83. package/dist/generated/prisma/models/WorkspaceKnowledgeBase.d.ts +1410 -0
  84. package/dist/generated/prisma/models/WorkspaceKnowledgeBase.js +1 -0
  85. package/dist/generated/prisma/models/WorkspaceMember.d.ts +1326 -0
  86. package/dist/generated/prisma/models/WorkspaceMember.js +1 -0
  87. package/dist/generated/prisma/models.d.ts +39 -0
  88. package/dist/generated/prisma/models.js +1 -0
  89. package/dist/src/context.d.ts +27 -0
  90. package/dist/src/context.js +33 -0
  91. package/dist/src/index.d.ts +3 -0
  92. package/dist/src/index.js +1 -0
  93. package/dist/src/lib/ai/config.d.ts +20 -0
  94. package/dist/src/lib/ai/config.js +31 -0
  95. package/dist/src/lib/ai/embedding-client.d.ts +8 -0
  96. package/dist/src/lib/ai/embedding-client.js +30 -0
  97. package/dist/src/lib/ai/index.d.ts +48 -0
  98. package/dist/src/lib/ai/index.js +29 -0
  99. package/dist/src/lib/ai/inference-backend/client.d.ts +28 -0
  100. package/dist/src/lib/ai/inference-backend/client.js +301 -0
  101. package/dist/src/lib/ai/inference-backend/mocks.d.ts +12 -0
  102. package/dist/src/lib/ai/inference-backend/mocks.js +133 -0
  103. package/dist/src/lib/ai/inference-backend/types.d.ts +44 -0
  104. package/dist/src/lib/ai/inference-backend/types.js +1 -0
  105. package/dist/src/lib/ai/json-parse.d.ts +2 -0
  106. package/dist/src/lib/ai/json-parse.js +34 -0
  107. package/dist/src/lib/ai/llm-client.d.ts +7 -0
  108. package/dist/src/lib/ai/llm-client.js +36 -0
  109. package/dist/src/lib/ai/mock.d.ts +2 -0
  110. package/dist/src/lib/ai/mock.js +10 -0
  111. package/dist/src/lib/ai/types.d.ts +9 -0
  112. package/dist/src/lib/ai/types.js +1 -0
  113. package/dist/src/lib/auth.d.ts +36 -0
  114. package/dist/src/lib/auth.js +117 -0
  115. package/dist/src/lib/chunking.d.ts +19 -0
  116. package/dist/src/lib/chunking.js +47 -0
  117. package/dist/src/lib/constants.d.ts +13 -0
  118. package/dist/src/lib/constants.js +12 -0
  119. package/dist/src/lib/curated-kb-seed.d.ts +12 -0
  120. package/dist/src/lib/curated-kb-seed.js +155 -0
  121. package/dist/src/lib/email.d.ts +11 -0
  122. package/dist/src/lib/email.js +152 -0
  123. package/dist/src/lib/embeddings.d.ts +2 -0
  124. package/dist/src/lib/embeddings.js +1 -0
  125. package/dist/src/lib/ensure-curated-kb-catalog.d.ts +6 -0
  126. package/dist/src/lib/ensure-curated-kb-catalog.js +53 -0
  127. package/dist/src/lib/env.d.ts +41 -0
  128. package/dist/src/lib/env.js +57 -0
  129. package/dist/src/lib/errors.d.ts +33 -0
  130. package/dist/src/lib/errors.js +78 -0
  131. package/dist/src/lib/file.d.ts +0 -0
  132. package/dist/src/lib/file.js +1 -0
  133. package/dist/src/lib/inference.d.ts +1 -0
  134. package/dist/src/lib/inference.js +1 -0
  135. package/dist/src/lib/kb-meta.d.ts +8 -0
  136. package/dist/src/lib/kb-meta.js +77 -0
  137. package/dist/src/lib/logger.d.ts +62 -0
  138. package/dist/src/lib/logger.js +364 -0
  139. package/dist/src/lib/pdf.d.ts +11 -0
  140. package/dist/src/lib/pdf.js +11 -0
  141. package/dist/src/lib/prisma.d.ts +3 -0
  142. package/dist/src/lib/prisma.js +15 -0
  143. package/dist/src/lib/pusher.d.ts +38 -0
  144. package/dist/src/lib/pusher.js +170 -0
  145. package/dist/src/lib/retry.d.ts +15 -0
  146. package/dist/src/lib/retry.js +37 -0
  147. package/dist/src/lib/storage.d.ts +11 -0
  148. package/dist/src/lib/storage.js +71 -0
  149. package/dist/src/lib/stripe.d.ts +10 -0
  150. package/dist/src/lib/stripe.js +36 -0
  151. package/dist/src/lib/validation.d.ts +51 -0
  152. package/dist/src/lib/validation.js +64 -0
  153. package/dist/src/lib/workspace-kb.d.ts +5 -0
  154. package/dist/src/lib/workspace-kb.js +7 -0
  155. package/dist/src/repositories/artifact.repository.d.ts +64 -0
  156. package/dist/src/repositories/artifact.repository.js +40 -0
  157. package/dist/src/repositories/base.repository.d.ts +14 -0
  158. package/dist/src/repositories/base.repository.js +14 -0
  159. package/dist/src/repositories/invitation.repository.d.ts +104 -0
  160. package/dist/src/repositories/invitation.repository.js +44 -0
  161. package/dist/src/repositories/notification.repository.d.ts +76 -0
  162. package/dist/src/repositories/notification.repository.js +44 -0
  163. package/dist/src/repositories/user.repository.d.ts +84 -0
  164. package/dist/src/repositories/user.repository.js +37 -0
  165. package/dist/src/repositories/workspace-member.repository.d.ts +35 -0
  166. package/dist/src/repositories/workspace-member.repository.js +31 -0
  167. package/dist/src/repositories/workspace.repository.d.ts +101 -0
  168. package/dist/src/repositories/workspace.repository.js +79 -0
  169. package/dist/src/routers/_app.d.ts +3464 -0
  170. package/dist/src/routers/_app.js +36 -0
  171. package/dist/src/routers/admin.d.ts +358 -0
  172. package/dist/src/routers/admin.js +105 -0
  173. package/dist/src/routers/annotations.d.ts +219 -0
  174. package/dist/src/routers/annotations.js +29 -0
  175. package/dist/src/routers/artifactVersions.d.ts +65 -0
  176. package/dist/src/routers/artifactVersions.js +14 -0
  177. package/dist/src/routers/auth.d.ts +161 -0
  178. package/dist/src/routers/auth.js +97 -0
  179. package/dist/src/routers/chat.d.ts +170 -0
  180. package/dist/src/routers/chat.js +32 -0
  181. package/dist/src/routers/copilot.d.ts +200 -0
  182. package/dist/src/routers/copilot.js +52 -0
  183. package/dist/src/routers/flashcards.d.ts +336 -0
  184. package/dist/src/routers/flashcards.js +93 -0
  185. package/dist/src/routers/knowledgeBase.d.ts +421 -0
  186. package/dist/src/routers/knowledgeBase.js +118 -0
  187. package/dist/src/routers/members.d.ts +169 -0
  188. package/dist/src/routers/members.js +47 -0
  189. package/dist/src/routers/notifications.d.ts +99 -0
  190. package/dist/src/routers/notifications.js +25 -0
  191. package/dist/src/routers/payment.d.ts +80 -0
  192. package/dist/src/routers/payment.js +21 -0
  193. package/dist/src/routers/podcast.d.ts +287 -0
  194. package/dist/src/routers/podcast.js +34 -0
  195. package/dist/src/routers/studyguide.d.ts +36 -0
  196. package/dist/src/routers/studyguide.js +8 -0
  197. package/dist/src/routers/worksheets.d.ts +429 -0
  198. package/dist/src/routers/worksheets.js +139 -0
  199. package/dist/src/routers/workspace.d.ts +563 -0
  200. package/dist/src/routers/workspace.js +104 -0
  201. package/dist/src/scripts/purge-deleted-users.d.ts +1 -0
  202. package/dist/src/scripts/purge-deleted-users.js +148 -0
  203. package/dist/src/server.d.ts +1 -0
  204. package/dist/src/server.js +190 -0
  205. package/dist/src/services/activity/activity-human-description.service.d.ts +13 -0
  206. package/dist/src/services/activity/activity-human-description.service.js +221 -0
  207. package/dist/src/services/activity/activity-human-description.service.test.d.ts +1 -0
  208. package/dist/src/services/activity/activity-human-description.service.test.js +16 -0
  209. package/dist/src/services/activity/activity-log.service.d.ts +87 -0
  210. package/dist/src/services/activity/activity-log.service.js +276 -0
  211. package/dist/src/services/activity/activity-log.service.test.d.ts +1 -0
  212. package/dist/src/services/activity/activity-log.service.test.js +27 -0
  213. package/dist/src/services/admin/admin.service.d.ts +270 -0
  214. package/dist/src/services/admin/admin.service.js +476 -0
  215. package/dist/src/services/ai/ai-session.service.d.ts +5 -0
  216. package/dist/src/services/ai/ai-session.service.js +4 -0
  217. package/dist/src/services/artifacts/annotation.service.d.ts +177 -0
  218. package/dist/src/services/artifacts/annotation.service.js +154 -0
  219. package/dist/src/services/artifacts/artifact-version.service.d.ts +38 -0
  220. package/dist/src/services/artifacts/artifact-version.service.js +129 -0
  221. package/dist/src/services/artifacts/chat.service.d.ts +127 -0
  222. package/dist/src/services/artifacts/chat.service.js +182 -0
  223. package/dist/src/services/artifacts/study-guide.service.d.ts +18 -0
  224. package/dist/src/services/artifacts/study-guide.service.js +65 -0
  225. package/dist/src/services/auth/auth.service.d.ts +94 -0
  226. package/dist/src/services/auth/auth.service.js +368 -0
  227. package/dist/src/services/base.service.d.ts +14 -0
  228. package/dist/src/services/base.service.js +14 -0
  229. package/dist/src/services/billing/payment.service.d.ts +44 -0
  230. package/dist/src/services/billing/payment.service.js +365 -0
  231. package/dist/src/services/billing/subscription.service.d.ts +37 -0
  232. package/dist/src/services/billing/subscription.service.js +654 -0
  233. package/dist/src/services/billing/usage.service.d.ts +47 -0
  234. package/dist/src/services/billing/usage.service.js +149 -0
  235. package/dist/src/services/content/copilot.service.d.ts +113 -0
  236. package/dist/src/services/content/copilot.service.js +439 -0
  237. package/dist/src/services/content/flashcard-progress.service.d.ts +159 -0
  238. package/dist/src/services/content/flashcard-progress.service.js +432 -0
  239. package/dist/src/services/content/flashcard.service.d.ts +184 -0
  240. package/dist/src/services/content/flashcard.service.js +339 -0
  241. package/dist/src/services/content/media-analysis.service.d.ts +23 -0
  242. package/dist/src/services/content/media-analysis.service.js +404 -0
  243. package/dist/src/services/content/podcast.service.d.ts +267 -0
  244. package/dist/src/services/content/podcast.service.js +653 -0
  245. package/dist/src/services/content/worksheet-content.service.d.ts +37 -0
  246. package/dist/src/services/content/worksheet-content.service.js +84 -0
  247. package/dist/src/services/content/worksheet-content.service.test.d.ts +1 -0
  248. package/dist/src/services/content/worksheet-content.service.test.js +69 -0
  249. package/dist/src/services/content/worksheet-generation.service.d.ts +91 -0
  250. package/dist/src/services/content/worksheet-generation.service.js +95 -0
  251. package/dist/src/services/content/worksheet-generation.service.test.d.ts +1 -0
  252. package/dist/src/services/content/worksheet-generation.service.test.js +20 -0
  253. package/dist/src/services/content/worksheet.service.d.ts +347 -0
  254. package/dist/src/services/content/worksheet.service.js +599 -0
  255. package/dist/src/services/knowledge/knowledge-base.service.d.ts +316 -0
  256. package/dist/src/services/knowledge/knowledge-base.service.js +544 -0
  257. package/dist/src/services/members/invitation.service.d.ts +66 -0
  258. package/dist/src/services/members/invitation.service.js +348 -0
  259. package/dist/src/services/members/member.service.d.ts +36 -0
  260. package/dist/src/services/members/member.service.js +193 -0
  261. package/dist/src/services/notifications/notification.service.d.ts +214 -0
  262. package/dist/src/services/notifications/notification.service.js +550 -0
  263. package/dist/src/services/notifications/notification.service.test.d.ts +1 -0
  264. package/dist/src/services/notifications/notification.service.test.js +87 -0
  265. package/dist/src/services/workspace/workspace-analytics.service.d.ts +24 -0
  266. package/dist/src/services/workspace/workspace-analytics.service.js +95 -0
  267. package/dist/src/services/workspace/workspace-kb.service.d.ts +40 -0
  268. package/dist/src/services/workspace/workspace-kb.service.js +184 -0
  269. package/dist/src/services/workspace/workspace.service.d.ts +263 -0
  270. package/dist/src/services/workspace/workspace.service.js +401 -0
  271. package/dist/src/trpc.d.ts +60 -0
  272. package/dist/src/trpc.js +217 -0
  273. package/dist/src/types/index.d.ts +126 -0
  274. package/dist/src/types/index.js +1 -0
  275. package/package.json +8 -9
  276. package/prisma/schema.prisma +3 -4
  277. package/prisma/seed.mjs +5 -2
  278. package/prisma.config.ts +16 -0
  279. package/src/lib/prisma.ts +18 -9
  280. package/src/scripts/purge-deleted-users.ts +1 -3
  281. package/tsconfig.json +3 -0
@@ -0,0 +1,3464 @@
1
+ import { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
2
+ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
3
+ ctx: import("../context.js").Context;
4
+ meta: object;
5
+ errorShape: {
6
+ data: {
7
+ zodError: string | null;
8
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
9
+ httpStatus: number;
10
+ path?: string;
11
+ stack?: string;
12
+ };
13
+ message: string;
14
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
15
+ };
16
+ transformer: true;
17
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
18
+ auth: import("@trpc/server").TRPCBuiltRouter<{
19
+ ctx: import("../context.js").Context;
20
+ meta: object;
21
+ errorShape: {
22
+ data: {
23
+ zodError: string | null;
24
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
25
+ httpStatus: number;
26
+ path?: string;
27
+ stack?: string;
28
+ };
29
+ message: string;
30
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
31
+ };
32
+ transformer: true;
33
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
34
+ updateProfile: import("@trpc/server").TRPCMutationProcedure<{
35
+ input: {
36
+ name: string;
37
+ };
38
+ output: {
39
+ success: boolean;
40
+ message: string;
41
+ };
42
+ meta: object;
43
+ }>;
44
+ changePassword: import("@trpc/server").TRPCMutationProcedure<{
45
+ input: {
46
+ currentPassword: string;
47
+ newPassword: string;
48
+ };
49
+ output: {
50
+ success: boolean;
51
+ message: string;
52
+ };
53
+ meta: object;
54
+ }>;
55
+ uploadProfilePicture: import("@trpc/server").TRPCMutationProcedure<{
56
+ input: void;
57
+ output: {
58
+ success: boolean;
59
+ message: string;
60
+ signedUrl: string;
61
+ };
62
+ meta: object;
63
+ }>;
64
+ confirmProfileUpdate: import("@trpc/server").TRPCMutationProcedure<{
65
+ input: void;
66
+ output: {
67
+ success: boolean;
68
+ };
69
+ meta: object;
70
+ }>;
71
+ signup: import("@trpc/server").TRPCMutationProcedure<{
72
+ input: {
73
+ name: string;
74
+ email: string;
75
+ password: string;
76
+ };
77
+ output: {
78
+ id: string;
79
+ email: string | null;
80
+ name: string | null;
81
+ };
82
+ meta: object;
83
+ }>;
84
+ verifyEmail: import("@trpc/server").TRPCMutationProcedure<{
85
+ input: {
86
+ token: string;
87
+ };
88
+ output: {
89
+ success: boolean;
90
+ message: string;
91
+ };
92
+ meta: object;
93
+ }>;
94
+ resendVerification: import("@trpc/server").TRPCMutationProcedure<{
95
+ input: void;
96
+ output: {
97
+ success: boolean;
98
+ message: string;
99
+ };
100
+ meta: object;
101
+ }>;
102
+ login: import("@trpc/server").TRPCMutationProcedure<{
103
+ input: {
104
+ email: string;
105
+ password: string;
106
+ };
107
+ output: {
108
+ id: string;
109
+ email: string | null;
110
+ name: string | null;
111
+ token: string;
112
+ };
113
+ meta: object;
114
+ }>;
115
+ requestPasswordReset: import("@trpc/server").TRPCMutationProcedure<{
116
+ input: {
117
+ email: string;
118
+ };
119
+ output: {
120
+ success: true;
121
+ message: string;
122
+ };
123
+ meta: object;
124
+ }>;
125
+ resetPassword: import("@trpc/server").TRPCMutationProcedure<{
126
+ input: {
127
+ token: string;
128
+ newPassword: string;
129
+ };
130
+ output: {
131
+ success: boolean;
132
+ message: string;
133
+ };
134
+ meta: object;
135
+ }>;
136
+ getSession: import("@trpc/server").TRPCQueryProcedure<{
137
+ input: void;
138
+ output: {
139
+ user: {
140
+ id: string;
141
+ email: string | null;
142
+ name: string | null;
143
+ emailVerified: boolean;
144
+ profilePicture: string | null;
145
+ role: {
146
+ id: string;
147
+ name: string;
148
+ } | null;
149
+ };
150
+ };
151
+ meta: object;
152
+ }>;
153
+ requestAccountDeletion: import("@trpc/server").TRPCMutationProcedure<{
154
+ input: void;
155
+ output: {
156
+ success: boolean;
157
+ message: string;
158
+ };
159
+ meta: object;
160
+ }>;
161
+ restoreAccount: import("@trpc/server").TRPCMutationProcedure<{
162
+ input: {
163
+ token: string;
164
+ };
165
+ output: {
166
+ success: boolean;
167
+ message: string;
168
+ };
169
+ meta: object;
170
+ }>;
171
+ logout: import("@trpc/server").TRPCMutationProcedure<{
172
+ input: void;
173
+ output: {
174
+ success: boolean;
175
+ };
176
+ meta: object;
177
+ }>;
178
+ }>>;
179
+ workspace: import("@trpc/server").TRPCBuiltRouter<{
180
+ ctx: import("../context.js").Context;
181
+ meta: object;
182
+ errorShape: {
183
+ data: {
184
+ zodError: string | null;
185
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
186
+ httpStatus: number;
187
+ path?: string;
188
+ stack?: string;
189
+ };
190
+ message: string;
191
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
192
+ };
193
+ transformer: true;
194
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
195
+ list: import("@trpc/server").TRPCQueryProcedure<{
196
+ input: {
197
+ parentId?: string | undefined;
198
+ };
199
+ output: {
200
+ workspaces: {
201
+ id: string;
202
+ createdAt: Date;
203
+ updatedAt: Date;
204
+ ownerId: string;
205
+ title: string;
206
+ description: string | null;
207
+ icon: string;
208
+ color: string;
209
+ markerColor: string | null;
210
+ folderId: string | null;
211
+ fileBeingAnalyzed: boolean;
212
+ analysisProgress: import("@prisma/client/runtime/client").JsonValue | null;
213
+ needsAnalysis: boolean;
214
+ }[];
215
+ folders: {
216
+ id: string;
217
+ name: string;
218
+ createdAt: Date;
219
+ updatedAt: Date;
220
+ ownerId: string;
221
+ color: string;
222
+ markerColor: string | null;
223
+ parentId: string | null;
224
+ }[];
225
+ };
226
+ meta: object;
227
+ }>;
228
+ getTree: import("@trpc/server").TRPCQueryProcedure<{
229
+ input: void;
230
+ output: {
231
+ folders: {
232
+ id: string;
233
+ name: string;
234
+ updatedAt: Date;
235
+ color: string;
236
+ markerColor: string | null;
237
+ parentId: string | null;
238
+ }[];
239
+ workspaces: {
240
+ id: string;
241
+ updatedAt: Date;
242
+ uploads: {
243
+ id: string;
244
+ name: string;
245
+ createdAt: Date;
246
+ mimeType: string;
247
+ }[];
248
+ title: string;
249
+ icon: string;
250
+ color: string;
251
+ markerColor: string | null;
252
+ folderId: string | null;
253
+ }[];
254
+ };
255
+ meta: object;
256
+ }>;
257
+ create: import("@trpc/server").TRPCMutationProcedure<{
258
+ input: {
259
+ name: string;
260
+ description?: string | undefined;
261
+ parentId?: string | undefined;
262
+ markerColor?: string | null | undefined;
263
+ };
264
+ output: {
265
+ id: string;
266
+ createdAt: Date;
267
+ updatedAt: Date;
268
+ ownerId: string;
269
+ title: string;
270
+ description: string | null;
271
+ icon: string;
272
+ color: string;
273
+ markerColor: string | null;
274
+ folderId: string | null;
275
+ fileBeingAnalyzed: boolean;
276
+ analysisProgress: import("@prisma/client/runtime/client").JsonValue | null;
277
+ needsAnalysis: boolean;
278
+ };
279
+ meta: object;
280
+ }>;
281
+ createFolder: import("@trpc/server").TRPCMutationProcedure<{
282
+ input: {
283
+ name: string;
284
+ color?: string | undefined;
285
+ parentId?: string | undefined;
286
+ };
287
+ output: {
288
+ id: string;
289
+ name: string;
290
+ createdAt: Date;
291
+ updatedAt: Date;
292
+ ownerId: string;
293
+ color: string;
294
+ markerColor: string | null;
295
+ parentId: string | null;
296
+ };
297
+ meta: object;
298
+ }>;
299
+ updateFolder: import("@trpc/server").TRPCMutationProcedure<{
300
+ input: {
301
+ id: string;
302
+ name?: string | undefined;
303
+ markerColor?: string | null | undefined;
304
+ };
305
+ output: {
306
+ id: string;
307
+ name: string;
308
+ createdAt: Date;
309
+ updatedAt: Date;
310
+ ownerId: string;
311
+ color: string;
312
+ markerColor: string | null;
313
+ parentId: string | null;
314
+ };
315
+ meta: object;
316
+ }>;
317
+ deleteFolder: import("@trpc/server").TRPCMutationProcedure<{
318
+ input: {
319
+ id: string;
320
+ };
321
+ output: {
322
+ id: string;
323
+ name: string;
324
+ createdAt: Date;
325
+ updatedAt: Date;
326
+ ownerId: string;
327
+ color: string;
328
+ markerColor: string | null;
329
+ parentId: string | null;
330
+ };
331
+ meta: object;
332
+ }>;
333
+ get: import("@trpc/server").TRPCQueryProcedure<{
334
+ input: {
335
+ id: string;
336
+ };
337
+ output: {
338
+ id: string;
339
+ createdAt: Date;
340
+ updatedAt: Date;
341
+ uploads: {
342
+ id: string;
343
+ name: string;
344
+ createdAt: Date;
345
+ size: number;
346
+ objectKey: string | null;
347
+ mimeType: string;
348
+ }[];
349
+ ownerId: string;
350
+ title: string;
351
+ description: string | null;
352
+ icon: string;
353
+ color: string;
354
+ markerColor: string | null;
355
+ folderId: string | null;
356
+ fileBeingAnalyzed: boolean;
357
+ analysisProgress: import("@prisma/client/runtime/client").JsonValue;
358
+ needsAnalysis: boolean;
359
+ folder: {
360
+ id: string;
361
+ name: string;
362
+ color: string;
363
+ } | null;
364
+ };
365
+ meta: object;
366
+ }>;
367
+ getStats: import("@trpc/server").TRPCQueryProcedure<{
368
+ input: void;
369
+ output: import("../services/billing/usage.service.js").AccountStats;
370
+ meta: object;
371
+ }>;
372
+ getAccountSummary: import("@trpc/server").TRPCQueryProcedure<{
373
+ input: void;
374
+ output: import("../services/billing/usage.service.js").AccountSummary;
375
+ meta: object;
376
+ }>;
377
+ getStudyAnalytics: import("@trpc/server").TRPCQueryProcedure<{
378
+ input: void;
379
+ output: {
380
+ streak: number;
381
+ totalStudyDays: number;
382
+ weeklyActivity: boolean[];
383
+ flashcards: {
384
+ total: number;
385
+ mastered: number;
386
+ dueForReview: number;
387
+ };
388
+ worksheets: {
389
+ completed: number;
390
+ correct: number;
391
+ accuracy: number;
392
+ };
393
+ };
394
+ meta: object;
395
+ }>;
396
+ update: import("@trpc/server").TRPCMutationProcedure<{
397
+ input: {
398
+ id: string;
399
+ name?: string | undefined;
400
+ description?: string | undefined;
401
+ markerColor?: string | null | undefined;
402
+ icon?: string | undefined;
403
+ };
404
+ output: {
405
+ id: string;
406
+ createdAt: Date;
407
+ updatedAt: Date;
408
+ ownerId: string;
409
+ title: string;
410
+ description: string | null;
411
+ icon: string;
412
+ color: string;
413
+ markerColor: string | null;
414
+ folderId: string | null;
415
+ fileBeingAnalyzed: boolean;
416
+ analysisProgress: import("@prisma/client/runtime/client").JsonValue | null;
417
+ needsAnalysis: boolean;
418
+ };
419
+ meta: object;
420
+ }>;
421
+ delete: import("@trpc/server").TRPCMutationProcedure<{
422
+ input: {
423
+ id: string;
424
+ };
425
+ output: boolean;
426
+ meta: object;
427
+ }>;
428
+ getFolderInformation: import("@trpc/server").TRPCQueryProcedure<{
429
+ input: {
430
+ id: string;
431
+ };
432
+ output: {
433
+ folder: {
434
+ id: string;
435
+ name: string;
436
+ createdAt: Date;
437
+ updatedAt: Date;
438
+ ownerId: string;
439
+ color: string;
440
+ markerColor: string | null;
441
+ parentId: string | null;
442
+ };
443
+ parents: {
444
+ id: string;
445
+ name: string;
446
+ createdAt: Date;
447
+ updatedAt: Date;
448
+ ownerId: string;
449
+ color: string;
450
+ markerColor: string | null;
451
+ parentId: string | null;
452
+ }[];
453
+ };
454
+ meta: object;
455
+ }>;
456
+ getSharedWith: import("@trpc/server").TRPCQueryProcedure<{
457
+ input: {
458
+ id: string;
459
+ };
460
+ output: {
461
+ shared: {
462
+ id: string;
463
+ createdAt: Date;
464
+ updatedAt: Date;
465
+ ownerId: string;
466
+ title: string;
467
+ description: string | null;
468
+ icon: string;
469
+ color: string;
470
+ markerColor: string | null;
471
+ folderId: string | null;
472
+ fileBeingAnalyzed: boolean;
473
+ analysisProgress: import("@prisma/client/runtime/client").JsonValue | null;
474
+ needsAnalysis: boolean;
475
+ }[];
476
+ invitations: ({
477
+ workspace: {
478
+ id: string;
479
+ createdAt: Date;
480
+ updatedAt: Date;
481
+ ownerId: string;
482
+ title: string;
483
+ description: string | null;
484
+ icon: string;
485
+ color: string;
486
+ markerColor: string | null;
487
+ folderId: string | null;
488
+ fileBeingAnalyzed: boolean;
489
+ analysisProgress: import("@prisma/client/runtime/client").JsonValue | null;
490
+ needsAnalysis: boolean;
491
+ };
492
+ } & {
493
+ id: string;
494
+ email: string;
495
+ createdAt: Date;
496
+ updatedAt: Date;
497
+ role: string;
498
+ token: string;
499
+ workspaceId: string;
500
+ invitedById: string;
501
+ acceptedAt: Date | null;
502
+ expiresAt: Date;
503
+ })[];
504
+ };
505
+ meta: object;
506
+ }>;
507
+ uploadFiles: import("@trpc/server").TRPCMutationProcedure<{
508
+ input: {
509
+ id: string;
510
+ files: {
511
+ filename: string;
512
+ contentType: string;
513
+ size: number;
514
+ }[];
515
+ };
516
+ output: {
517
+ fileId: string;
518
+ uploadUrl: string;
519
+ }[];
520
+ meta: object;
521
+ }>;
522
+ deleteFiles: import("@trpc/server").TRPCMutationProcedure<{
523
+ input: {
524
+ fileId: string[];
525
+ id: string;
526
+ };
527
+ output: boolean;
528
+ meta: object;
529
+ }>;
530
+ getFileUploadUrl: import("@trpc/server").TRPCQueryProcedure<{
531
+ input: {
532
+ workspaceId: string;
533
+ filename: string;
534
+ contentType: string;
535
+ size: number;
536
+ };
537
+ output: {
538
+ fileId: string;
539
+ uploadUrl: string;
540
+ };
541
+ meta: object;
542
+ }>;
543
+ uploadAndAnalyzeMedia: import("@trpc/server").TRPCMutationProcedure<{
544
+ input: {
545
+ workspaceId: string;
546
+ files: {
547
+ id: string;
548
+ }[];
549
+ generateStudyGuide?: boolean | undefined;
550
+ generateFlashcards?: boolean | undefined;
551
+ generateWorksheet?: boolean | undefined;
552
+ };
553
+ output: {
554
+ filename: string;
555
+ artifacts: {
556
+ studyGuide: any | null;
557
+ flashcards: any | null;
558
+ worksheet: any | null;
559
+ };
560
+ };
561
+ meta: object;
562
+ }>;
563
+ search: import("@trpc/server").TRPCQueryProcedure<{
564
+ input: {
565
+ query: string;
566
+ color?: string | undefined;
567
+ limit?: number | undefined;
568
+ };
569
+ output: any[];
570
+ meta: object;
571
+ }>;
572
+ members: import("@trpc/server").TRPCBuiltRouter<{
573
+ ctx: import("../context.js").Context;
574
+ meta: object;
575
+ errorShape: {
576
+ data: {
577
+ zodError: string | null;
578
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
579
+ httpStatus: number;
580
+ path?: string;
581
+ stack?: string;
582
+ };
583
+ message: string;
584
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
585
+ };
586
+ transformer: true;
587
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
588
+ getMembers: import("@trpc/server").TRPCQueryProcedure<{
589
+ input: {
590
+ workspaceId: string;
591
+ };
592
+ output: ({
593
+ id: string;
594
+ name: string;
595
+ email: string;
596
+ role: "admin" | "member";
597
+ joinedAt: Date;
598
+ } | {
599
+ id: string;
600
+ name: string;
601
+ email: string;
602
+ role: "owner";
603
+ joinedAt: Date;
604
+ })[];
605
+ meta: object;
606
+ }>;
607
+ getCurrentUserRole: import("@trpc/server").TRPCQueryProcedure<{
608
+ input: {
609
+ workspaceId: string;
610
+ };
611
+ output: "admin" | "member" | "owner";
612
+ meta: object;
613
+ }>;
614
+ inviteMember: import("@trpc/server").TRPCMutationProcedure<{
615
+ input: {
616
+ workspaceId: string;
617
+ email: string;
618
+ role?: "admin" | "member" | undefined;
619
+ };
620
+ output: {
621
+ invitationId: string;
622
+ token: string;
623
+ email: string;
624
+ role: string;
625
+ expiresAt: Date;
626
+ workspaceTitle: string;
627
+ invitedByName: string | null;
628
+ };
629
+ meta: object;
630
+ }>;
631
+ getInvitations: import("@trpc/server").TRPCQueryProcedure<{
632
+ input: {
633
+ workspaceId: string;
634
+ };
635
+ output: {
636
+ id: string;
637
+ email: string;
638
+ createdAt: Date;
639
+ updatedAt: Date;
640
+ role: string;
641
+ token: string;
642
+ workspaceId: string;
643
+ invitedById: string;
644
+ acceptedAt: Date | null;
645
+ expiresAt: Date;
646
+ }[];
647
+ meta: object;
648
+ }>;
649
+ acceptInvite: import("@trpc/server").TRPCMutationProcedure<{
650
+ input: {
651
+ token: string;
652
+ };
653
+ output: {
654
+ message?: string | undefined;
655
+ workspaceId: string;
656
+ workspaceTitle: string;
657
+ role: string;
658
+ ownerName: string | null;
659
+ };
660
+ meta: object;
661
+ }>;
662
+ changeMemberRole: import("@trpc/server").TRPCMutationProcedure<{
663
+ input: {
664
+ workspaceId: string;
665
+ memberId: string;
666
+ role: "admin" | "member";
667
+ };
668
+ output: {
669
+ memberId: string;
670
+ role: "admin" | "member";
671
+ memberName: string | null;
672
+ message: string;
673
+ };
674
+ meta: object;
675
+ }>;
676
+ removeMember: import("@trpc/server").TRPCMutationProcedure<{
677
+ input: {
678
+ workspaceId: string;
679
+ memberId: string;
680
+ };
681
+ output: {
682
+ memberId: string;
683
+ message: string;
684
+ };
685
+ meta: object;
686
+ }>;
687
+ getPendingInvitations: import("@trpc/server").TRPCQueryProcedure<{
688
+ input: {
689
+ workspaceId: string;
690
+ };
691
+ output: {
692
+ id: string;
693
+ email: string;
694
+ role: string;
695
+ token: string;
696
+ expiresAt: Date;
697
+ createdAt: Date;
698
+ invitedByName: string | null;
699
+ }[];
700
+ meta: object;
701
+ }>;
702
+ cancelInvitation: import("@trpc/server").TRPCMutationProcedure<{
703
+ input: {
704
+ invitationId: string;
705
+ };
706
+ output: {
707
+ invitationId: string;
708
+ message: string;
709
+ };
710
+ meta: object;
711
+ }>;
712
+ resendInvitation: import("@trpc/server").TRPCMutationProcedure<{
713
+ input: {
714
+ invitationId: string;
715
+ };
716
+ output: {
717
+ invitationId: string;
718
+ message: string;
719
+ };
720
+ meta: object;
721
+ }>;
722
+ getAllInvitationsDebug: import("@trpc/server").TRPCQueryProcedure<{
723
+ input: {
724
+ workspaceId: string;
725
+ };
726
+ output: {
727
+ id: string;
728
+ email: string;
729
+ createdAt: Date;
730
+ updatedAt: Date;
731
+ role: string;
732
+ token: string;
733
+ workspaceId: string;
734
+ invitedById: string;
735
+ acceptedAt: Date | null;
736
+ expiresAt: Date;
737
+ }[];
738
+ meta: object;
739
+ }>;
740
+ }>>;
741
+ }>>;
742
+ flashcards: import("@trpc/server").TRPCBuiltRouter<{
743
+ ctx: import("../context.js").Context;
744
+ meta: object;
745
+ errorShape: {
746
+ data: {
747
+ zodError: string | null;
748
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
749
+ httpStatus: number;
750
+ path?: string;
751
+ stack?: string;
752
+ };
753
+ message: string;
754
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
755
+ };
756
+ transformer: true;
757
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
758
+ listSets: import("@trpc/server").TRPCQueryProcedure<{
759
+ input: {
760
+ workspaceId: string;
761
+ };
762
+ output: ({
763
+ versions: {
764
+ id: string;
765
+ createdAt: Date;
766
+ data: import("@prisma/client/runtime/client").JsonValue | null;
767
+ createdById: string | null;
768
+ artifactId: string;
769
+ content: string;
770
+ version: number;
771
+ }[];
772
+ } & {
773
+ id: string;
774
+ createdAt: Date;
775
+ updatedAt: Date;
776
+ title: string;
777
+ description: string | null;
778
+ createdById: string | null;
779
+ type: import("../lib/prisma.js").ArtifactType;
780
+ workspaceId: string;
781
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
782
+ estimatedTime: string | null;
783
+ isArchived: boolean;
784
+ generating: boolean;
785
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
786
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
787
+ imageObjectKey: string | null;
788
+ })[];
789
+ meta: object;
790
+ }>;
791
+ listCards: import("@trpc/server").TRPCQueryProcedure<{
792
+ input: {
793
+ workspaceId: string;
794
+ };
795
+ output: ({
796
+ progress: {
797
+ userId: string;
798
+ id: string;
799
+ createdAt: Date;
800
+ updatedAt: Date;
801
+ interval: number;
802
+ flashcardId: string;
803
+ timesStudied: number;
804
+ timesCorrect: number;
805
+ timesIncorrect: number;
806
+ timesIncorrectConsecutive: number;
807
+ easeFactor: number;
808
+ repetitions: number;
809
+ masteryLevel: number;
810
+ lastStudiedAt: Date | null;
811
+ nextReviewAt: Date | null;
812
+ }[];
813
+ } & {
814
+ id: string;
815
+ createdAt: Date;
816
+ tags: string[];
817
+ artifactId: string;
818
+ order: number;
819
+ front: string;
820
+ back: string;
821
+ acceptedAnswers: string[];
822
+ })[];
823
+ meta: object;
824
+ }>;
825
+ isGenerating: import("@trpc/server").TRPCQueryProcedure<{
826
+ input: {
827
+ workspaceId: string;
828
+ };
829
+ output: boolean;
830
+ meta: object;
831
+ }>;
832
+ createCard: import("@trpc/server").TRPCMutationProcedure<{
833
+ input: {
834
+ workspaceId: string;
835
+ front: string;
836
+ back: string;
837
+ acceptedAnswers?: string[] | undefined;
838
+ tags?: string[] | undefined;
839
+ order?: number | undefined;
840
+ };
841
+ output: {
842
+ id: string;
843
+ createdAt: Date;
844
+ tags: string[];
845
+ artifactId: string;
846
+ order: number;
847
+ front: string;
848
+ back: string;
849
+ acceptedAnswers: string[];
850
+ };
851
+ meta: object;
852
+ }>;
853
+ updateCard: import("@trpc/server").TRPCMutationProcedure<{
854
+ input: {
855
+ cardId: string;
856
+ front?: string | undefined;
857
+ back?: string | undefined;
858
+ acceptedAnswers?: string[] | undefined;
859
+ tags?: string[] | undefined;
860
+ order?: number | undefined;
861
+ };
862
+ output: {
863
+ id: string;
864
+ createdAt: Date;
865
+ tags: string[];
866
+ artifactId: string;
867
+ order: number;
868
+ front: string;
869
+ back: string;
870
+ acceptedAnswers: string[];
871
+ };
872
+ meta: object;
873
+ }>;
874
+ gradeTypedAnswer: import("@trpc/server").TRPCMutationProcedure<{
875
+ input: {
876
+ flashcardId: string;
877
+ userAnswer: string;
878
+ };
879
+ output: {
880
+ isCorrect: boolean;
881
+ confidence: number;
882
+ reason: string;
883
+ matchedAnswer: string | null;
884
+ };
885
+ meta: object;
886
+ }>;
887
+ deleteCard: import("@trpc/server").TRPCMutationProcedure<{
888
+ input: {
889
+ cardId: string;
890
+ };
891
+ output: boolean;
892
+ meta: object;
893
+ }>;
894
+ deleteSet: import("@trpc/server").TRPCMutationProcedure<{
895
+ input: {
896
+ setId: string;
897
+ };
898
+ output: boolean;
899
+ meta: object;
900
+ }>;
901
+ generateFromPrompt: import("@trpc/server").TRPCMutationProcedure<{
902
+ input: {
903
+ workspaceId: string;
904
+ prompt: string;
905
+ numCards?: number | undefined;
906
+ difficulty?: "easy" | "medium" | "hard" | undefined;
907
+ title?: string | undefined;
908
+ tags?: string[] | undefined;
909
+ };
910
+ output: {
911
+ artifact: {
912
+ flashcards: {
913
+ id: string;
914
+ createdAt: Date;
915
+ tags: string[];
916
+ artifactId: string;
917
+ order: number;
918
+ front: string;
919
+ back: string;
920
+ acceptedAnswers: string[];
921
+ }[];
922
+ } & {
923
+ id: string;
924
+ createdAt: Date;
925
+ updatedAt: Date;
926
+ title: string;
927
+ description: string | null;
928
+ createdById: string | null;
929
+ type: import("../lib/prisma.js").ArtifactType;
930
+ workspaceId: string;
931
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
932
+ estimatedTime: string | null;
933
+ isArchived: boolean;
934
+ generating: boolean;
935
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
936
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
937
+ imageObjectKey: string | null;
938
+ };
939
+ createdCards: number;
940
+ };
941
+ meta: object;
942
+ }>;
943
+ recordStudyAttempt: import("@trpc/server").TRPCMutationProcedure<{
944
+ input: {
945
+ flashcardId: string;
946
+ isCorrect: boolean;
947
+ confidence?: "easy" | "medium" | "hard" | undefined;
948
+ timeSpentMs?: number | undefined;
949
+ };
950
+ output: any;
951
+ meta: object;
952
+ }>;
953
+ getSetProgress: import("@trpc/server").TRPCQueryProcedure<{
954
+ input: {
955
+ artifactId: string;
956
+ };
957
+ output: {
958
+ flashcardId: any;
959
+ front: any;
960
+ back: any;
961
+ progress: {
962
+ userId: string;
963
+ id: string;
964
+ createdAt: Date;
965
+ updatedAt: Date;
966
+ interval: number;
967
+ flashcardId: string;
968
+ timesStudied: number;
969
+ timesCorrect: number;
970
+ timesIncorrect: number;
971
+ timesIncorrectConsecutive: number;
972
+ easeFactor: number;
973
+ repetitions: number;
974
+ masteryLevel: number;
975
+ lastStudiedAt: Date | null;
976
+ nextReviewAt: Date | null;
977
+ } | null;
978
+ }[];
979
+ meta: object;
980
+ }>;
981
+ getDueFlashcards: import("@trpc/server").TRPCQueryProcedure<{
982
+ input: {
983
+ workspaceId: string;
984
+ };
985
+ output: (({
986
+ artifact: {
987
+ id: string;
988
+ createdAt: Date;
989
+ updatedAt: Date;
990
+ title: string;
991
+ description: string | null;
992
+ createdById: string | null;
993
+ type: import("../lib/prisma.js").ArtifactType;
994
+ workspaceId: string;
995
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
996
+ estimatedTime: string | null;
997
+ isArchived: boolean;
998
+ generating: boolean;
999
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1000
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1001
+ imageObjectKey: string | null;
1002
+ };
1003
+ } & {
1004
+ id: string;
1005
+ createdAt: Date;
1006
+ tags: string[];
1007
+ artifactId: string;
1008
+ order: number;
1009
+ front: string;
1010
+ back: string;
1011
+ acceptedAnswers: string[];
1012
+ }) | {
1013
+ artifact: {
1014
+ id: string;
1015
+ createdAt: Date;
1016
+ updatedAt: Date;
1017
+ title: string;
1018
+ description: string | null;
1019
+ createdById: string | null;
1020
+ type: import("../lib/prisma.js").ArtifactType;
1021
+ workspaceId: string;
1022
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
1023
+ estimatedTime: string | null;
1024
+ isArchived: boolean;
1025
+ generating: boolean;
1026
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1027
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1028
+ imageObjectKey: string | null;
1029
+ };
1030
+ id: string;
1031
+ createdAt: Date;
1032
+ tags: string[];
1033
+ artifactId: string;
1034
+ order: number;
1035
+ front: string;
1036
+ back: string;
1037
+ acceptedAnswers: string[];
1038
+ })[];
1039
+ meta: object;
1040
+ }>;
1041
+ getSetStatistics: import("@trpc/server").TRPCQueryProcedure<{
1042
+ input: {
1043
+ artifactId: string;
1044
+ };
1045
+ output: {
1046
+ totalCards: number;
1047
+ studiedCards: number;
1048
+ unstudiedCards: number;
1049
+ masteredCards: number;
1050
+ dueForReview: number;
1051
+ averageMastery: number;
1052
+ successRate: number;
1053
+ totalAttempts: number;
1054
+ totalCorrect: number;
1055
+ };
1056
+ meta: object;
1057
+ }>;
1058
+ resetProgress: import("@trpc/server").TRPCMutationProcedure<{
1059
+ input: {
1060
+ flashcardId: string;
1061
+ };
1062
+ output: import("../../generated/prisma/internal/prismaNamespace.js").BatchPayload;
1063
+ meta: object;
1064
+ }>;
1065
+ recordStudySession: import("@trpc/server").TRPCMutationProcedure<{
1066
+ input: {
1067
+ attempts: {
1068
+ flashcardId: string;
1069
+ isCorrect: boolean;
1070
+ confidence?: "easy" | "medium" | "hard" | undefined;
1071
+ timeSpentMs?: number | undefined;
1072
+ }[];
1073
+ };
1074
+ output: any[];
1075
+ meta: object;
1076
+ }>;
1077
+ }>>;
1078
+ worksheets: import("@trpc/server").TRPCBuiltRouter<{
1079
+ ctx: import("../context.js").Context;
1080
+ meta: object;
1081
+ errorShape: {
1082
+ data: {
1083
+ zodError: string | null;
1084
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
1085
+ httpStatus: number;
1086
+ path?: string;
1087
+ stack?: string;
1088
+ };
1089
+ message: string;
1090
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
1091
+ };
1092
+ transformer: true;
1093
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
1094
+ list: import("@trpc/server").TRPCQueryProcedure<{
1095
+ input: {
1096
+ workspaceId: string;
1097
+ };
1098
+ output: ({
1099
+ versions: {
1100
+ id: string;
1101
+ createdAt: Date;
1102
+ data: import("@prisma/client/runtime/client").JsonValue | null;
1103
+ createdById: string | null;
1104
+ artifactId: string;
1105
+ content: string;
1106
+ version: number;
1107
+ }[];
1108
+ questions: {
1109
+ id: string;
1110
+ createdAt: Date;
1111
+ type: import("../../generated/prisma/enums.js").QuestionType;
1112
+ artifactId: string;
1113
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1114
+ prompt: string;
1115
+ answer: string | null;
1116
+ difficulty: import("../../generated/prisma/enums.js").Difficulty;
1117
+ order: number;
1118
+ }[];
1119
+ } & {
1120
+ id: string;
1121
+ createdAt: Date;
1122
+ updatedAt: Date;
1123
+ title: string;
1124
+ description: string | null;
1125
+ createdById: string | null;
1126
+ type: import("../lib/prisma.js").ArtifactType;
1127
+ workspaceId: string;
1128
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
1129
+ estimatedTime: string | null;
1130
+ isArchived: boolean;
1131
+ generating: boolean;
1132
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1133
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1134
+ imageObjectKey: string | null;
1135
+ })[] | {
1136
+ questions: import("../services/content/worksheet-content.service.js").WorksheetQuestionWithProgress[];
1137
+ versions: {
1138
+ id: string;
1139
+ createdAt: Date;
1140
+ data: import("@prisma/client/runtime/client").JsonValue | null;
1141
+ createdById: string | null;
1142
+ artifactId: string;
1143
+ content: string;
1144
+ version: number;
1145
+ }[];
1146
+ id: string;
1147
+ createdAt: Date;
1148
+ updatedAt: Date;
1149
+ title: string;
1150
+ description: string | null;
1151
+ createdById: string | null;
1152
+ type: import("../lib/prisma.js").ArtifactType;
1153
+ workspaceId: string;
1154
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
1155
+ estimatedTime: string | null;
1156
+ isArchived: boolean;
1157
+ generating: boolean;
1158
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1159
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1160
+ imageObjectKey: string | null;
1161
+ }[];
1162
+ meta: object;
1163
+ }>;
1164
+ listPresets: import("@trpc/server").TRPCQueryProcedure<{
1165
+ input: {
1166
+ workspaceId: string;
1167
+ };
1168
+ output: {
1169
+ userId: string | null;
1170
+ id: string;
1171
+ name: string;
1172
+ createdAt: Date;
1173
+ updatedAt: Date;
1174
+ workspaceId: string | null;
1175
+ isSystem: boolean;
1176
+ config: import("@prisma/client/runtime/client").JsonValue;
1177
+ }[];
1178
+ meta: object;
1179
+ }>;
1180
+ createPreset: import("@trpc/server").TRPCMutationProcedure<{
1181
+ input: {
1182
+ name: string;
1183
+ config: Record<string, unknown>;
1184
+ workspaceId?: string | undefined;
1185
+ };
1186
+ output: {
1187
+ userId: string | null;
1188
+ id: string;
1189
+ name: string;
1190
+ createdAt: Date;
1191
+ updatedAt: Date;
1192
+ workspaceId: string | null;
1193
+ isSystem: boolean;
1194
+ config: import("@prisma/client/runtime/client").JsonValue;
1195
+ };
1196
+ meta: object;
1197
+ }>;
1198
+ updatePreset: import("@trpc/server").TRPCMutationProcedure<{
1199
+ input: {
1200
+ id: string;
1201
+ name?: string | undefined;
1202
+ config?: Record<string, unknown> | undefined;
1203
+ };
1204
+ output: {
1205
+ userId: string | null;
1206
+ id: string;
1207
+ name: string;
1208
+ createdAt: Date;
1209
+ updatedAt: Date;
1210
+ workspaceId: string | null;
1211
+ isSystem: boolean;
1212
+ config: import("@prisma/client/runtime/client").JsonValue;
1213
+ };
1214
+ meta: object;
1215
+ }>;
1216
+ deletePreset: import("@trpc/server").TRPCMutationProcedure<{
1217
+ input: {
1218
+ id: string;
1219
+ };
1220
+ output: boolean;
1221
+ meta: object;
1222
+ }>;
1223
+ create: import("@trpc/server").TRPCMutationProcedure<{
1224
+ input: {
1225
+ workspaceId: string;
1226
+ title: string;
1227
+ description?: string | undefined;
1228
+ difficulty?: "EASY" | "MEDIUM" | "HARD" | undefined;
1229
+ estimatedTime?: string | undefined;
1230
+ problems?: {
1231
+ question: string;
1232
+ answer: string;
1233
+ type?: "MULTIPLE_CHOICE" | "TEXT" | "NUMERIC" | "TRUE_FALSE" | "MATCHING" | "FILL_IN_THE_BLANK" | undefined;
1234
+ options?: string[] | undefined;
1235
+ }[] | undefined;
1236
+ };
1237
+ output: {
1238
+ questions: {
1239
+ id: string;
1240
+ createdAt: Date;
1241
+ type: import("../../generated/prisma/enums.js").QuestionType;
1242
+ artifactId: string;
1243
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1244
+ prompt: string;
1245
+ answer: string | null;
1246
+ difficulty: import("../../generated/prisma/enums.js").Difficulty;
1247
+ order: number;
1248
+ }[];
1249
+ } & {
1250
+ id: string;
1251
+ createdAt: Date;
1252
+ updatedAt: Date;
1253
+ title: string;
1254
+ description: string | null;
1255
+ createdById: string | null;
1256
+ type: import("../lib/prisma.js").ArtifactType;
1257
+ workspaceId: string;
1258
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
1259
+ estimatedTime: string | null;
1260
+ isArchived: boolean;
1261
+ generating: boolean;
1262
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1263
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1264
+ imageObjectKey: string | null;
1265
+ };
1266
+ meta: object;
1267
+ }>;
1268
+ get: import("@trpc/server").TRPCQueryProcedure<{
1269
+ input: {
1270
+ worksheetId: string;
1271
+ };
1272
+ output: {
1273
+ questions: import("../services/content/worksheet-content.service.js").WorksheetQuestionWithProgress[];
1274
+ id: string;
1275
+ createdAt: Date;
1276
+ updatedAt: Date;
1277
+ title: string;
1278
+ description: string | null;
1279
+ createdById: string | null;
1280
+ type: import("../lib/prisma.js").ArtifactType;
1281
+ workspaceId: string;
1282
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
1283
+ estimatedTime: string | null;
1284
+ isArchived: boolean;
1285
+ generating: boolean;
1286
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1287
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1288
+ imageObjectKey: string | null;
1289
+ };
1290
+ meta: object;
1291
+ }>;
1292
+ createWorksheetQuestion: import("@trpc/server").TRPCMutationProcedure<{
1293
+ input: {
1294
+ worksheetId: string;
1295
+ prompt: string;
1296
+ answer?: string | undefined;
1297
+ type?: "MULTIPLE_CHOICE" | "TEXT" | "NUMERIC" | "TRUE_FALSE" | "MATCHING" | "FILL_IN_THE_BLANK" | undefined;
1298
+ difficulty?: "EASY" | "MEDIUM" | "HARD" | undefined;
1299
+ order?: number | undefined;
1300
+ meta?: Record<string, unknown> | undefined;
1301
+ };
1302
+ output: {
1303
+ id: string;
1304
+ createdAt: Date;
1305
+ type: import("../../generated/prisma/enums.js").QuestionType;
1306
+ artifactId: string;
1307
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1308
+ prompt: string;
1309
+ answer: string | null;
1310
+ difficulty: import("../../generated/prisma/enums.js").Difficulty;
1311
+ order: number;
1312
+ };
1313
+ meta: object;
1314
+ }>;
1315
+ updateWorksheetQuestion: import("@trpc/server").TRPCMutationProcedure<{
1316
+ input: {
1317
+ worksheetQuestionId: string;
1318
+ prompt?: string | undefined;
1319
+ answer?: string | undefined;
1320
+ type?: "MULTIPLE_CHOICE" | "TEXT" | "NUMERIC" | "TRUE_FALSE" | "MATCHING" | "FILL_IN_THE_BLANK" | undefined;
1321
+ difficulty?: "EASY" | "MEDIUM" | "HARD" | undefined;
1322
+ order?: number | undefined;
1323
+ meta?: Record<string, unknown> | undefined;
1324
+ };
1325
+ output: {
1326
+ id: string;
1327
+ createdAt: Date;
1328
+ type: import("../../generated/prisma/enums.js").QuestionType;
1329
+ artifactId: string;
1330
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1331
+ prompt: string;
1332
+ answer: string | null;
1333
+ difficulty: import("../../generated/prisma/enums.js").Difficulty;
1334
+ order: number;
1335
+ };
1336
+ meta: object;
1337
+ }>;
1338
+ deleteWorksheetQuestion: import("@trpc/server").TRPCMutationProcedure<{
1339
+ input: {
1340
+ worksheetQuestionId: string;
1341
+ };
1342
+ output: boolean;
1343
+ meta: object;
1344
+ }>;
1345
+ updateProblemStatus: import("@trpc/server").TRPCMutationProcedure<{
1346
+ input: {
1347
+ problemId: string;
1348
+ completed: boolean;
1349
+ answer?: string | undefined;
1350
+ correct?: boolean | undefined;
1351
+ };
1352
+ output: {
1353
+ userId: string;
1354
+ id: string;
1355
+ createdAt: Date;
1356
+ updatedAt: Date;
1357
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1358
+ worksheetQuestionId: string;
1359
+ userAnswer: string | null;
1360
+ completedAt: Date | null;
1361
+ attempts: number;
1362
+ timeSpentSec: number | null;
1363
+ correct: boolean | null;
1364
+ modified: boolean;
1365
+ };
1366
+ meta: object;
1367
+ }>;
1368
+ getProgress: import("@trpc/server").TRPCQueryProcedure<{
1369
+ input: {
1370
+ worksheetId: string;
1371
+ };
1372
+ output: {
1373
+ userId: string;
1374
+ id: string;
1375
+ createdAt: Date;
1376
+ updatedAt: Date;
1377
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1378
+ worksheetQuestionId: string;
1379
+ userAnswer: string | null;
1380
+ completedAt: Date | null;
1381
+ attempts: number;
1382
+ timeSpentSec: number | null;
1383
+ correct: boolean | null;
1384
+ modified: boolean;
1385
+ }[];
1386
+ meta: object;
1387
+ }>;
1388
+ update: import("@trpc/server").TRPCMutationProcedure<{
1389
+ input: {
1390
+ id: string;
1391
+ title?: string | undefined;
1392
+ description?: string | undefined;
1393
+ difficulty?: "EASY" | "MEDIUM" | "HARD" | undefined;
1394
+ estimatedTime?: string | undefined;
1395
+ problems?: {
1396
+ question: string;
1397
+ answer: string;
1398
+ id?: string | undefined;
1399
+ type?: "MULTIPLE_CHOICE" | "TEXT" | "NUMERIC" | "TRUE_FALSE" | "MATCHING" | "FILL_IN_THE_BLANK" | undefined;
1400
+ options?: string[] | undefined;
1401
+ }[] | undefined;
1402
+ };
1403
+ output: {
1404
+ questions: {
1405
+ id: string;
1406
+ createdAt: Date;
1407
+ type: import("../../generated/prisma/enums.js").QuestionType;
1408
+ artifactId: string;
1409
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1410
+ prompt: string;
1411
+ answer: string | null;
1412
+ difficulty: import("../../generated/prisma/enums.js").Difficulty;
1413
+ order: number;
1414
+ }[];
1415
+ } & {
1416
+ id: string;
1417
+ createdAt: Date;
1418
+ updatedAt: Date;
1419
+ title: string;
1420
+ description: string | null;
1421
+ createdById: string | null;
1422
+ type: import("../lib/prisma.js").ArtifactType;
1423
+ workspaceId: string;
1424
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
1425
+ estimatedTime: string | null;
1426
+ isArchived: boolean;
1427
+ generating: boolean;
1428
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1429
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1430
+ imageObjectKey: string | null;
1431
+ };
1432
+ meta: object;
1433
+ }>;
1434
+ delete: import("@trpc/server").TRPCMutationProcedure<{
1435
+ input: {
1436
+ id: string;
1437
+ };
1438
+ output: boolean;
1439
+ meta: object;
1440
+ }>;
1441
+ generateFromPrompt: import("@trpc/server").TRPCMutationProcedure<{
1442
+ input: {
1443
+ workspaceId: string;
1444
+ prompt: string;
1445
+ numQuestions?: number | undefined;
1446
+ difficulty?: "easy" | "medium" | "hard" | undefined;
1447
+ mode?: "practice" | "quiz" | undefined;
1448
+ presetId?: string | undefined;
1449
+ configOverride?: {
1450
+ mode?: "practice" | "quiz" | undefined;
1451
+ numQuestions?: number | undefined;
1452
+ difficulty?: "easy" | "medium" | "hard" | undefined;
1453
+ questionTypes?: ("MULTIPLE_CHOICE" | "TEXT" | "NUMERIC" | "TRUE_FALSE" | "MATCHING" | "FILL_IN_THE_BLANK")[] | undefined;
1454
+ mcqRatio?: number | undefined;
1455
+ } | undefined;
1456
+ title?: string | undefined;
1457
+ estimatedTime?: string | undefined;
1458
+ };
1459
+ output: {
1460
+ artifact: {
1461
+ id: string;
1462
+ createdAt: Date;
1463
+ updatedAt: Date;
1464
+ title: string;
1465
+ description: string | null;
1466
+ createdById: string | null;
1467
+ type: import("../lib/prisma.js").ArtifactType;
1468
+ workspaceId: string;
1469
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
1470
+ estimatedTime: string | null;
1471
+ isArchived: boolean;
1472
+ generating: boolean;
1473
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1474
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1475
+ imageObjectKey: string | null;
1476
+ };
1477
+ };
1478
+ meta: object;
1479
+ }>;
1480
+ checkAnswer: import("@trpc/server").TRPCMutationProcedure<{
1481
+ input: {
1482
+ worksheetId: string;
1483
+ questionId: string;
1484
+ answer: string;
1485
+ };
1486
+ output: {
1487
+ isCorrect: boolean;
1488
+ userMarkScheme: any;
1489
+ progress: {
1490
+ userId: string;
1491
+ id: string;
1492
+ createdAt: Date;
1493
+ updatedAt: Date;
1494
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1495
+ worksheetQuestionId: string;
1496
+ userAnswer: string | null;
1497
+ completedAt: Date | null;
1498
+ attempts: number;
1499
+ timeSpentSec: number | null;
1500
+ correct: boolean | null;
1501
+ modified: boolean;
1502
+ };
1503
+ };
1504
+ meta: object;
1505
+ }>;
1506
+ }>>;
1507
+ studyguide: import("@trpc/server").TRPCBuiltRouter<{
1508
+ ctx: import("../context.js").Context;
1509
+ meta: object;
1510
+ errorShape: {
1511
+ data: {
1512
+ zodError: string | null;
1513
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
1514
+ httpStatus: number;
1515
+ path?: string;
1516
+ stack?: string;
1517
+ };
1518
+ message: string;
1519
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
1520
+ };
1521
+ transformer: true;
1522
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
1523
+ get: import("@trpc/server").TRPCQueryProcedure<{
1524
+ input: {
1525
+ workspaceId: string;
1526
+ };
1527
+ output: {
1528
+ artifactId: string;
1529
+ title: string;
1530
+ latestVersion: {
1531
+ id: string;
1532
+ createdAt: Date;
1533
+ data: import("@prisma/client/runtime/client").JsonValue | null;
1534
+ createdById: string | null;
1535
+ artifactId: string;
1536
+ content: string;
1537
+ version: number;
1538
+ };
1539
+ };
1540
+ meta: object;
1541
+ }>;
1542
+ }>>;
1543
+ podcast: import("@trpc/server").TRPCBuiltRouter<{
1544
+ ctx: import("../context.js").Context;
1545
+ meta: object;
1546
+ errorShape: {
1547
+ data: {
1548
+ zodError: string | null;
1549
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
1550
+ httpStatus: number;
1551
+ path?: string;
1552
+ stack?: string;
1553
+ };
1554
+ message: string;
1555
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
1556
+ };
1557
+ transformer: true;
1558
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
1559
+ listEpisodes: import("@trpc/server").TRPCQueryProcedure<{
1560
+ input: {
1561
+ workspaceId: string;
1562
+ };
1563
+ output: {
1564
+ id: string;
1565
+ title: string;
1566
+ description: string | null;
1567
+ metadata: {
1568
+ title: string;
1569
+ totalDuration: number;
1570
+ speakers: {
1571
+ id: string;
1572
+ role: "host" | "guest" | "expert";
1573
+ name?: string | undefined;
1574
+ }[];
1575
+ summary: {
1576
+ executiveSummary: string;
1577
+ learningObjectives: string[];
1578
+ keyConcepts: string[];
1579
+ followUpActions: string[];
1580
+ targetAudience: string;
1581
+ prerequisites: string[];
1582
+ tags: string[];
1583
+ };
1584
+ generatedAt: string;
1585
+ description?: string | undefined;
1586
+ } | null;
1587
+ imageUrl: string | null;
1588
+ segments: ({
1589
+ id: string;
1590
+ title: string;
1591
+ audioUrl: string;
1592
+ objectKey: string;
1593
+ startTime: number;
1594
+ duration: number;
1595
+ order: number;
1596
+ } | {
1597
+ id: string;
1598
+ title: string;
1599
+ audioUrl: null;
1600
+ objectKey: string | null;
1601
+ startTime: number;
1602
+ duration: number;
1603
+ order: number;
1604
+ })[];
1605
+ createdAt: Date;
1606
+ updatedAt: Date;
1607
+ workspaceId: string;
1608
+ generating: boolean;
1609
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue;
1610
+ type: import("../lib/prisma.js").ArtifactType;
1611
+ createdById: string | null;
1612
+ isArchived: boolean;
1613
+ }[];
1614
+ meta: object;
1615
+ }>;
1616
+ getEpisode: import("@trpc/server").TRPCQueryProcedure<{
1617
+ input: {
1618
+ episodeId: string;
1619
+ };
1620
+ output: {
1621
+ id: string;
1622
+ title: string;
1623
+ description: string | undefined;
1624
+ metadata: {
1625
+ title: string;
1626
+ totalDuration: number;
1627
+ speakers: {
1628
+ id: string;
1629
+ role: "host" | "guest" | "expert";
1630
+ name?: string | undefined;
1631
+ }[];
1632
+ summary: {
1633
+ executiveSummary: string;
1634
+ learningObjectives: string[];
1635
+ keyConcepts: string[];
1636
+ followUpActions: string[];
1637
+ targetAudience: string;
1638
+ prerequisites: string[];
1639
+ tags: string[];
1640
+ };
1641
+ generatedAt: string;
1642
+ description?: string | undefined;
1643
+ };
1644
+ imageUrl: string | null;
1645
+ segments: ({
1646
+ id: string;
1647
+ title: string;
1648
+ content: string;
1649
+ audioUrl: string;
1650
+ objectKey: string;
1651
+ startTime: number;
1652
+ duration: number;
1653
+ keyPoints: string[];
1654
+ order: number;
1655
+ } | {
1656
+ id: string;
1657
+ title: string;
1658
+ content: string;
1659
+ audioUrl: null;
1660
+ objectKey: string | null;
1661
+ startTime: number;
1662
+ duration: number;
1663
+ keyPoints: string[];
1664
+ order: number;
1665
+ })[];
1666
+ content: string;
1667
+ createdAt: Date;
1668
+ updatedAt: Date;
1669
+ };
1670
+ meta: object;
1671
+ }>;
1672
+ generateEpisode: import("@trpc/server").TRPCMutationProcedure<{
1673
+ input: {
1674
+ workspaceId: string;
1675
+ podcastData: {
1676
+ title: string;
1677
+ userPrompt: string;
1678
+ description?: string | undefined;
1679
+ speakers?: {
1680
+ id: string;
1681
+ role: "host" | "guest" | "expert";
1682
+ name?: string | undefined;
1683
+ }[] | undefined;
1684
+ speed?: number | undefined;
1685
+ generateIntro?: boolean | undefined;
1686
+ generateOutro?: boolean | undefined;
1687
+ segmentByTopics?: boolean | undefined;
1688
+ };
1689
+ };
1690
+ output: {
1691
+ id: string;
1692
+ title: any;
1693
+ description: string | undefined;
1694
+ metadata: {
1695
+ title: any;
1696
+ description: string | undefined;
1697
+ totalDuration: number;
1698
+ summary: any;
1699
+ speakers: {
1700
+ id: string;
1701
+ role: "host" | "guest" | "expert";
1702
+ name?: string | undefined;
1703
+ }[];
1704
+ generatedAt: string;
1705
+ };
1706
+ content: string;
1707
+ };
1708
+ meta: object;
1709
+ }>;
1710
+ deleteSegment: import("@trpc/server").TRPCMutationProcedure<{
1711
+ input: {
1712
+ segmentId: string;
1713
+ };
1714
+ output: {
1715
+ id: string;
1716
+ createdAt: Date;
1717
+ updatedAt: Date;
1718
+ title: string;
1719
+ duration: number;
1720
+ objectKey: string | null;
1721
+ artifactId: string;
1722
+ content: string;
1723
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
1724
+ order: number;
1725
+ generating: boolean;
1726
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1727
+ startTime: number;
1728
+ audioUrl: string | null;
1729
+ keyPoints: string[];
1730
+ };
1731
+ meta: object;
1732
+ }>;
1733
+ getEpisodeSchema: import("@trpc/server").TRPCQueryProcedure<{
1734
+ input: {
1735
+ episodeId: string;
1736
+ };
1737
+ output: {
1738
+ segments: {
1739
+ id: string;
1740
+ title: string;
1741
+ startTime: number;
1742
+ duration: number;
1743
+ keyPoints: string[];
1744
+ order: number;
1745
+ }[];
1746
+ summary: {
1747
+ executiveSummary: string;
1748
+ learningObjectives: string[];
1749
+ keyConcepts: string[];
1750
+ followUpActions: string[];
1751
+ targetAudience: string;
1752
+ prerequisites: string[];
1753
+ tags: string[];
1754
+ };
1755
+ metadata: {
1756
+ title: string;
1757
+ description: string | undefined;
1758
+ totalDuration: number;
1759
+ speakers: {
1760
+ id: string;
1761
+ role: "host" | "guest" | "expert";
1762
+ name?: string | undefined;
1763
+ }[];
1764
+ };
1765
+ };
1766
+ meta: object;
1767
+ }>;
1768
+ updateEpisode: import("@trpc/server").TRPCMutationProcedure<{
1769
+ input: {
1770
+ episodeId: string;
1771
+ title?: string | undefined;
1772
+ description?: string | undefined;
1773
+ };
1774
+ output: {
1775
+ id: string;
1776
+ createdAt: Date;
1777
+ updatedAt: Date;
1778
+ title: string;
1779
+ description: string | null;
1780
+ createdById: string | null;
1781
+ type: import("../lib/prisma.js").ArtifactType;
1782
+ workspaceId: string;
1783
+ difficulty: import("../../generated/prisma/enums.js").Difficulty | null;
1784
+ estimatedTime: string | null;
1785
+ isArchived: boolean;
1786
+ generating: boolean;
1787
+ generatingMetadata: import("@prisma/client/runtime/client").JsonValue | null;
1788
+ worksheetConfig: import("@prisma/client/runtime/client").JsonValue | null;
1789
+ imageObjectKey: string | null;
1790
+ };
1791
+ meta: object;
1792
+ }>;
1793
+ deleteEpisode: import("@trpc/server").TRPCMutationProcedure<{
1794
+ input: {
1795
+ episodeId: string;
1796
+ };
1797
+ output: boolean;
1798
+ meta: object;
1799
+ }>;
1800
+ getSegment: import("@trpc/server").TRPCQueryProcedure<{
1801
+ input: {
1802
+ segmentId: string;
1803
+ };
1804
+ output: {
1805
+ id: string;
1806
+ title: string;
1807
+ content: string;
1808
+ startTime: number;
1809
+ duration: number;
1810
+ order: number;
1811
+ keyPoints: string[];
1812
+ audioUrl: string | null;
1813
+ objectKey: string | null;
1814
+ meta: import("@prisma/client/runtime/client").JsonValue;
1815
+ createdAt: Date;
1816
+ updatedAt: Date;
1817
+ };
1818
+ meta: object;
1819
+ }>;
1820
+ getAvailableVoices: import("@trpc/server").TRPCQueryProcedure<{
1821
+ input: void;
1822
+ output: {
1823
+ id: string;
1824
+ name: string;
1825
+ description: string;
1826
+ }[];
1827
+ meta: object;
1828
+ }>;
1829
+ }>>;
1830
+ chat: import("@trpc/server").TRPCBuiltRouter<{
1831
+ ctx: import("../context.js").Context;
1832
+ meta: object;
1833
+ errorShape: {
1834
+ data: {
1835
+ zodError: string | null;
1836
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
1837
+ httpStatus: number;
1838
+ path?: string;
1839
+ stack?: string;
1840
+ };
1841
+ message: string;
1842
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
1843
+ };
1844
+ transformer: true;
1845
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
1846
+ getChannels: import("@trpc/server").TRPCQueryProcedure<{
1847
+ input: {
1848
+ workspaceId: string;
1849
+ };
1850
+ output: {
1851
+ id: string;
1852
+ name: string;
1853
+ createdAt: Date;
1854
+ workspaceId: string;
1855
+ }[];
1856
+ meta: object;
1857
+ }>;
1858
+ getChannel: import("@trpc/server").TRPCQueryProcedure<{
1859
+ input: {
1860
+ workspaceId?: string | undefined;
1861
+ channelId?: string | undefined;
1862
+ };
1863
+ output: {
1864
+ chats: ({
1865
+ user: {
1866
+ id: string;
1867
+ name: string | null;
1868
+ } | null;
1869
+ } & {
1870
+ userId: string | null;
1871
+ id: string;
1872
+ createdAt: Date;
1873
+ updatedAt: Date;
1874
+ message: string;
1875
+ channelId: string;
1876
+ })[];
1877
+ } & {
1878
+ id: string;
1879
+ name: string;
1880
+ createdAt: Date;
1881
+ workspaceId: string;
1882
+ };
1883
+ meta: object;
1884
+ }>;
1885
+ removeChannel: import("@trpc/server").TRPCMutationProcedure<{
1886
+ input: {
1887
+ workspaceId: string;
1888
+ channelId: string;
1889
+ };
1890
+ output: {
1891
+ success: boolean;
1892
+ };
1893
+ meta: object;
1894
+ }>;
1895
+ editChannel: import("@trpc/server").TRPCMutationProcedure<{
1896
+ input: {
1897
+ workspaceId: string;
1898
+ channelId: string;
1899
+ name: string;
1900
+ };
1901
+ output: {
1902
+ chats: ({
1903
+ user: {
1904
+ id: string;
1905
+ name: string | null;
1906
+ } | null;
1907
+ } & {
1908
+ userId: string | null;
1909
+ id: string;
1910
+ createdAt: Date;
1911
+ updatedAt: Date;
1912
+ message: string;
1913
+ channelId: string;
1914
+ })[];
1915
+ } & {
1916
+ id: string;
1917
+ name: string;
1918
+ createdAt: Date;
1919
+ workspaceId: string;
1920
+ };
1921
+ meta: object;
1922
+ }>;
1923
+ createChannel: import("@trpc/server").TRPCMutationProcedure<{
1924
+ input: {
1925
+ workspaceId: string;
1926
+ name: string;
1927
+ };
1928
+ output: {
1929
+ chats: ({
1930
+ user: {
1931
+ id: string;
1932
+ name: string | null;
1933
+ } | null;
1934
+ } & {
1935
+ userId: string | null;
1936
+ id: string;
1937
+ createdAt: Date;
1938
+ updatedAt: Date;
1939
+ message: string;
1940
+ channelId: string;
1941
+ })[];
1942
+ } & {
1943
+ id: string;
1944
+ name: string;
1945
+ createdAt: Date;
1946
+ workspaceId: string;
1947
+ };
1948
+ meta: object;
1949
+ }>;
1950
+ postMessage: import("@trpc/server").TRPCMutationProcedure<{
1951
+ input: {
1952
+ channelId: string;
1953
+ message: string;
1954
+ };
1955
+ output: {
1956
+ user: {
1957
+ id: string;
1958
+ name: string | null;
1959
+ } | null;
1960
+ } & {
1961
+ userId: string | null;
1962
+ id: string;
1963
+ createdAt: Date;
1964
+ updatedAt: Date;
1965
+ message: string;
1966
+ channelId: string;
1967
+ };
1968
+ meta: object;
1969
+ }>;
1970
+ editMessage: import("@trpc/server").TRPCMutationProcedure<{
1971
+ input: {
1972
+ chatId: string;
1973
+ message: string;
1974
+ };
1975
+ output: {
1976
+ user: {
1977
+ id: string;
1978
+ name: string | null;
1979
+ } | null;
1980
+ } & {
1981
+ userId: string | null;
1982
+ id: string;
1983
+ createdAt: Date;
1984
+ updatedAt: Date;
1985
+ message: string;
1986
+ channelId: string;
1987
+ };
1988
+ meta: object;
1989
+ }>;
1990
+ deleteMessage: import("@trpc/server").TRPCMutationProcedure<{
1991
+ input: {
1992
+ chatId: string;
1993
+ };
1994
+ output: {
1995
+ success: boolean;
1996
+ };
1997
+ meta: object;
1998
+ }>;
1999
+ }>>;
2000
+ annotations: import("@trpc/server").TRPCBuiltRouter<{
2001
+ ctx: import("../context.js").Context;
2002
+ meta: object;
2003
+ errorShape: {
2004
+ data: {
2005
+ zodError: string | null;
2006
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
2007
+ httpStatus: number;
2008
+ path?: string;
2009
+ stack?: string;
2010
+ };
2011
+ message: string;
2012
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
2013
+ };
2014
+ transformer: true;
2015
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
2016
+ listHighlights: import("@trpc/server").TRPCQueryProcedure<{
2017
+ input: {
2018
+ artifactVersionId: string;
2019
+ };
2020
+ output: ({
2021
+ comments: ({
2022
+ user: {
2023
+ id: string;
2024
+ name: string | null;
2025
+ profilePicture: {
2026
+ userId: string | null;
2027
+ id: string;
2028
+ name: string;
2029
+ createdAt: Date;
2030
+ size: number;
2031
+ workspaceId: string | null;
2032
+ url: string | null;
2033
+ objectKey: string | null;
2034
+ mimeType: string;
2035
+ bucket: string | null;
2036
+ checksum: string | null;
2037
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
2038
+ aiTranscription: import("@prisma/client/runtime/client").JsonValue | null;
2039
+ } | null;
2040
+ };
2041
+ } & {
2042
+ userId: string;
2043
+ id: string;
2044
+ createdAt: Date;
2045
+ updatedAt: Date;
2046
+ highlightId: string;
2047
+ content: string;
2048
+ })[];
2049
+ user: {
2050
+ id: string;
2051
+ name: string | null;
2052
+ profilePicture: {
2053
+ userId: string | null;
2054
+ id: string;
2055
+ name: string;
2056
+ createdAt: Date;
2057
+ size: number;
2058
+ workspaceId: string | null;
2059
+ url: string | null;
2060
+ objectKey: string | null;
2061
+ mimeType: string;
2062
+ bucket: string | null;
2063
+ checksum: string | null;
2064
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
2065
+ aiTranscription: import("@prisma/client/runtime/client").JsonValue | null;
2066
+ } | null;
2067
+ };
2068
+ } & {
2069
+ userId: string;
2070
+ id: string;
2071
+ createdAt: Date;
2072
+ updatedAt: Date;
2073
+ color: string;
2074
+ artifactVersionId: string;
2075
+ startOffset: number;
2076
+ endOffset: number;
2077
+ selectedText: string;
2078
+ })[];
2079
+ meta: object;
2080
+ }>;
2081
+ createHighlight: import("@trpc/server").TRPCMutationProcedure<{
2082
+ input: {
2083
+ artifactVersionId: string;
2084
+ startOffset: number;
2085
+ endOffset: number;
2086
+ selectedText: string;
2087
+ color?: string | undefined;
2088
+ };
2089
+ output: {
2090
+ comments: {
2091
+ userId: string;
2092
+ id: string;
2093
+ createdAt: Date;
2094
+ updatedAt: Date;
2095
+ highlightId: string;
2096
+ content: string;
2097
+ }[];
2098
+ user: {
2099
+ id: string;
2100
+ name: string | null;
2101
+ profilePicture: {
2102
+ userId: string | null;
2103
+ id: string;
2104
+ name: string;
2105
+ createdAt: Date;
2106
+ size: number;
2107
+ workspaceId: string | null;
2108
+ url: string | null;
2109
+ objectKey: string | null;
2110
+ mimeType: string;
2111
+ bucket: string | null;
2112
+ checksum: string | null;
2113
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
2114
+ aiTranscription: import("@prisma/client/runtime/client").JsonValue | null;
2115
+ } | null;
2116
+ };
2117
+ } & {
2118
+ userId: string;
2119
+ id: string;
2120
+ createdAt: Date;
2121
+ updatedAt: Date;
2122
+ color: string;
2123
+ artifactVersionId: string;
2124
+ startOffset: number;
2125
+ endOffset: number;
2126
+ selectedText: string;
2127
+ };
2128
+ meta: object;
2129
+ }>;
2130
+ deleteHighlight: import("@trpc/server").TRPCMutationProcedure<{
2131
+ input: {
2132
+ highlightId: string;
2133
+ };
2134
+ output: {
2135
+ success: boolean;
2136
+ };
2137
+ meta: object;
2138
+ }>;
2139
+ addComment: import("@trpc/server").TRPCMutationProcedure<{
2140
+ input: {
2141
+ highlightId: string;
2142
+ content: string;
2143
+ };
2144
+ output: {
2145
+ user: {
2146
+ id: string;
2147
+ name: string | null;
2148
+ profilePicture: {
2149
+ userId: string | null;
2150
+ id: string;
2151
+ name: string;
2152
+ createdAt: Date;
2153
+ size: number;
2154
+ workspaceId: string | null;
2155
+ url: string | null;
2156
+ objectKey: string | null;
2157
+ mimeType: string;
2158
+ bucket: string | null;
2159
+ checksum: string | null;
2160
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
2161
+ aiTranscription: import("@prisma/client/runtime/client").JsonValue | null;
2162
+ } | null;
2163
+ };
2164
+ } & {
2165
+ userId: string;
2166
+ id: string;
2167
+ createdAt: Date;
2168
+ updatedAt: Date;
2169
+ highlightId: string;
2170
+ content: string;
2171
+ };
2172
+ meta: object;
2173
+ }>;
2174
+ updateComment: import("@trpc/server").TRPCMutationProcedure<{
2175
+ input: {
2176
+ commentId: string;
2177
+ content: string;
2178
+ };
2179
+ output: {
2180
+ user: {
2181
+ id: string;
2182
+ name: string | null;
2183
+ profilePicture: {
2184
+ userId: string | null;
2185
+ id: string;
2186
+ name: string;
2187
+ createdAt: Date;
2188
+ size: number;
2189
+ workspaceId: string | null;
2190
+ url: string | null;
2191
+ objectKey: string | null;
2192
+ mimeType: string;
2193
+ bucket: string | null;
2194
+ checksum: string | null;
2195
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
2196
+ aiTranscription: import("@prisma/client/runtime/client").JsonValue | null;
2197
+ } | null;
2198
+ };
2199
+ } & {
2200
+ userId: string;
2201
+ id: string;
2202
+ createdAt: Date;
2203
+ updatedAt: Date;
2204
+ highlightId: string;
2205
+ content: string;
2206
+ };
2207
+ meta: object;
2208
+ }>;
2209
+ deleteComment: import("@trpc/server").TRPCMutationProcedure<{
2210
+ input: {
2211
+ commentId: string;
2212
+ };
2213
+ output: {
2214
+ success: boolean;
2215
+ };
2216
+ meta: object;
2217
+ }>;
2218
+ }>>;
2219
+ admin: import("@trpc/server").TRPCBuiltRouter<{
2220
+ ctx: import("../context.js").Context;
2221
+ meta: object;
2222
+ errorShape: {
2223
+ data: {
2224
+ zodError: string | null;
2225
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
2226
+ httpStatus: number;
2227
+ path?: string;
2228
+ stack?: string;
2229
+ };
2230
+ message: string;
2231
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
2232
+ };
2233
+ transformer: true;
2234
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
2235
+ getSystemStats: import("@trpc/server").TRPCQueryProcedure<{
2236
+ input: void;
2237
+ output: {
2238
+ totalUsers: number;
2239
+ totalWorkspaces: number;
2240
+ totalSubscriptions: number;
2241
+ revenue: number;
2242
+ subscriptionRevenue: number;
2243
+ topupRevenue: number;
2244
+ };
2245
+ meta: object;
2246
+ }>;
2247
+ listUsers: import("@trpc/server").TRPCQueryProcedure<{
2248
+ input: {
2249
+ page?: number | undefined;
2250
+ pageSize?: number | undefined;
2251
+ search?: string | undefined;
2252
+ emailVerified?: "all" | "yes" | "no" | undefined;
2253
+ joinedFrom?: unknown;
2254
+ joinedTo?: unknown;
2255
+ };
2256
+ output: {
2257
+ users: any[];
2258
+ page: number;
2259
+ pageSize: number;
2260
+ totalCount: number;
2261
+ totalPages: number;
2262
+ };
2263
+ meta: object;
2264
+ }>;
2265
+ listInvoices: import("@trpc/server").TRPCQueryProcedure<{
2266
+ input: {
2267
+ page?: number | undefined;
2268
+ pageSize?: number | undefined;
2269
+ search?: string | undefined;
2270
+ status?: string | undefined;
2271
+ type?: "TOPUP" | "SUBSCRIPTION" | undefined;
2272
+ userId?: string | undefined;
2273
+ from?: unknown;
2274
+ to?: unknown;
2275
+ };
2276
+ output: {
2277
+ items: any;
2278
+ page: number;
2279
+ pageSize: number;
2280
+ totalCount: any;
2281
+ totalPages: number;
2282
+ };
2283
+ meta: object;
2284
+ }>;
2285
+ listWorkspaces: import("@trpc/server").TRPCQueryProcedure<{
2286
+ input: {
2287
+ limit?: number | undefined;
2288
+ cursor?: string | null | undefined;
2289
+ };
2290
+ output: {
2291
+ workspaces: ({
2292
+ owner: {
2293
+ email: string | null;
2294
+ name: string | null;
2295
+ };
2296
+ } & {
2297
+ id: string;
2298
+ createdAt: Date;
2299
+ updatedAt: Date;
2300
+ ownerId: string;
2301
+ title: string;
2302
+ description: string | null;
2303
+ icon: string;
2304
+ color: string;
2305
+ markerColor: string | null;
2306
+ folderId: string | null;
2307
+ fileBeingAnalyzed: boolean;
2308
+ analysisProgress: import("@prisma/client/runtime/client").JsonValue | null;
2309
+ needsAnalysis: boolean;
2310
+ })[];
2311
+ nextCursor: string | undefined;
2312
+ };
2313
+ meta: object;
2314
+ }>;
2315
+ updateUserRole: import("@trpc/server").TRPCMutationProcedure<{
2316
+ input: {
2317
+ userId: string;
2318
+ roleName: string;
2319
+ };
2320
+ output: {
2321
+ id: string;
2322
+ email: string | null;
2323
+ stripe_customer_id: string | null;
2324
+ name: string | null;
2325
+ emailVerified: Date | null;
2326
+ passwordHash: string | null;
2327
+ createdAt: Date;
2328
+ updatedAt: Date;
2329
+ fileAssetId: string | null;
2330
+ roleId: string | null;
2331
+ deletedAt: Date | null;
2332
+ };
2333
+ meta: object;
2334
+ }>;
2335
+ listPlans: import("@trpc/server").TRPCQueryProcedure<{
2336
+ input: void;
2337
+ output: ({
2338
+ limit: {
2339
+ id: string;
2340
+ createdAt: Date;
2341
+ updatedAt: Date;
2342
+ planId: string;
2343
+ maxStorageBytes: bigint;
2344
+ maxWorksheets: number;
2345
+ maxFlashcards: number;
2346
+ maxPodcasts: number;
2347
+ maxStudyGuides: number;
2348
+ } | null;
2349
+ } & {
2350
+ id: string;
2351
+ name: string;
2352
+ createdAt: Date;
2353
+ description: string | null;
2354
+ type: string;
2355
+ active: boolean;
2356
+ price: number;
2357
+ stripePriceId: string;
2358
+ interval: string | null;
2359
+ })[];
2360
+ meta: object;
2361
+ }>;
2362
+ upsertPlan: import("@trpc/server").TRPCMutationProcedure<{
2363
+ input: {
2364
+ name: string;
2365
+ type: string;
2366
+ price: number;
2367
+ interval: string | null;
2368
+ limits: {
2369
+ maxStorageBytes: number;
2370
+ maxWorksheets: number;
2371
+ maxFlashcards: number;
2372
+ maxPodcasts?: number | undefined;
2373
+ maxStudyGuides?: number | undefined;
2374
+ };
2375
+ id?: string | undefined;
2376
+ description?: string | undefined;
2377
+ stripePriceId?: string | undefined;
2378
+ active?: boolean | undefined;
2379
+ };
2380
+ output: {
2381
+ id: string;
2382
+ name: string;
2383
+ createdAt: Date;
2384
+ description: string | null;
2385
+ type: string;
2386
+ active: boolean;
2387
+ price: number;
2388
+ stripePriceId: string;
2389
+ interval: string | null;
2390
+ };
2391
+ meta: object;
2392
+ }>;
2393
+ deletePlan: import("@trpc/server").TRPCMutationProcedure<{
2394
+ input: {
2395
+ id: string;
2396
+ };
2397
+ output: {
2398
+ success: boolean;
2399
+ message: string;
2400
+ };
2401
+ meta: object;
2402
+ }>;
2403
+ getUserInvoices: import("@trpc/server").TRPCQueryProcedure<{
2404
+ input: {
2405
+ userId: string;
2406
+ limit?: number | undefined;
2407
+ };
2408
+ output: any;
2409
+ meta: object;
2410
+ }>;
2411
+ getUserDetailedInfo: import("@trpc/server").TRPCQueryProcedure<{
2412
+ input: {
2413
+ userId: string;
2414
+ };
2415
+ output: {
2416
+ totalSpent: number;
2417
+ purchasedCredits: {
2418
+ type: import("../lib/prisma.js").ArtifactType;
2419
+ amount: number;
2420
+ }[];
2421
+ profilePicture: string | null;
2422
+ role: {
2423
+ id: string;
2424
+ name: string;
2425
+ } | null;
2426
+ subscriptions: ({
2427
+ plan: {
2428
+ id: string;
2429
+ name: string;
2430
+ createdAt: Date;
2431
+ description: string | null;
2432
+ type: string;
2433
+ active: boolean;
2434
+ price: number;
2435
+ stripePriceId: string;
2436
+ interval: string | null;
2437
+ };
2438
+ } & {
2439
+ userId: string;
2440
+ id: string;
2441
+ createdAt: Date;
2442
+ planId: string;
2443
+ stripeSubscriptionId: string;
2444
+ stripeCustomerId: string | null;
2445
+ status: string;
2446
+ currentPeriodStart: Date;
2447
+ currentPeriodEnd: Date;
2448
+ cancelAt: Date | null;
2449
+ canceledAt: Date | null;
2450
+ })[];
2451
+ _count: {
2452
+ artifacts: number;
2453
+ workspaces: number;
2454
+ };
2455
+ id: string;
2456
+ email: string | null;
2457
+ stripe_customer_id: string | null;
2458
+ name: string | null;
2459
+ emailVerified: Date | null;
2460
+ passwordHash: string | null;
2461
+ createdAt: Date;
2462
+ updatedAt: Date;
2463
+ fileAssetId: string | null;
2464
+ roleId: string | null;
2465
+ deletedAt: Date | null;
2466
+ };
2467
+ meta: object;
2468
+ }>;
2469
+ debugInvoices: import("@trpc/server").TRPCQueryProcedure<{
2470
+ input: void;
2471
+ output: {
2472
+ count: any;
2473
+ all: any;
2474
+ };
2475
+ meta: object;
2476
+ }>;
2477
+ listResourcePrices: import("@trpc/server").TRPCQueryProcedure<{
2478
+ input: void;
2479
+ output: {
2480
+ id: string;
2481
+ updatedAt: Date;
2482
+ resourceType: import("../lib/prisma.js").ArtifactType;
2483
+ priceCents: number;
2484
+ }[];
2485
+ meta: object;
2486
+ }>;
2487
+ upsertResourcePrice: import("@trpc/server").TRPCMutationProcedure<{
2488
+ input: {
2489
+ resourceType: "WORKSHEET" | "STORAGE" | "STUDY_GUIDE" | "FLASHCARD_SET" | "MEETING_SUMMARY" | "PODCAST_EPISODE";
2490
+ priceCents: number;
2491
+ };
2492
+ output: {
2493
+ id: string;
2494
+ updatedAt: Date;
2495
+ resourceType: import("../lib/prisma.js").ArtifactType;
2496
+ priceCents: number;
2497
+ };
2498
+ meta: object;
2499
+ }>;
2500
+ listRecentInvoices: import("@trpc/server").TRPCQueryProcedure<{
2501
+ input: {
2502
+ limit?: number | undefined;
2503
+ };
2504
+ output: any;
2505
+ meta: object;
2506
+ }>;
2507
+ activityList: import("@trpc/server").TRPCQueryProcedure<{
2508
+ input: {
2509
+ from?: unknown;
2510
+ to?: unknown;
2511
+ actorUserId?: string | undefined;
2512
+ workspaceId?: string | undefined;
2513
+ category?: "AUTH" | "WORKSPACE" | "BILLING" | "ADMIN" | "CONTENT" | "SYSTEM" | undefined;
2514
+ status?: "SUCCESS" | "FAILURE" | undefined;
2515
+ search?: string | undefined;
2516
+ page?: number | undefined;
2517
+ limit?: number | undefined;
2518
+ };
2519
+ output: {
2520
+ items: {
2521
+ id: string;
2522
+ createdAt: Date;
2523
+ action: string;
2524
+ description: string;
2525
+ category: import("../lib/prisma.js").ActivityLogCategory;
2526
+ trpcPath: string | null;
2527
+ status: import("../lib/prisma.js").ActivityLogStatus;
2528
+ durationMs: number;
2529
+ errorCode: string | null;
2530
+ ipAddress: string | null;
2531
+ actor: {
2532
+ id: string;
2533
+ email: string | null;
2534
+ name: string | null;
2535
+ } | null;
2536
+ workspace: {
2537
+ id: string;
2538
+ title: string;
2539
+ } | null;
2540
+ metadata: import("@prisma/client/runtime/client").JsonValue;
2541
+ }[];
2542
+ page: number;
2543
+ pageSize: number;
2544
+ totalCount: number;
2545
+ totalPages: number;
2546
+ };
2547
+ meta: object;
2548
+ }>;
2549
+ activityExportCsv: import("@trpc/server").TRPCQueryProcedure<{
2550
+ input: {
2551
+ from?: unknown;
2552
+ to?: unknown;
2553
+ actorUserId?: string | undefined;
2554
+ workspaceId?: string | undefined;
2555
+ category?: "AUTH" | "WORKSPACE" | "BILLING" | "ADMIN" | "CONTENT" | "SYSTEM" | undefined;
2556
+ status?: "SUCCESS" | "FAILURE" | undefined;
2557
+ search?: string | undefined;
2558
+ maxRows?: number | undefined;
2559
+ };
2560
+ output: {
2561
+ csv: string;
2562
+ count: number;
2563
+ };
2564
+ meta: object;
2565
+ }>;
2566
+ activityPurgeRetention: import("@trpc/server").TRPCMutationProcedure<{
2567
+ input: void;
2568
+ output: {
2569
+ deleted: number;
2570
+ retentionDays: number;
2571
+ cutoff: Date;
2572
+ };
2573
+ meta: object;
2574
+ }>;
2575
+ }>>;
2576
+ payment: import("@trpc/server").TRPCBuiltRouter<{
2577
+ ctx: import("../context.js").Context;
2578
+ meta: object;
2579
+ errorShape: {
2580
+ data: {
2581
+ zodError: string | null;
2582
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
2583
+ httpStatus: number;
2584
+ path?: string;
2585
+ stack?: string;
2586
+ };
2587
+ message: string;
2588
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
2589
+ };
2590
+ transformer: true;
2591
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
2592
+ getPlans: import("@trpc/server").TRPCQueryProcedure<{
2593
+ input: void;
2594
+ output: any[];
2595
+ meta: object;
2596
+ }>;
2597
+ createCheckoutSession: import("@trpc/server").TRPCMutationProcedure<{
2598
+ input: {
2599
+ planId: string;
2600
+ };
2601
+ output: {
2602
+ url: string | null;
2603
+ };
2604
+ meta: object;
2605
+ }>;
2606
+ confirmCheckoutSuccess: import("@trpc/server").TRPCMutationProcedure<{
2607
+ input: {
2608
+ sessionId: string;
2609
+ };
2610
+ output: {
2611
+ confirmed: boolean;
2612
+ reason: string;
2613
+ kind?: undefined;
2614
+ } | {
2615
+ confirmed: boolean;
2616
+ kind: "payment";
2617
+ reason?: undefined;
2618
+ } | {
2619
+ confirmed: boolean;
2620
+ kind: "subscription";
2621
+ reason?: undefined;
2622
+ };
2623
+ meta: object;
2624
+ }>;
2625
+ createResourcePurchaseSession: import("@trpc/server").TRPCMutationProcedure<{
2626
+ input: {
2627
+ resourceType: "WORKSHEET" | "STORAGE" | "STUDY_GUIDE" | "FLASHCARD_SET" | "MEETING_SUMMARY" | "PODCAST_EPISODE";
2628
+ quantity?: number | undefined;
2629
+ };
2630
+ output: {
2631
+ url: string | null;
2632
+ };
2633
+ meta: object;
2634
+ }>;
2635
+ getUsageOverview: import("@trpc/server").TRPCQueryProcedure<{
2636
+ input: void;
2637
+ output: {
2638
+ usage: import("../services/billing/usage.service.js").UserUsage;
2639
+ limits: import("../services/billing/usage.service.js").UserPlanLimits;
2640
+ hasActivePlan: boolean;
2641
+ };
2642
+ meta: object;
2643
+ }>;
2644
+ getResourcePrices: import("@trpc/server").TRPCQueryProcedure<{
2645
+ input: void;
2646
+ output: {
2647
+ id: string;
2648
+ updatedAt: Date;
2649
+ resourceType: import("../lib/prisma.js").ArtifactType;
2650
+ priceCents: number;
2651
+ }[];
2652
+ meta: object;
2653
+ }>;
2654
+ }>>;
2655
+ copilot: import("@trpc/server").TRPCBuiltRouter<{
2656
+ ctx: import("../context.js").Context;
2657
+ meta: object;
2658
+ errorShape: {
2659
+ data: {
2660
+ zodError: string | null;
2661
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
2662
+ httpStatus: number;
2663
+ path?: string;
2664
+ stack?: string;
2665
+ };
2666
+ message: string;
2667
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
2668
+ };
2669
+ transformer: true;
2670
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
2671
+ listConversations: import("@trpc/server").TRPCQueryProcedure<{
2672
+ input: {
2673
+ workspaceId: string;
2674
+ };
2675
+ output: {
2676
+ id: string;
2677
+ title: string;
2678
+ updatedAt: Date;
2679
+ preview: string;
2680
+ }[];
2681
+ meta: object;
2682
+ }>;
2683
+ getConversation: import("@trpc/server").TRPCQueryProcedure<{
2684
+ input: {
2685
+ workspaceId: string;
2686
+ conversationId: string;
2687
+ };
2688
+ output: {
2689
+ id: string;
2690
+ title: string;
2691
+ messages: {
2692
+ id: string;
2693
+ role: string;
2694
+ content: string;
2695
+ createdAt: Date;
2696
+ }[];
2697
+ };
2698
+ meta: object;
2699
+ }>;
2700
+ createConversation: import("@trpc/server").TRPCMutationProcedure<{
2701
+ input: {
2702
+ workspaceId: string;
2703
+ title?: string | undefined;
2704
+ };
2705
+ output: {
2706
+ id: string;
2707
+ title: string;
2708
+ updatedAt: Date;
2709
+ };
2710
+ meta: object;
2711
+ }>;
2712
+ deleteConversation: import("@trpc/server").TRPCMutationProcedure<{
2713
+ input: {
2714
+ workspaceId: string;
2715
+ conversationId: string;
2716
+ };
2717
+ output: {
2718
+ success: boolean;
2719
+ };
2720
+ meta: object;
2721
+ }>;
2722
+ ask: import("@trpc/server").TRPCMutationProcedure<{
2723
+ input: {
2724
+ context: {
2725
+ workspaceId: string;
2726
+ artifactId: string;
2727
+ artifactType: "flashcards" | "worksheet" | "study-guide";
2728
+ documentContent: string;
2729
+ documentPlainText?: string | undefined;
2730
+ selectedText?: string | undefined;
2731
+ viewportText?: string | undefined;
2732
+ cursorPosition?: {
2733
+ start: number;
2734
+ end: number;
2735
+ } | undefined;
2736
+ metadata?: {
2737
+ flashcardId?: string | undefined;
2738
+ questionId?: string | undefined;
2739
+ documentId?: string | undefined;
2740
+ } | undefined;
2741
+ };
2742
+ message: string;
2743
+ conversationId?: string | undefined;
2744
+ };
2745
+ output: {
2746
+ answer: string;
2747
+ highlights: {
2748
+ text: string;
2749
+ label?: string;
2750
+ }[];
2751
+ };
2752
+ meta: object;
2753
+ }>;
2754
+ explainSelection: import("@trpc/server").TRPCMutationProcedure<{
2755
+ input: {
2756
+ context: {
2757
+ workspaceId: string;
2758
+ artifactId: string;
2759
+ artifactType: "flashcards" | "worksheet" | "study-guide";
2760
+ documentContent: string;
2761
+ documentPlainText?: string | undefined;
2762
+ selectedText?: string | undefined;
2763
+ viewportText?: string | undefined;
2764
+ cursorPosition?: {
2765
+ start: number;
2766
+ end: number;
2767
+ } | undefined;
2768
+ metadata?: {
2769
+ flashcardId?: string | undefined;
2770
+ questionId?: string | undefined;
2771
+ documentId?: string | undefined;
2772
+ } | undefined;
2773
+ };
2774
+ message?: string | undefined;
2775
+ conversationId?: string | undefined;
2776
+ };
2777
+ output: {
2778
+ answer: string;
2779
+ };
2780
+ meta: object;
2781
+ }>;
2782
+ suggestHighlights: import("@trpc/server").TRPCMutationProcedure<{
2783
+ input: {
2784
+ context: {
2785
+ workspaceId: string;
2786
+ artifactId: string;
2787
+ artifactType: "flashcards" | "worksheet" | "study-guide";
2788
+ documentContent: string;
2789
+ documentPlainText?: string | undefined;
2790
+ selectedText?: string | undefined;
2791
+ viewportText?: string | undefined;
2792
+ cursorPosition?: {
2793
+ start: number;
2794
+ end: number;
2795
+ } | undefined;
2796
+ metadata?: {
2797
+ flashcardId?: string | undefined;
2798
+ questionId?: string | undefined;
2799
+ documentId?: string | undefined;
2800
+ } | undefined;
2801
+ };
2802
+ message?: string | undefined;
2803
+ conversationId?: string | undefined;
2804
+ };
2805
+ output: {
2806
+ answer: string;
2807
+ highlights: {
2808
+ text: string;
2809
+ label?: string;
2810
+ }[];
2811
+ };
2812
+ meta: object;
2813
+ }>;
2814
+ generateFlashcards: import("@trpc/server").TRPCMutationProcedure<{
2815
+ input: {
2816
+ context: {
2817
+ workspaceId: string;
2818
+ artifactId: string;
2819
+ artifactType: "flashcards" | "worksheet" | "study-guide";
2820
+ documentContent: string;
2821
+ documentPlainText?: string | undefined;
2822
+ selectedText?: string | undefined;
2823
+ viewportText?: string | undefined;
2824
+ cursorPosition?: {
2825
+ start: number;
2826
+ end: number;
2827
+ } | undefined;
2828
+ metadata?: {
2829
+ flashcardId?: string | undefined;
2830
+ questionId?: string | undefined;
2831
+ documentId?: string | undefined;
2832
+ } | undefined;
2833
+ };
2834
+ message?: string | undefined;
2835
+ numCards?: number | undefined;
2836
+ conversationId?: string | undefined;
2837
+ };
2838
+ output: {
2839
+ answer: string;
2840
+ artifactId: string;
2841
+ flashcards: {
2842
+ id: string;
2843
+ createdAt: Date;
2844
+ tags: string[];
2845
+ artifactId: string;
2846
+ order: number;
2847
+ front: string;
2848
+ back: string;
2849
+ acceptedAnswers: string[];
2850
+ }[];
2851
+ };
2852
+ meta: object;
2853
+ }>;
2854
+ }>>;
2855
+ notifications: import("@trpc/server").TRPCBuiltRouter<{
2856
+ ctx: import("../context.js").Context;
2857
+ meta: object;
2858
+ errorShape: {
2859
+ data: {
2860
+ zodError: string | null;
2861
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
2862
+ httpStatus: number;
2863
+ path?: string;
2864
+ stack?: string;
2865
+ };
2866
+ message: string;
2867
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
2868
+ };
2869
+ transformer: true;
2870
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
2871
+ list: import("@trpc/server").TRPCQueryProcedure<{
2872
+ input: {
2873
+ cursor?: string | undefined;
2874
+ limit?: number | undefined;
2875
+ unreadOnly?: boolean | undefined;
2876
+ types?: string[] | undefined;
2877
+ };
2878
+ output: {
2879
+ items: ({
2880
+ workspace: {
2881
+ id: string;
2882
+ title: string;
2883
+ } | null;
2884
+ actor: {
2885
+ id: string;
2886
+ email: string | null;
2887
+ name: string | null;
2888
+ } | null;
2889
+ } & {
2890
+ userId: string;
2891
+ id: string;
2892
+ createdAt: Date;
2893
+ updatedAt: Date;
2894
+ title: string;
2895
+ type: string;
2896
+ workspaceId: string | null;
2897
+ metadata: import("@prisma/client/runtime/client").JsonValue | null;
2898
+ actorUserId: string | null;
2899
+ body: string;
2900
+ actionUrl: string | null;
2901
+ priority: import("../../generated/prisma/enums.js").NotificationPriority;
2902
+ sourceId: string | null;
2903
+ content: string | null;
2904
+ read: boolean;
2905
+ readAt: Date | null;
2906
+ deliveredAt: Date | null;
2907
+ })[];
2908
+ nextCursor: string | undefined;
2909
+ };
2910
+ meta: object;
2911
+ }>;
2912
+ unreadCount: import("@trpc/server").TRPCQueryProcedure<{
2913
+ input: void;
2914
+ output: {
2915
+ count: number;
2916
+ };
2917
+ meta: object;
2918
+ }>;
2919
+ markRead: import("@trpc/server").TRPCMutationProcedure<{
2920
+ input: {
2921
+ id: string;
2922
+ };
2923
+ output: {
2924
+ success: boolean;
2925
+ };
2926
+ meta: object;
2927
+ }>;
2928
+ markManyRead: import("@trpc/server").TRPCMutationProcedure<{
2929
+ input: {
2930
+ ids: string[];
2931
+ };
2932
+ output: {
2933
+ success: boolean;
2934
+ };
2935
+ meta: object;
2936
+ }>;
2937
+ markAllRead: import("@trpc/server").TRPCMutationProcedure<{
2938
+ input: void;
2939
+ output: {
2940
+ success: boolean;
2941
+ };
2942
+ meta: object;
2943
+ }>;
2944
+ delete: import("@trpc/server").TRPCMutationProcedure<{
2945
+ input: {
2946
+ id: string;
2947
+ };
2948
+ output: {
2949
+ success: boolean;
2950
+ };
2951
+ meta: object;
2952
+ }>;
2953
+ }>>;
2954
+ knowledgeBase: import("@trpc/server").TRPCBuiltRouter<{
2955
+ ctx: import("../context.js").Context;
2956
+ meta: object;
2957
+ errorShape: {
2958
+ data: {
2959
+ zodError: string | null;
2960
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
2961
+ httpStatus: number;
2962
+ path?: string;
2963
+ stack?: string;
2964
+ };
2965
+ message: string;
2966
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
2967
+ };
2968
+ transformer: true;
2969
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
2970
+ listForWorkspace: import("@trpc/server").TRPCQueryProcedure<{
2971
+ input: {
2972
+ workspaceId: string;
2973
+ };
2974
+ output: {
2975
+ attachmentId: string;
2976
+ attachedAt: Date;
2977
+ attachedById: string | null;
2978
+ _count: {
2979
+ documents: number;
2980
+ };
2981
+ id: string;
2982
+ name: string;
2983
+ createdAt: Date;
2984
+ updatedAt: Date;
2985
+ description: string | null;
2986
+ createdById: string | null;
2987
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseStatus;
2988
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
2989
+ isCurated: boolean;
2990
+ embeddingModel: string;
2991
+ embeddingDim: number;
2992
+ }[];
2993
+ meta: object;
2994
+ }>;
2995
+ searchCatalog: import("@trpc/server").TRPCQueryProcedure<{
2996
+ input: {
2997
+ query?: string | undefined;
2998
+ workspaceId?: string | undefined;
2999
+ limit?: number | undefined;
3000
+ };
3001
+ output: {
3002
+ attached: boolean;
3003
+ _count: {
3004
+ documents: number;
3005
+ };
3006
+ id: string;
3007
+ name: string;
3008
+ createdAt: Date;
3009
+ updatedAt: Date;
3010
+ description: string | null;
3011
+ createdById: string | null;
3012
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseStatus;
3013
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3014
+ isCurated: boolean;
3015
+ embeddingModel: string;
3016
+ embeddingDim: number;
3017
+ }[];
3018
+ meta: object;
3019
+ }>;
3020
+ get: import("@trpc/server").TRPCQueryProcedure<{
3021
+ input: {
3022
+ id: string;
3023
+ };
3024
+ output: {
3025
+ documents: {
3026
+ id: string;
3027
+ name: string;
3028
+ createdAt: Date;
3029
+ updatedAt: Date;
3030
+ size: number;
3031
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseDocumentStatus;
3032
+ objectKey: string | null;
3033
+ mimeType: string;
3034
+ bucket: string | null;
3035
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3036
+ knowledgeBaseId: string;
3037
+ errorMessage: string | null;
3038
+ numChunks: number;
3039
+ numPages: number | null;
3040
+ }[];
3041
+ id: string;
3042
+ name: string;
3043
+ createdAt: Date;
3044
+ updatedAt: Date;
3045
+ description: string | null;
3046
+ createdById: string | null;
3047
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseStatus;
3048
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3049
+ isCurated: boolean;
3050
+ embeddingModel: string;
3051
+ embeddingDim: number;
3052
+ };
3053
+ meta: object;
3054
+ }>;
3055
+ listDocuments: import("@trpc/server").TRPCQueryProcedure<{
3056
+ input: {
3057
+ knowledgeBaseId: string;
3058
+ };
3059
+ output: {
3060
+ id: string;
3061
+ name: string;
3062
+ createdAt: Date;
3063
+ updatedAt: Date;
3064
+ size: number;
3065
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseDocumentStatus;
3066
+ objectKey: string | null;
3067
+ mimeType: string;
3068
+ bucket: string | null;
3069
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3070
+ knowledgeBaseId: string;
3071
+ errorMessage: string | null;
3072
+ numChunks: number;
3073
+ numPages: number | null;
3074
+ }[];
3075
+ meta: object;
3076
+ }>;
3077
+ addToWorkspace: import("@trpc/server").TRPCMutationProcedure<{
3078
+ input: {
3079
+ workspaceId: string;
3080
+ knowledgeBaseId: string;
3081
+ };
3082
+ output: {
3083
+ id: string;
3084
+ createdAt: Date;
3085
+ workspaceId: string;
3086
+ knowledgeBaseId: string;
3087
+ addedById: string | null;
3088
+ };
3089
+ meta: object;
3090
+ }>;
3091
+ removeFromWorkspace: import("@trpc/server").TRPCMutationProcedure<{
3092
+ input: {
3093
+ workspaceId: string;
3094
+ knowledgeBaseId: string;
3095
+ };
3096
+ output: boolean;
3097
+ meta: object;
3098
+ }>;
3099
+ query: import("@trpc/server").TRPCMutationProcedure<{
3100
+ input: {
3101
+ knowledgeBaseId: string;
3102
+ query: string;
3103
+ topK?: number | undefined;
3104
+ generateAnswer?: boolean | undefined;
3105
+ };
3106
+ output: {
3107
+ matches: {
3108
+ chunkId: string;
3109
+ documentId: string;
3110
+ documentName: string;
3111
+ chunkIndex: number;
3112
+ content: string;
3113
+ score: number;
3114
+ }[];
3115
+ answer: string | null;
3116
+ };
3117
+ meta: object;
3118
+ }>;
3119
+ admin: import("@trpc/server").TRPCBuiltRouter<{
3120
+ ctx: import("../context.js").Context;
3121
+ meta: object;
3122
+ errorShape: {
3123
+ data: {
3124
+ zodError: string | null;
3125
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
3126
+ httpStatus: number;
3127
+ path?: string;
3128
+ stack?: string;
3129
+ };
3130
+ message: string;
3131
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
3132
+ };
3133
+ transformer: true;
3134
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
3135
+ listAll: import("@trpc/server").TRPCQueryProcedure<{
3136
+ input: void;
3137
+ output: ({
3138
+ _count: {
3139
+ workspaces: number;
3140
+ documents: number;
3141
+ };
3142
+ } & {
3143
+ id: string;
3144
+ name: string;
3145
+ createdAt: Date;
3146
+ updatedAt: Date;
3147
+ description: string | null;
3148
+ createdById: string | null;
3149
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseStatus;
3150
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3151
+ isCurated: boolean;
3152
+ embeddingModel: string;
3153
+ embeddingDim: number;
3154
+ })[];
3155
+ meta: object;
3156
+ }>;
3157
+ get: import("@trpc/server").TRPCQueryProcedure<{
3158
+ input: {
3159
+ id: string;
3160
+ };
3161
+ output: {
3162
+ documents: {
3163
+ id: string;
3164
+ name: string;
3165
+ createdAt: Date;
3166
+ updatedAt: Date;
3167
+ size: number;
3168
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseDocumentStatus;
3169
+ objectKey: string | null;
3170
+ mimeType: string;
3171
+ bucket: string | null;
3172
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3173
+ knowledgeBaseId: string;
3174
+ errorMessage: string | null;
3175
+ numChunks: number;
3176
+ numPages: number | null;
3177
+ }[];
3178
+ workspaces: ({
3179
+ workspace: {
3180
+ id: string;
3181
+ title: string;
3182
+ icon: string;
3183
+ };
3184
+ } & {
3185
+ id: string;
3186
+ createdAt: Date;
3187
+ workspaceId: string;
3188
+ knowledgeBaseId: string;
3189
+ addedById: string | null;
3190
+ })[];
3191
+ id: string;
3192
+ name: string;
3193
+ createdAt: Date;
3194
+ updatedAt: Date;
3195
+ description: string | null;
3196
+ createdById: string | null;
3197
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseStatus;
3198
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3199
+ isCurated: boolean;
3200
+ embeddingModel: string;
3201
+ embeddingDim: number;
3202
+ };
3203
+ meta: object;
3204
+ }>;
3205
+ listDocuments: import("@trpc/server").TRPCQueryProcedure<{
3206
+ input: {
3207
+ knowledgeBaseId: string;
3208
+ };
3209
+ output: {
3210
+ id: string;
3211
+ name: string;
3212
+ createdAt: Date;
3213
+ updatedAt: Date;
3214
+ size: number;
3215
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseDocumentStatus;
3216
+ objectKey: string | null;
3217
+ mimeType: string;
3218
+ bucket: string | null;
3219
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3220
+ knowledgeBaseId: string;
3221
+ errorMessage: string | null;
3222
+ numChunks: number;
3223
+ numPages: number | null;
3224
+ }[];
3225
+ meta: object;
3226
+ }>;
3227
+ create: import("@trpc/server").TRPCMutationProcedure<{
3228
+ input: {
3229
+ name: string;
3230
+ description?: string | undefined;
3231
+ isCurated?: boolean | undefined;
3232
+ };
3233
+ output: {
3234
+ id: string;
3235
+ name: string;
3236
+ createdAt: Date;
3237
+ updatedAt: Date;
3238
+ description: string | null;
3239
+ createdById: string | null;
3240
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseStatus;
3241
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3242
+ isCurated: boolean;
3243
+ embeddingModel: string;
3244
+ embeddingDim: number;
3245
+ };
3246
+ meta: object;
3247
+ }>;
3248
+ update: import("@trpc/server").TRPCMutationProcedure<{
3249
+ input: {
3250
+ id: string;
3251
+ name?: string | undefined;
3252
+ description?: string | null | undefined;
3253
+ isCurated?: boolean | undefined;
3254
+ };
3255
+ output: {
3256
+ id: string;
3257
+ name: string;
3258
+ createdAt: Date;
3259
+ updatedAt: Date;
3260
+ description: string | null;
3261
+ createdById: string | null;
3262
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseStatus;
3263
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3264
+ isCurated: boolean;
3265
+ embeddingModel: string;
3266
+ embeddingDim: number;
3267
+ };
3268
+ meta: object;
3269
+ }>;
3270
+ delete: import("@trpc/server").TRPCMutationProcedure<{
3271
+ input: {
3272
+ id: string;
3273
+ };
3274
+ output: boolean;
3275
+ meta: object;
3276
+ }>;
3277
+ attachToWorkspace: import("@trpc/server").TRPCMutationProcedure<{
3278
+ input: {
3279
+ workspaceId: string;
3280
+ knowledgeBaseId: string;
3281
+ };
3282
+ output: {
3283
+ id: string;
3284
+ createdAt: Date;
3285
+ workspaceId: string;
3286
+ knowledgeBaseId: string;
3287
+ addedById: string | null;
3288
+ };
3289
+ meta: object;
3290
+ }>;
3291
+ detachFromWorkspace: import("@trpc/server").TRPCMutationProcedure<{
3292
+ input: {
3293
+ workspaceId: string;
3294
+ knowledgeBaseId: string;
3295
+ };
3296
+ output: boolean;
3297
+ meta: object;
3298
+ }>;
3299
+ requestDocumentUploadUrl: import("@trpc/server").TRPCMutationProcedure<{
3300
+ input: {
3301
+ knowledgeBaseId: string;
3302
+ filename: string;
3303
+ contentType: string;
3304
+ size: number;
3305
+ };
3306
+ output: {
3307
+ documentId: string;
3308
+ uploadUrl: string;
3309
+ bucket: string;
3310
+ objectKey: string;
3311
+ };
3312
+ meta: object;
3313
+ }>;
3314
+ processDocument: import("@trpc/server").TRPCMutationProcedure<{
3315
+ input: {
3316
+ knowledgeBaseId: string;
3317
+ documentId: string;
3318
+ };
3319
+ output: {
3320
+ id: string;
3321
+ name: string;
3322
+ createdAt: Date;
3323
+ updatedAt: Date;
3324
+ size: number;
3325
+ status: import("../../generated/prisma/enums.js").KnowledgeBaseDocumentStatus;
3326
+ objectKey: string | null;
3327
+ mimeType: string;
3328
+ bucket: string | null;
3329
+ meta: import("@prisma/client/runtime/client").JsonValue | null;
3330
+ knowledgeBaseId: string;
3331
+ errorMessage: string | null;
3332
+ numChunks: number;
3333
+ numPages: number | null;
3334
+ } | null;
3335
+ meta: object;
3336
+ }>;
3337
+ deleteDocument: import("@trpc/server").TRPCMutationProcedure<{
3338
+ input: {
3339
+ documentId: string;
3340
+ };
3341
+ output: boolean;
3342
+ meta: object;
3343
+ }>;
3344
+ query: import("@trpc/server").TRPCMutationProcedure<{
3345
+ input: {
3346
+ knowledgeBaseId: string;
3347
+ query: string;
3348
+ topK?: number | undefined;
3349
+ generateAnswer?: boolean | undefined;
3350
+ };
3351
+ output: {
3352
+ matches: {
3353
+ chunkId: string;
3354
+ documentId: string;
3355
+ documentName: string;
3356
+ chunkIndex: number;
3357
+ content: string;
3358
+ score: number;
3359
+ }[];
3360
+ answer: string | null;
3361
+ };
3362
+ meta: object;
3363
+ }>;
3364
+ }>>;
3365
+ }>>;
3366
+ artifactVersions: import("@trpc/server").TRPCBuiltRouter<{
3367
+ ctx: import("../context.js").Context;
3368
+ meta: object;
3369
+ errorShape: {
3370
+ data: {
3371
+ zodError: string | null;
3372
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
3373
+ httpStatus: number;
3374
+ path?: string;
3375
+ stack?: string;
3376
+ };
3377
+ message: string;
3378
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
3379
+ };
3380
+ transformer: true;
3381
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
3382
+ list: import("@trpc/server").TRPCQueryProcedure<{
3383
+ input: {
3384
+ artifactId: string;
3385
+ };
3386
+ output: {
3387
+ id: string;
3388
+ version: number;
3389
+ createdAt: Date;
3390
+ isCurrent: boolean;
3391
+ label: string | null;
3392
+ createdBy: {
3393
+ id: string;
3394
+ name: string | null;
3395
+ } | null;
3396
+ }[];
3397
+ meta: object;
3398
+ }>;
3399
+ get: import("@trpc/server").TRPCQueryProcedure<{
3400
+ input: {
3401
+ artifactVersionId: string;
3402
+ };
3403
+ output: {
3404
+ id: string;
3405
+ artifactId: string;
3406
+ version: number;
3407
+ content: string;
3408
+ data: import("@prisma/client/runtime/client").JsonValue;
3409
+ createdAt: Date;
3410
+ isCurrent: boolean;
3411
+ createdBy: string | null;
3412
+ };
3413
+ meta: object;
3414
+ }>;
3415
+ restore: import("@trpc/server").TRPCMutationProcedure<{
3416
+ input: {
3417
+ artifactVersionId: string;
3418
+ };
3419
+ output: {
3420
+ id: string;
3421
+ createdAt: Date;
3422
+ data: import("@prisma/client/runtime/client").JsonValue | null;
3423
+ createdById: string | null;
3424
+ artifactId: string;
3425
+ content: string;
3426
+ version: number;
3427
+ };
3428
+ meta: object;
3429
+ }>;
3430
+ }>>;
3431
+ member: import("@trpc/server").TRPCBuiltRouter<{
3432
+ ctx: import("../context.js").Context;
3433
+ meta: object;
3434
+ errorShape: {
3435
+ data: {
3436
+ zodError: string | null;
3437
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
3438
+ httpStatus: number;
3439
+ path?: string;
3440
+ stack?: string;
3441
+ };
3442
+ message: string;
3443
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
3444
+ };
3445
+ transformer: true;
3446
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
3447
+ acceptInvite: import("@trpc/server").TRPCMutationProcedure<{
3448
+ input: {
3449
+ token: string;
3450
+ };
3451
+ output: {
3452
+ message?: string | undefined;
3453
+ workspaceId: string;
3454
+ workspaceTitle: string;
3455
+ role: string;
3456
+ ownerName: string | null;
3457
+ };
3458
+ meta: object;
3459
+ }>;
3460
+ }>>;
3461
+ }>>;
3462
+ export type AppRouter = typeof appRouter;
3463
+ export type RouterInputs = inferRouterInputs<AppRouter>;
3464
+ export type RouterOutputs = inferRouterOutputs<AppRouter>;