@goscribe/server 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/context.d.ts +5 -1
  2. package/dist/lib/activity_human_description.d.ts +13 -0
  3. package/dist/lib/activity_human_description.js +221 -0
  4. package/dist/lib/activity_human_description.test.d.ts +1 -0
  5. package/dist/lib/activity_human_description.test.js +16 -0
  6. package/dist/lib/activity_log_service.d.ts +87 -0
  7. package/dist/lib/activity_log_service.js +276 -0
  8. package/dist/lib/activity_log_service.test.d.ts +1 -0
  9. package/dist/lib/activity_log_service.test.js +27 -0
  10. package/dist/lib/ai-session.d.ts +15 -2
  11. package/dist/lib/ai-session.js +147 -85
  12. package/dist/lib/constants.d.ts +13 -0
  13. package/dist/lib/constants.js +12 -0
  14. package/dist/lib/email.d.ts +11 -0
  15. package/dist/lib/email.js +193 -0
  16. package/dist/lib/env.d.ts +13 -0
  17. package/dist/lib/env.js +16 -0
  18. package/dist/lib/inference.d.ts +4 -1
  19. package/dist/lib/inference.js +3 -3
  20. package/dist/lib/logger.d.ts +4 -4
  21. package/dist/lib/logger.js +30 -8
  22. package/dist/lib/notification-service.d.ts +152 -0
  23. package/dist/lib/notification-service.js +473 -0
  24. package/dist/lib/notification-service.test.d.ts +1 -0
  25. package/dist/lib/notification-service.test.js +87 -0
  26. package/dist/lib/prisma.d.ts +2 -1
  27. package/dist/lib/prisma.js +5 -1
  28. package/dist/lib/pusher.d.ts +23 -0
  29. package/dist/lib/pusher.js +69 -5
  30. package/dist/lib/retry.d.ts +15 -0
  31. package/dist/lib/retry.js +37 -0
  32. package/dist/lib/storage.js +2 -2
  33. package/dist/lib/stripe.d.ts +9 -0
  34. package/dist/lib/stripe.js +36 -0
  35. package/dist/lib/subscription_service.d.ts +37 -0
  36. package/dist/lib/subscription_service.js +654 -0
  37. package/dist/lib/usage_service.d.ts +26 -0
  38. package/dist/lib/usage_service.js +59 -0
  39. package/dist/lib/worksheet-generation.d.ts +91 -0
  40. package/dist/lib/worksheet-generation.js +95 -0
  41. package/dist/lib/worksheet-generation.test.d.ts +1 -0
  42. package/dist/lib/worksheet-generation.test.js +20 -0
  43. package/dist/lib/workspace-access.d.ts +18 -0
  44. package/dist/lib/workspace-access.js +13 -0
  45. package/dist/routers/_app.d.ts +1349 -253
  46. package/dist/routers/_app.js +10 -0
  47. package/dist/routers/admin.d.ts +361 -0
  48. package/dist/routers/admin.js +633 -0
  49. package/dist/routers/annotations.d.ts +219 -0
  50. package/dist/routers/annotations.js +187 -0
  51. package/dist/routers/auth.d.ts +88 -7
  52. package/dist/routers/auth.js +339 -19
  53. package/dist/routers/chat.d.ts +6 -12
  54. package/dist/routers/copilot.d.ts +199 -0
  55. package/dist/routers/copilot.js +571 -0
  56. package/dist/routers/flashcards.d.ts +47 -81
  57. package/dist/routers/flashcards.js +143 -27
  58. package/dist/routers/members.d.ts +36 -7
  59. package/dist/routers/members.js +200 -19
  60. package/dist/routers/notifications.d.ts +99 -0
  61. package/dist/routers/notifications.js +127 -0
  62. package/dist/routers/payment.d.ts +89 -0
  63. package/dist/routers/payment.js +403 -0
  64. package/dist/routers/podcast.d.ts +8 -13
  65. package/dist/routers/podcast.js +54 -31
  66. package/dist/routers/studyguide.d.ts +1 -29
  67. package/dist/routers/studyguide.js +80 -71
  68. package/dist/routers/worksheets.d.ts +105 -38
  69. package/dist/routers/worksheets.js +258 -68
  70. package/dist/routers/workspace.d.ts +139 -60
  71. package/dist/routers/workspace.js +455 -315
  72. package/dist/scripts/purge-deleted-users.d.ts +1 -0
  73. package/dist/scripts/purge-deleted-users.js +149 -0
  74. package/dist/server.js +130 -10
  75. package/dist/services/flashcard-progress.service.d.ts +18 -66
  76. package/dist/services/flashcard-progress.service.js +51 -42
  77. package/dist/trpc.d.ts +20 -21
  78. package/dist/trpc.js +150 -1
  79. package/package.json +1 -1
