@goscribe/server 1.1.2 → 1.1.4

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 (36) hide show
  1. package/dist/lib/ai-session.d.ts +13 -3
  2. package/dist/lib/ai-session.js +66 -146
  3. package/dist/lib/pusher.js +1 -1
  4. package/dist/routers/_app.d.ts +114 -7
  5. package/dist/routers/chat.js +2 -23
  6. package/dist/routers/flashcards.d.ts +25 -1
  7. package/dist/routers/flashcards.js +0 -14
  8. package/dist/routers/members.d.ts +18 -0
  9. package/dist/routers/members.js +14 -1
  10. package/dist/routers/worksheets.js +5 -4
  11. package/dist/routers/workspace.d.ts +89 -6
  12. package/dist/routers/workspace.js +389 -259
  13. package/dist/services/flashcard-progress.service.d.ts +25 -1
  14. package/dist/services/flashcard-progress.service.js +70 -31
  15. package/package.json +3 -2
  16. package/prisma/schema.prisma +196 -184
  17. package/src/lib/ai-session.ts +3 -21
  18. package/src/routers/auth.ts +50 -2
  19. package/src/routers/flashcards.ts +0 -16
  20. package/src/routers/members.ts +27 -6
  21. package/src/routers/workspace.ts +468 -439
  22. package/src/server.ts +13 -0
  23. package/ANALYSIS_PROGRESS_SPEC.md +0 -463
  24. package/PROGRESS_QUICK_REFERENCE.md +0 -239
  25. package/dist/lib/podcast-prompts.d.ts +0 -43
  26. package/dist/lib/podcast-prompts.js +0 -135
  27. package/dist/routers/ai-session.d.ts +0 -0
  28. package/dist/routers/ai-session.js +0 -1
  29. package/dist/services/flashcard.service.d.ts +0 -183
  30. package/dist/services/flashcard.service.js +0 -224
  31. package/dist/services/podcast-segment-reorder.d.ts +0 -0
  32. package/dist/services/podcast-segment-reorder.js +0 -107
  33. package/dist/services/podcast.service.d.ts +0 -0
  34. package/dist/services/podcast.service.js +0 -326
  35. package/dist/services/worksheet.service.d.ts +0 -0
  36. package/dist/services/worksheet.service.js +0 -295
@@ -272,6 +272,7 @@ export const worksheets = router({
272
272
  userAnswer: input.answer,
273
273
  completedAt: input.completed ? new Date() : null,
274
274
  attempts: { increment: 1 },
275
+ correct: input.correct,
275
276
  },
276
277
  });
277
278
  return progress;
@@ -426,10 +427,10 @@ export const worksheets = router({
426
427
  answer,
427
428
  difficulty: (input.difficulty.toUpperCase()),
428
429
  order: i,
430
+ type,
429
431
  meta: {
430
- type,
431
432
  options: options.length > 0 ? options : undefined,
432
- mark_scheme: problem.mark_scheme || undefined,
433
+ markScheme: problem.mark_scheme || undefined,
433
434
  },
434
435
  },
435
436
  });
@@ -472,7 +473,7 @@ export const worksheets = router({
472
473
  throw new TRPCError({ code: 'NOT_FOUND' });
473
474
  // Parse question meta to get mark_scheme
474
475
  const questionMeta = question.meta ? (typeof question.meta === 'object' ? question.meta : JSON.parse(question.meta)) : {};
475
- const markScheme = questionMeta.mark_scheme;
476
+ const markScheme = questionMeta.markScheme;
476
477
  let isCorrect = false;
477
478
  let userMarkScheme = null;
478
479
  // If mark scheme exists, use AI marking
@@ -491,7 +492,7 @@ export const worksheets = router({
491
492
  }
492
493
  else {
493
494
  // Simple string comparison if no mark scheme
494
- isCorrect = question.answer === input.answer;
495
+ throw new TRPCError({ code: 'BAD_REQUEST', message: 'No mark scheme found for question' });
495
496
  }
496
497
  // @todo: figure out this wierd fix
497
498
  const progress = await ctx.db.worksheetQuestionProgress.upsert({
@@ -38,6 +38,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
38
38
  folderId: string | null;
39
39
  fileBeingAnalyzed: boolean;
40
40
  analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
41
+ needsAnalysis: boolean;
41
42
  }[];
42
43
  folders: {
43
44
  name: string;
@@ -69,6 +70,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
69
70
  folderId: string | null;
70
71
  fileBeingAnalyzed: boolean;
71
72
  analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
73
+ needsAnalysis: boolean;
72
74
  };
73
75
  meta: object;
74
76
  }>;
@@ -148,6 +150,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
148
150
  objectKey: string | null;
149
151
  url: string | null;
150
152
  checksum: string | null;
153
+ aiTranscription: import("@prisma/client/runtime/library").JsonValue | null;
151
154
  }[];
152
155
  artifacts: {
153
156
  id: string;
@@ -177,6 +180,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
177
180
  folderId: string | null;
178
181
  fileBeingAnalyzed: boolean;
179
182
  analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
183
+ needsAnalysis: boolean;
180
184
  };
181
185
  meta: object;
182
186
  }>;
@@ -211,6 +215,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
211
215
  folderId: string | null;
212
216
  fileBeingAnalyzed: boolean;
213
217
  analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
218
+ needsAnalysis: boolean;
214
219
  };
