@studious-lms/server 1.4.5 → 1.4.6

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 (45) hide show
  1. package/dist/lib/config/cors.d.ts.map +1 -1
  2. package/dist/lib/config/cors.js +8 -3
  3. package/dist/lib/config/cors.js.map +1 -1
  4. package/dist/models/comment.d.ts +163 -0
  5. package/dist/models/comment.d.ts.map +1 -1
  6. package/dist/models/comment.js +145 -3
  7. package/dist/models/comment.js.map +1 -1
  8. package/dist/models/worksheet.d.ts +2 -0
  9. package/dist/models/worksheet.d.ts.map +1 -1
  10. package/dist/pipelines/aiLabChat.d.ts.map +1 -1
  11. package/dist/pipelines/aiLabChat.js +4 -3
  12. package/dist/pipelines/aiLabChat.js.map +1 -1
  13. package/dist/routers/_app.d.ts +562 -8
  14. package/dist/routers/_app.d.ts.map +1 -1
  15. package/dist/routers/announcement.d.ts +8 -0
  16. package/dist/routers/announcement.d.ts.map +1 -1
  17. package/dist/routers/assignment.d.ts +230 -0
  18. package/dist/routers/assignment.d.ts.map +1 -1
  19. package/dist/routers/assignment.js +207 -2
  20. package/dist/routers/assignment.js.map +1 -1
  21. package/dist/routers/comment.d.ts +37 -0
  22. package/dist/routers/comment.d.ts.map +1 -1
  23. package/dist/routers/comment.js +14 -5
  24. package/dist/routers/comment.js.map +1 -1
  25. package/dist/routers/worksheet.d.ts +2 -0
  26. package/dist/routers/worksheet.d.ts.map +1 -1
  27. package/dist/services/comment.d.ts +28 -2
  28. package/dist/services/comment.d.ts.map +1 -1
  29. package/dist/services/comment.js +97 -19
  30. package/dist/services/comment.js.map +1 -1
  31. package/dist/services/worksheet.d.ts +2 -0
  32. package/dist/services/worksheet.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/prisma/migrations/20260502230500_assignment_submission_comments/migration.sql +60 -0
  35. package/prisma/schema.prisma +9 -0
  36. package/src/lib/config/cors.ts +8 -1
  37. package/src/models/comment.ts +148 -1
  38. package/src/pipelines/aiLabChat.ts +2 -1
  39. package/src/routers/assignment.ts +224 -1
  40. package/src/routers/comment.ts +19 -2
  41. package/src/services/comment.ts +113 -18
  42. package/tests/lib/cors.test.ts +13 -1
  43. package/tests/routers/assignment.test.ts +68 -2
  44. package/tests/routers/comment.test.ts +42 -1
  45. package/vercel.json +8 -0
@@ -1 +1 @@
1
- {"version":3,"file":"cors.d.ts","sourceRoot":"/","sources":["lib/config/cors.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG;IACb,QAAQ,CAAC,EAAE,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;IACjD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAqCF,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,aACX,CAAC;AAiBvC,eAAO,MAAM,uBAAuB,GAAI,WAAW,MAAM,aAC6B,CAAC;AAEvF,eAAO,MAAM,4BAA4B,GAAI,WAAW,MAAM,YAO7D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,KAAK,OAAO;;;+BAShB,MAAM;CAczC,CAAC"}
1
+ {"version":3,"file":"cors.d.ts","sourceRoot":"/","sources":["lib/config/cors.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG;IACb,QAAQ,CAAC,EAAE,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;IACjD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAyCF,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,aACX,CAAC;AAiBvC,eAAO,MAAM,uBAAuB,GAAI,WAAW,MAAM,aAC6B,CAAC;AAEvF,eAAO,MAAM,4BAA4B,GAAI,WAAW,MAAM,YAO7D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,KAAK,OAAO;;;+BAYhB,MAAM;CAczC,CAAC"}
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2499986f-b37e-5e23-a023-556de6317b0f")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fed6d0aa-55db-5889-9721-82cba71f1d3b")}catch(e){}}();
3
3
  const productionOrigins = [
4
4
  'https://www.studious.sh',
5
5
  'https://studious.sh',
@@ -12,6 +12,8 @@ const nonProductionOrigins = [
12
12
  'http://127.0.0.1:3000',
13
13
  'http://127.0.0.1:3001',
14
14
  ];
15
+ /** Any preview / prod deployment on *.vercel.app (HTTPS only). */
16
+ const vercelAppOriginPattern = /^https:\/\/[a-z0-9][a-z0-9.-]*\.vercel\.app$/i;
15
17
  const MAX_PATTERN_LENGTH = 200;
16
18
  // This heuristic only targets common nested-quantifier cases like `(a+)+`.
17
19
  // It does not catch every risky construct (for example `.*.*` or deep alternation nesting),
@@ -59,7 +61,10 @@ export const createCorsOriginMatcher = (env) => {
59
61
  env.NEXT_PUBLIC_APP_URL ? toCorsOrigin(env.NEXT_PUBLIC_APP_URL) : undefined,
60
62
  ...parseCorsOrigins(env.CORS_ALLOWED_ORIGINS),
61
63
  ].filter(isDefined)));
