@goscribe/server 1.3.3 → 1.5.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 (378) hide show
  1. package/.env.example +12 -0
  2. package/.vscode/settings.json +3 -0
  3. package/REFACTOR_NOTES.md +60 -0
  4. package/TESTING_PROMPT.md +225 -0
  5. package/dist/controllers/admin.controller.d.ts +715 -0
  6. package/dist/controllers/admin.controller.js +9 -0
  7. package/dist/controllers/annotations.controller.d.ts +439 -0
  8. package/dist/controllers/annotations.controller.js +9 -0
  9. package/dist/controllers/app-router.controller.d.ts +3011 -0
  10. package/dist/controllers/app-router.controller.js +38 -0
  11. package/dist/controllers/app-router.controller.test.d.ts +1 -0
  12. package/dist/controllers/app-router.controller.test.js +36 -0
  13. package/dist/controllers/auth.controller.d.ts +323 -0
  14. package/dist/controllers/auth.controller.js +9 -0
  15. package/dist/controllers/base.controller.d.ts +4 -0
  16. package/dist/controllers/base.controller.js +5 -0
  17. package/dist/controllers/chat.controller.d.ts +341 -0
  18. package/dist/controllers/chat.controller.js +9 -0
  19. package/dist/controllers/copilot.controller.d.ts +397 -0
  20. package/dist/controllers/copilot.controller.js +9 -0
  21. package/dist/controllers/flashcards.controller.d.ts +651 -0
  22. package/dist/controllers/flashcards.controller.js +9 -0
  23. package/dist/controllers/members.controller.d.ts +339 -0
  24. package/dist/controllers/members.controller.js +9 -0
  25. package/dist/controllers/notifications.controller.d.ts +199 -0
  26. package/dist/controllers/notifications.controller.js +9 -0
  27. package/dist/controllers/payment.controller.d.ts +181 -0
  28. package/dist/controllers/payment.controller.js +9 -0
  29. package/dist/controllers/podcast.controller.d.ts +575 -0
  30. package/dist/controllers/podcast.controller.js +9 -0
  31. package/dist/controllers/router-module.controller.d.ts +5 -0
  32. package/dist/controllers/router-module.controller.js +6 -0
  33. package/dist/controllers/studyguide.controller.d.ts +73 -0
  34. package/dist/controllers/studyguide.controller.js +9 -0
  35. package/dist/controllers/worksheets.controller.d.ts +829 -0
  36. package/dist/controllers/worksheets.controller.js +9 -0
  37. package/dist/controllers/workspace.controller.d.ts +1207 -0
  38. package/dist/controllers/workspace.controller.js +9 -0
  39. package/dist/lib/activity_human_description.test.js +16 -15
  40. package/dist/lib/activity_log_service.test.js +28 -23
  41. package/dist/lib/ai/config.d.ts +20 -0
  42. package/dist/lib/ai/config.js +31 -0
  43. package/dist/lib/ai/embedding-client.d.ts +8 -0
  44. package/dist/lib/ai/embedding-client.js +30 -0
  45. package/dist/lib/ai/index.d.ts +47 -0
  46. package/dist/lib/ai/index.js +28 -0
  47. package/dist/lib/ai/inference-backend/client.d.ts +28 -0
  48. package/dist/lib/ai/inference-backend/client.js +301 -0
  49. package/dist/lib/ai/inference-backend/mocks.d.ts +12 -0
  50. package/dist/lib/ai/inference-backend/mocks.js +133 -0
  51. package/dist/lib/ai/inference-backend/types.d.ts +44 -0
  52. package/dist/lib/ai/inference-backend/types.js +1 -0
  53. package/dist/lib/ai/json-parse.d.ts +2 -0
  54. package/dist/lib/ai/json-parse.js +34 -0
  55. package/dist/lib/ai/llm-client.d.ts +6 -0
  56. package/dist/lib/ai/llm-client.js +19 -0
  57. package/dist/lib/ai/mock.d.ts +2 -0
  58. package/dist/lib/ai/mock.js +10 -0
  59. package/dist/lib/ai/types.d.ts +9 -0
  60. package/dist/lib/ai/types.js +1 -0
  61. package/dist/lib/chunking.d.ts +19 -0
  62. package/dist/lib/chunking.js +47 -0
  63. package/dist/lib/curated-kb-seed.d.ts +12 -0
  64. package/dist/lib/curated-kb-seed.js +155 -0
  65. package/dist/lib/email.js +67 -108
  66. package/dist/lib/embeddings.d.ts +2 -0
  67. package/dist/lib/embeddings.js +1 -0
  68. package/dist/lib/ensure-curated-kb-catalog.d.ts +6 -0
  69. package/dist/lib/ensure-curated-kb-catalog.js +53 -0
  70. package/dist/lib/env.d.ts +1 -5
  71. package/dist/lib/env.js +2 -7
  72. package/dist/lib/inference.d.ts +1 -8
  73. package/dist/lib/inference.js +1 -19
  74. package/dist/lib/kb-meta.d.ts +8 -0
  75. package/dist/lib/kb-meta.js +77 -0
  76. package/dist/lib/note-text.d.ts +1 -0
  77. package/dist/lib/note-text.js +47 -0
  78. package/dist/lib/notification-service.test.js +37 -36
  79. package/dist/lib/pdf.d.ts +11 -0
  80. package/dist/lib/pdf.js +11 -0
  81. package/dist/lib/usage_service.d.ts +2 -1
  82. package/dist/lib/usage_service.js +30 -12
  83. package/dist/lib/worksheet-generation.js +4 -4
  84. package/dist/lib/worksheet-generation.test.js +32 -17
  85. package/dist/lib/workspace-kb.d.ts +5 -0
  86. package/dist/lib/workspace-kb.js +7 -0
  87. package/dist/models/controller-context.model.d.ts +8 -0
  88. package/dist/models/controller-context.model.js +1 -0
  89. package/dist/repositories/artifact.repository.d.ts +60 -0
  90. package/dist/repositories/artifact.repository.js +40 -0
  91. package/dist/repositories/base.repository.d.ts +14 -0
  92. package/dist/repositories/base.repository.js +14 -0
  93. package/dist/repositories/invitation.repository.d.ts +94 -0
  94. package/dist/repositories/invitation.repository.js +44 -0
  95. package/dist/repositories/notification.repository.d.ts +72 -0
  96. package/dist/repositories/notification.repository.js +44 -0
  97. package/dist/repositories/router-module.repository.d.ts +10 -0
  98. package/dist/repositories/router-module.repository.js +14 -0
  99. package/dist/repositories/user.repository.d.ts +74 -0
  100. package/dist/repositories/user.repository.js +37 -0
  101. package/dist/repositories/workspace-member.repository.d.ts +31 -0
  102. package/dist/repositories/workspace-member.repository.js +31 -0
  103. package/dist/repositories/workspace.repository.d.ts +97 -0
  104. package/dist/repositories/workspace.repository.js +79 -0
  105. package/dist/routers/_app.d.ts +528 -33
  106. package/dist/routers/_app.js +4 -0
  107. package/dist/routers/admin.d.ts +0 -4
  108. package/dist/routers/admin.js +21 -549
  109. package/dist/routers/annotations.js +12 -170
  110. package/dist/routers/artifactVersions.d.ts +65 -0
  111. package/dist/routers/artifactVersions.js +14 -0
  112. package/dist/routers/auth.d.ts +0 -6
  113. package/dist/routers/auth.js +36 -421
  114. package/dist/routers/chat.js +15 -229
  115. package/dist/routers/copilot.d.ts +14 -13
  116. package/dist/routers/copilot.js +13 -532
  117. package/dist/routers/flashcards.d.ts +5 -5
  118. package/dist/routers/flashcards.js +23 -349
  119. package/dist/routers/knowledgeBase.d.ts +421 -0
  120. package/dist/routers/knowledgeBase.js +118 -0
  121. package/dist/routers/members.d.ts +0 -41
  122. package/dist/routers/members.js +22 -710
  123. package/dist/routers/notes.d.ts +94 -0
  124. package/dist/routers/notes.js +37 -0
  125. package/dist/routers/notifications.js +7 -109
  126. package/dist/routers/payment.d.ts +3 -2
  127. package/dist/routers/payment.js +11 -393
  128. package/dist/routers/podcast.d.ts +1 -1
  129. package/dist/routers/podcast.js +11 -784
  130. package/dist/routers/studyguide.js +3 -129
  131. package/dist/routers/worksheets.d.ts +29 -14
  132. package/dist/routers/worksheets.js +49 -628
  133. package/dist/routers/workspace.d.ts +0 -4
  134. package/dist/routers/workspace.js +28 -922
  135. package/dist/scripts/purge-deleted-users.js +2 -2
  136. package/dist/server.js +10 -3
  137. package/dist/services/activity/activity-human-description.service.d.ts +13 -0
  138. package/dist/services/activity/activity-human-description.service.js +221 -0
  139. package/dist/services/activity/activity-human-description.service.test.d.ts +1 -0
  140. package/dist/services/activity/activity-human-description.service.test.js +16 -0
  141. package/dist/services/activity/activity-log.service.d.ts +87 -0
  142. package/dist/services/activity/activity-log.service.js +276 -0
  143. package/dist/services/activity/activity-log.service.test.d.ts +1 -0
  144. package/dist/services/activity/activity-log.service.test.js +27 -0
  145. package/dist/services/activity-human-description.service.d.ts +13 -0
  146. package/dist/services/activity-human-description.service.js +221 -0
  147. package/dist/services/activity-human-description.service.test.d.ts +1 -0
  148. package/dist/services/activity-human-description.service.test.js +16 -0
  149. package/dist/services/activity-log.service.d.ts +87 -0
  150. package/dist/services/activity-log.service.js +276 -0
  151. package/dist/services/activity-log.service.test.d.ts +1 -0
  152. package/dist/services/activity-log.service.test.js +27 -0
  153. package/dist/services/admin/admin.service.d.ts +270 -0
  154. package/dist/services/admin/admin.service.js +476 -0
  155. package/dist/services/admin.service.d.ts +270 -0
  156. package/dist/services/admin.service.js +476 -0
  157. package/dist/services/ai/ai-session.service.d.ts +5 -0
  158. package/dist/services/ai/ai-session.service.js +4 -0
  159. package/dist/services/ai-session.service.d.ts +60 -0
  160. package/dist/services/ai-session.service.js +561 -0
  161. package/dist/services/annotation.service.d.ts +177 -0
  162. package/dist/services/annotation.service.js +154 -0
  163. package/dist/services/artifact-notification.service.d.ts +14 -0
  164. package/dist/services/artifact-notification.service.js +20 -0
  165. package/dist/services/artifact-version.service.d.ts +38 -0
  166. package/dist/services/artifact-version.service.js +129 -0
  167. package/dist/services/artifacts/annotation.service.d.ts +177 -0
  168. package/dist/services/artifacts/annotation.service.js +154 -0
  169. package/dist/services/artifacts/artifact-version.service.d.ts +38 -0
  170. package/dist/services/artifacts/artifact-version.service.js +129 -0
  171. package/dist/services/artifacts/chat.service.d.ts +127 -0
  172. package/dist/services/artifacts/chat.service.js +182 -0
  173. package/dist/services/artifacts/study-guide.service.d.ts +18 -0
  174. package/dist/services/artifacts/study-guide.service.js +65 -0
  175. package/dist/services/auth/auth.service.d.ts +94 -0
  176. package/dist/services/auth/auth.service.js +368 -0
  177. package/dist/services/auth.service.d.ts +94 -0
  178. package/dist/services/auth.service.js +368 -0
  179. package/dist/services/base.service.d.ts +14 -0
  180. package/dist/services/base.service.js +14 -0
  181. package/dist/services/billing/payment.service.d.ts +55 -0
  182. package/dist/services/billing/payment.service.js +368 -0
  183. package/dist/services/billing/subscription.service.d.ts +37 -0
  184. package/dist/services/billing/subscription.service.js +654 -0
  185. package/dist/services/billing/usage.service.d.ts +27 -0
  186. package/dist/services/billing/usage.service.js +77 -0
  187. package/dist/services/chat.service.d.ts +127 -0
  188. package/dist/services/chat.service.js +182 -0
  189. package/dist/services/content/copilot.service.d.ts +113 -0
  190. package/dist/services/content/copilot.service.js +453 -0
  191. package/dist/services/content/flashcard-progress.service.d.ts +159 -0
  192. package/dist/services/content/flashcard-progress.service.js +432 -0
  193. package/dist/services/content/flashcard.service.d.ts +140 -0
  194. package/dist/services/content/flashcard.service.js +326 -0
  195. package/dist/services/content/media-analysis.service.d.ts +23 -0
  196. package/dist/services/content/media-analysis.service.js +404 -0
  197. package/dist/services/content/podcast.service.d.ts +267 -0
  198. package/dist/services/content/podcast.service.js +653 -0
  199. package/dist/services/content/worksheet-content.service.d.ts +37 -0
  200. package/dist/services/content/worksheet-content.service.js +84 -0
  201. package/dist/services/content/worksheet-content.service.test.d.ts +1 -0
  202. package/dist/services/content/worksheet-content.service.test.js +69 -0
  203. package/dist/services/content/worksheet-generation.service.d.ts +91 -0
  204. package/dist/services/content/worksheet-generation.service.js +95 -0
  205. package/dist/services/content/worksheet-generation.service.test.d.ts +1 -0
  206. package/dist/services/content/worksheet-generation.service.test.js +20 -0
  207. package/dist/services/content/worksheet.service.d.ts +347 -0
  208. package/dist/services/content/worksheet.service.js +599 -0
  209. package/dist/services/copilot.service.d.ts +116 -0
  210. package/dist/services/copilot.service.js +447 -0
  211. package/dist/services/flashcard-progress.service.d.ts +2 -2
  212. package/dist/services/flashcard-progress.service.js +3 -2
  213. package/dist/services/flashcard.service.d.ts +140 -0
  214. package/dist/services/flashcard.service.js +325 -0
  215. package/dist/services/invitation.service.d.ts +66 -0
  216. package/dist/services/invitation.service.js +348 -0
  217. package/dist/services/knowledge/knowledge-base.service.d.ts +316 -0
  218. package/dist/services/knowledge/knowledge-base.service.js +544 -0
  219. package/dist/services/knowledge-base.service.d.ts +316 -0
  220. package/dist/services/knowledge-base.service.js +536 -0
  221. package/dist/services/media-analysis.service.d.ts +23 -0
  222. package/dist/services/media-analysis.service.js +384 -0
  223. package/dist/services/member.service.d.ts +36 -0
  224. package/dist/services/member.service.js +193 -0
  225. package/dist/services/members/invitation.service.d.ts +66 -0
  226. package/dist/services/members/invitation.service.js +348 -0
  227. package/dist/services/members/member.service.d.ts +36 -0
  228. package/dist/services/members/member.service.js +193 -0
  229. package/dist/services/note.service.d.ts +55 -0
  230. package/dist/services/note.service.js +111 -0
  231. package/dist/services/notification.service.d.ts +214 -0
  232. package/dist/services/notification.service.js +550 -0
  233. package/dist/services/notification.service.test.d.ts +1 -0
  234. package/dist/services/notification.service.test.js +87 -0
  235. package/dist/services/notifications/notification.service.d.ts +214 -0
  236. package/dist/services/notifications/notification.service.js +550 -0
  237. package/dist/services/notifications/notification.service.test.d.ts +1 -0
  238. package/dist/services/notifications/notification.service.test.js +87 -0
  239. package/dist/services/payment.service.d.ts +55 -0
  240. package/dist/services/payment.service.js +368 -0
  241. package/dist/services/podcast.service.d.ts +267 -0
  242. package/dist/services/podcast.service.js +654 -0
  243. package/dist/services/router-module.service.d.ts +7 -0
  244. package/dist/services/router-module.service.js +10 -0
  245. package/dist/services/study-guide.service.d.ts +18 -0
  246. package/dist/services/study-guide.service.js +65 -0
  247. package/dist/services/subscription.service.d.ts +37 -0
  248. package/dist/services/subscription.service.js +654 -0
  249. package/dist/services/usage-limit-policy.service.d.ts +12 -0
  250. package/dist/services/usage-limit-policy.service.js +22 -0
  251. package/dist/services/usage-limit-policy.service.test.d.ts +1 -0
  252. package/dist/services/usage-limit-policy.service.test.js +46 -0
  253. package/dist/services/usage.service.d.ts +27 -0
  254. package/dist/services/usage.service.js +77 -0
  255. package/dist/services/worksheet-content.service.d.ts +42 -0
  256. package/dist/services/worksheet-content.service.js +84 -0
  257. package/dist/services/worksheet-content.service.test.d.ts +1 -0
  258. package/dist/services/worksheet-content.service.test.js +69 -0
  259. package/dist/services/worksheet-generation.service.d.ts +91 -0
  260. package/dist/services/worksheet-generation.service.js +95 -0
  261. package/dist/services/worksheet-generation.service.test.d.ts +1 -0
  262. package/dist/services/worksheet-generation.service.test.js +20 -0
  263. package/dist/services/worksheet.service.d.ts +385 -0
  264. package/dist/services/worksheet.service.js +596 -0
  265. package/dist/services/workspace/workspace-analytics.service.d.ts +24 -0
  266. package/dist/services/workspace/workspace-analytics.service.js +95 -0
  267. package/dist/services/workspace/workspace-kb.service.d.ts +40 -0
  268. package/dist/services/workspace/workspace-kb.service.js +184 -0
  269. package/dist/services/workspace/workspace.service.d.ts +307 -0
  270. package/dist/services/workspace/workspace.service.js +394 -0
  271. package/dist/services/workspace-analytics.service.d.ts +24 -0
  272. package/dist/services/workspace-analytics.service.js +95 -0
  273. package/dist/services/workspace-kb.service.d.ts +40 -0
  274. package/dist/services/workspace-kb.service.js +184 -0
  275. package/dist/services/workspace-progress.service.d.ts +27 -0
  276. package/dist/services/workspace-progress.service.js +56 -0
  277. package/dist/services/workspace-progress.service.test.d.ts +1 -0
  278. package/dist/services/workspace-progress.service.test.js +49 -0
  279. package/dist/services/workspace.service.d.ts +307 -0
  280. package/dist/services/workspace.service.js +390 -0
  281. package/dist/trpc.js +2 -2
  282. package/package.json +5 -6
  283. package/prisma/migrations/20260509000001_add_knowledge_base/migration.sql +99 -0
  284. package/prisma/migrations/20260509000002_curate_knowledge_base/migration.sql +52 -0
  285. package/prisma/migrations/20260522000000_add_notes/migration.sql +27 -0
  286. package/prisma/migrations/20260524000000_remove_notes/migration.sql +3 -0
  287. package/prisma/schema.prisma +150 -48
  288. package/prisma/seed.mjs +67 -0
  289. package/scripts/debug/README.md +4 -0
  290. package/src/README.md +63 -0
  291. package/src/lib/ai/config.ts +34 -0
  292. package/src/lib/ai/embedding-client.ts +47 -0
  293. package/src/lib/ai/index.ts +62 -0
  294. package/src/lib/ai/inference-backend/client.ts +479 -0
  295. package/src/lib/ai/inference-backend/mocks.ts +171 -0
  296. package/src/lib/ai/inference-backend/types.ts +50 -0
  297. package/src/lib/ai/json-parse.ts +35 -0
  298. package/src/lib/ai/llm-client.ts +31 -0
  299. package/src/lib/ai/mock.ts +12 -0
  300. package/src/lib/ai/types.ts +11 -0
  301. package/src/lib/chunking.ts +81 -0
  302. package/src/lib/curated-kb-seed.ts +164 -0
  303. package/src/lib/email.ts +77 -115
  304. package/src/lib/embeddings.ts +9 -0
  305. package/src/lib/ensure-curated-kb-catalog.ts +60 -0
  306. package/src/lib/env.ts +2 -7
  307. package/src/lib/inference.ts +1 -21
  308. package/src/lib/kb-meta.ts +81 -0
  309. package/src/lib/pdf.ts +23 -0
  310. package/src/lib/workspace-kb.ts +7 -0
  311. package/src/repositories/artifact.repository.ts +55 -0
  312. package/src/repositories/base.repository.ts +19 -0
  313. package/src/repositories/invitation.repository.ts +53 -0
  314. package/src/repositories/notification.repository.ts +53 -0
  315. package/src/repositories/user.repository.ts +44 -0
  316. package/src/repositories/workspace-member.repository.ts +38 -0
  317. package/src/repositories/workspace.repository.ts +89 -0
  318. package/src/routers/_app.ts +4 -0
  319. package/src/routers/admin.ts +124 -692
  320. package/src/routers/annotations.ts +25 -203
  321. package/src/routers/artifactVersions.ts +32 -0
  322. package/src/routers/auth.ts +81 -519
  323. package/src/routers/chat.ts +42 -245
  324. package/src/routers/copilot.ts +41 -666
  325. package/src/routers/flashcards.ts +108 -404
  326. package/src/routers/knowledgeBase.ts +216 -0
  327. package/src/routers/members.ts +60 -782
  328. package/src/routers/notifications.ts +15 -117
  329. package/src/routers/payment.ts +37 -446
  330. package/src/routers/podcast.ts +36 -898
  331. package/src/routers/studyguide.ts +5 -144
  332. package/src/routers/worksheets.ts +171 -735
  333. package/src/routers/workspace.ts +138 -1109
  334. package/src/scripts/purge-deleted-users.ts +2 -2
  335. package/src/server.ts +10 -3
  336. package/src/{lib/activity_human_description.test.ts → services/activity/activity-human-description.service.test.ts} +1 -1
  337. package/src/{lib/activity_log_service.test.ts → services/activity/activity-log.service.test.ts} +1 -1
  338. package/src/{lib/activity_log_service.ts → services/activity/activity-log.service.ts} +2 -2
  339. package/src/services/admin/admin.service.ts +612 -0
  340. package/src/services/ai/ai-session.service.ts +5 -0
  341. package/src/services/artifacts/annotation.service.ts +189 -0
  342. package/src/services/artifacts/artifact-version.service.ts +151 -0
  343. package/src/services/artifacts/chat.service.ts +197 -0
  344. package/src/services/artifacts/study-guide.service.ts +72 -0
  345. package/src/services/auth/auth.service.ts +473 -0
  346. package/src/services/base.service.ts +19 -0
  347. package/src/services/billing/payment.service.ts +436 -0
  348. package/src/{lib/subscription_service.ts → services/billing/subscription.service.ts} +5 -5
  349. package/src/{lib/usage_service.ts → services/billing/usage.service.ts} +32 -12
  350. package/src/services/content/copilot.service.ts +596 -0
  351. package/src/services/{flashcard-progress.service.ts → content/flashcard-progress.service.ts} +6 -3
  352. package/src/services/content/flashcard.service.ts +394 -0
  353. package/src/services/content/media-analysis.service.ts +556 -0
  354. package/src/services/content/podcast.service.ts +777 -0
  355. package/src/services/content/worksheet-content.service.test.ts +83 -0
  356. package/src/services/content/worksheet-content.service.ts +117 -0
  357. package/src/{lib/worksheet-generation.test.ts → services/content/worksheet-generation.service.test.ts} +1 -1
  358. package/src/services/content/worksheet.service.ts +751 -0
  359. package/src/services/knowledge/knowledge-base.service.ts +705 -0
  360. package/src/services/members/invitation.service.ts +427 -0
  361. package/src/services/members/member.service.ts +241 -0
  362. package/src/{lib/notification-service.test.ts → services/notifications/notification.service.test.ts} +2 -2
  363. package/src/{lib/notification-service.ts → services/notifications/notification.service.ts} +102 -1
  364. package/src/services/workspace/workspace-analytics.service.ts +107 -0
  365. package/src/services/workspace/workspace-kb.service.ts +273 -0
  366. package/src/services/workspace/workspace.service.ts +481 -0
  367. package/src/trpc.ts +2 -2
  368. package/src/lib/ai-session.ts +0 -704
  369. package/src/lib/workspace-access.ts +0 -13
  370. /package/{check-difficulty.cjs → scripts/debug/check-difficulty.cjs} +0 -0
  371. /package/{check-questions.cjs → scripts/debug/check-questions.cjs} +0 -0
  372. /package/{db-summary.cjs → scripts/debug/db-summary.cjs} +0 -0
  373. /package/{mcq-test.cjs → scripts/debug/mcq-test.cjs} +0 -0
  374. /package/{test-generate.js → scripts/debug/test-generate.js} +0 -0
  375. /package/{test-ratio.cjs → scripts/debug/test-ratio.cjs} +0 -0
  376. /package/{zod-test.cjs → scripts/debug/zod-test.cjs} +0 -0
  377. /package/src/{lib/activity_human_description.ts → services/activity/activity-human-description.service.ts} +0 -0
  378. /package/src/{lib/worksheet-generation.ts → services/content/worksheet-generation.service.ts} +0 -0