@@ -1,11 +1,5 @@
1
1
  export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
2
- ctx: {
3
- db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
4
- session: any;
5
- req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
6
- res: import("express").Response<any, Record<string, any>>;
7
- cookies: Record<string, string | undefined>;
8
- };
2
+ ctx: import("../context.js").Context;
9
3
  meta: object;
10
4
  errorShape: {
11
5
  data: {
@@ -49,20 +43,80 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
49
43
  id: string;
50
44
  createdAt: Date;
51
45
  updatedAt: Date;
52
- title: string;
53
- description: string | null;
54
46
  workspaceId: string;
55
47
  type: import("@prisma/client").$Enums.ArtifactType;
48
+ title: string;
56
49
  isArchived: boolean;
57
- generating: boolean;
58
- generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
59
50
  difficulty: import("@prisma/client").$Enums.Difficulty | null;
60
51
  estimatedTime: string | null;
61
- imageObjectKey: string | null;
62
52
  createdById: string | null;
53
+ description: string | null;
54
+ generating: boolean;
55
+ generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
56
+ worksheetConfig: import("@prisma/client/runtime/library").JsonValue | null;
57
+ imageObjectKey: string | null;
63
58
  })[];
64
59
  meta: object;
65
60
  }>;
61
+ listPresets: import("@trpc/server").TRPCQueryProcedure<{
62
+ input: {
63
+ workspaceId: string;
64
+ };
65
+ output: {
66
+ name: string;
67
+ id: string;
68
+ createdAt: Date;
69
+ updatedAt: Date;
70
+ workspaceId: string | null;
71
+ userId: string | null;
72
+ isSystem: boolean;
73
+ config: import("@prisma/client/runtime/library").JsonValue;
74
+ }[];
75
+ meta: object;
76
+ }>;
77
+ createPreset: import("@trpc/server").TRPCMutationProcedure<{
78
+ input: {
79
+ name: string;
80
+ config: Record<string, unknown>;
81
+ workspaceId?: string | undefined;
82
+ };
83
+ output: {
84
+ name: string;
85
+ id: string;
86
+ createdAt: Date;
87
+ updatedAt: Date;
88
+ workspaceId: string | null;
89
+ userId: string | null;
90
+ isSystem: boolean;
91
+ config: import("@prisma/client/runtime/library").JsonValue;
92
+ };
93
+ meta: object;
94
+ }>;
95
+ updatePreset: import("@trpc/server").TRPCMutationProcedure<{
96
+ input: {
97
+ id: string;
98
+ name?: string | undefined;
99
+ config?: Record<string, unknown> | undefined;
100
+ };
101
+ output: {
102
+ name: string;
103
+ id: string;
104
+ createdAt: Date;
105
+ updatedAt: Date;
106
+ workspaceId: string | null;
107
+ userId: string | null;
108
+ isSystem: boolean;
109
+ config: import("@prisma/client/runtime/library").JsonValue;
110
+ };
111
+ meta: object;
112
+ }>;
113
+ deletePreset: import("@trpc/server").TRPCMutationProcedure<{
114
+ input: {
115
+ id: string;
116
+ };
117
+ output: boolean;
118
+ meta: object;
119
+ }>;
66
120
  create: import("@trpc/server").TRPCMutationProcedure<{
67
121
  input: {
68
122
  workspaceId: string;
@@ -93,17 +147,18 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
93
147
  id: string;
94
148
  createdAt: Date;
95
149
  updatedAt: Date;
96
- title: string;
97
- description: string | null;
98
150
  workspaceId: string;
99
151
  type: import("@prisma/client").$Enums.ArtifactType;
152
+ title: string;
100
153
  isArchived: boolean;
101
- generating: boolean;
102
- generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
103
154
  difficulty: import("@prisma/client").$Enums.Difficulty | null;
104
155
  estimatedTime: string | null;
105
- imageObjectKey: string | null;
106
156
  createdById: string | null;
157
+ description: string | null;
158
+ generating: boolean;
159
+ generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
160
+ worksheetConfig: import("@prisma/client/runtime/library").JsonValue | null;
161
+ imageObjectKey: string | null;
107
162
  };
108
163
  meta: object;
109
164
  }>;
@@ -127,17 +182,18 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
127
182
  id: string;
128
183
  createdAt: Date;
129
184
  updatedAt: Date;
130
- title: string;
131
- description: string | null;
132
185
  workspaceId: string;
133
186
  type: import("@prisma/client").$Enums.ArtifactType;
187
+ title: string;
134
188
  isArchived: boolean;