62
- const allowedOriginPatterns = parseCorsOriginPatterns(env.CORS_ALLOWED_ORIGIN_PATTERNS);
64
+ const allowedOriginPatterns = [
65
+ vercelAppOriginPattern,
66
+ ...parseCorsOriginPatterns(env.CORS_ALLOWED_ORIGIN_PATTERNS),
67
+ ];
63
68
  const isAllowedOrigin = (origin) => {
64
69
  const corsOrigin = origin ? toCorsOrigin(origin) : undefined;
65
70
  return Boolean(corsOrigin && (allowedOrigins.includes(corsOrigin) ||
@@ -72,4 +77,4 @@ export const createCorsOriginMatcher = (env) => {
72
77
  };
73
78
  };
74
79
  //# sourceMappingURL=cors.js.map
75
- //# debugId=2499986f-b37e-5e23-a023-556de6317b0f
80
+ //# debugId=fed6d0aa-55db-5889-9721-82cba71f1d3b
@@ -1 +1 @@
1
- {"version":3,"file":"cors.js","sources":["lib/config/cors.ts"],"sourceRoot":"/","sourcesContent":["type CorsEnv = {\n NODE_ENV?: 'development' | 'production' | 'test';\n NEXT_PUBLIC_APP_URL?: string;\n CORS_ALLOWED_ORIGINS?: string;\n CORS_ALLOWED_ORIGIN_PATTERNS?: string;\n};\n\nconst productionOrigins = [\n 'https://www.studious.sh',\n 'https://studious.sh',\n 'https://dev.studious.sh',\n 'https://www.dev.studious.sh',\n];\n\nconst nonProductionOrigins = [\n 'http://localhost:3000',\n 'http://localhost:3001',\n 'http://127.0.0.1:3000',\n 'http://127.0.0.1:3001',\n];\nconst MAX_PATTERN_LENGTH = 200;\n// This heuristic only targets common nested-quantifier cases like `(a+)+`.\n// It does not catch every risky construct (for example `.*.*` or deep alternation nesting),\n// so `parseCorsOriginPatterns` should still be limited to operator-controlled, anchored patterns.\nconst SUSPICIOUS_QUANTIFIER_PATTERN = /(\\([^)]*[+*{][^)]*\\)|\\[[^\\]]+[+*{][^\\]]*\\])[+*{]/;\n\nconst parseList = (value?: string) =>\n value\n ?.split(',')\n .map((item) => item.trim())\n .filter(Boolean) ?? [];\n\nconst isDefined = <T>(value: T | undefined | null): value is T => Boolean(value);\n\nconst toCorsOrigin = (value: string) => {\n try {\n return new URL(value).origin;\n } catch {\n return value.replace(/\\/+$/, '');\n }\n};\n\nexport const parseCorsOrigins = (origins?: string) =>\n parseList(origins).map(toCorsOrigin);\n\nconst validateCorsOriginPattern = (pattern: string) => {\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new Error(`CORS pattern exceeds maximum length of ${MAX_PATTERN_LENGTH}`);\n }\n\n // Prefer short, anchored patterns and avoid other complex regex features even if they pass this check.\n if (SUSPICIOUS_QUANTIFIER_PATTERN.test(pattern)) {\n throw new Error(\"CORS pattern contains nested or ambiguous quantifiers\");\n }\n\n return pattern;\n};\n\n// Patterns are operator-controlled and matched against bounded URL origins, so ReDoS risk is low.\n// Syntax validation does not guarantee safety; prefer anchored patterns and avoid nested quantifiers.\nexport const parseCorsOriginPatterns = (patterns?: string) =>\n parseList(patterns).map((pattern) => new RegExp(validateCorsOriginPattern(pattern)));\n\nexport const isValidCorsOriginPatternList = (patterns?: string) => {\n try {\n parseCorsOriginPatterns(patterns);\n return true;\n } catch {\n return false;\n }\n};\n\nexport const createCorsOriginMatcher = (env: CorsEnv) => {\n const allowedOrigins = Array.from(new Set([\n ...(env.NODE_ENV === 'production' ? productionOrigins : nonProductionOrigins),\n env.NEXT_PUBLIC_APP_URL ? toCorsOrigin(env.NEXT_PUBLIC_APP_URL) : undefined,\n ...parseCorsOrigins(env.CORS_ALLOWED_ORIGINS),\n ].filter(isDefined)));\n\n const allowedOriginPatterns = parseCorsOriginPatterns(env.CORS_ALLOWED_ORIGIN_PATTERNS);\n\n const isAllowedOrigin = (origin?: string) => {\n const corsOrigin = origin ? toCorsOrigin(origin) : undefined;\n\n return Boolean(corsOrigin && (\n allowedOrigins.includes(corsOrigin) ||\n allowedOriginPatterns.some((pattern) => pattern.test(corsOrigin))\n ));\n };\n\n return {\n allowedOrigins,\n allowedOriginPatterns,\n isAllowedOrigin,\n };\n};\n"],"names":[],"mappings":";;AAOA,MAAM,iBAAiB,GAAG;IACxB,yBAAyB;IACzB,qBAAqB;IACrB,yBAAyB;IACzB,6BAA6B;CAC9B,CAAC;AAEF,MAAM,oBAAoB,GAAG;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;CACxB,CAAC;AACF,MAAM,kBAAkB,GAAG,GA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UAAU,CAAC,CAAC,CAClE,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,cAAc;QACd,qBAAqB;QACrB,eAAe;KAChB,CAAC;AACJ,CAAC,CAAC","debug_id":"2499986f-b37e-5e23-a023-556de6317b0f"}
1
+ {"version":3,"file":"cors.js","sources":["lib/config/cors.ts"],"sourceRoot":"/","sourcesContent":["type CorsEnv = {\n NODE_ENV?: 'development' | 'production' | 'test';\n NEXT_PUBLIC_APP_URL?: string;\n CORS_ALLOWED_ORIGINS?: string;\n CORS_ALLOWED_ORIGIN_PATTERNS?: string;\n};\n\nconst productionOrigins = [\n 'https://www.studious.sh',\n 'https://studious.sh',\n 'https://dev.studious.sh',\n 'https://www.dev.studious.sh',\n];\n\nconst nonProductionOrigins = [\n 'http://localhost:3000',\n 'http://localhost:3001',\n 'http://127.0.0.1:3000',\n 'http://127.0.0.1:3001',\n];\n\n/** Any preview / prod deployment on *.vercel.app (HTTPS only). */\nconst vercelAppOriginPattern = /^https:\\/\\/[a-z0-9][a-z0-9.-]*\\.vercel\\.app$/i;\n\nconst MAX_PATTERN_LENGTH = 200;\n// This heuristic only targets common nested-quantifier cases like `(a+)+`.\n// It does not catch every risky construct (for example `.*.*` or deep alternation nesting),\n// so `parseCorsOriginPatterns` should still be limited to operator-controlled, anchored patterns.\nconst SUSPICIOUS_QUANTIFIER_PATTERN = /(\\([^)]*[+*{][^)]*\\)|\\[[^\\]]+[+*{][^\\]]*\\])[+*{]/;\n\nconst parseList = (value?: string) =>\n value\n ?.split(',')\n .map((item) => item.trim())\n .filter(Boolean) ?? [];\n\nconst isDefined = <T>(value: T | undefined | null): value is T => Boolean(value);\n\nconst toCorsOrigin = (value: string) => {\n try {\n return new URL(value).origin;\n } catch {\n return value.replace(/\\/+$/, '');\n }\n};\n\nexport const parseCorsOrigins = (origins?: string) =>\n parseList(origins).map(toCorsOrigin);\n\nconst validateCorsOriginPattern = (pattern: string) => {\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new Error(`CORS pattern exceeds maximum length of ${MAX_PATTERN_LENGTH}`);\n }\n\n // Prefer short, anchored patterns and avoid other complex regex features even if they pass this check.\n if (SUSPICIOUS_QUANTIFIER_PATTERN.test(pattern)) {\n throw new Error(\"CORS pattern contains nested or ambiguous quantifiers\");\n }\n\n return pattern;\n};\n\n// Patterns are operator-controlled and matched against bounded URL origins, so ReDoS risk is low.\n// Syntax validation does not guarantee safety; prefer anchored patterns and avoid nested quantifiers.\nexport const parseCorsOriginPatterns = (patterns?: string) =>\n parseList(patterns).map((pattern) => new RegExp(validateCorsOriginPattern(pattern)));\n\nexport const isValidCorsOriginPatternList = (patterns?: string) => {\n try {\n parseCorsOriginPatterns(patterns);\n return true;\n } catch {\n return false;\n }\n};\n\nexport const createCorsOriginMatcher = (env: CorsEnv) => {\n const allowedOrigins = Array.from(new Set([\n ...(env.NODE_ENV === 'production' ? productionOrigins : nonProductionOrigins),\n env.NEXT_PUBLIC_APP_URL ? toCorsOrigin(env.NEXT_PUBLIC_APP_URL) : undefined,\n ...parseCorsOrigins(env.CORS_ALLOWED_ORIGINS),\n ].filter(isDefined)));\n\n const allowedOriginPatterns = [\n vercelAppOriginPattern,\n ...parseCorsOriginPatterns(env.CORS_ALLOWED_ORIGIN_PATTERNS),\n ];\n\n const isAllowedOrigin = (origin?: string) => {\n const corsOrigin = origin ? toCorsOrigin(origin) : undefined;\n\n return Boolean(corsOrigin && (\n allowedOrigins.includes(corsOrigin) ||\n allowedOriginPatterns.some((pattern) => pattern.test(corsOrigin))\n ));\n };\n\n return {\n allowedOrigins,\n allowedOriginPatterns,\n isAllowedOrigin,\n };\n};\n"],"names":[],"mappings":";;AAOA,MAAM,iBAAiB,GAAG;IACxB,yBAAyB;IACzB,qBAAqB;IACrB,yBAAyB;IACzB,6BAA6B;CAC9B,CAAC;AAEF,MAAM,oBAAoB,GAAG;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;CACxB,CAAC;AAE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AAC,QAAQ,CAAC,UAAU,CAAC;YACnC,qBAAqB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAClE,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,cAAc;QACd,qBAAqB;QACrB,eAAe;KAChB,CAAC;AACJ,CAAC,CAAC","debug_id":"fed6d0aa-55db-5889-9721-82cba71f1d3b"}
@@ -1,6 +1,10 @@
1
1
  export declare const commentSelect: {
2
2
  readonly id: true;
3
3
  readonly content: true;
4
+ readonly announcementId: true;
5
+ readonly assignmentId: true;
6
+ readonly submissionId: true;
7
+ readonly parentCommentId: true;
4
8
  readonly createdAt: true;
5
9
  readonly modifiedAt: true;
6
10
  readonly author: {
@@ -38,6 +42,9 @@ export declare const commentSelect: {
38
42
  /** @returns Comment by ID with author and reactions. */
39
43
  export declare function findCommentById(id: string): import(".prisma/client").Prisma.Prisma__CommentClient<{
40
44
  id: string;
45
+ assignmentId: string | null;
46
+ submissionId: string | null;
47
+ announcementId: string | null;
41
48
  reactions: {
42
49
  type: import(".prisma/client").$Enums.ReactionType;
43
50
  user: {
@@ -53,6 +60,7 @@ export declare function findCommentById(id: string): import(".prisma/client").Pr
53
60
  createdAt: Date;
54
61
  modifiedAt: Date | null;
55
62
  content: string;
63
+ parentCommentId: string | null;
56
64
  author: {
57
65
  id: string;
58
66
  username: string;
@@ -83,6 +91,8 @@ export declare function findRepliesByCommentId(commentId: string): import(".pris
83
91
  } & {
84
92
  status: import(".prisma/client").$Enums.GenerationStatus | null;
85
93
  id: string;
94
+ assignmentId: string | null;
95
+ submissionId: string | null;
86
96
  announcementId: string | null;
87
97
  createdAt: Date;
88
98
  modifiedAt: Date | null;
@@ -96,9 +106,15 @@ export declare function createComment(data: {
96
106
  parentCommentId: string;
97
107
  content: string;
98
108
  authorId: string;
109
+ announcementId?: string | null;
110
+ assignmentId?: string | null;
111
+ submissionId?: string | null;
112
+ studentQuestionProgressId?: string | null;
99
113
  }): import(".prisma/client").Prisma.Prisma__CommentClient<{
100
114
  status: import(".prisma/client").$Enums.GenerationStatus | null;
101
115
  id: string;
116
+ assignmentId: string | null;
117
+ submissionId: string | null;
102
118
  announcementId: string | null;
103
119
  createdAt: Date;
104
120
  modifiedAt: Date | null;
@@ -180,6 +196,153 @@ export declare function findCommentWithAnnouncement(commentId: string): import("
180
196
  } & {
181
197
  status: import(".prisma/client").$Enums.GenerationStatus | null;
182
198
  id: string;
199
+ assignmentId: string | null;
200
+ submissionId: string | null;
201
+ announcementId: string | null;
202
+ createdAt: Date;
203
+ modifiedAt: Date | null;
204
+ content: string;
205
+ authorId: string;
206
+ parentCommentId: string | null;
207
+ studentQuestionProgressId: string | null;
208
+ }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
209
+ datasources: {
210
+ db: {
211
+ url: string;
212
+ };
213
+ };
214
+ }>;
215
+ /** @returns Comment with the owning class context for authorization. */
216
+ export declare function findCommentWithContext(commentId: string): import(".prisma/client").Prisma.Prisma__CommentClient<({
217
+ studentQuestionProgress: {
218
+ studentId: string;
219
+ studentWorksheetResponse: {
220
+ submission: {
221
+ studentId: string;
222
+ assignment: {
223
+ class: {
224
+ id: string;
225
+ students: {
226
+ id: string;
227
+ }[];
228
+ teachers: {
229
+ id: string;
230
+ }[];
231
+ };
232
+ };
233
+ } | null;
234
+ } | null;
235
+ } | null;
236
+ submission: {
237
+ studentId: string;
238
+ assignment: {
239
+ class: {
240
+ id: string;
241
+ students: {
242
+ id: string;
243
+ }[];
244
+ teachers: {
245
+ id: string;
246
+ }[];
247
+ };
248
+ };
249
+ } | null;
250
+ assignment: {
251
+ class: {
252
+ id: string;
253
+ students: {
254
+ id: string;
255
+ }[];
256
+ teachers: {
257
+ id: string;
258
+ }[];
259
+ };
260
+ } | null;
261
+ announcement: {
262
+ class: {
263
+ id: string;
264
+ students: {
265
+ id: string;
266
+ }[];
267
+ teachers: {
268
+ id: string;
269
+ }[];
270
+ };
271
+ } | null;
272
+ parentComment: ({
273
+ studentQuestionProgress: {
274
+ studentId: string;
275
+ studentWorksheetResponse: {
276
+ submission: {
277
+ studentId: string;
278
+ assignment: {
279
+ class: {
280
+ id: string;
281
+ students: {
282
+ id: string;
283
+ }[];
284
+ teachers: {
285
+ id: string;
286
+ }[];
287
+ };
288
+ };
289
+ } | null;
290
+ } | null;
291
+ } | null;
292
+ submission: {
293
+ studentId: string;
294
+ assignment: {
295
+ class: {
296
+ id: string;
297
+ students: {
298
+ id: string;
299
+ }[];
300
+ teachers: {
301
+ id: string;
302
+ }[];
303
+ };
304
+ };
305
+ } | null;
306
+ assignment: {
307
+ class: {
308
+ id: string;
309
+ students: {
310
+ id: string;
311
+ }[];
312
+ teachers: {
313
+ id: string;
314
+ }[];
315
+ };
316
+ } | null;
317
+ announcement: {
318
+ class: {
319
+ id: string;
320
+ students: {
321
+ id: string;
322
+ }[];
323
+ teachers: {
324
+ id: string;
325
+ }[];
326
+ };
327
+ } | null;
328
+ } & {
329
+ status: import(".prisma/client").$Enums.GenerationStatus | null;
330
+ id: string;
331
+ assignmentId: string | null;
332
+ submissionId: string | null;
333
+ announcementId: string | null;
334
+ createdAt: Date;
335
+ modifiedAt: Date | null;
336
+ content: string;
337
+ authorId: string;
338
+ parentCommentId: string | null;
339
+ studentQuestionProgressId: string | null;
340
+ }) | null;
341
+ } & {
342
+ status: import(".prisma/client").$Enums.GenerationStatus | null;
343
+ id: string;
344
+ assignmentId: string | null;
345
+ submissionId: string | null;
183
346
  announcementId: string | null;
184
347
  createdAt: Date;
185
348
  modifiedAt: Date | null;
@@ -1 +1 @@
1
- {"version":3,"file":"comment.d.ts","sourceRoot":"/","sources":["models/comment.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoChB,CAAC;AAEX,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;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EAAE;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,yBAAyB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;;;;;;;;;;;;;;;;;;GAIA;AAED,6CAA6C;AAC7C,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;GAM7E;AAED,2CAA2C;AAC3C,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;;;;;;GA0BA;AAED,yBAAyB;AACzB,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;GAI5C;AAED,kDAAkD;AAClD,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;GAO5D;AAED,wEAAwE;AACxE,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwIvD;AAED,sDAAsD;AACtD,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM;;;;;;;;GAM7D"}
@@ -1,12 +1,16 @@
1
1
  /**
2
- * Comment model – comments, replies, and reactions (for announcements/worksheets).
2
+ * Comment model – comments, replies, and reactions.
3
3
  */
4
4
 
5
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ca426704-cab3-590c-bf53-62a421ec814d")}catch(e){}}();
5
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f7121ae4-2705-5c41-8439-e02632b5f35c")}catch(e){}}();
6
6
  import { prisma } from "../lib/prisma.js";
7
7
  export const commentSelect = {
8
8
  id: true,
9
9
  content: true,
10
+ announcementId: true,
11
+ assignmentId: true,
12
+ submissionId: true,
13
+ parentCommentId: true,
10
14
  createdAt: true,
11
15
  modifiedAt: true,
12
16
  author: {
@@ -126,6 +130,144 @@ export function findCommentWithAnnouncement(commentId) {
126
130
  },
127
131
  });
128
132
  }
133
+ /** @returns Comment with the owning class context for authorization. */
134
+ export function findCommentWithContext(commentId) {
135
+ return prisma.comment.findUnique({
136
+ where: { id: commentId },
137
+ include: {
138
+ announcement: {
139
+ select: {
140
+ class: {
141
+ select: {
142
+ id: true,
143
+ teachers: { select: { id: true } },
144
+ students: { select: { id: true } },
145
+ },
146
+ },
147
+ },
148
+ },
149
+ assignment: {
150
+ select: {
151
+ class: {
152
+ select: {
153
+ id: true,
154
+ teachers: { select: { id: true } },
155
+ students: { select: { id: true } },
156
+ },
157
+ },
158
+ },
159
+ },
160
+ submission: {
161
+ select: {
162
+ studentId: true,
163
+ assignment: {
164
+ select: {
165
+ class: {
166
+ select: {
167
+ id: true,
168
+ teachers: { select: { id: true } },
169
+ students: { select: { id: true } },
170
+ },
171
+ },
172
+ },
173
+ },
174
+ },
175
+ },
176
+ studentQuestionProgress: {
177
+ select: {
178
+ studentId: true,
179
+ studentWorksheetResponse: {
180
+ select: {
181
+ submission: {
182
+ select: {
183
+ studentId: true,
184
+ assignment: {
185
+ select: {
186
+ class: {
187
+ select: {
188
+ id: true,
189
+ teachers: { select: { id: true } },
190
+ students: { select: { id: true } },
191
+ },
192
+ },
193
+ },
194
+ },
195
+ },
196
+ },
197
+ },
198
+ },
199
+ },
200
+ },
201
+ parentComment: {
202
+ include: {
203
+ announcement: {
204
+ select: {
205
+ class: {
206
+ select: {
207
+ id: true,
208
+ teachers: { select: { id: true } },
209
+ students: { select: { id: true } },
210
+ },
211
+ },
212
+ },
213
+ },
214
+ assignment: {
215
+ select: {
216
+ class: {
217
+ select: {
218
+ id: true,
219
+ teachers: { select: { id: true } },
220
+ students: { select: { id: true } },
221
+ },
222
+ },
223
+ },
224
+ },
225
+ submission: {
226
+ select: {
227
+ studentId: true,
228
+ assignment: {
229
+ select: {
230
+ class: {
231
+ select: {
232
+ id: true,
233
+ teachers: { select: { id: true } },
234
+ students: { select: { id: true } },
235
+ },
236
+ },
237
+ },
238
+ },
239
+ },
240
+ },
241
+ studentQuestionProgress: {
242
+ select: {
243
+ studentId: true,
244
+ studentWorksheetResponse: {
245
+ select: {
246
+ submission: {
247
+ select: {
248
+ studentId: true,
249
+ assignment: {
250
+ select: {
251
+ class: {
252
+ select: {
253
+ id: true,
254
+ teachers: { select: { id: true } },
255
+ students: { select: { id: true } },
256
+ },
257
+ },
258
+ },
259
+ },
260
+ },
261
+ },
262
+ },
263
+ },
264
+ },
265
+ },
266
+ },
267
+ },
268
+ },
269
+ });
270
+ }
129
271
  /** @returns Reaction counts by type for a comment. */
130
272
  export function getReactionCountsByCommentId(commentId) {
131
273
  return prisma.reaction.groupBy({
@@ -135,4 +277,4 @@ export function getReactionCountsByCommentId(commentId) {
135
277
  });
136
278
  }
137
279
  //# sourceMappingURL=comment.js.map
138
- //# debugId=ca426704-cab3-590c-bf53-62a421ec814d
280
+ //# debugId=f7121ae4-2705-5c41-8439-e02632b5f35c
@@ -1 +1 @@
1
- {"version":3,"file":"comment.js","sources":["models/comment.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Comment model – comments, replies, and reactions (for announcements/worksheets).\n */\nimport { prisma } from \"../lib/prisma.js\";\nimport type { ReactionType } from \"@prisma/client\";\n\nexport const commentSelect = {\n id: true,\n content: true,\n createdAt: true,\n modifiedAt: true,\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n reactions: {\n select: {\n type: true,\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n} as const;\n\n/** @returns Comment by ID with author and reactions. */\nexport function findCommentById(id: string) {\n return prisma.comment.findUnique({\n where: { id },\n select: commentSelect,\n });\n}\n\n/** @returns Replies to a comment. */\nexport function findRepliesByCommentId(commentId: string) {\n return prisma.comment.findMany({\n where: { parentCommentId: commentId },\n include: {\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Create a comment (reply). */\nexport function createComment(data: {\n parentCommentId: string;\n content: string;\n authorId: string;\n}) {\n return prisma.comment.create({\n data,\n });\n}\n\n/** @returns User's reaction on a comment. */\nexport function findReactionByUserAndComment(userId: string, commentId: string) {\n return prisma.reaction.findUnique({\n where: {\n userId_commentId: { userId, commentId },\n },\n });\n}\n\n/** Add or update reaction on a comment. */\nexport function upsertReaction(data: {\n userId: string;\n commentId: string;\n type: string;\n}) {\n return prisma.reaction.upsert({\n where: {\n userId_commentId: {\n userId: data.userId,\n commentId: data.commentId,\n },\n },\n update: { type: data.type as ReactionType },\n create: { ...data, type: data.type as ReactionType },\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Delete a reaction. */\nexport function deleteReactionById(id: string) {\n return prisma.reaction.delete({\n where: { id },\n });\n}\n\n/** @returns Comment with announcement classId. */\nexport function findCommentWithAnnouncement(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: { select: { classId: true } },\n },\n });\n}\n\n/** @returns Reaction counts by type for a comment. */\nexport function getReactionCountsByCommentId(commentId: string) {\n return prisma.reaction.groupBy({\n by: [\"type\"],\n where: { commentId },\n _count: { type: true },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE;QACN,MAAM,EAAE;YACN,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,MAAM,EAAE;oBACN,WAAW,EAAE,IAAI;oBACjB,cAAc,EAAE,IAAI;oBACpB,uBAAuB,EAAE,IAAI;iBAC9B;aACF;SACF;KACF;IACD,SAAS,EAAE;QACT,MAAM,EAAE;YACN,IAAI,EAAE,IAAI;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI;oBACR,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,MAAM,EAAE;4BACN,WAAW,EAAE,IAAI;4BACjB,cAAc,EAAE,IAAI;4BACpB,uBAAuB,EAAE,IAAI;yBAC9B;qBACF;iBACF;aACF;SACF;KACF;CACO,CAAC;AAEX,wDAAwD;AACxD,MAAM,UAAU,eAAe,CAAC,EAAU;IACxC,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;QAC/B,KAAK,EAAE,EAAE,EAAE,EAAE;QACb,MAAM,EAAE,aAAa;KACtB,CAAC,CAAC;AACL,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,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AAE;wBACP,MAAM,EAAE;4BACN,WAAW,EAAE,IAAI;4BACjB,cAAc,EAAE,IAAI;4BACpB,uBAAuB,EAAE,IAAI;yBAC9B;qBACF;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,yBAAyB;AACzB,MAAM,UAAU,kBAAkB,CAAC,EAAU;IAC3C,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC5B,KAAK,EAAE,EAAE,EAAE,EAAE;KACd,CAAC,CAAC;AACL,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,2BAA2B,CAAC,SAAiB;IAC3D,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;QAC/B,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE;QACxB,OAAO,EAAE;YACP,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;SAC5C;KACF,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC7B,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,KAAK,EAAE,EAAE,SAAS,EAAE;QACpB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KACvB,CAAC,CAAC;AACL,CAAC","debug_id":"ca426704-cab3-590c-bf53-62a421ec814d"}
1
+ {"version":3,"file":"comment.js","sources":["models/comment.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Comment model – comments, replies, and reactions.\n */\nimport { prisma } from \"../lib/prisma.js\";\nimport type { ReactionType } from \"@prisma/client\";\n\nexport const commentSelect = {\n id: true,\n content: true,\n announcementId: true,\n assignmentId: true,\n submissionId: true,\n parentCommentId: true,\n createdAt: true,\n modifiedAt: true,\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n reactions: {\n select: {\n type: true,\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n} as const;\n\n/** @returns Comment by ID with author and reactions. */\nexport function findCommentById(id: string) {\n return prisma.comment.findUnique({\n where: { id },\n select: commentSelect,\n });\n}\n\n/** @returns Replies to a comment. */\nexport function findRepliesByCommentId(commentId: string) {\n return prisma.comment.findMany({\n where: { parentCommentId: commentId },\n include: {\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Create a comment (reply). */\nexport function createComment(data: {\n parentCommentId: string;\n content: string;\n authorId: string;\n announcementId?: string | null;\n assignmentId?: string | null;\n submissionId?: string | null;\n studentQuestionProgressId?: string | null;\n}) {\n return prisma.comment.create({\n data,\n });\n}\n\n/** @returns User's reaction on a comment. */\nexport function findReactionByUserAndComment(userId: string, commentId: string) {\n return prisma.reaction.findUnique({\n where: {\n userId_commentId: { userId, commentId },\n },\n });\n}\n\n/** Add or update reaction on a comment. */\nexport function upsertReaction(data: {\n userId: string;\n commentId: string;\n type: string;\n}) {\n return prisma.reaction.upsert({\n where: {\n userId_commentId: {\n userId: data.userId,\n commentId: data.commentId,\n },\n },\n update: { type: data.type as ReactionType },\n create: { ...data, type: data.type as ReactionType },\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Delete a reaction. */\nexport function deleteReactionById(id: string) {\n return prisma.reaction.delete({\n where: { id },\n });\n}\n\n/** @returns Comment with announcement classId. */\nexport function findCommentWithAnnouncement(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: { select: { classId: true } },\n },\n });\n}\n\n/** @returns Comment with the owning class context for authorization. */\nexport function findCommentWithContext(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: {\n select: {\n class: {\n select: {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n },\n },\n },\n },\n assignment: {\n select: {\n class: {\n select: {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n },\n },\n },\n },\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n },\n },\n },\n },\n },\n },\n studentQuestionProgress: {\n select: {\n studentId: true,\n studentWorksheetResponse: {\n select: {\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n parentComment: {\n include: {\n announcement: {\n select: {\n class: {\n select: {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n },\n },\n },\n },\n assignment: {\n select: {\n class: {\n select: {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n },\n },\n },\n },\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n },\n },\n },\n },\n },\n },\n studentQuestionProgress: {\n select: {\n studentId: true,\n studentWorksheetResponse: {\n select: {\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n });\n}\n\n/** @returns Reaction counts by type for a comment. */\nexport function getReactionCountsByCommentId(commentId: string) {\n return prisma.reaction.groupBy({\n by: [\"type\"],\n where: { commentId },\n _count: { type: true },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,CAAC,MAAM,aAAa,G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gCACV,MAAM,EAAE;oCACN,KAAK,EAAE;wCACL,MAAM,EAAE;4CACN,EAAE,EAAE,IAAI;4CACR,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;4CAClC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;yCACnC;qCACF;iCACF;6BACF;yBACF;qBACF;oBACD,uBAAuB,EAAE;wBACvB,MAAM,EAAE;4BACN,SAAS,EAAE,IAAI;4BACf,wBAAwB,EAAE;gCACxB,MAAM,EAAE;oCACN,UAAU,EAAE;wCACV,MAAM,EAAE;4CACN,SAAS,EAAE,IAAI;4CACf,UAAU,EAAE;gDACV,MAAM,EAAE;oDACN,KAAK,EAAE;wDACL,MAAM,EAAE;4DACN,EAAE,EAAE,IAAI;4DACR,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;4DAClC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;yDACnC;qDACF;iDACF;6CACF;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC7B,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,KAAK,EAAE,EAAE,SAAS,EAAE;QACpB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KACvB,CAAC,CAAC;AACL,CAAC","debug_id":"f7121ae4-2705-5c41-8439-e02632b5f35c"}
@@ -944,6 +944,8 @@ export declare function createComment(data: {
944
944
  }): import(".prisma/client").Prisma.Prisma__CommentClient<{
945
945
  status: import(".prisma/client").$Enums.GenerationStatus | null;
946
946
  id: string;
947
+ assignmentId: string | null;
948
+ submissionId: string | null;
947
949
  announcementId: string | null;
948
950
  createdAt: Date;
949
951
  modifiedAt: Date | null;
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet.d.ts","sourceRoot":"/","sources":["models/worksheet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAiB9E,mDAAmD;AACnD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQ3C;AAED,0CAA0C;AAC1C,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;GAIlD;AAED,+DAA+D;AAC/D,wBAAgB,+BAA+B,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAWzE;AAED,0DAA0D;AAC1D,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAWrE;AAED,uCAAuC;AACvC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;MAQtD;AAED,mEAAmE;AACnE,wBAAgB,mCAAmC,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;GAO7E;AAED,yDAAyD;AACzD,wBAAgB,oCAAoC,CAClD,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM;;;;;;;;;;;;;;;;;;GAKpB;AAED,0BAA0B;AAC1B,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;GAItE;AAED,6BAA6B;AAC7B,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAA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f,aAAa,UAAU,EAAE,EACzB,OAAO,IAAI,EAAE,EACb,UAAU,OAAO,EAAE,KAClB,MAYF,CAAC;AAIF;;;;;;;GAOG;AAoBH;;;GAGG;AACH,eAAO,MAAM,8BAA8B,GACvC,WAAW,MAAM,EACjB,gBAAgB,MAAM,EACtB,gBAAgB,MAAM,EACtB,SAAS,MAAM,KACd,OAAO,CAAC,IAAI,CA0Bd,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,WAAW,MAAM,EACjB,iBAAiB,MAAM,EACvB,cAAc;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KACnD,OAAO,CAAC,IAAI,CAoRd,CAAA"}
@@ -3,7 +3,7 @@
3
3
  * Can create worksheets, sections, assignments, and PDF docs from AI output.
4
4
  */
5
5
 
6
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9e1c8d5f-8cb6-52e4-b180-55ace3db9ca5")}catch(e){}}();
6
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0181f16e-08db-56bd-b00d-d970d94af9d3")}catch(e){}}();
7
7
  import { isAIUser } from "../utils/aiUser.js";
8
8
  import { prisma } from "../lib/prisma.js";
9
9
  import { GenerationStatus } from "@prisma/client";
@@ -15,7 +15,8 @@ import { v4 } from "uuid";
15
15
  import { bucket } from "../lib/googleCloudStorage.js";
16
16
  import { labChatResponseSchema } from "./aiLabChatContract.js";
17
17
  import { buildLabChatResponseMessages } from "./labChatPrompt.js";
18
- const LAB_CHAT_RESPONSE_TIMEOUT_MS = 90000;
18
+ /** Cap model wait time; leave headroom after inference for PDF/GCS/DB within Vercel maxDuration (500s). */
19
+ const LAB_CHAT_RESPONSE_TIMEOUT_MS = 400000;
19
20
  const withTimeout = async (task, timeoutMs, operationName) => {
20
21
  let timeoutHandle;
21
22
  const timeoutPromise = new Promise((_, reject) => {
@@ -527,4 +528,4 @@ export const generateAndSendLabResponse = async (labChatId, _teacherMessage, emi
527
528
  }
528
529
  };
529
530
  //# sourceMappingURL=aiLabChat.js.map
530
- //# debugId=9e1c8d5f-8cb6-52e4-b180-55ace3db9ca5
531
+ //# debugId=0181f16e-08db-56bd-b00d-d970d94af9d3