@@ -0,0 +1,1207 @@
1
+ import { RouterModuleController } from './router-module.controller.js';
2
+ export declare const workspaceController: RouterModuleController<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
+ list: import("@trpc/server").TRPCQueryProcedure<{
19
+ input: {
20
+ parentId?: string | undefined;
21
+ };
22
+ output: {
23
+ workspaces: {
24
+ id: string;
25
+ createdAt: Date;
26
+ updatedAt: Date;
27
+ title: string;
28
+ description: string | null;
29
+ ownerId: string;
30
+ color: string;
31
+ markerColor: string | null;
32
+ icon: string;
33
+ folderId: string | null;
34
+ fileBeingAnalyzed: boolean;
35
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
36
+ needsAnalysis: boolean;
37
+ }[];
38
+ folders: {
39
+ name: string;
40
+ id: string;
41
+ createdAt: Date;
42
+ updatedAt: Date;
43
+ ownerId: string;
44
+ parentId: string | null;
45
+ color: string;
46
+ markerColor: string | null;
47
+ }[];
48
+ };
49
+ meta: object;
50
+ }>;
51
+ getTree: import("@trpc/server").TRPCQueryProcedure<{
52
+ input: void;
53
+ output: {
54
+ folders: {
55
+ name: string;
56
+ id: string;
57
+ createdAt: Date;
58
+ updatedAt: Date;
59
+ ownerId: string;
60
+ parentId: string | null;
61
+ color: string;
62
+ markerColor: string | null;
63
+ }[];
64
+ workspaces: ({
65
+ uploads: {
66
+ name: string;
67
+ id: string;
68
+ createdAt: Date;
69
+ mimeType: string;
70
+ }[];
71
+ } & {
72
+ id: string;
73
+ createdAt: Date;
74
+ updatedAt: Date;
75
+ title: string;
76
+ description: string | null;
77
+ ownerId: string;
78
+ color: string;
79
+ markerColor: string | null;
80
+ icon: string;
81
+ folderId: string | null;
82
+ fileBeingAnalyzed: boolean;
83
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
84
+ needsAnalysis: boolean;
85
+ })[];
86
+ };
87
+ meta: object;
88
+ }>;
89
+ create: import("@trpc/server").TRPCMutationProcedure<{
90
+ input: {
91
+ name: string;
92
+ description?: string | undefined;
93
+ parentId?: string | undefined;
94
+ markerColor?: string | null | undefined;
95
+ };
96
+ output: {
97
+ id: string;
98
+ createdAt: Date;
99
+ updatedAt: Date;
100
+ title: string;
101
+ description: string | null;
102
+ ownerId: string;
103
+ color: string;
104
+ markerColor: string | null;
105
+ icon: string;
106
+ folderId: string | null;
107
+ fileBeingAnalyzed: boolean;
108
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
109
+ needsAnalysis: boolean;
110
+ };
111
+ meta: object;
112
+ }>;
113
+ createFolder: import("@trpc/server").TRPCMutationProcedure<{
114
+ input: {
115
+ name: string;
116
+ color?: string | undefined;
117
+ parentId?: string | undefined;
118
+ };
119
+ output: {
120
+ name: string;
121
+ id: string;
122
+ createdAt: Date;
123
+ updatedAt: Date;
124
+ ownerId: string;
125
+ parentId: string | null;
126
+ color: string;
127
+ markerColor: string | null;
128
+ };
129
+ meta: object;
130
+ }>;
131
+ updateFolder: import("@trpc/server").TRPCMutationProcedure<{
132
+ input: {
133
+ id: string;
134
+ name?: string | undefined;
135
+ markerColor?: string | null | undefined;
136
+ };
137
+ output: {
138
+ name: string;
139
+ id: string;
140
+ createdAt: Date;
141
+ updatedAt: Date;
142
+ ownerId: string;
143
+ parentId: string | null;
144
+ color: string;
145
+ markerColor: string | null;
146
+ };
147
+ meta: object;
148
+ }>;
149
+ deleteFolder: import("@trpc/server").TRPCMutationProcedure<{
150
+ input: {
151
+ id: string;
152
+ };
153
+ output: {
154
+ name: string;
155
+ id: string;
156
+ createdAt: Date;
157
+ updatedAt: Date;
158
+ ownerId: string;
159
+ parentId: string | null;
160
+ color: string;
161
+ markerColor: string | null;
162
+ };
163
+ meta: object;
164
+ }>;
165
+ get: import("@trpc/server").TRPCQueryProcedure<{
166
+ input: {
167
+ id: string;
168
+ };
169
+ output: {
170
+ folder: {
171
+ name: string;
172
+ id: string;
173
+ createdAt: Date;
174
+ updatedAt: Date;
175
+ ownerId: string;
176
+ parentId: string | null;
177
+ color: string;
178
+ markerColor: string | null;
179
+ } | null;
180
+ artifacts: {
181
+ id: string;
182
+ createdAt: Date;
183
+ updatedAt: Date;
184
+ workspaceId: string;
185
+ type: import("@prisma/client").$Enums.ArtifactType;
186
+ title: string;
187
+ isArchived: boolean;
188
+ difficulty: import("@prisma/client").$Enums.Difficulty | null;
189
+ estimatedTime: string | null;
190
+ createdById: string | null;
191
+ description: string | null;
192
+ generating: boolean;
193
+ generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
194
+ worksheetConfig: import("@prisma/client/runtime/library").JsonValue | null;
195
+ imageObjectKey: string | null;
196
+ }[];
197
+ uploads: {
198
+ meta: import("@prisma/client/runtime/library").JsonValue | null;
199
+ name: string;
200
+ id: string;
201
+ createdAt: Date;
202
+ workspaceId: string | null;
203
+ userId: string | null;
204
+ mimeType: string;
205
+ size: number;
206
+ bucket: string | null;
207
+ objectKey: string | null;
208
+ url: string | null;
209
+ checksum: string | null;
210
+ aiTranscription: import("@prisma/client/runtime/library").JsonValue | null;
211
+ }[];
212
+ } & {
213
+ id: string;
214
+ createdAt: Date;
215
+ updatedAt: Date;
216
+ title: string;
217
+ description: string | null;
218
+ ownerId: string;
219
+ color: string;
220
+ markerColor: string | null;
221
+ icon: string;
222
+ folderId: string | null;
223
+ fileBeingAnalyzed: boolean;
224
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
225
+ needsAnalysis: boolean;
226
+ };
227
+ meta: object;
228
+ }>;
229
+ getStats: import("@trpc/server").TRPCQueryProcedure<{
230
+ input: void;
231
+ output: {
232
+ workspaces: number;
233
+ folders: number;
234
+ lastUpdated: Date | undefined;
235
+ spaceUsed: number;
236
+ spaceTotal: number;
237
+ };
238
+ meta: object;
239
+ }>;
240
+ getStudyAnalytics: import("@trpc/server").TRPCQueryProcedure<{
241
+ input: void;
242
+ output: {
243
+ streak: number;
244
+ totalStudyDays: number;
245
+ weeklyActivity: boolean[];
246
+ flashcards: {
247
+ total: number;
248
+ mastered: number;
249
+ dueForReview: number;
250
+ };
251
+ worksheets: {
252
+ completed: number;
253
+ correct: number;
254
+ accuracy: number;
255
+ };
256
+ };
257
+ meta: object;
258
+ }>;
259
+ update: import("@trpc/server").TRPCMutationProcedure<{
260
+ input: {
261
+ id: string;
262
+ name?: string | undefined;
263
+ description?: string | undefined;
264
+ markerColor?: string | null | undefined;
265
+ icon?: string | undefined;
266
+ };
267
+ output: {
268
+ id: string;
269
+ createdAt: Date;
270
+ updatedAt: Date;
271
+ title: string;
272
+ description: string | null;
273
+ ownerId: string;
274
+ color: string;
275
+ markerColor: string | null;
276
+ icon: string;
277
+ folderId: string | null;
278
+ fileBeingAnalyzed: boolean;
279
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
280
+ needsAnalysis: boolean;
281
+ };
282
+ meta: object;
283
+ }>;
284
+ delete: import("@trpc/server").TRPCMutationProcedure<{
285
+ input: {
286
+ id: string;
287
+ };
288
+ output: boolean;
289
+ meta: object;
290
+ }>;
291
+ getFolderInformation: import("@trpc/server").TRPCQueryProcedure<{
292
+ input: {
293
+ id: string;
294
+ };
295
+ output: {
296
+ folder: {
297
+ name: string;
298
+ id: string;
299
+ createdAt: Date;
300
+ updatedAt: Date;
301
+ ownerId: string;
302
+ parentId: string | null;
303
+ color: string;
304
+ markerColor: string | null;
305
+ };
306
+ parents: {
307
+ name: string;
308
+ id: string;
309
+ createdAt: Date;
310
+ updatedAt: Date;
311
+ ownerId: string;
312
+ parentId: string | null;
313
+ color: string;
314
+ markerColor: string | null;
315
+ }[];
316
+ };
317
+ meta: object;
318
+ }>;
319
+ getSharedWith: import("@trpc/server").TRPCQueryProcedure<{
320
+ input: {
321
+ id: string;
322
+ };
323
+ output: {
324
+ shared: {
325
+ id: string;
326
+ createdAt: Date;
327
+ updatedAt: Date;
328
+ title: string;
329
+ description: string | null;
330
+ ownerId: string;
331
+ color: string;
332
+ markerColor: string | null;
333
+ icon: string;
334
+ folderId: string | null;
335
+ fileBeingAnalyzed: boolean;
336
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
337
+ needsAnalysis: boolean;
338
+ }[];
339
+ invitations: ({
340
+ workspace: {
341
+ id: string;
342
+ createdAt: Date;
343
+ updatedAt: Date;
344
+ title: string;
345
+ description: string | null;
346
+ ownerId: string;
347
+ color: string;
348
+ markerColor: string | null;
349
+ icon: string;
350
+ folderId: string | null;
351
+ fileBeingAnalyzed: boolean;
352
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
353
+ needsAnalysis: boolean;
354
+ };
355
+ } & {
356
+ id: string;
357
+ email: string;
358
+ createdAt: Date;
359
+ updatedAt: Date;
360
+ workspaceId: string;
361
+ role: string;
362
+ token: string;
363
+ invitedById: string;
364
+ acceptedAt: Date | null;
365
+ expiresAt: Date;
366
+ })[];
367
+ };
368
+ meta: object;
369
+ }>;
370
+ uploadFiles: import("@trpc/server").TRPCMutationProcedure<{
371
+ input: {
372
+ id: string;
373
+ files: {
374
+ filename: string;
375
+ contentType: string;
376
+ size: number;
377
+ }[];
378
+ };
379
+ output: {
380
+ fileId: string;
381
+ uploadUrl: string;
382
+ }[];
383
+ meta: object;
384
+ }>;
385
+ deleteFiles: import("@trpc/server").TRPCMutationProcedure<{
386
+ input: {
387
+ fileId: string[];
388
+ id: string;
389
+ };
390
+ output: boolean;
391
+ meta: object;
392
+ }>;
393
+ getFileUploadUrl: import("@trpc/server").TRPCQueryProcedure<{
394
+ input: {
395
+ workspaceId: string;
396
+ filename: string;
397
+ contentType: string;
398
+ size: number;
399
+ };
400
+ output: {
401
+ fileId: string;
402
+ uploadUrl: string;
403
+ };
404
+ meta: object;
405
+ }>;
406
+ uploadAndAnalyzeMedia: import("@trpc/server").TRPCMutationProcedure<{
407
+ input: {
408
+ workspaceId: string;
409
+ files: {
410
+ id: string;
411
+ }[];
412
+ generateStudyGuide?: boolean | undefined;
413
+ generateFlashcards?: boolean | undefined;
414
+ generateWorksheet?: boolean | undefined;
415
+ };
416
+ output: {
417
+ filename: string;
418
+ artifacts: {
419
+ studyGuide: any | null;
420
+ flashcards: any | null;
421
+ worksheet: any | null;
422
+ };
423
+ };
424
+ meta: object;
425
+ }>;
426
+ search: import("@trpc/server").TRPCQueryProcedure<{
427
+ input: {
428
+ query: string;
429
+ color?: string | undefined;
430
+ limit?: number | undefined;
431
+ };
432
+ output: any[];
433
+ meta: object;
434
+ }>;
435
+ members: import("@trpc/server").TRPCBuiltRouter<{
436
+ ctx: import("../context.js").Context;
437
+ meta: object;
438
+ errorShape: {
439
+ data: {
440
+ zodError: string | null;
441
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
442
+ httpStatus: number;
443
+ path?: string;
444
+ stack?: string;
445
+ };
446
+ message: string;
447
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
448
+ };
449
+ transformer: true;
450
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
451
+ getMembers: import("@trpc/server").TRPCQueryProcedure<{
452
+ input: {
453
+ workspaceId: string;
454
+ };
455
+ output: ({
456
+ id: string;
457
+ name: string;
458
+ email: string;
459
+ role: "admin" | "member";
460
+ joinedAt: Date;
461
+ } | {
462
+ id: string;
463
+ name: string;
464
+ email: string;
465
+ role: "owner";
466
+ joinedAt: Date;
467
+ })[];
468
+ meta: object;
469
+ }>;
470
+ getCurrentUserRole: import("@trpc/server").TRPCQueryProcedure<{
471
+ input: {
472
+ workspaceId: string;
473
+ };
474
+ output: "admin" | "member" | "owner";
475
+ meta: object;
476
+ }>;
477
+ inviteMember: import("@trpc/server").TRPCMutationProcedure<{
478
+ input: {
479
+ workspaceId: string;
480
+ email: string;
481
+ role?: "admin" | "member" | undefined;
482
+ };
483
+ output: {
484
+ invitationId: string;
485
+ token: string;
486
+ email: string;
487
+ role: string;
488
+ expiresAt: Date;
489
+ workspaceTitle: string;
490
+ invitedByName: string | null;
491
+ };
492
+ meta: object;
493
+ }>;
494
+ getInvitations: import("@trpc/server").TRPCQueryProcedure<{
495
+ input: {
496
+ workspaceId: string;
497
+ };
498
+ output: {
499
+ id: string;
500
+ email: string;
501
+ createdAt: Date;
502
+ updatedAt: Date;
503
+ workspaceId: string;
504
+ role: string;
505
+ token: string;
506
+ invitedById: string;
507
+ acceptedAt: Date | null;
508
+ expiresAt: Date;
509
+ }[];
510
+ meta: object;
511
+ }>;
512
+ acceptInvite: import("@trpc/server").TRPCMutationProcedure<{
513
+ input: {
514
+ token: string;
515
+ };
516
+ output: {
517
+ message?: string | undefined;
518
+ workspaceId: string;
519
+ workspaceTitle: string;
520
+ role: string;
521
+ ownerName: string | null;
522
+ };
523
+ meta: object;
524
+ }>;
525
+ changeMemberRole: import("@trpc/server").TRPCMutationProcedure<{
526
+ input: {
527
+ workspaceId: string;
528
+ memberId: string;
529
+ role: "admin" | "member";
530
+ };
531
+ output: {
532
+ memberId: string;
533
+ role: "admin" | "member";
534
+ memberName: string | null;
535
+ message: string;
536
+ };
537
+ meta: object;
538
+ }>;
539
+ removeMember: import("@trpc/server").TRPCMutationProcedure<{
540
+ input: {
541
+ workspaceId: string;
542
+ memberId: string;
543
+ };
544
+ output: {
545
+ memberId: string;
546
+ message: string;
547
+ };
548
+ meta: object;
549
+ }>;
550
+ getPendingInvitations: import("@trpc/server").TRPCQueryProcedure<{
551
+ input: {
552
+ workspaceId: string;
553
+ };
554
+ output: {
555
+ id: string;
556
+ email: string;
557
+ role: string;
558
+ token: string;
559
+ expiresAt: Date;
560
+ createdAt: Date;
561
+ invitedByName: string | null;
562
+ }[];
563
+ meta: object;
564
+ }>;
565
+ cancelInvitation: import("@trpc/server").TRPCMutationProcedure<{
566
+ input: {
567
+ invitationId: string;
568
+ };
569
+ output: {
570
+ invitationId: string;
571
+ message: string;
572
+ };
573
+ meta: object;
574
+ }>;
575
+ resendInvitation: import("@trpc/server").TRPCMutationProcedure<{
576
+ input: {
577
+ invitationId: string;
578
+ };
579
+ output: {
580
+ invitationId: string;
581
+ message: string;
582
+ };
583
+ meta: object;
584
+ }>;
585
+ getAllInvitationsDebug: import("@trpc/server").TRPCQueryProcedure<{
586
+ input: {
587
+ workspaceId: string;
588
+ };
589
+ output: {
590
+ id: string;
591
+ email: string;
592
+ createdAt: Date;
593
+ updatedAt: Date;
594
+ workspaceId: string;
595
+ role: string;
596
+ token: string;
597
+ invitedById: string;
598
+ acceptedAt: Date | null;
599
+ expiresAt: Date;
600
+ }[];
601
+ meta: object;
602
+ }>;
603
+ }>>;
604
+ }>>>;
605
+ export declare const workspaceRouter: import("@trpc/server").TRPCBuiltRouter<{
606
+ ctx: import("../context.js").Context;
607
+ meta: object;
608
+ errorShape: {
609
+ data: {
610
+ zodError: string | null;
611
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
612
+ httpStatus: number;
613
+ path?: string;
614
+ stack?: string;
615
+ };
616
+ message: string;
617
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
618
+ };
619
+ transformer: true;
620
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
621
+ list: import("@trpc/server").TRPCQueryProcedure<{
622
+ input: {
623
+ parentId?: string | undefined;
624
+ };
625
+ output: {
626
+ workspaces: {
627
+ id: string;
628
+ createdAt: Date;
629
+ updatedAt: Date;
630
+ title: string;
631
+ description: string | null;
632
+ ownerId: string;
633
+ color: string;
634
+ markerColor: string | null;
635
+ icon: string;
636
+ folderId: string | null;
637
+ fileBeingAnalyzed: boolean;
638
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
639
+ needsAnalysis: boolean;
640
+ }[];
641
+ folders: {
642
+ name: string;
643
+ id: string;
644
+ createdAt: Date;
645
+ updatedAt: Date;
646
+ ownerId: string;
647
+ parentId: string | null;
648
+ color: string;
649
+ markerColor: string | null;
650
+ }[];
651
+ };
652
+ meta: object;
653
+ }>;
654
+ getTree: import("@trpc/server").TRPCQueryProcedure<{
655
+ input: void;
656
+ output: {
657
+ folders: {
658
+ name: string;
659
+ id: string;
660
+ createdAt: Date;
661
+ updatedAt: Date;
662
+ ownerId: string;
663
+ parentId: string | null;
664
+ color: string;
665
+ markerColor: string | null;
666
+ }[];
667
+ workspaces: ({
668
+ uploads: {
669
+ name: string;
670
+ id: string;
671
+ createdAt: Date;
672
+ mimeType: string;
673
+ }[];
674
+ } & {
675
+ id: string;
676
+ createdAt: Date;
677
+ updatedAt: Date;
678
+ title: string;
679
+ description: string | null;
680
+ ownerId: string;
681
+ color: string;
682
+ markerColor: string | null;
683
+ icon: string;
684
+ folderId: string | null;
685
+ fileBeingAnalyzed: boolean;
686
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
687
+ needsAnalysis: boolean;
688
+ })[];
689
+ };
690
+ meta: object;
691
+ }>;
692
+ create: import("@trpc/server").TRPCMutationProcedure<{
693
+ input: {
694
+ name: string;
695
+ description?: string | undefined;
696
+ parentId?: string | undefined;
697
+ markerColor?: string | null | undefined;
698
+ };
699
+ output: {
700
+ id: string;
701
+ createdAt: Date;
702
+ updatedAt: Date;
703
+ title: string;
704
+ description: string | null;
705
+ ownerId: string;
706
+ color: string;
707
+ markerColor: string | null;
708
+ icon: string;
709
+ folderId: string | null;
710
+ fileBeingAnalyzed: boolean;
711
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
712
+ needsAnalysis: boolean;
713
+ };
714
+ meta: object;
715
+ }>;
716
+ createFolder: import("@trpc/server").TRPCMutationProcedure<{
717
+ input: {
718
+ name: string;
719
+ color?: string | undefined;
720
+ parentId?: string | undefined;
721
+ };
722
+ output: {
723
+ name: string;
724
+ id: string;
725
+ createdAt: Date;
726
+ updatedAt: Date;
727
+ ownerId: string;
728
+ parentId: string | null;
729
+ color: string;
730
+ markerColor: string | null;
731
+ };
732
+ meta: object;
733
+ }>;
734
+ updateFolder: import("@trpc/server").TRPCMutationProcedure<{
735
+ input: {
736
+ id: string;
737
+ name?: string | undefined;
738
+ markerColor?: string | null | undefined;
739
+ };
740
+ output: {
741
+ name: string;
742
+ id: string;
743
+ createdAt: Date;
744
+ updatedAt: Date;
745
+ ownerId: string;
746
+ parentId: string | null;
747
+ color: string;
748
+ markerColor: string | null;
749
+ };
750
+ meta: object;
751
+ }>;
752
+ deleteFolder: import("@trpc/server").TRPCMutationProcedure<{
753
+ input: {
754
+ id: string;
755
+ };
756
+ output: {
757
+ name: string;
758
+ id: string;
759
+ createdAt: Date;
760
+ updatedAt: Date;
761
+ ownerId: string;
762
+ parentId: string | null;
763
+ color: string;
764
+ markerColor: string | null;
765
+ };
766
+ meta: object;
767
+ }>;
768
+ get: import("@trpc/server").TRPCQueryProcedure<{
769
+ input: {
770
+ id: string;
771
+ };
772
+ output: {
773
+ folder: {
774
+ name: string;
775
+ id: string;
776
+ createdAt: Date;
777
+ updatedAt: Date;
778
+ ownerId: string;
779
+ parentId: string | null;
780
+ color: string;
781
+ markerColor: string | null;
782
+ } | null;
783
+ artifacts: {
784
+ id: string;
785
+ createdAt: Date;
786
+ updatedAt: Date;
787
+ workspaceId: string;
788
+ type: import("@prisma/client").$Enums.ArtifactType;
789
+ title: string;
790
+ isArchived: boolean;
791
+ difficulty: import("@prisma/client").$Enums.Difficulty | null;
792
+ estimatedTime: string | null;
793
+ createdById: string | null;
794
+ description: string | null;
795
+ generating: boolean;
796
+ generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
797
+ worksheetConfig: import("@prisma/client/runtime/library").JsonValue | null;
798
+ imageObjectKey: string | null;
799
+ }[];
800
+ uploads: {
801
+ meta: import("@prisma/client/runtime/library").JsonValue | null;
802
+ name: string;
803
+ id: string;
804
+ createdAt: Date;
805
+ workspaceId: string | null;
806
+ userId: string | null;
807
+ mimeType: string;
808
+ size: number;
809
+ bucket: string | null;
810
+ objectKey: string | null;
811
+ url: string | null;
812
+ checksum: string | null;
813
+ aiTranscription: import("@prisma/client/runtime/library").JsonValue | null;
814
+ }[];
815
+ } & {
816
+ id: string;
817
+ createdAt: Date;
818
+ updatedAt: Date;
819
+ title: string;
820
+ description: string | null;
821
+ ownerId: string;
822
+ color: string;
823
+ markerColor: string | null;
824
+ icon: string;
825
+ folderId: string | null;
826
+ fileBeingAnalyzed: boolean;
827
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
828
+ needsAnalysis: boolean;
829
+ };
830
+ meta: object;
831
+ }>;
832
+ getStats: import("@trpc/server").TRPCQueryProcedure<{
833
+ input: void;
834
+ output: {
835
+ workspaces: number;
836
+ folders: number;
837
+ lastUpdated: Date | undefined;
838
+ spaceUsed: number;
839
+ spaceTotal: number;
840
+ };
841
+ meta: object;
842
+ }>;
843
+ getStudyAnalytics: import("@trpc/server").TRPCQueryProcedure<{
844
+ input: void;
845
+ output: {
846
+ streak: number;
847
+ totalStudyDays: number;
848
+ weeklyActivity: boolean[];
849
+ flashcards: {
850
+ total: number;
851
+ mastered: number;
852
+ dueForReview: number;
853
+ };
854
+ worksheets: {
855
+ completed: number;
856
+ correct: number;
857
+ accuracy: number;
858
+ };
859
+ };
860
+ meta: object;
861
+ }>;
862
+ update: import("@trpc/server").TRPCMutationProcedure<{
863
+ input: {
864
+ id: string;
865
+ name?: string | undefined;
866
+ description?: string | undefined;
867
+ markerColor?: string | null | undefined;
868
+ icon?: string | undefined;
869
+ };
870
+ output: {
871
+ id: string;
872
+ createdAt: Date;
873
+ updatedAt: Date;
874
+ title: string;
875
+ description: string | null;
876
+ ownerId: string;
877
+ color: string;
878
+ markerColor: string | null;
879
+ icon: string;
880
+ folderId: string | null;
881
+ fileBeingAnalyzed: boolean;
882
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
883
+ needsAnalysis: boolean;
884
+ };
885
+ meta: object;
886
+ }>;
887
+ delete: import("@trpc/server").TRPCMutationProcedure<{
888
+ input: {
889
+ id: string;
890
+ };
891
+ output: boolean;
892
+ meta: object;
893
+ }>;
894
+ getFolderInformation: import("@trpc/server").TRPCQueryProcedure<{
895
+ input: {
896
+ id: string;
897
+ };
898
+ output: {
899
+ folder: {
900
+ name: string;
901
+ id: string;
902
+ createdAt: Date;
903
+ updatedAt: Date;
904
+ ownerId: string;
905
+ parentId: string | null;
906
+ color: string;
907
+ markerColor: string | null;
908
+ };
909
+ parents: {
910
+ name: string;
911
+ id: string;
912
+ createdAt: Date;
913
+ updatedAt: Date;
914
+ ownerId: string;
915
+ parentId: string | null;
916
+ color: string;
917
+ markerColor: string | null;
918
+ }[];
919
+ };
920
+ meta: object;
921
+ }>;
922
+ getSharedWith: import("@trpc/server").TRPCQueryProcedure<{
923
+ input: {
924
+ id: string;
925
+ };
926
+ output: {
927
+ shared: {
928
+ id: string;
929
+ createdAt: Date;
930
+ updatedAt: Date;
931
+ title: string;
932
+ description: string | null;
933
+ ownerId: string;
934
+ color: string;
935
+ markerColor: string | null;
936
+ icon: string;
937
+ folderId: string | null;
938
+ fileBeingAnalyzed: boolean;
939
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
940
+ needsAnalysis: boolean;
941
+ }[];
942
+ invitations: ({
943
+ workspace: {
944
+ id: string;
945
+ createdAt: Date;
946
+ updatedAt: Date;
947
+ title: string;
948
+ description: string | null;
949
+ ownerId: string;
950
+ color: string;
951
+ markerColor: string | null;
952
+ icon: string;
953
+ folderId: string | null;
954
+ fileBeingAnalyzed: boolean;
955
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
956
+ needsAnalysis: boolean;
957
+ };
958
+ } & {
959
+ id: string;
960
+ email: string;
961
+ createdAt: Date;
962
+ updatedAt: Date;
963
+ workspaceId: string;
964
+ role: string;
965
+ token: string;
966
+ invitedById: string;
967
+ acceptedAt: Date | null;
968
+ expiresAt: Date;
969
+ })[];
970
+ };
971
+ meta: object;
972
+ }>;
973
+ uploadFiles: import("@trpc/server").TRPCMutationProcedure<{
974
+ input: {
975
+ id: string;
976
+ files: {
977
+ filename: string;
978
+ contentType: string;
979
+ size: number;
980
+ }[];
981
+ };
982
+ output: {
983
+ fileId: string;
984
+ uploadUrl: string;
985
+ }[];
986
+ meta: object;
987
+ }>;
988
+ deleteFiles: import("@trpc/server").TRPCMutationProcedure<{
989
+ input: {
990
+ fileId: string[];
991
+ id: string;
992
+ };
993
+ output: boolean;
994
+ meta: object;
995
+ }>;
996
+ getFileUploadUrl: import("@trpc/server").TRPCQueryProcedure<{
997
+ input: {
998
+ workspaceId: string;
999
+ filename: string;
1000
+ contentType: string;
1001
+ size: number;
1002
+ };
1003
+ output: {
1004
+ fileId: string;
1005
+ uploadUrl: string;
1006
+ };
1007
+ meta: object;
1008
+ }>;
1009
+ uploadAndAnalyzeMedia: import("@trpc/server").TRPCMutationProcedure<{
1010
+ input: {
1011
+ workspaceId: string;
1012
+ files: {
1013
+ id: string;
1014
+ }[];
1015
+ generateStudyGuide?: boolean | undefined;
1016
+ generateFlashcards?: boolean | undefined;
1017
+ generateWorksheet?: boolean | undefined;
1018
+ };
1019
+ output: {
1020
+ filename: string;
1021
+ artifacts: {
1022
+ studyGuide: any | null;
1023
+ flashcards: any | null;
1024
+ worksheet: any | null;
1025
+ };
1026
+ };
1027
+ meta: object;
1028
+ }>;
1029
+ search: import("@trpc/server").TRPCQueryProcedure<{
1030
+ input: {
1031
+ query: string;
1032
+ color?: string | undefined;
1033
+ limit?: number | undefined;
1034
+ };
1035
+ output: any[];
1036
+ meta: object;
1037
+ }>;
1038
+ members: import("@trpc/server").TRPCBuiltRouter<{
1039
+ ctx: import("../context.js").Context;
1040
+ meta: object;
1041
+ errorShape: {
1042
+ data: {
1043
+ zodError: string | null;
1044
+ code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
1045
+ httpStatus: number;
1046
+ path?: string;
1047
+ stack?: string;
1048
+ };
1049
+ message: string;
1050
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
1051
+ };
1052
+ transformer: true;
1053
+ }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
1054
+ getMembers: import("@trpc/server").TRPCQueryProcedure<{
1055
+ input: {
1056
+ workspaceId: string;
1057
+ };
1058
+ output: ({
1059
+ id: string;
1060
+ name: string;
1061
+ email: string;
1062
+ role: "admin" | "member";
1063
+ joinedAt: Date;
1064
+ } | {
1065
+ id: string;
1066
+ name: string;
1067
+ email: string;
1068
+ role: "owner";
1069
+ joinedAt: Date;
1070
+ })[];
1071
+ meta: object;
1072
+ }>;
1073
+ getCurrentUserRole: import("@trpc/server").TRPCQueryProcedure<{
1074
+ input: {
1075
+ workspaceId: string;
1076
+ };
1077
+ output: "admin" | "member" | "owner";
1078
+ meta: object;
1079
+ }>;
1080
+ inviteMember: import("@trpc/server").TRPCMutationProcedure<{
1081
+ input: {
1082
+ workspaceId: string;
1083
+ email: string;
1084
+ role?: "admin" | "member" | undefined;
1085
+ };
1086
+ output: {
1087
+ invitationId: string;
1088
+ token: string;
1089
+ email: string;
1090
+ role: string;
1091
+ expiresAt: Date;
1092
+ workspaceTitle: string;
1093
+ invitedByName: string | null;
1094
+ };
1095
+ meta: object;
1096
+ }>;
1097
+ getInvitations: import("@trpc/server").TRPCQueryProcedure<{
1098
+ input: {
1099
+ workspaceId: string;
1100
+ };
1101
+ output: {
1102
+ id: string;
1103
+ email: string;
1104
+ createdAt: Date;
1105
+ updatedAt: Date;
1106
+ workspaceId: string;
1107
+ role: string;
1108
+ token: string;
1109
+ invitedById: string;
1110
+ acceptedAt: Date | null;
1111
+ expiresAt: Date;
1112
+ }[];
1113
+ meta: object;
1114
+ }>;
1115
+ acceptInvite: import("@trpc/server").TRPCMutationProcedure<{
1116
+ input: {
1117
+ token: string;
1118
+ };
1119
+ output: {
1120
+ message?: string | undefined;
1121
+ workspaceId: string;
1122
+ workspaceTitle: string;
1123
+ role: string;
1124
+ ownerName: string | null;
1125
+ };
1126
+ meta: object;
1127
+ }>;
1128
+ changeMemberRole: import("@trpc/server").TRPCMutationProcedure<{
1129
+ input: {
1130
+ workspaceId: string;
1131
+ memberId: string;
1132
+ role: "admin" | "member";
1133
+ };
1134
+ output: {
1135
+ memberId: string;
1136
+ role: "admin" | "member";
1137
+ memberName: string | null;
1138
+ message: string;
1139
+ };
1140
+ meta: object;
1141
+ }>;
1142
+ removeMember: import("@trpc/server").TRPCMutationProcedure<{
1143
+ input: {
1144
+ workspaceId: string;
1145
+ memberId: string;
1146
+ };
1147
+ output: {
1148
+ memberId: string;
1149
+ message: string;
1150
+ };
1151
+ meta: object;
1152
+ }>;
1153
+ getPendingInvitations: import("@trpc/server").TRPCQueryProcedure<{
1154
+ input: {
1155
+ workspaceId: string;
1156
+ };
1157
+ output: {
1158
+ id: string;
1159
+ email: string;
1160
+ role: string;
1161
+ token: string;
1162
+ expiresAt: Date;
1163
+ createdAt: Date;
1164
+ invitedByName: string | null;
1165
+ }[];
1166
+ meta: object;
1167
+ }>;
1168
+ cancelInvitation: import("@trpc/server").TRPCMutationProcedure<{
1169
+ input: {
1170
+ invitationId: string;
1171
+ };
1172
+ output: {
1173
+ invitationId: string;
1174
+ message: string;
1175
+ };
1176
+ meta: object;
1177
+ }>;
1178
+ resendInvitation: import("@trpc/server").TRPCMutationProcedure<{
1179
+ input: {
1180
+ invitationId: string;
1181
+ };
1182
+ output: {
1183
+ invitationId: string;
1184
+ message: string;
1185
+ };
1186
+ meta: object;
1187
+ }>;
1188
+ getAllInvitationsDebug: import("@trpc/server").TRPCQueryProcedure<{
1189
+ input: {
1190
+ workspaceId: string;
1191
+ };
1192
+ output: {
1193
+ id: string;
1194
+ email: string;
1195
+ createdAt: Date;
1196
+ updatedAt: Date;
1197
+ workspaceId: string;
1198
+ role: string;
1199
+ token: string;
1200
+ invitedById: string;
1201
+ acceptedAt: Date | null;
1202
+ expiresAt: Date;
1203
+ }[];
1204
+ meta: object;
1205
+ }>;
1206
+ }>>;
1207
+ }>>;