135
- generating: boolean;
136
- generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
137
189
  difficulty: import("@prisma/client").$Enums.Difficulty | null;
138
190
  estimatedTime: string | null;
139
- imageObjectKey: string | null;
140
191
  createdById: string | null;
192
+ description: string | null;
193
+ generating: boolean;
194
+ generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
195
+ worksheetConfig: import("@prisma/client/runtime/library").JsonValue | null;
196
+ imageObjectKey: string | null;
141
197
  };
142
198
  meta: object;
143
199
  }>;
@@ -208,12 +264,12 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
208
264
  updatedAt: Date;
209
265
  userId: string;
210
266
  worksheetQuestionId: string;
211
- modified: boolean;
212
267
  userAnswer: string | null;
213
- correct: boolean | null;
214
268
  completedAt: Date | null;
215
269
  attempts: number;
216
270
  timeSpentSec: number | null;
271
+ correct: boolean | null;
272
+ modified: boolean;
217
273
  };
218
274
  meta: object;
219
275
  }>;
@@ -228,12 +284,12 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
228
284
  updatedAt: Date;
229
285
  userId: string;
230
286
  worksheetQuestionId: string;
231
- modified: boolean;
232
287
  userAnswer: string | null;
233
- correct: boolean | null;
234
288
  completedAt: Date | null;
235
289
  attempts: number;
236
290
  timeSpentSec: number | null;
291
+ correct: boolean | null;
292
+ modified: boolean;
237
293
  }[];
238
294
  meta: object;
239
295
  }>;
@@ -268,17 +324,18 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
268
324
  id: string;
269
325
  createdAt: Date;
270
326
  updatedAt: Date;
271
- title: string;
272
- description: string | null;
273
327
  workspaceId: string;
274
328
  type: import("@prisma/client").$Enums.ArtifactType;
329
+ title: string;
275
330
  isArchived: boolean;
276
- generating: boolean;
277
- generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
278
331
  difficulty: import("@prisma/client").$Enums.Difficulty | null;
279
332
  estimatedTime: string | null;
280
- imageObjectKey: string | null;
281
333
  createdById: string | null;
334
+ description: string | null;
335
+ generating: boolean;
336
+ generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
337
+ worksheetConfig: import("@prisma/client/runtime/library").JsonValue | null;
338
+ imageObjectKey: string | null;
282
339
  };
283
340
  meta: object;
284
341
  }>;
@@ -295,6 +352,15 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
295
352
  prompt: string;
296
353
  numQuestions?: number | undefined;
297
354
  difficulty?: "easy" | "medium" | "hard" | undefined;
355
+ mode?: "practice" | "quiz" | undefined;
356
+ presetId?: string | undefined;
357
+ configOverride?: {
358
+ mode?: "practice" | "quiz" | undefined;
359
+ numQuestions?: number | undefined;
360
+ difficulty?: "easy" | "medium" | "hard" | undefined;
361
+ questionTypes?: ("MULTIPLE_CHOICE" | "TEXT" | "NUMERIC" | "TRUE_FALSE" | "MATCHING" | "FILL_IN_THE_BLANK")[] | undefined;
362
+ mcqRatio?: number | undefined;
363
+ } | undefined;
298
364
  title?: string | undefined;
299
365
  estimatedTime?: string | undefined;
300
366
  };
@@ -303,17 +369,18 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
303
369
  id: string;
304
370
  createdAt: Date;
305
371
  updatedAt: Date;
306
- title: string;
307
- description: string | null;
308
372
  workspaceId: string;
309
373
  type: import("@prisma/client").$Enums.ArtifactType;
374
+ title: string;
310
375
  isArchived: boolean;
311
- generating: boolean;
312
- generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
313
376
  difficulty: import("@prisma/client").$Enums.Difficulty | null;
314
377
  estimatedTime: string | null;
315
- imageObjectKey: string | null;
316
378
  createdById: string | null;
379
+ description: string | null;
380
+ generating: boolean;
381
+ generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
382
+ worksheetConfig: import("@prisma/client/runtime/library").JsonValue | null;
383
+ imageObjectKey: string | null;
317
384
  };
318
385
  };
319
386
  meta: object;
@@ -334,12 +401,12 @@ export declare const worksheets: import("@trpc/server").TRPCBuiltRouter<{
334
401
  updatedAt: Date;
335
402
  userId: string;
336
403
  worksheetQuestionId: string;
337
- modified: boolean;
338
404
  userAnswer: string | null;
339
- correct: boolean | null;
340
405
  completedAt: Date | null;
341
406
  attempts: number;
342
407
  timeSpentSec: number | null;
408
+ correct: boolean | null;
409
+ modified: boolean;
343
410
  };
344
411
  };
345
412
  meta: object;