@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.
- package/dist/context.d.ts +5 -1
- package/dist/lib/activity_human_description.d.ts +13 -0
- package/dist/lib/activity_human_description.js +221 -0
- package/dist/lib/activity_human_description.test.d.ts +1 -0
- package/dist/lib/activity_human_description.test.js +16 -0
- package/dist/lib/activity_log_service.d.ts +87 -0
- package/dist/lib/activity_log_service.js +276 -0
- package/dist/lib/activity_log_service.test.d.ts +1 -0
- package/dist/lib/activity_log_service.test.js +27 -0
- package/dist/lib/ai-session.d.ts +15 -2
- package/dist/lib/ai-session.js +147 -85
- package/dist/lib/constants.d.ts +13 -0
- package/dist/lib/constants.js +12 -0
- package/dist/lib/email.d.ts +11 -0
- package/dist/lib/email.js +193 -0
- package/dist/lib/env.d.ts +13 -0
- package/dist/lib/env.js +16 -0
- package/dist/lib/inference.d.ts +4 -1
- package/dist/lib/inference.js +3 -3
- package/dist/lib/logger.d.ts +4 -4
- package/dist/lib/logger.js +30 -8
- package/dist/lib/notification-service.d.ts +152 -0
- package/dist/lib/notification-service.js +473 -0
- package/dist/lib/notification-service.test.d.ts +1 -0
- package/dist/lib/notification-service.test.js +87 -0
- package/dist/lib/prisma.d.ts +2 -1
- package/dist/lib/prisma.js +5 -1
- package/dist/lib/pusher.d.ts +23 -0
- package/dist/lib/pusher.js +69 -5
- package/dist/lib/retry.d.ts +15 -0
- package/dist/lib/retry.js +37 -0
- package/dist/lib/storage.js +2 -2
- package/dist/lib/stripe.d.ts +9 -0
- package/dist/lib/stripe.js +36 -0
- package/dist/lib/subscription_service.d.ts +37 -0
- package/dist/lib/subscription_service.js +654 -0
- package/dist/lib/usage_service.d.ts +26 -0
- package/dist/lib/usage_service.js +59 -0
- package/dist/lib/worksheet-generation.d.ts +91 -0
- package/dist/lib/worksheet-generation.js +95 -0
- package/dist/lib/worksheet-generation.test.d.ts +1 -0
- package/dist/lib/worksheet-generation.test.js +20 -0
- package/dist/lib/workspace-access.d.ts +18 -0
- package/dist/lib/workspace-access.js +13 -0
- package/dist/routers/_app.d.ts +1349 -253
- package/dist/routers/_app.js +10 -0
- package/dist/routers/admin.d.ts +361 -0
- package/dist/routers/admin.js +633 -0
- package/dist/routers/annotations.d.ts +219 -0
- package/dist/routers/annotations.js +187 -0
- package/dist/routers/auth.d.ts +88 -7
- package/dist/routers/auth.js +339 -19
- package/dist/routers/chat.d.ts +6 -12
- package/dist/routers/copilot.d.ts +199 -0
- package/dist/routers/copilot.js +571 -0
- package/dist/routers/flashcards.d.ts +47 -81
- package/dist/routers/flashcards.js +143 -27
- package/dist/routers/members.d.ts +36 -7
- package/dist/routers/members.js +200 -19
- package/dist/routers/notifications.d.ts +99 -0
- package/dist/routers/notifications.js +127 -0
- package/dist/routers/payment.d.ts +89 -0
- package/dist/routers/payment.js +403 -0
- package/dist/routers/podcast.d.ts +8 -13
- package/dist/routers/podcast.js +54 -31
- package/dist/routers/studyguide.d.ts +1 -29
- package/dist/routers/studyguide.js +80 -71
- package/dist/routers/worksheets.d.ts +105 -38
- package/dist/routers/worksheets.js +258 -68
- package/dist/routers/workspace.d.ts +139 -60
- package/dist/routers/workspace.js +455 -315
- package/dist/scripts/purge-deleted-users.d.ts +1 -0
- package/dist/scripts/purge-deleted-users.js +149 -0
- package/dist/server.js +130 -10
- package/dist/services/flashcard-progress.service.d.ts +18 -66
- package/dist/services/flashcard-progress.service.js +51 -42
- package/dist/trpc.d.ts +20 -21
- package/dist/trpc.js +150 -1
- package/package.json +1 -1
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
export declare const annotations: import("@trpc/server").TRPCBuiltRouter<{
|
|
2
|
+
ctx: import("../context.js").Context;
|
|
3
|
+
meta: object;
|
|
4
|
+
errorShape: {
|
|
5
|
+
data: {
|
|
6
|
+
zodError: string | null;
|
|
7
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
8
|
+
httpStatus: number;
|
|
9
|
+
path?: string;
|
|
10
|
+
stack?: string;
|
|
11
|
+
};
|
|
12
|
+
message: string;
|
|
13
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
14
|
+
};
|
|
15
|
+
transformer: true;
|
|
16
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
17
|
+
listHighlights: import("@trpc/server").TRPCQueryProcedure<{
|
|
18
|
+
input: {
|
|
19
|
+
artifactVersionId: string;
|
|
20
|
+
};
|
|
21
|
+
output: ({
|
|
22
|
+
user: {
|
|
23
|
+
name: string | null;
|
|
24
|
+
id: string;
|
|
25
|
+
profilePicture: {
|
|
26
|
+
meta: import("@prisma/client/runtime/library").JsonValue | null;
|
|
27
|
+
name: string;
|
|
28
|
+
id: string;
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
workspaceId: string | null;
|
|
31
|
+
userId: string | null;
|
|
32
|
+
mimeType: string;
|
|
33
|
+
size: number;
|
|
34
|
+
bucket: string | null;
|
|
35
|
+
objectKey: string | null;
|
|
36
|
+
url: string | null;
|
|
37
|
+
checksum: string | null;
|
|
38
|
+
aiTranscription: import("@prisma/client/runtime/library").JsonValue | null;
|
|
39
|
+
} | null;
|
|
40
|
+
};
|
|
41
|
+
comments: ({
|
|
42
|
+
user: {
|
|
43
|
+
name: string | null;
|
|
44
|
+
id: string;
|
|
45
|
+
profilePicture: {
|
|
46
|
+
meta: import("@prisma/client/runtime/library").JsonValue | null;
|
|
47
|
+
name: string;
|
|
48
|
+
id: string;
|
|
49
|
+
createdAt: Date;
|
|
50
|
+
workspaceId: string | null;
|
|
51
|
+
userId: string | null;
|
|
52
|
+
mimeType: string;
|
|
53
|
+
size: number;
|
|
54
|
+
bucket: string | null;
|
|
55
|
+
objectKey: string | null;
|
|
56
|
+
url: string | null;
|
|
57
|
+
checksum: string | null;
|
|
58
|
+
aiTranscription: import("@prisma/client/runtime/library").JsonValue | null;
|
|
59
|
+
} | null;
|
|
60
|
+
};
|
|
61
|
+
} & {
|
|
62
|
+
id: string;
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt: Date;
|
|
65
|
+
content: string;
|
|
66
|
+
userId: string;
|
|
67
|
+
highlightId: string;
|
|
68
|
+
})[];
|
|
69
|
+
} & {
|
|
70
|
+
id: string;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
userId: string;
|
|
74
|
+
color: string;
|
|
75
|
+
artifactVersionId: string;
|
|
76
|
+
startOffset: number;
|
|
77
|
+
endOffset: number;
|
|
78
|
+
selectedText: string;
|
|
79
|
+
})[];
|
|
80
|
+
meta: object;
|
|
81
|
+
}>;
|
|
82
|
+
createHighlight: import("@trpc/server").TRPCMutationProcedure<{
|
|
83
|
+
input: {
|
|
84
|
+
artifactVersionId: string;
|
|
85
|
+
startOffset: number;
|
|
86
|
+
endOffset: number;
|
|
87
|
+
selectedText: string;
|
|
88
|
+
color?: string | undefined;
|
|
89
|
+
};
|
|
90
|
+
output: {
|
|
91
|
+
user: {
|
|
92
|
+
name: string | null;
|
|
93
|
+
id: string;
|
|
94
|
+
profilePicture: {
|
|
95
|
+
meta: import("@prisma/client/runtime/library").JsonValue | null;
|
|
96
|
+
name: string;
|
|
97
|
+
id: string;
|
|
98
|
+
createdAt: Date;
|
|
99
|
+
workspaceId: string | null;
|
|
100
|
+
userId: string | null;
|
|
101
|
+
mimeType: string;
|
|
102
|
+
size: number;
|
|
103
|
+
bucket: string | null;
|
|
104
|
+
objectKey: string | null;
|
|
105
|
+
url: string | null;
|
|
106
|
+
checksum: string | null;
|
|
107
|
+
aiTranscription: import("@prisma/client/runtime/library").JsonValue | null;
|
|
108
|
+
} | null;
|
|
109
|
+
};
|
|
110
|
+
comments: {
|
|
111
|
+
id: string;
|
|
112
|
+
createdAt: Date;
|
|
113
|
+
updatedAt: Date;
|
|
114
|
+
content: string;
|
|
115
|
+
userId: string;
|
|
116
|
+
highlightId: string;
|
|
117
|
+
}[];
|
|
118
|
+
} & {
|
|
119
|
+
id: string;
|
|
120
|
+
createdAt: Date;
|
|
121
|
+
updatedAt: Date;
|
|
122
|
+
userId: string;
|
|
123
|
+
color: string;
|
|
124
|
+
artifactVersionId: string;
|
|
125
|
+
startOffset: number;
|
|
126
|
+
endOffset: number;
|
|
127
|
+
selectedText: string;
|
|
128
|
+
};
|
|
129
|
+
meta: object;
|
|
130
|
+
}>;
|
|
131
|
+
deleteHighlight: import("@trpc/server").TRPCMutationProcedure<{
|
|
132
|
+
input: {
|
|
133
|
+
highlightId: string;
|
|
134
|
+
};
|
|
135
|
+
output: {
|
|
136
|
+
success: boolean;
|
|
137
|
+
};
|
|
138
|
+
meta: object;
|
|
139
|
+
}>;
|
|
140
|
+
addComment: import("@trpc/server").TRPCMutationProcedure<{
|
|
141
|
+
input: {
|
|
142
|
+
highlightId: string;
|
|
143
|
+
content: string;
|
|
144
|
+
};
|
|
145
|
+
output: {
|
|
146
|
+
user: {
|
|
147
|
+
name: string | null;
|
|
148
|
+
id: string;
|
|
149
|
+
profilePicture: {
|
|
150
|
+
meta: import("@prisma/client/runtime/library").JsonValue | null;
|
|
151
|
+
name: string;
|
|
152
|
+
id: string;
|
|
153
|
+
createdAt: Date;
|
|
154
|
+
workspaceId: string | null;
|
|
155
|
+
userId: string | null;
|
|
156
|
+
mimeType: string;
|
|
157
|
+
size: number;
|
|
158
|
+
bucket: string | null;
|
|
159
|
+
objectKey: string | null;
|
|
160
|
+
url: string | null;
|
|
161
|
+
checksum: string | null;
|
|
162
|
+
aiTranscription: import("@prisma/client/runtime/library").JsonValue | null;
|
|
163
|
+
} | null;
|
|
164
|
+
};
|
|
165
|
+
} & {
|
|
166
|
+
id: string;
|
|
167
|
+
createdAt: Date;
|
|
168
|
+
updatedAt: Date;
|
|
169
|
+
content: string;
|
|
170
|
+
userId: string;
|
|
171
|
+
highlightId: string;
|
|
172
|
+
};
|
|
173
|
+
meta: object;
|
|
174
|
+
}>;
|
|
175
|
+
updateComment: import("@trpc/server").TRPCMutationProcedure<{
|
|
176
|
+
input: {
|
|
177
|
+
commentId: string;
|
|
178
|
+
content: string;
|
|
179
|
+
};
|
|
180
|
+
output: {
|
|
181
|
+
user: {
|
|
182
|
+
name: string | null;
|
|
183
|
+
id: string;
|
|
184
|
+
profilePicture: {
|
|
185
|
+
meta: import("@prisma/client/runtime/library").JsonValue | null;
|
|
186
|
+
name: string;
|
|
187
|
+
id: string;
|
|
188
|
+
createdAt: Date;
|
|
189
|
+
workspaceId: string | null;
|
|
190
|
+
userId: string | null;
|
|
191
|
+
mimeType: string;
|
|
192
|
+
size: number;
|
|
193
|
+
bucket: string | null;
|
|
194
|
+
objectKey: string | null;
|
|
195
|
+
url: string | null;
|
|
196
|
+
checksum: string | null;
|
|
197
|
+
aiTranscription: import("@prisma/client/runtime/library").JsonValue | null;
|
|
198
|
+
} | null;
|
|
199
|
+
};
|
|
200
|
+
} & {
|
|
201
|
+
id: string;
|
|
202
|
+
createdAt: Date;
|
|
203
|
+
updatedAt: Date;
|
|
204
|
+
content: string;
|
|
205
|
+
userId: string;
|
|
206
|
+
highlightId: string;
|
|
207
|
+
};
|
|
208
|
+
meta: object;
|
|
209
|
+
}>;
|
|
210
|
+
deleteComment: import("@trpc/server").TRPCMutationProcedure<{
|
|
211
|
+
input: {
|
|
212
|
+
commentId: string;
|
|
213
|
+
};
|
|
214
|
+
output: {
|
|
215
|
+
success: boolean;
|
|
216
|
+
};
|
|
217
|
+
meta: object;
|
|
218
|
+
}>;
|
|
219
|
+
}>>;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TRPCError } from '@trpc/server';
|
|
3
|
+
import { router, authedProcedure } from '../trpc.js';
|
|
4
|
+
import { notifyStudyGuideCommentAdded } from '../lib/notification-service.js';
|
|
5
|
+
export const annotations = router({
|
|
6
|
+
// List all highlights (with nested comments) for an artifact version
|
|
7
|
+
listHighlights: authedProcedure
|
|
8
|
+
.input(z.object({
|
|
9
|
+
artifactVersionId: z.string(),
|
|
10
|
+
}))
|
|
11
|
+
.query(async ({ ctx, input }) => {
|
|
12
|
+
const highlights = await ctx.db.studyGuideHighlight.findMany({
|
|
13
|
+
where: { artifactVersionId: input.artifactVersionId },
|
|
14
|
+
include: {
|
|
15
|
+
comments: {
|
|
16
|
+
include: {
|
|
17
|
+
user: { select: { id: true, name: true, profilePicture: true } },
|
|
18
|
+
},
|
|
19
|
+
orderBy: { createdAt: 'asc' },
|
|
20
|
+
},
|
|
21
|
+
user: { select: { id: true, name: true, profilePicture: true } },
|
|
22
|
+
},
|
|
23
|
+
orderBy: { startOffset: 'asc' },
|
|
24
|
+
});
|
|
25
|
+
return highlights;
|
|
26
|
+
}),
|
|
27
|
+
// Create a new highlight
|
|
28
|
+
createHighlight: authedProcedure
|
|
29
|
+
.input(z.object({
|
|
30
|
+
artifactVersionId: z.string(),
|
|
31
|
+
startOffset: z.number().int().min(0),
|
|
32
|
+
endOffset: z.number().int().min(0),
|
|
33
|
+
selectedText: z.string().min(1),
|
|
34
|
+
color: z.string().optional(),
|
|
35
|
+
}))
|
|
36
|
+
.mutation(async ({ ctx, input }) => {
|
|
37
|
+
// Verify the artifact version exists
|
|
38
|
+
const version = await ctx.db.artifactVersion.findUnique({
|
|
39
|
+
where: { id: input.artifactVersionId },
|
|
40
|
+
});
|
|
41
|
+
if (!version) {
|
|
42
|
+
throw new TRPCError({ code: 'NOT_FOUND', message: 'Artifact version not found' });
|
|
43
|
+
}
|
|
44
|
+
const highlight = await ctx.db.studyGuideHighlight.create({
|
|
45
|
+
data: {
|
|
46
|
+
artifactVersionId: input.artifactVersionId,
|
|
47
|
+
userId: ctx.session.user.id,
|
|
48
|
+
startOffset: input.startOffset,
|
|
49
|
+
endOffset: input.endOffset,
|
|
50
|
+
selectedText: input.selectedText,
|
|
51
|
+
...(input.color && { color: input.color }),
|
|
52
|
+
},
|
|
53
|
+
include: {
|
|
54
|
+
comments: true,
|
|
55
|
+
user: { select: { id: true, name: true, profilePicture: true } },
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
return highlight;
|
|
59
|
+
}),
|
|
60
|
+
// Delete a highlight (and its comments via cascade)
|
|
61
|
+
deleteHighlight: authedProcedure
|
|
62
|
+
.input(z.object({
|
|
63
|
+
highlightId: z.string(),
|
|
64
|
+
}))
|
|
65
|
+
.mutation(async ({ ctx, input }) => {
|
|
66
|
+
const highlight = await ctx.db.studyGuideHighlight.findUnique({
|
|
67
|
+
where: { id: input.highlightId },
|
|
68
|
+
});
|
|
69
|
+
if (!highlight) {
|
|
70
|
+
throw new TRPCError({ code: 'NOT_FOUND', message: 'Highlight not found' });
|
|
71
|
+
}
|
|
72
|
+
if (highlight.userId !== ctx.session.user.id) {
|
|
73
|
+
throw new TRPCError({ code: 'FORBIDDEN', message: 'You can only delete your own highlights' });
|
|
74
|
+
}
|
|
75
|
+
await ctx.db.studyGuideHighlight.delete({
|
|
76
|
+
where: { id: input.highlightId },
|
|
77
|
+
});
|
|
78
|
+
return { success: true };
|
|
79
|
+
}),
|
|
80
|
+
// Add a comment to a highlight
|
|
81
|
+
addComment: authedProcedure
|
|
82
|
+
.input(z.object({
|
|
83
|
+
highlightId: z.string(),
|
|
84
|
+
content: z.string().min(1),
|
|
85
|
+
}))
|
|
86
|
+
.mutation(async ({ ctx, input }) => {
|
|
87
|
+
const highlight = await ctx.db.studyGuideHighlight.findUnique({
|
|
88
|
+
where: { id: input.highlightId },
|
|
89
|
+
});
|
|
90
|
+
if (!highlight) {
|
|
91
|
+
throw new TRPCError({ code: 'NOT_FOUND', message: 'Highlight not found' });
|
|
92
|
+
}
|
|
93
|
+
const comment = await ctx.db.studyGuideComment.create({
|
|
94
|
+
data: {
|
|
95
|
+
highlightId: input.highlightId,
|
|
96
|
+
userId: ctx.session.user.id,
|
|
97
|
+
content: input.content,
|
|
98
|
+
},
|
|
99
|
+
include: {
|
|
100
|
+
user: { select: { id: true, name: true, profilePicture: true } },
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
const after = await ctx.db.studyGuideHighlight.findUnique({
|
|
104
|
+
where: { id: input.highlightId },
|
|
105
|
+
include: {
|
|
106
|
+
comments: { select: { userId: true } },
|
|
107
|
+
artifactVersion: {
|
|
108
|
+
include: {
|
|
109
|
+
artifact: {
|
|
110
|
+
select: { id: true, title: true, workspaceId: true, type: true },
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
if (after?.artifactVersion?.artifact) {
|
|
117
|
+
const art = after.artifactVersion.artifact;
|
|
118
|
+
const recipientIds = new Set();
|
|
119
|
+
if (after.userId !== ctx.session.user.id) {
|
|
120
|
+
recipientIds.add(after.userId);
|
|
121
|
+
}
|
|
122
|
+
for (const c of after.comments) {
|
|
123
|
+
if (c.userId !== ctx.session.user.id) {
|
|
124
|
+
recipientIds.add(c.userId);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const authorName = comment.user.name?.trim() || 'Someone';
|
|
128
|
+
await notifyStudyGuideCommentAdded(ctx.db, {
|
|
129
|
+
authorUserId: ctx.session.user.id,
|
|
130
|
+
authorName,
|
|
131
|
+
content: input.content,
|
|
132
|
+
highlightId: input.highlightId,
|
|
133
|
+
commentId: comment.id,
|
|
134
|
+
workspaceId: art.workspaceId,
|
|
135
|
+
artifactId: art.id,
|
|
136
|
+
artifactTitle: art.title,
|
|
137
|
+
recipientUserIds: [...recipientIds],
|
|
138
|
+
}).catch(() => { });
|
|
139
|
+
}
|
|
140
|
+
return comment;
|
|
141
|
+
}),
|
|
142
|
+
// Update a comment
|
|
143
|
+
updateComment: authedProcedure
|
|
144
|
+
.input(z.object({
|
|
145
|
+
commentId: z.string(),
|
|
146
|
+
content: z.string().min(1),
|
|
147
|
+
}))
|
|
148
|
+
.mutation(async ({ ctx, input }) => {
|
|
149
|
+
const comment = await ctx.db.studyGuideComment.findUnique({
|
|
150
|
+
where: { id: input.commentId },
|
|
151
|
+
});
|
|
152
|
+
if (!comment) {
|
|
153
|
+
throw new TRPCError({ code: 'NOT_FOUND', message: 'Comment not found' });
|
|
154
|
+
}
|
|
155
|
+
if (comment.userId !== ctx.session.user.id) {
|
|
156
|
+
throw new TRPCError({ code: 'FORBIDDEN', message: 'You can only edit your own comments' });
|
|
157
|
+
}
|
|
158
|
+
const updated = await ctx.db.studyGuideComment.update({
|
|
159
|
+
where: { id: input.commentId },
|
|
160
|
+
data: { content: input.content },
|
|
161
|
+
include: {
|
|
162
|
+
user: { select: { id: true, name: true, profilePicture: true } },
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
return updated;
|
|
166
|
+
}),
|
|
167
|
+
// Delete a comment
|
|
168
|
+
deleteComment: authedProcedure
|
|
169
|
+
.input(z.object({
|
|
170
|
+
commentId: z.string(),
|
|
171
|
+
}))
|
|
172
|
+
.mutation(async ({ ctx, input }) => {
|
|
173
|
+
const comment = await ctx.db.studyGuideComment.findUnique({
|
|
174
|
+
where: { id: input.commentId },
|
|
175
|
+
});
|
|
176
|
+
if (!comment) {
|
|
177
|
+
throw new TRPCError({ code: 'NOT_FOUND', message: 'Comment not found' });
|
|
178
|
+
}
|
|
179
|
+
if (comment.userId !== ctx.session.user.id) {
|
|
180
|
+
throw new TRPCError({ code: 'FORBIDDEN', message: 'You can only delete your own comments' });
|
|
181
|
+
}
|
|
182
|
+
await ctx.db.studyGuideComment.delete({
|
|
183
|
+
where: { id: input.commentId },
|
|
184
|
+
});
|
|
185
|
+
return { success: true };
|
|
186
|
+
}),
|
|
187
|
+
});
|
package/dist/routers/auth.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
export declare const auth: 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: {
|
|
@@ -30,6 +24,17 @@ export declare const auth: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
30
24
|
};
|
|
31
25
|
meta: object;
|
|
32
26
|
}>;
|
|
27
|
+
changePassword: import("@trpc/server").TRPCMutationProcedure<{
|
|
28
|
+
input: {
|
|
29
|
+
currentPassword: string;
|
|
30
|
+
newPassword: string;
|
|
31
|
+
};
|
|
32
|
+
output: {
|
|
33
|
+
success: boolean;
|
|
34
|
+
message: string;
|
|
35
|
+
};
|
|
36
|
+
meta: object;
|
|
37
|
+
}>;
|
|
33
38
|
uploadProfilePicture: import("@trpc/server").TRPCMutationProcedure<{
|
|
34
39
|
input: void;
|
|
35
40
|
output: {
|
|
@@ -39,6 +44,13 @@ export declare const auth: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
39
44
|
};
|
|
40
45
|
meta: object;
|
|
41
46
|
}>;
|
|
47
|
+
confirmProfileUpdate: import("@trpc/server").TRPCMutationProcedure<{
|
|
48
|
+
input: void;
|
|
49
|
+
output: {
|
|
50
|
+
success: boolean;
|
|
51
|
+
};
|
|
52
|
+
meta: object;
|
|
53
|
+
}>;
|
|
42
54
|
signup: import("@trpc/server").TRPCMutationProcedure<{
|
|
43
55
|
input: {
|
|
44
56
|
name: string;
|
|
@@ -52,6 +64,24 @@ export declare const auth: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
52
64
|
};
|
|
53
65
|
meta: object;
|
|
54
66
|
}>;
|
|
67
|
+
verifyEmail: import("@trpc/server").TRPCMutationProcedure<{
|
|
68
|
+
input: {
|
|
69
|
+
token: string;
|
|
70
|
+
};
|
|
71
|
+
output: {
|
|
72
|
+
success: boolean;
|
|
73
|
+
message: string;
|
|
74
|
+
};
|
|
75
|
+
meta: object;
|
|
76
|
+
}>;
|
|
77
|
+
resendVerification: import("@trpc/server").TRPCMutationProcedure<{
|
|
78
|
+
input: void;
|
|
79
|
+
output: {
|
|
80
|
+
success: boolean;
|
|
81
|
+
message: string;
|
|
82
|
+
};
|
|
83
|
+
meta: object;
|
|
84
|
+
}>;
|
|
55
85
|
login: import("@trpc/server").TRPCMutationProcedure<{
|
|
56
86
|
input: {
|
|
57
87
|
email: string;
|
|
@@ -65,6 +95,33 @@ export declare const auth: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
65
95
|
};
|
|
66
96
|
meta: object;
|
|
67
97
|
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Request a password reset email. Always returns the same message (no email enumeration).
|
|
100
|
+
*/
|
|
101
|
+
requestPasswordReset: import("@trpc/server").TRPCMutationProcedure<{
|
|
102
|
+
input: {
|
|
103
|
+
email: string;
|
|
104
|
+
};
|
|
105
|
+
output: {
|
|
106
|
+
success: true;
|
|
107
|
+
message: string;
|
|
108
|
+
};
|
|
109
|
+
meta: object;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Complete password reset using the token from the email link.
|
|
113
|
+
*/
|
|
114
|
+
resetPassword: import("@trpc/server").TRPCMutationProcedure<{
|
|
115
|
+
input: {
|
|
116
|
+
token: string;
|
|
117
|
+
newPassword: string;
|
|
118
|
+
};
|
|
119
|
+
output: {
|
|
120
|
+
success: boolean;
|
|
121
|
+
message: string;
|
|
122
|
+
};
|
|
123
|
+
meta: object;
|
|
124
|
+
}>;
|
|
68
125
|
getSession: import("@trpc/server").TRPCQueryProcedure<{
|
|
69
126
|
input: void;
|
|
70
127
|
output: {
|
|
@@ -72,10 +129,34 @@ export declare const auth: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
72
129
|
id: string;
|
|
73
130
|
email: string | null;
|
|
74
131
|
name: string | null;
|
|
132
|
+
emailVerified: boolean;
|
|
133
|
+
profilePicture: string | null;
|
|
134
|
+
role: {
|
|
135
|
+
name: string;
|
|
136
|
+
id: string;
|
|
137
|
+
} | null;
|
|
75
138
|
};
|
|
76
139
|
};
|
|
77
140
|
meta: object;
|
|
78
141
|
}>;
|
|
142
|
+
requestAccountDeletion: import("@trpc/server").TRPCMutationProcedure<{
|
|
143
|
+
input: void;
|
|
144
|
+
output: {
|
|
145
|
+
success: boolean;
|
|
146
|
+
message: string;
|
|
147
|
+
};
|
|
148
|
+
meta: object;
|
|
149
|
+
}>;
|
|
150
|
+
restoreAccount: import("@trpc/server").TRPCMutationProcedure<{
|
|
151
|
+
input: {
|
|
152
|
+
token: string;
|
|
153
|
+
};
|
|
154
|
+
output: {
|
|
155
|
+
success: boolean;
|
|
156
|
+
message: string;
|
|
157
|
+
};
|
|
158
|
+
meta: object;
|
|
159
|
+
}>;
|
|
79
160
|
logout: import("@trpc/server").TRPCMutationProcedure<{
|
|
80
161
|
input: void;
|
|
81
162
|
output: {
|