@goscribe/server 1.5.0 → 1.7.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/dist/context.d.ts +14 -1
- package/dist/context.js +23 -2
- package/dist/generated/prisma/client.d.ts +224 -0
- package/dist/generated/prisma/client.js +34 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +941 -0
- package/dist/generated/prisma/commonInputTypes.js +10 -0
- package/dist/generated/prisma/enums.d.ts +67 -0
- package/dist/generated/prisma/enums.js +66 -0
- package/dist/generated/prisma/internal/class.d.ts +539 -0
- package/dist/generated/prisma/internal/class.js +49 -0
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +3924 -0
- package/dist/generated/prisma/internal/prismaNamespace.js +557 -0
- package/dist/generated/prisma/models/ActivityLog.d.ts +1847 -0
- package/dist/generated/prisma/models/ActivityLog.js +1 -0
- package/dist/generated/prisma/models/Artifact.d.ts +2345 -0
- package/dist/generated/prisma/models/Artifact.js +1 -0
- package/dist/generated/prisma/models/ArtifactVersion.d.ts +1550 -0
- package/dist/generated/prisma/models/ArtifactVersion.js +1 -0
- package/dist/generated/prisma/models/Channel.d.ts +1257 -0
- package/dist/generated/prisma/models/Channel.js +1 -0
- package/dist/generated/prisma/models/Chat.d.ts +1339 -0
- package/dist/generated/prisma/models/Chat.js +1 -0
- package/dist/generated/prisma/models/CopilotConversation.d.ts +1450 -0
- package/dist/generated/prisma/models/CopilotConversation.js +1 -0
- package/dist/generated/prisma/models/CopilotMessage.d.ts +1179 -0
- package/dist/generated/prisma/models/CopilotMessage.js +1 -0
- package/dist/generated/prisma/models/FileAsset.d.ts +1832 -0
- package/dist/generated/prisma/models/FileAsset.js +1 -0
- package/dist/generated/prisma/models/Flashcard.d.ts +1460 -0
- package/dist/generated/prisma/models/Flashcard.js +1 -0
- package/dist/generated/prisma/models/FlashcardProgress.d.ts +1782 -0
- package/dist/generated/prisma/models/FlashcardProgress.js +1 -0
- package/dist/generated/prisma/models/Folder.d.ts +1685 -0
- package/dist/generated/prisma/models/Folder.js +1 -0
- package/dist/generated/prisma/models/IdempotencyRecord.d.ts +1319 -0
- package/dist/generated/prisma/models/IdempotencyRecord.js +1 -0
- package/dist/generated/prisma/models/Invoice.d.ts +1586 -0
- package/dist/generated/prisma/models/Invoice.js +1 -0
- package/dist/generated/prisma/models/KnowledgeBase.d.ts +1721 -0
- package/dist/generated/prisma/models/KnowledgeBase.js +1 -0
- package/dist/generated/prisma/models/KnowledgeBaseChunk.d.ts +1333 -0
- package/dist/generated/prisma/models/KnowledgeBaseChunk.js +1 -0
- package/dist/generated/prisma/models/KnowledgeBaseDocument.d.ts +1695 -0
- package/dist/generated/prisma/models/KnowledgeBaseDocument.js +1 -0
- package/dist/generated/prisma/models/Notification.d.ts +1992 -0
- package/dist/generated/prisma/models/Notification.js +1 -0
- package/dist/generated/prisma/models/PasswordResetToken.d.ts +1210 -0
- package/dist/generated/prisma/models/PasswordResetToken.js +1 -0
- package/dist/generated/prisma/models/Plan.d.ts +1431 -0
- package/dist/generated/prisma/models/Plan.js +1 -0
- package/dist/generated/prisma/models/PlanLimit.d.ts +1328 -0
- package/dist/generated/prisma/models/PlanLimit.js +1 -0
- package/dist/generated/prisma/models/PodcastSegment.d.ts +1564 -0
- package/dist/generated/prisma/models/PodcastSegment.js +1 -0
- package/dist/generated/prisma/models/ResourcePrice.d.ts +1008 -0
- package/dist/generated/prisma/models/ResourcePrice.js +1 -0
- package/dist/generated/prisma/models/Role.d.ts +1065 -0
- package/dist/generated/prisma/models/Role.js +1 -0
- package/dist/generated/prisma/models/Session.d.ts +1105 -0
- package/dist/generated/prisma/models/Session.js +1 -0
- package/dist/generated/prisma/models/StripeEvent.d.ts +1081 -0
- package/dist/generated/prisma/models/StripeEvent.js +1 -0
- package/dist/generated/prisma/models/StudyGuideComment.d.ts +1321 -0
- package/dist/generated/prisma/models/StudyGuideComment.js +1 -0
- package/dist/generated/prisma/models/StudyGuideHighlight.d.ts +1629 -0
- package/dist/generated/prisma/models/StudyGuideHighlight.js +1 -0
- package/dist/generated/prisma/models/Subscription.d.ts +1677 -0
- package/dist/generated/prisma/models/Subscription.js +1 -0
- package/dist/generated/prisma/models/User.d.ts +7559 -0
- package/dist/generated/prisma/models/User.js +1 -0
- package/dist/generated/prisma/models/UserCredit.d.ts +1249 -0
- package/dist/generated/prisma/models/UserCredit.js +1 -0
- package/dist/generated/prisma/models/VerificationToken.d.ts +946 -0
- package/dist/generated/prisma/models/VerificationToken.js +1 -0
- package/dist/generated/prisma/models/WorksheetPreset.d.ts +1433 -0
- package/dist/generated/prisma/models/WorksheetPreset.js +1 -0
- package/dist/generated/prisma/models/WorksheetQuestion.d.ts +1491 -0
- package/dist/generated/prisma/models/WorksheetQuestion.js +1 -0
- package/dist/generated/prisma/models/WorksheetQuestionProgress.d.ts +1620 -0
- package/dist/generated/prisma/models/WorksheetQuestionProgress.js +1 -0
- package/dist/generated/prisma/models/Workspace.d.ts +3620 -0
- package/dist/generated/prisma/models/Workspace.js +1 -0
- package/dist/generated/prisma/models/WorkspaceInvitation.d.ts +1490 -0
- package/dist/generated/prisma/models/WorkspaceInvitation.js +1 -0
- package/dist/generated/prisma/models/WorkspaceKnowledgeBase.d.ts +1410 -0
- package/dist/generated/prisma/models/WorkspaceKnowledgeBase.js +1 -0
- package/dist/generated/prisma/models/WorkspaceMember.d.ts +1326 -0
- package/dist/generated/prisma/models/WorkspaceMember.js +1 -0
- package/dist/generated/prisma/models.d.ts +39 -0
- package/dist/generated/prisma/models.js +1 -0
- package/dist/lib/ai/index.d.ts +3 -2
- package/dist/lib/ai/index.js +3 -2
- package/dist/lib/ai/llm-client.d.ts +1 -0
- package/dist/lib/ai/llm-client.js +17 -0
- package/dist/routers/_app.d.ts +40 -80
- package/dist/routers/auth.js +1 -1
- package/dist/routers/flashcards.d.ts +12 -1
- package/dist/routers/payment.d.ts +1 -12
- package/dist/routers/workspace.d.ts +27 -67
- package/dist/routers/workspace.js +1 -0
- package/dist/services/billing/payment.service.d.ts +1 -12
- package/dist/services/billing/payment.service.js +3 -6
- package/dist/services/billing/usage.service.d.ts +30 -10
- package/dist/services/billing/usage.service.js +87 -15
- package/dist/services/content/copilot.service.js +15 -29
- package/dist/services/content/flashcard-progress.service.js +9 -9
- package/dist/services/content/flashcard.service.d.ts +45 -1
- package/dist/services/content/flashcard.service.js +81 -68
- package/dist/services/content/media-analysis.service.js +27 -27
- package/dist/services/content/worksheet-generation.service.test.js +2 -2
- package/dist/services/workspace/workspace.service.d.ts +23 -67
- package/dist/services/workspace/workspace.service.js +69 -62
- package/dist/src/context.d.ts +27 -0
- package/dist/src/context.js +33 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +1 -0
- package/dist/src/lib/ai/config.d.ts +20 -0
- package/dist/src/lib/ai/config.js +31 -0
- package/dist/src/lib/ai/embedding-client.d.ts +8 -0
- package/dist/src/lib/ai/embedding-client.js +30 -0
- package/dist/src/lib/ai/index.d.ts +48 -0
- package/dist/src/lib/ai/index.js +29 -0
- package/dist/src/lib/ai/inference-backend/client.d.ts +28 -0
- package/dist/src/lib/ai/inference-backend/client.js +301 -0
- package/dist/src/lib/ai/inference-backend/mocks.d.ts +12 -0
- package/dist/src/lib/ai/inference-backend/mocks.js +133 -0
- package/dist/src/lib/ai/inference-backend/types.d.ts +44 -0
- package/dist/src/lib/ai/inference-backend/types.js +1 -0
- package/dist/src/lib/ai/json-parse.d.ts +2 -0
- package/dist/src/lib/ai/json-parse.js +34 -0
- package/dist/src/lib/ai/llm-client.d.ts +7 -0
- package/dist/src/lib/ai/llm-client.js +36 -0
- package/dist/src/lib/ai/mock.d.ts +2 -0
- package/dist/src/lib/ai/mock.js +10 -0
- package/dist/src/lib/ai/types.d.ts +9 -0
- package/dist/src/lib/ai/types.js +1 -0
- package/dist/src/lib/auth.d.ts +36 -0
- package/dist/src/lib/auth.js +117 -0
- package/dist/src/lib/chunking.d.ts +19 -0
- package/dist/src/lib/chunking.js +47 -0
- package/dist/src/lib/constants.d.ts +13 -0
- package/dist/src/lib/constants.js +12 -0
- package/dist/src/lib/curated-kb-seed.d.ts +12 -0
- package/dist/src/lib/curated-kb-seed.js +155 -0
- package/dist/src/lib/email.d.ts +11 -0
- package/dist/src/lib/email.js +152 -0
- package/dist/src/lib/embeddings.d.ts +2 -0
- package/dist/src/lib/embeddings.js +1 -0
- package/dist/src/lib/ensure-curated-kb-catalog.d.ts +6 -0
- package/dist/src/lib/ensure-curated-kb-catalog.js +53 -0
- package/dist/src/lib/env.d.ts +41 -0
- package/dist/src/lib/env.js +57 -0
- package/dist/src/lib/errors.d.ts +33 -0
- package/dist/src/lib/errors.js +78 -0
- package/dist/src/lib/file.d.ts +0 -0
- package/dist/src/lib/file.js +1 -0
- package/dist/src/lib/inference.d.ts +1 -0
- package/dist/src/lib/inference.js +1 -0
- package/dist/src/lib/kb-meta.d.ts +8 -0
- package/dist/src/lib/kb-meta.js +77 -0
- package/dist/src/lib/logger.d.ts +62 -0
- package/dist/src/lib/logger.js +364 -0
- package/dist/src/lib/pdf.d.ts +11 -0
- package/dist/src/lib/pdf.js +11 -0
- package/dist/src/lib/prisma.d.ts +3 -0
- package/dist/src/lib/prisma.js +15 -0
- package/dist/src/lib/pusher.d.ts +38 -0
- package/dist/src/lib/pusher.js +170 -0
- package/dist/src/lib/retry.d.ts +15 -0
- package/dist/src/lib/retry.js +37 -0
- package/dist/src/lib/storage.d.ts +11 -0
- package/dist/src/lib/storage.js +71 -0
- package/dist/src/lib/stripe.d.ts +10 -0
- package/dist/src/lib/stripe.js +36 -0
- package/dist/src/lib/validation.d.ts +51 -0
- package/dist/src/lib/validation.js +64 -0
- package/dist/src/lib/workspace-kb.d.ts +5 -0
- package/dist/src/lib/workspace-kb.js +7 -0
- package/dist/src/repositories/artifact.repository.d.ts +64 -0
- package/dist/src/repositories/artifact.repository.js +40 -0
- package/dist/src/repositories/base.repository.d.ts +14 -0
- package/dist/src/repositories/base.repository.js +14 -0
- package/dist/src/repositories/invitation.repository.d.ts +104 -0
- package/dist/src/repositories/invitation.repository.js +44 -0
- package/dist/src/repositories/notification.repository.d.ts +76 -0
- package/dist/src/repositories/notification.repository.js +44 -0
- package/dist/src/repositories/user.repository.d.ts +84 -0
- package/dist/src/repositories/user.repository.js +37 -0
- package/dist/src/repositories/workspace-member.repository.d.ts +35 -0
- package/dist/src/repositories/workspace-member.repository.js +31 -0
- package/dist/src/repositories/workspace.repository.d.ts +101 -0
- package/dist/src/repositories/workspace.repository.js +79 -0
- package/dist/src/routers/_app.d.ts +3464 -0
- package/dist/src/routers/_app.js +36 -0
- package/dist/src/routers/admin.d.ts +358 -0
- package/dist/src/routers/admin.js +105 -0
- package/dist/src/routers/annotations.d.ts +219 -0
- package/dist/src/routers/annotations.js +29 -0
- package/dist/src/routers/artifactVersions.d.ts +65 -0
- package/dist/src/routers/artifactVersions.js +14 -0
- package/dist/src/routers/auth.d.ts +161 -0
- package/dist/src/routers/auth.js +97 -0
- package/dist/src/routers/chat.d.ts +170 -0
- package/dist/src/routers/chat.js +32 -0
- package/dist/src/routers/copilot.d.ts +200 -0
- package/dist/src/routers/copilot.js +52 -0
- package/dist/src/routers/flashcards.d.ts +336 -0
- package/dist/src/routers/flashcards.js +93 -0
- package/dist/src/routers/knowledgeBase.d.ts +421 -0
- package/dist/src/routers/knowledgeBase.js +118 -0
- package/dist/src/routers/members.d.ts +169 -0
- package/dist/src/routers/members.js +47 -0
- package/dist/src/routers/notifications.d.ts +99 -0
- package/dist/src/routers/notifications.js +25 -0
- package/dist/src/routers/payment.d.ts +80 -0
- package/dist/src/routers/payment.js +21 -0
- package/dist/src/routers/podcast.d.ts +287 -0
- package/dist/src/routers/podcast.js +34 -0
- package/dist/src/routers/studyguide.d.ts +36 -0
- package/dist/src/routers/studyguide.js +8 -0
- package/dist/src/routers/worksheets.d.ts +429 -0
- package/dist/src/routers/worksheets.js +139 -0
- package/dist/src/routers/workspace.d.ts +563 -0
- package/dist/src/routers/workspace.js +104 -0
- package/dist/src/scripts/purge-deleted-users.d.ts +1 -0
- package/dist/src/scripts/purge-deleted-users.js +148 -0
- package/dist/src/server.d.ts +1 -0
- package/dist/src/server.js +190 -0
- package/dist/src/services/activity/activity-human-description.service.d.ts +13 -0
- package/dist/src/services/activity/activity-human-description.service.js +221 -0
- package/dist/src/services/activity/activity-human-description.service.test.d.ts +1 -0
- package/dist/src/services/activity/activity-human-description.service.test.js +16 -0
- package/dist/src/services/activity/activity-log.service.d.ts +87 -0
- package/dist/src/services/activity/activity-log.service.js +276 -0
- package/dist/src/services/activity/activity-log.service.test.d.ts +1 -0
- package/dist/src/services/activity/activity-log.service.test.js +27 -0
- package/dist/src/services/admin/admin.service.d.ts +270 -0
- package/dist/src/services/admin/admin.service.js +476 -0
- package/dist/src/services/ai/ai-session.service.d.ts +5 -0
- package/dist/src/services/ai/ai-session.service.js +4 -0
- package/dist/src/services/artifacts/annotation.service.d.ts +177 -0
- package/dist/src/services/artifacts/annotation.service.js +154 -0
- package/dist/src/services/artifacts/artifact-version.service.d.ts +38 -0
- package/dist/src/services/artifacts/artifact-version.service.js +129 -0
- package/dist/src/services/artifacts/chat.service.d.ts +127 -0
- package/dist/src/services/artifacts/chat.service.js +182 -0
- package/dist/src/services/artifacts/study-guide.service.d.ts +18 -0
- package/dist/src/services/artifacts/study-guide.service.js +65 -0
- package/dist/src/services/auth/auth.service.d.ts +94 -0
- package/dist/src/services/auth/auth.service.js +368 -0
- package/dist/src/services/base.service.d.ts +14 -0
- package/dist/src/services/base.service.js +14 -0
- package/dist/src/services/billing/payment.service.d.ts +44 -0
- package/dist/src/services/billing/payment.service.js +365 -0
- package/dist/src/services/billing/subscription.service.d.ts +37 -0
- package/dist/src/services/billing/subscription.service.js +654 -0
- package/dist/src/services/billing/usage.service.d.ts +47 -0
- package/dist/src/services/billing/usage.service.js +149 -0
- package/dist/src/services/content/copilot.service.d.ts +113 -0
- package/dist/src/services/content/copilot.service.js +439 -0
- package/dist/src/services/content/flashcard-progress.service.d.ts +159 -0
- package/dist/src/services/content/flashcard-progress.service.js +432 -0
- package/dist/src/services/content/flashcard.service.d.ts +184 -0
- package/dist/src/services/content/flashcard.service.js +339 -0
- package/dist/src/services/content/media-analysis.service.d.ts +23 -0
- package/dist/src/services/content/media-analysis.service.js +404 -0
- package/dist/src/services/content/podcast.service.d.ts +267 -0
- package/dist/src/services/content/podcast.service.js +653 -0
- package/dist/src/services/content/worksheet-content.service.d.ts +37 -0
- package/dist/src/services/content/worksheet-content.service.js +84 -0
- package/dist/src/services/content/worksheet-content.service.test.d.ts +1 -0
- package/dist/src/services/content/worksheet-content.service.test.js +69 -0
- package/dist/src/services/content/worksheet-generation.service.d.ts +91 -0
- package/dist/src/services/content/worksheet-generation.service.js +95 -0
- package/dist/src/services/content/worksheet-generation.service.test.d.ts +1 -0
- package/dist/src/services/content/worksheet-generation.service.test.js +20 -0
- package/dist/src/services/content/worksheet.service.d.ts +347 -0
- package/dist/src/services/content/worksheet.service.js +599 -0
- package/dist/src/services/knowledge/knowledge-base.service.d.ts +316 -0
- package/dist/src/services/knowledge/knowledge-base.service.js +544 -0
- package/dist/src/services/members/invitation.service.d.ts +66 -0
- package/dist/src/services/members/invitation.service.js +348 -0
- package/dist/src/services/members/member.service.d.ts +36 -0
- package/dist/src/services/members/member.service.js +193 -0
- package/dist/src/services/notifications/notification.service.d.ts +214 -0
- package/dist/src/services/notifications/notification.service.js +550 -0
- package/dist/src/services/notifications/notification.service.test.d.ts +1 -0
- package/dist/src/services/notifications/notification.service.test.js +87 -0
- package/dist/src/services/workspace/workspace-analytics.service.d.ts +24 -0
- package/dist/src/services/workspace/workspace-analytics.service.js +95 -0
- package/dist/src/services/workspace/workspace-kb.service.d.ts +40 -0
- package/dist/src/services/workspace/workspace-kb.service.js +184 -0
- package/dist/src/services/workspace/workspace.service.d.ts +263 -0
- package/dist/src/services/workspace/workspace.service.js +401 -0
- package/dist/src/trpc.d.ts +60 -0
- package/dist/src/trpc.js +217 -0
- package/dist/src/types/index.d.ts +126 -0
- package/dist/src/types/index.js +1 -0
- package/dist/trpc.d.ts +12 -4
- package/dist/trpc.js +5 -11
- package/package.json +8 -9
- package/prisma/schema.prisma +3 -4
- package/prisma/seed.mjs +5 -2
- package/prisma.config.ts +16 -0
- package/src/context.ts +33 -3
- package/src/lib/ai/index.ts +3 -0
- package/src/lib/ai/llm-client.ts +23 -0
- package/src/lib/prisma.ts +18 -9
- package/src/routers/auth.ts +1 -1
- package/src/routers/workspace.ts +4 -0
- package/src/scripts/purge-deleted-users.ts +1 -3
- package/src/services/billing/payment.service.ts +3 -6
- package/src/services/billing/usage.service.ts +190 -77
- package/src/services/content/copilot.service.ts +23 -32
- package/src/services/content/flashcard-progress.service.ts +12 -9
- package/src/services/content/flashcard.service.ts +89 -66
- package/src/services/content/media-analysis.service.ts +34 -29
- package/src/services/content/worksheet-generation.service.test.ts +2 -2
- package/src/services/workspace/workspace.service.ts +73 -66
- package/src/trpc.ts +5 -13
- package/tsconfig.json +3 -0
package/dist/context.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import type { CreateExpressContextOptions } from "@trpc/server/adapters/express";
|
|
2
2
|
import { prisma } from "./lib/prisma.js";
|
|
3
3
|
import cookie from "cookie";
|
|
4
|
+
export type SessionUser = {
|
|
5
|
+
id: string;
|
|
6
|
+
emailVerified: boolean;
|
|
7
|
+
isSystemAdmin: boolean;
|
|
8
|
+
};
|
|
4
9
|
export declare function createContext({ req, res }: CreateExpressContextOptions): Promise<{
|
|
5
10
|
db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
6
|
-
session:
|
|
11
|
+
session: null;
|
|
12
|
+
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
13
|
+
res: import("express").Response<any, Record<string, any>>;
|
|
14
|
+
cookies: cookie.Cookies;
|
|
15
|
+
} | {
|
|
16
|
+
db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
17
|
+
session: {
|
|
18
|
+
user: SessionUser;
|
|
19
|
+
};
|
|
7
20
|
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
8
21
|
res: import("express").Response<any, Record<string, any>>;
|
|
9
22
|
cookies: cookie.Cookies;
|
package/dist/context.js
CHANGED
|
@@ -3,10 +3,31 @@ import { verifyCustomAuthCookie } from "./lib/auth.js";
|
|
|
3
3
|
import cookie from "cookie";
|
|
4
4
|
export async function createContext({ req, res }) {
|
|
5
5
|
const cookies = cookie.parse(req.headers.cookie ?? "");
|
|
6
|
-
// Only use custom auth cookie
|
|
7
6
|
const custom = verifyCustomAuthCookie(cookies["auth_token"]);
|
|
8
7
|
if (custom) {
|
|
9
|
-
|
|
8
|
+
const user = await prisma.user.findUnique({
|
|
9
|
+
where: { id: custom.userId },
|
|
10
|
+
select: {
|
|
11
|
+
id: true,
|
|
12
|
+
emailVerified: true,
|
|
13
|
+
role: { select: { name: true } },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
if (!user) {
|
|
17
|
+
return { db: prisma, session: null, req, res, cookies };
|
|
18
|
+
}
|
|
19
|
+
const sessionUser = {
|
|
20
|
+
id: user.id,
|
|
21
|
+
emailVerified: !!user.emailVerified,
|
|
22
|
+
isSystemAdmin: user.role?.name === "System Admin",
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
db: prisma,
|
|
26
|
+
session: { user: sessionUser },
|
|
27
|
+
req,
|
|
28
|
+
res,
|
|
29
|
+
cookies,
|
|
30
|
+
};
|
|
10
31
|
}
|
|
11
32
|
return { db: prisma, session: null, req, res, cookies };
|
|
12
33
|
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import * as runtime from "@prisma/client/runtime/client";
|
|
2
|
+
import * as $Class from "./internal/class";
|
|
3
|
+
import * as Prisma from "./internal/prismaNamespace";
|
|
4
|
+
export * as $Enums from './enums';
|
|
5
|
+
export * from "./enums";
|
|
6
|
+
/**
|
|
7
|
+
* ## Prisma Client
|
|
8
|
+
*
|
|
9
|
+
* Type-safe database client for TypeScript
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* const prisma = new PrismaClient({
|
|
13
|
+
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
14
|
+
* })
|
|
15
|
+
* // Fetch zero or more Users
|
|
16
|
+
* const users = await prisma.user.findMany()
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
20
|
+
*/
|
|
21
|
+
export declare const PrismaClient: $Class.PrismaClientConstructor;
|
|
22
|
+
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>;
|
|
23
|
+
export { Prisma };
|
|
24
|
+
/**
|
|
25
|
+
* Model User
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export type User = Prisma.UserModel;
|
|
29
|
+
/**
|
|
30
|
+
* Model PasswordResetToken
|
|
31
|
+
* One-time tokens for forgot-password flow (token stored as SHA-256 hash of the secret from the email link).
|
|
32
|
+
*/
|
|
33
|
+
export type PasswordResetToken = Prisma.PasswordResetTokenModel;
|
|
34
|
+
/**
|
|
35
|
+
* Model Role
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export type Role = Prisma.RoleModel;
|
|
39
|
+
/**
|
|
40
|
+
* Model Notification
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
export type Notification = Prisma.NotificationModel;
|
|
44
|
+
/**
|
|
45
|
+
* Model Session
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
export type Session = Prisma.SessionModel;
|
|
49
|
+
/**
|
|
50
|
+
* Model VerificationToken
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
export type VerificationToken = Prisma.VerificationTokenModel;
|
|
54
|
+
/**
|
|
55
|
+
* Model Folder
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
export type Folder = Prisma.FolderModel;
|
|
59
|
+
/**
|
|
60
|
+
* Model Workspace
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
export type Workspace = Prisma.WorkspaceModel;
|
|
64
|
+
/**
|
|
65
|
+
* Model Channel
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
export type Channel = Prisma.ChannelModel;
|
|
69
|
+
/**
|
|
70
|
+
* Model Chat
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
export type Chat = Prisma.ChatModel;
|
|
74
|
+
/**
|
|
75
|
+
* Model CopilotConversation
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
export type CopilotConversation = Prisma.CopilotConversationModel;
|
|
79
|
+
/**
|
|
80
|
+
* Model CopilotMessage
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
export type CopilotMessage = Prisma.CopilotMessageModel;
|
|
84
|
+
/**
|
|
85
|
+
* Model FileAsset
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
export type FileAsset = Prisma.FileAssetModel;
|
|
89
|
+
/**
|
|
90
|
+
* Model Artifact
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
export type Artifact = Prisma.ArtifactModel;
|
|
94
|
+
/**
|
|
95
|
+
* Model ArtifactVersion
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
98
|
+
export type ArtifactVersion = Prisma.ArtifactVersionModel;
|
|
99
|
+
/**
|
|
100
|
+
* Model StudyGuideHighlight
|
|
101
|
+
*
|
|
102
|
+
*/
|
|
103
|
+
export type StudyGuideHighlight = Prisma.StudyGuideHighlightModel;
|
|
104
|
+
/**
|
|
105
|
+
* Model StudyGuideComment
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
export type StudyGuideComment = Prisma.StudyGuideCommentModel;
|
|
109
|
+
/**
|
|
110
|
+
* Model Flashcard
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
export type Flashcard = Prisma.FlashcardModel;
|
|
114
|
+
/**
|
|
115
|
+
* Model FlashcardProgress
|
|
116
|
+
*
|
|
117
|
+
*/
|
|
118
|
+
export type FlashcardProgress = Prisma.FlashcardProgressModel;
|
|
119
|
+
/**
|
|
120
|
+
* Model WorksheetQuestion
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
export type WorksheetQuestion = Prisma.WorksheetQuestionModel;
|
|
124
|
+
/**
|
|
125
|
+
* Model WorksheetQuestionProgress
|
|
126
|
+
*
|
|
127
|
+
*/
|
|
128
|
+
export type WorksheetQuestionProgress = Prisma.WorksheetQuestionProgressModel;
|
|
129
|
+
/**
|
|
130
|
+
* Model WorksheetPreset
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
export type WorksheetPreset = Prisma.WorksheetPresetModel;
|
|
134
|
+
/**
|
|
135
|
+
* Model WorkspaceMember
|
|
136
|
+
*
|
|
137
|
+
*/
|
|
138
|
+
export type WorkspaceMember = Prisma.WorkspaceMemberModel;
|
|
139
|
+
/**
|
|
140
|
+
* Model WorkspaceInvitation
|
|
141
|
+
*
|
|
142
|
+
*/
|
|
143
|
+
export type WorkspaceInvitation = Prisma.WorkspaceInvitationModel;
|
|
144
|
+
/**
|
|
145
|
+
* Model PodcastSegment
|
|
146
|
+
*
|
|
147
|
+
*/
|
|
148
|
+
export type PodcastSegment = Prisma.PodcastSegmentModel;
|
|
149
|
+
/**
|
|
150
|
+
* Model Invoice
|
|
151
|
+
*
|
|
152
|
+
*/
|
|
153
|
+
export type Invoice = Prisma.InvoiceModel;
|
|
154
|
+
/**
|
|
155
|
+
* Model Plan
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
export type Plan = Prisma.PlanModel;
|
|
159
|
+
/**
|
|
160
|
+
* Model PlanLimit
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
export type PlanLimit = Prisma.PlanLimitModel;
|
|
164
|
+
/**
|
|
165
|
+
* Model Subscription
|
|
166
|
+
*
|
|
167
|
+
*/
|
|
168
|
+
export type Subscription = Prisma.SubscriptionModel;
|
|
169
|
+
/**
|
|
170
|
+
* Model ResourcePrice
|
|
171
|
+
*
|
|
172
|
+
*/
|
|
173
|
+
export type ResourcePrice = Prisma.ResourcePriceModel;
|
|
174
|
+
/**
|
|
175
|
+
* Model UserCredit
|
|
176
|
+
*
|
|
177
|
+
*/
|
|
178
|
+
export type UserCredit = Prisma.UserCreditModel;
|
|
179
|
+
/**
|
|
180
|
+
* Model IdempotencyRecord
|
|
181
|
+
*
|
|
182
|
+
*/
|
|
183
|
+
export type IdempotencyRecord = Prisma.IdempotencyRecordModel;
|
|
184
|
+
/**
|
|
185
|
+
* Model StripeEvent
|
|
186
|
+
*
|
|
187
|
+
*/
|
|
188
|
+
export type StripeEvent = Prisma.StripeEventModel;
|
|
189
|
+
/**
|
|
190
|
+
* Model ActivityLog
|
|
191
|
+
* Append-only system / user activity (tRPC and explicit events). Retention via admin or scheduled job.
|
|
192
|
+
*/
|
|
193
|
+
export type ActivityLog = Prisma.ActivityLogModel;
|
|
194
|
+
/**
|
|
195
|
+
* Model KnowledgeBase
|
|
196
|
+
* A retrieval-augmented knowledge base. Knowledge bases live in a global
|
|
197
|
+
* catalog managed by System Admins; workspaces opt-in by attaching one
|
|
198
|
+
* (see `WorkspaceKnowledgeBase`). When `isCurated = true` the KB shows up
|
|
199
|
+
* in the user-facing catalog search so any workspace can add it.
|
|
200
|
+
*
|
|
201
|
+
* Each knowledge base owns uploaded documents (PDFs, etc.) which are split
|
|
202
|
+
* into chunks with pgvector embeddings for semantic search.
|
|
203
|
+
*/
|
|
204
|
+
export type KnowledgeBase = Prisma.KnowledgeBaseModel;
|
|
205
|
+
/**
|
|
206
|
+
* Model WorkspaceKnowledgeBase
|
|
207
|
+
* Many-to-many join between Workspace and KnowledgeBase. A row exists
|
|
208
|
+
* whenever a workspace has "added" a knowledge base from the catalog (or
|
|
209
|
+
* when an admin attaches one directly).
|
|
210
|
+
*/
|
|
211
|
+
export type WorkspaceKnowledgeBase = Prisma.WorkspaceKnowledgeBaseModel;
|
|
212
|
+
/**
|
|
213
|
+
* Model KnowledgeBaseDocument
|
|
214
|
+
* A single uploaded source document inside a knowledge base.
|
|
215
|
+
*/
|
|
216
|
+
export type KnowledgeBaseDocument = Prisma.KnowledgeBaseDocumentModel;
|
|
217
|
+
/**
|
|
218
|
+
* Model KnowledgeBaseChunk
|
|
219
|
+
* A single text chunk inside a document. The `embedding` column is a
|
|
220
|
+
* pgvector value; Prisma cannot generate types for it, so similarity
|
|
221
|
+
* search must be performed via raw SQL (`$queryRaw`). The dimension is
|
|
222
|
+
* fixed at 1536 to match `text-embedding-3-small`.
|
|
223
|
+
*/
|
|
224
|
+
export type KnowledgeBaseChunk = Prisma.KnowledgeBaseChunkModel;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// biome-ignore-all lint: generated file
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
/*
|
|
6
|
+
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
|
|
7
|
+
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
|
|
8
|
+
*
|
|
9
|
+
* 🟢 You can import this file directly.
|
|
10
|
+
*/
|
|
11
|
+
import * as path from 'node:path';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
import * as $Class from "./internal/class";
|
|
15
|
+
import * as Prisma from "./internal/prismaNamespace";
|
|
16
|
+
export * as $Enums from './enums';
|
|
17
|
+
export * from "./enums";
|
|
18
|
+
/**
|
|
19
|
+
* ## Prisma Client
|
|
20
|
+
*
|
|
21
|
+
* Type-safe database client for TypeScript
|
|
22
|
+
* @example
|
|
23
|
+
* ```
|
|
24
|
+
* const prisma = new PrismaClient({
|
|
25
|
+
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
26
|
+
* })
|
|
27
|
+
* // Fetch zero or more Users
|
|
28
|
+
* const users = await prisma.user.findMany()
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
32
|
+
*/
|
|
33
|
+
export const PrismaClient = $Class.getPrismaClientClass();
|
|
34
|
+
export { Prisma };
|