@goscribe/server 1.0.11 → 1.1.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.
- package/ANALYSIS_PROGRESS_SPEC.md +463 -0
- package/PROGRESS_QUICK_REFERENCE.md +239 -0
- package/dist/lib/ai-session.d.ts +20 -9
- package/dist/lib/ai-session.js +316 -80
- package/dist/lib/auth.d.ts +35 -2
- package/dist/lib/auth.js +88 -15
- package/dist/lib/env.d.ts +32 -0
- package/dist/lib/env.js +46 -0
- package/dist/lib/errors.d.ts +33 -0
- package/dist/lib/errors.js +78 -0
- package/dist/lib/inference.d.ts +4 -1
- package/dist/lib/inference.js +9 -11
- package/dist/lib/logger.d.ts +62 -0
- package/dist/lib/logger.js +342 -0
- package/dist/lib/podcast-prompts.d.ts +43 -0
- package/dist/lib/podcast-prompts.js +135 -0
- package/dist/lib/pusher.d.ts +1 -0
- package/dist/lib/pusher.js +14 -2
- package/dist/lib/storage.d.ts +3 -3
- package/dist/lib/storage.js +51 -47
- package/dist/lib/validation.d.ts +51 -0
- package/dist/lib/validation.js +64 -0
- package/dist/routers/_app.d.ts +697 -111
- package/dist/routers/_app.js +5 -0
- package/dist/routers/auth.d.ts +11 -1
- package/dist/routers/chat.d.ts +11 -1
- package/dist/routers/flashcards.d.ts +205 -6
- package/dist/routers/flashcards.js +144 -66
- package/dist/routers/members.d.ts +165 -0
- package/dist/routers/members.js +531 -0
- package/dist/routers/podcast.d.ts +78 -63
- package/dist/routers/podcast.js +330 -393
- package/dist/routers/studyguide.d.ts +11 -1
- package/dist/routers/worksheets.d.ts +124 -13
- package/dist/routers/worksheets.js +123 -50
- package/dist/routers/workspace.d.ts +213 -26
- package/dist/routers/workspace.js +303 -181
- package/dist/server.js +12 -4
- package/dist/services/flashcard-progress.service.d.ts +183 -0
- package/dist/services/flashcard-progress.service.js +383 -0
- package/dist/services/flashcard.service.d.ts +183 -0
- package/dist/services/flashcard.service.js +224 -0
- package/dist/services/podcast-segment-reorder.d.ts +0 -0
- package/dist/services/podcast-segment-reorder.js +107 -0
- package/dist/services/podcast.service.d.ts +0 -0
- package/dist/services/podcast.service.js +326 -0
- package/dist/services/worksheet.service.d.ts +0 -0
- package/dist/services/worksheet.service.js +295 -0
- package/dist/trpc.d.ts +13 -2
- package/dist/trpc.js +55 -6
- package/dist/types/index.d.ts +126 -0
- package/dist/types/index.js +1 -0
- package/package.json +3 -2
- package/prisma/schema.prisma +142 -4
- package/src/lib/ai-session.ts +356 -85
- package/src/lib/auth.ts +113 -19
- package/src/lib/env.ts +59 -0
- package/src/lib/errors.ts +92 -0
- package/src/lib/inference.ts +11 -11
- package/src/lib/logger.ts +405 -0
- package/src/lib/pusher.ts +15 -3
- package/src/lib/storage.ts +56 -51
- package/src/lib/validation.ts +75 -0
- package/src/routers/_app.ts +5 -0
- package/src/routers/chat.ts +2 -23
- package/src/routers/flashcards.ts +108 -24
- package/src/routers/members.ts +586 -0
- package/src/routers/podcast.ts +385 -420
- package/src/routers/worksheets.ts +117 -35
- package/src/routers/workspace.ts +328 -195
- package/src/server.ts +13 -4
- package/src/services/flashcard-progress.service.ts +541 -0
- package/src/trpc.ts +59 -6
- package/src/types/index.ts +165 -0
- package/AUTH_FRONTEND_SPEC.md +0 -21
- package/CHAT_FRONTEND_SPEC.md +0 -474
- package/DATABASE_SETUP.md +0 -165
- package/MEETINGSUMMARY_FRONTEND_SPEC.md +0 -28
- package/PODCAST_FRONTEND_SPEC.md +0 -595
- package/STUDYGUIDE_FRONTEND_SPEC.md +0 -18
- package/WORKSHEETS_FRONTEND_SPEC.md +0 -26
- package/WORKSPACE_FRONTEND_SPEC.md +0 -47
- package/test-ai-integration.js +0 -134
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import type { PrismaClient } from '@prisma/client';
|
|
1
2
|
export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
2
3
|
ctx: {
|
|
3
|
-
db:
|
|
4
|
+
db: PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
4
5
|
session: any;
|
|
5
6
|
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
6
7
|
res: import("express").Response<any, Record<string, any>>;
|
|
7
8
|
cookies: Record<string, string | undefined>;
|
|
8
9
|
};
|
|
9
10
|
meta: object;
|
|
10
|
-
errorShape:
|
|
11
|
+
errorShape: {
|
|
12
|
+
data: {
|
|
13
|
+
zodError: string | null;
|
|
14
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
15
|
+
httpStatus: number;
|
|
16
|
+
path?: string;
|
|
17
|
+
stack?: string;
|
|
18
|
+
};
|
|
19
|
+
message: string;
|
|
20
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
21
|
+
};
|
|
11
22
|
transformer: true;
|
|
12
23
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
13
24
|
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
@@ -20,10 +31,13 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
20
31
|
createdAt: Date;
|
|
21
32
|
updatedAt: Date;
|
|
22
33
|
ownerId: string;
|
|
34
|
+
color: string;
|
|
23
35
|
title: string;
|
|
24
36
|
description: string | null;
|
|
37
|
+
icon: string;
|
|
25
38
|
folderId: string | null;
|
|
26
|
-
|
|
39
|
+
fileBeingAnalyzed: boolean;
|
|
40
|
+
analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
|
|
27
41
|
}[];
|
|
28
42
|
folders: {
|
|
29
43
|
name: string;
|
|
@@ -32,6 +46,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
32
46
|
updatedAt: Date;
|
|
33
47
|
ownerId: string;
|
|
34
48
|
parentId: string | null;
|
|
49
|
+
color: string;
|
|
35
50
|
}[];
|
|
36
51
|
};
|
|
37
52
|
meta: object;
|
|
@@ -47,16 +62,20 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
47
62
|
createdAt: Date;
|
|
48
63
|
updatedAt: Date;
|
|
49
64
|
ownerId: string;
|
|
65
|
+
color: string;
|
|
50
66
|
title: string;
|
|
51
67
|
description: string | null;
|
|
68
|
+
icon: string;
|
|
52
69
|
folderId: string | null;
|
|
53
|
-
|
|
70
|
+
fileBeingAnalyzed: boolean;
|
|
71
|
+
analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
|
|
54
72
|
};
|
|
55
73
|
meta: object;
|
|
56
74
|
}>;
|
|
57
75
|
createFolder: import("@trpc/server").TRPCMutationProcedure<{
|
|
58
76
|
input: {
|
|
59
77
|
name: string;
|
|
78
|
+
color?: string | undefined;
|
|
60
79
|
parentId?: string | undefined;
|
|
61
80
|
};
|
|
62
81
|
output: {
|
|
@@ -66,6 +85,39 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
66
85
|
updatedAt: Date;
|
|
67
86
|
ownerId: string;
|
|
68
87
|
parentId: string | null;
|
|
88
|
+
color: string;
|
|
89
|
+
};
|
|
90
|
+
meta: object;
|
|
91
|
+
}>;
|
|
92
|
+
updateFolder: import("@trpc/server").TRPCMutationProcedure<{
|
|
93
|
+
input: {
|
|
94
|
+
id: string;
|
|
95
|
+
name?: string | undefined;
|
|
96
|
+
color?: string | undefined;
|
|
97
|
+
};
|
|
98
|
+
output: {
|
|
99
|
+
name: string;
|
|
100
|
+
id: string;
|
|
101
|
+
createdAt: Date;
|
|
102
|
+
updatedAt: Date;
|
|
103
|
+
ownerId: string;
|
|
104
|
+
parentId: string | null;
|
|
105
|
+
color: string;
|
|
106
|
+
};
|
|
107
|
+
meta: object;
|
|
108
|
+
}>;
|
|
109
|
+
deleteFolder: import("@trpc/server").TRPCMutationProcedure<{
|
|
110
|
+
input: {
|
|
111
|
+
id: string;
|
|
112
|
+
};
|
|
113
|
+
output: {
|
|
114
|
+
name: string;
|
|
115
|
+
id: string;
|
|
116
|
+
createdAt: Date;
|
|
117
|
+
updatedAt: Date;
|
|
118
|
+
ownerId: string;
|
|
119
|
+
parentId: string | null;
|
|
120
|
+
color: string;
|
|
69
121
|
};
|
|
70
122
|
meta: object;
|
|
71
123
|
}>;
|
|
@@ -81,6 +133,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
81
133
|
updatedAt: Date;
|
|
82
134
|
ownerId: string;
|
|
83
135
|
parentId: string | null;
|
|
136
|
+
color: string;
|
|
84
137
|
} | null;
|
|
85
138
|
uploads: {
|
|
86
139
|
meta: import("@prisma/client/runtime/library").JsonValue | null;
|
|
@@ -105,8 +158,11 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
105
158
|
workspaceId: string;
|
|
106
159
|
type: import("@prisma/client").$Enums.ArtifactType;
|
|
107
160
|
isArchived: boolean;
|
|
161
|
+
generating: boolean;
|
|
162
|
+
generatingMetadata: import("@prisma/client/runtime/library").JsonValue | null;
|
|
108
163
|
difficulty: import("@prisma/client").$Enums.Difficulty | null;
|
|
109
164
|
estimatedTime: string | null;
|
|
165
|
+
imageObjectKey: string | null;
|
|
110
166
|
createdById: string | null;
|
|
111
167
|
}[];
|
|
112
168
|
} & {
|
|
@@ -114,33 +170,24 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
114
170
|
createdAt: Date;
|
|
115
171
|
updatedAt: Date;
|
|
116
172
|
ownerId: string;
|
|
173
|
+
color: string;
|
|
117
174
|
title: string;
|
|
118
175
|
description: string | null;
|
|
176
|
+
icon: string;
|
|
119
177
|
folderId: string | null;
|
|
120
|
-
|
|
178
|
+
fileBeingAnalyzed: boolean;
|
|
179
|
+
analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
|
|
121
180
|
};
|
|
122
181
|
meta: object;
|
|
123
182
|
}>;
|
|
124
|
-
|
|
125
|
-
input:
|
|
126
|
-
id: string;
|
|
127
|
-
};
|
|
128
|
-
output: {
|
|
129
|
-
shareLink: string | null;
|
|
130
|
-
} | undefined;
|
|
131
|
-
meta: object;
|
|
132
|
-
}>;
|
|
133
|
-
join: import("@trpc/server").TRPCMutationProcedure<{
|
|
134
|
-
input: {
|
|
135
|
-
shareLink: string;
|
|
136
|
-
};
|
|
183
|
+
getStats: import("@trpc/server").TRPCQueryProcedure<{
|
|
184
|
+
input: void;
|
|
137
185
|
output: {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
updatedAt: Date;
|
|
186
|
+
workspaces: number;
|
|
187
|
+
folders: number;
|
|
188
|
+
lastUpdated: Date | undefined;
|
|
189
|
+
spaceUsed: number;
|
|
190
|
+
spaceLeft: number;
|
|
144
191
|
};
|
|
145
192
|
meta: object;
|
|
146
193
|
}>;
|
|
@@ -149,16 +196,21 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
149
196
|
id: string;
|
|
150
197
|
name?: string | undefined;
|
|
151
198
|
description?: string | undefined;
|
|
199
|
+
color?: string | undefined;
|
|
200
|
+
icon?: string | undefined;
|
|
152
201
|
};
|
|
153
202
|
output: {
|
|
154
203
|
id: string;
|
|
155
204
|
createdAt: Date;
|
|
156
205
|
updatedAt: Date;
|
|
157
206
|
ownerId: string;
|
|
207
|
+
color: string;
|
|
158
208
|
title: string;
|
|
159
209
|
description: string | null;
|
|
210
|
+
icon: string;
|
|
160
211
|
folderId: string | null;
|
|
161
|
-
|
|
212
|
+
fileBeingAnalyzed: boolean;
|
|
213
|
+
analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
|
|
162
214
|
};
|
|
163
215
|
meta: object;
|
|
164
216
|
}>;
|
|
@@ -181,6 +233,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
181
233
|
updatedAt: Date;
|
|
182
234
|
ownerId: string;
|
|
183
235
|
parentId: string | null;
|
|
236
|
+
color: string;
|
|
184
237
|
};
|
|
185
238
|
parents: {
|
|
186
239
|
name: string;
|
|
@@ -189,6 +242,7 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
189
242
|
updatedAt: Date;
|
|
190
243
|
ownerId: string;
|
|
191
244
|
parentId: string | null;
|
|
245
|
+
color: string;
|
|
192
246
|
}[];
|
|
193
247
|
};
|
|
194
248
|
meta: object;
|
|
@@ -249,11 +303,144 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
249
303
|
createdAt: Date;
|
|
250
304
|
updatedAt: Date;
|
|
251
305
|
ownerId: string;
|
|
306
|
+
color: string;
|
|
252
307
|
title: string;
|
|
253
308
|
description: string | null;
|
|
309
|
+
icon: string;
|
|
254
310
|
folderId: string | null;
|
|
255
|
-
|
|
311
|
+
fileBeingAnalyzed: boolean;
|
|
312
|
+
analysisProgress: import("@prisma/client/runtime/library").JsonValue | null;
|
|
256
313
|
}[];
|
|
257
314
|
meta: object;
|
|
258
315
|
}>;
|
|
316
|
+
members: import("@trpc/server").TRPCBuiltRouter<{
|
|
317
|
+
ctx: {
|
|
318
|
+
db: PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
319
|
+
session: any;
|
|
320
|
+
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
321
|
+
res: import("express").Response<any, Record<string, any>>;
|
|
322
|
+
cookies: Record<string, string | undefined>;
|
|
323
|
+
};
|
|
324
|
+
meta: object;
|
|
325
|
+
errorShape: {
|
|
326
|
+
data: {
|
|
327
|
+
zodError: string | null;
|
|
328
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
329
|
+
httpStatus: number;
|
|
330
|
+
path?: string;
|
|
331
|
+
stack?: string;
|
|
332
|
+
};
|
|
333
|
+
message: string;
|
|
334
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
335
|
+
};
|
|
336
|
+
transformer: true;
|
|
337
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
338
|
+
getMembers: import("@trpc/server").TRPCQueryProcedure<{
|
|
339
|
+
input: {
|
|
340
|
+
workspaceId: string;
|
|
341
|
+
};
|
|
342
|
+
output: ({
|
|
343
|
+
id: string;
|
|
344
|
+
name: string;
|
|
345
|
+
email: string;
|
|
346
|
+
image: string | null;
|
|
347
|
+
role: "admin" | "member";
|
|
348
|
+
joinedAt: Date;
|
|
349
|
+
} | {
|
|
350
|
+
id: string;
|
|
351
|
+
name: string;
|
|
352
|
+
email: string;
|
|
353
|
+
image: string | null;
|
|
354
|
+
role: "owner";
|
|
355
|
+
joinedAt: Date;
|
|
356
|
+
})[];
|
|
357
|
+
meta: object;
|
|
358
|
+
}>;
|
|
359
|
+
getCurrentUserRole: import("@trpc/server").TRPCQueryProcedure<{
|
|
360
|
+
input: {
|
|
361
|
+
workspaceId: string;
|
|
362
|
+
};
|
|
363
|
+
output: "admin" | "member" | "owner";
|
|
364
|
+
meta: object;
|
|
365
|
+
}>;
|
|
366
|
+
inviteMember: import("@trpc/server").TRPCMutationProcedure<{
|
|
367
|
+
input: {
|
|
368
|
+
workspaceId: string;
|
|
369
|
+
email: string;
|
|
370
|
+
role?: "admin" | "member" | undefined;
|
|
371
|
+
};
|
|
372
|
+
output: {
|
|
373
|
+
invitationId: string;
|
|
374
|
+
token: string;
|
|
375
|
+
email: string;
|
|
376
|
+
role: string;
|
|
377
|
+
expiresAt: Date;
|
|
378
|
+
workspaceTitle: string;
|
|
379
|
+
invitedByName: string | null;
|
|
380
|
+
};
|
|
381
|
+
meta: object;
|
|
382
|
+
}>;
|
|
383
|
+
acceptInvite: import("@trpc/server").TRPCMutationProcedure<{
|
|
384
|
+
input: {
|
|
385
|
+
token: string;
|
|
386
|
+
};
|
|
387
|
+
output: {
|
|
388
|
+
workspaceId: string;
|
|
389
|
+
workspaceTitle: string;
|
|
390
|
+
role: string;
|
|
391
|
+
ownerName: string | null;
|
|
392
|
+
};
|
|
393
|
+
meta: object;
|
|
394
|
+
}>;
|
|
395
|
+
changeMemberRole: import("@trpc/server").TRPCMutationProcedure<{
|
|
396
|
+
input: {
|
|
397
|
+
workspaceId: string;
|
|
398
|
+
memberId: string;
|
|
399
|
+
role: "admin" | "member";
|
|
400
|
+
};
|
|
401
|
+
output: {
|
|
402
|
+
memberId: string;
|
|
403
|
+
role: "admin" | "member";
|
|
404
|
+
memberName: string | null;
|
|
405
|
+
message: string;
|
|
406
|
+
};
|
|
407
|
+
meta: object;
|
|
408
|
+
}>;
|
|
409
|
+
removeMember: import("@trpc/server").TRPCMutationProcedure<{
|
|
410
|
+
input: {
|
|
411
|
+
workspaceId: string;
|
|
412
|
+
memberId: string;
|
|
413
|
+
};
|
|
414
|
+
output: {
|
|
415
|
+
memberId: string;
|
|
416
|
+
message: string;
|
|
417
|
+
};
|
|
418
|
+
meta: object;
|
|
419
|
+
}>;
|
|
420
|
+
getPendingInvitations: import("@trpc/server").TRPCQueryProcedure<{
|
|
421
|
+
input: {
|
|
422
|
+
workspaceId: string;
|
|
423
|
+
};
|
|
424
|
+
output: {
|
|
425
|
+
id: string;
|
|
426
|
+
email: string;
|
|
427
|
+
role: string;
|
|
428
|
+
token: string;
|
|
429
|
+
expiresAt: Date;
|
|
430
|
+
createdAt: Date;
|
|
431
|
+
invitedByName: string | null;
|
|
432
|
+
}[];
|
|
433
|
+
meta: object;
|
|
434
|
+
}>;
|
|
435
|
+
cancelInvitation: import("@trpc/server").TRPCMutationProcedure<{
|
|
436
|
+
input: {
|
|
437
|
+
invitationId: string;
|
|
438
|
+
};
|
|
439
|
+
output: {
|
|
440
|
+
invitationId: string;
|
|
441
|
+
message: string;
|
|
442
|
+
};
|
|
443
|
+
meta: object;
|
|
444
|
+
}>;
|
|
445
|
+
}>>;
|
|
259
446
|
}>>;
|