215
220
  meta: object;
216
221
  }>;
@@ -247,6 +252,55 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
247
252
  };
248
253
  meta: object;
249
254
  }>;
255
+ getSharedWith: import("@trpc/server").TRPCQueryProcedure<{
256
+ input: {
257
+ id: string;
258
+ };
259
+ output: {
260
+ shared: {
261
+ id: string;
262
+ createdAt: Date;
263
+ updatedAt: Date;
264
+ ownerId: string;
265
+ color: string;
266
+ title: string;
267
+ description: string | null;
268
+ icon: string;
269
+ folderId: string | null;
270
+ fileBeingAnalyzed: boolean;
271
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
272
+ needsAnalysis: boolean;
273
+ }[];
274
+ invitations: ({
275
+ workspace: {
276
+ id: string;
277
+ createdAt: Date;
278
+ updatedAt: Date;
279
+ ownerId: string;
280
+ color: string;
281
+ title: string;
282
+ description: string | null;
283
+ icon: string;
284
+ folderId: string | null;
285
+ fileBeingAnalyzed: boolean;
286
+ analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
287
+ needsAnalysis: boolean;
288
+ };
289
+ } & {
290
+ id: string;
291
+ email: string;
292
+ createdAt: Date;
293
+ updatedAt: Date;
294
+ workspaceId: string;
295
+ role: string;
296
+ token: string;
297
+ invitedById: string;
298
+ acceptedAt: Date | null;
299
+ expiresAt: Date;
300
+ })[];
301
+ };
302
+ meta: object;
303
+ }>;
250
304
  uploadFiles: import("@trpc/server").TRPCMutationProcedure<{
251
305
  input: {
252
306
  id: string;
@@ -270,15 +324,25 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
270
324
  output: boolean;
271
325
  meta: object;
272
326
  }>;
327
+ getFileUploadUrl: import("@trpc/server").TRPCQueryProcedure<{
328
+ input: {
329
+ workspaceId: string;
330
+ filename: string;
331
+ contentType: string;
332
+ size: number;
333
+ };
334
+ output: {
335
+ fileId: string;
336
+ uploadUrl: string;
337
+ };
338
+ meta: object;
339
+ }>;
273
340
  uploadAndAnalyzeMedia: import("@trpc/server").TRPCMutationProcedure<{
274
341
  input: {
275
342
  workspaceId: string;
276
- file: {
277
- filename: string;
278
- contentType: string;
279
- size: number;
280
- content: string;
281
- };
343
+ files: {
344
+ id: string;
345
+ }[];
282
346
  generateStudyGuide?: boolean | undefined;
283
347
  generateFlashcards?: boolean | undefined;
284
348
  generateWorksheet?: boolean | undefined;
@@ -310,6 +374,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
310
374
  folderId: string | null;
311
375
  fileBeingAnalyzed: boolean;
312
376
  analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
377
+ needsAnalysis: boolean;
313
378
  }[];
314
379
  meta: object;
315
380
  }>;
@@ -380,6 +445,24 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
380
445
  };
381
446
  meta: object;
382
447
  }>;
448
+ getInvitations: import("@trpc/server").TRPCQueryProcedure<{
449
+ input: {
450
+ workspaceId: string;
451
+ };
452
+ output: {
453
+ id: string;
454
+ email: string;
455
+ createdAt: Date;
456
+ updatedAt: Date;
457
+ workspaceId: string;
458
+ role: string;
459
+ token: string;
460
+ invitedById: string;
461
+ acceptedAt: Date | null;
462
+ expiresAt: Date;
463
+ }[];
464
+ meta: object;
465
+ }>;
383
466
  acceptInvite: import("@trpc/server").TRPCMutationProcedure<{
384
467
  input: {
385
468
  token: string;