@goscribe/server 1.0.2 → 1.0.4

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 (44) hide show
  1. package/dist/context.d.ts +2 -2
  2. package/dist/context.js +11 -7
  3. package/dist/index.d.ts +3 -4
  4. package/dist/index.js +1 -2
  5. package/dist/lib/auth.d.ts +3 -2
  6. package/dist/lib/auth.js +39 -36
  7. package/dist/lib/file.d.ts +0 -0
  8. package/dist/lib/file.js +1 -0
  9. package/dist/lib/prisma.d.ts +2 -3
  10. package/dist/lib/prisma.js +4 -7
  11. package/dist/lib/storage.d.ts +3 -0
  12. package/dist/lib/storage.js +10 -0
  13. package/dist/routers/_app.d.ts +90 -16
  14. package/dist/routers/_app.js +6 -9
  15. package/dist/routers/auth.d.ts +28 -2
  16. package/dist/routers/auth.js +48 -16
  17. package/dist/routers/workspace.d.ts +60 -14
  18. package/dist/routers/workspace.js +129 -30
  19. package/dist/server.d.ts +0 -1
  20. package/dist/server.js +19 -56
  21. package/dist/trpc.d.ts +10 -9
  22. package/dist/trpc.js +13 -26
  23. package/package.json +11 -4
  24. package/prisma/schema.prisma +7 -21
  25. package/src/context.ts +12 -4
  26. package/src/index.ts +3 -3
  27. package/src/lib/auth.ts +37 -32
  28. package/src/lib/prisma.ts +1 -1
  29. package/src/routers/_app.ts +3 -3
  30. package/src/routers/auth.ts +47 -2
  31. package/src/routers/workspace.ts +16 -15
  32. package/src/server.ts +2 -5
  33. package/src/trpc.ts +5 -11
  34. package/tsconfig.json +17 -10
  35. package/dist/context.d.ts.map +0 -1
  36. package/dist/index.d.ts.map +0 -1
  37. package/dist/lib/auth.d.ts.map +0 -1
  38. package/dist/lib/prisma.d.ts.map +0 -1
  39. package/dist/routers/_app.d.ts.map +0 -1
  40. package/dist/routers/auth.d.ts.map +0 -1
  41. package/dist/routers/sample.js +0 -21
  42. package/dist/routers/workspace.d.ts.map +0 -1
  43. package/dist/server.d.ts.map +0 -1
  44. package/dist/trpc.d.ts.map +0 -1
package/dist/context.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { CreateExpressContextOptions } from "@trpc/server/adapters/express";
2
2
  export declare function createContext({ req, res }: CreateExpressContextOptions): Promise<{
3
- db: import("src/generated/prisma").PrismaClient<import("src/generated/prisma").Prisma.PrismaClientOptions, never, import("src/generated/prisma/runtime/library").DefaultArgs>;
3
+ db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
4
4
  session: any;
5
5
  req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
6
6
  res: import("express").Response<any, Record<string, any>>;
7
+ cookies: Record<string, string | undefined>;
7
8
  }>;
8
9
  export type Context = Awaited<ReturnType<typeof createContext>>;
9
- //# sourceMappingURL=context.d.ts.map
package/dist/context.js CHANGED
@@ -1,8 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createContext = createContext;
4
- const prisma_1 = require("./lib/prisma");
5
- async function createContext({ req, res }) {
6
- const session = req.auth ?? null;
7
- return { db: prisma_1.prisma, session, req, res };
1
+ import { prisma } from "./lib/prisma.js";
2
+ import { verifyCustomAuthCookie } from "./lib/auth.js";
3
+ import cookie from "cookie";
4
+ export async function createContext({ req, res }) {
5
+ const cookies = cookie.parse(req.headers.cookie ?? "");
6
+ // Only use custom auth cookie
7
+ const custom = verifyCustomAuthCookie(cookies["auth_token"]);
8
+ if (custom) {
9
+ return { db: prisma, session: { user: { id: custom.userId } }, req, res, cookies };
10
+ }
11
+ return { db: prisma, session: null, req, res, cookies };
8
12
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export type { AppRouter } from "./routers/_app";
2
- export type { RouterInputs } from "./routers/_app";
3
- export type { RouterOutputs } from "./routers/_app";
4
- //# sourceMappingURL=index.d.ts.map
1
+ export type { AppRouter } from "./routers/_app.js";
2
+ export type { RouterInputs } from "./routers/_app.js";
3
+ export type { RouterOutputs } from "./routers/_app.js";
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1,3 @@
1
- export declare const authRouter: (req: import("express").Request, res: import("express").Response, next: import("express").NextFunction) => Promise<void>;
2
- //# sourceMappingURL=auth.d.ts.map
1
+ export declare function verifyCustomAuthCookie(cookieValue: string | undefined): {
2
+ userId: string;
3
+ } | null;
package/dist/lib/auth.js CHANGED
@@ -1,37 +1,40 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.authRouter = void 0;
7
1
  // src/server/auth.ts
8
- const express_1 = require("@auth/express");
9
- const prisma_adapter_1 = require("@auth/prisma-adapter");
10
- const prisma_1 = require("../lib/prisma");
11
- const google_1 = __importDefault(require("@auth/core/providers/google"));
12
- const credentials_1 = __importDefault(require("@auth/core/providers/credentials"));
13
- exports.authRouter = (0, express_1.ExpressAuth)({
14
- providers: [
15
- (0, google_1.default)({
16
- clientId: process.env.GOOGLE_CLIENT_ID,
17
- clientSecret: process.env.GOOGLE_CLIENT_SECRET,
18
- }),
19
- (0, credentials_1.default)({
20
- name: "credentials",
21
- credentials: {
22
- email: { label: "Email", type: "email" },
23
- password: { label: "Password", type: "password" },
24
- },
25
- async authorize(credentials) {
26
- if (credentials?.email === "demo@example.com" &&
27
- credentials?.password === "demo") {
28
- return { id: "1", email: "demo@example.com", name: "Demo User" };
29
- }
30
- return null;
31
- },
32
- }),
33
- ],
34
- adapter: (0, prisma_adapter_1.PrismaAdapter)(prisma_1.prisma),
35
- secret: process.env.AUTH_SECRET,
36
- session: { strategy: "jwt" },
37
- });
2
+ import crypto from "node:crypto";
3
+ // Custom HMAC cookie: auth_token = base64(userId).hex(hmacSHA256(base64(userId), secret))
4
+ export function verifyCustomAuthCookie(cookieValue) {
5
+ if (!cookieValue)
6
+ return null;
7
+ const secret = process.env.CUSTOM_AUTH_SECRET;
8
+ if (!secret)
9
+ return null;
10
+ const parts = cookieValue.split(".");
11
+ if (parts.length !== 2)
12
+ return null;
13
+ const [base64UserId, signatureHex] = parts;
14
+ let userId;
15
+ try {
16
+ const buf = Buffer.from(base64UserId, "base64url");
17
+ userId = buf.toString("utf8");
18
+ }
19
+ catch {
20
+ return null;
21
+ }
22
+ const hmac = crypto.createHmac("sha256", secret);
23
+ hmac.update(base64UserId);
24
+ const expected = hmac.digest("hex");
25
+ if (!timingSafeEqualHex(signatureHex, expected))
26
+ return null;
27
+ return { userId };
28
+ }
29
+ function timingSafeEqualHex(a, b) {
30
+ try {
31
+ const ab = Buffer.from(a, "hex");
32
+ const bb = Buffer.from(b, "hex");
33
+ if (ab.length !== bb.length)
34
+ return false;
35
+ return crypto.timingSafeEqual(ab, bb);
36
+ }
37
+ catch {
38
+ return false;
39
+ }
40
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,3 +1,2 @@
1
- import { PrismaClient } from "../generated/prisma";
2
- export declare const prisma: PrismaClient<import("../generated/prisma").Prisma.PrismaClientOptions, never, import("src/generated/prisma/runtime/library").DefaultArgs>;
3
- //# sourceMappingURL=prisma.d.ts.map
1
+ import { PrismaClient } from "@prisma/client";
2
+ export declare const prisma: PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prisma = void 0;
4
- const prisma_1 = require("../generated/prisma");
1
+ import { PrismaClient } from "@prisma/client";
5
2
  const globalForPrisma = globalThis;
6
- exports.prisma = globalForPrisma.prisma ??
7
- new prisma_1.PrismaClient({
3
+ export const prisma = globalForPrisma.prisma ??
4
+ new PrismaClient({
8
5
  // log: ["query"], // enable if you want
9
6
  });
10
7
  if (process.env.NODE_ENV !== "production")
11
- globalForPrisma.prisma = exports.prisma;
8
+ globalForPrisma.prisma = prisma;
@@ -0,0 +1,3 @@
1
+ import { Storage } from "@google-cloud/storage";
2
+ export declare const storage: Storage;
3
+ export declare const bucket: import("@google-cloud/storage").Bucket;
@@ -0,0 +1,10 @@
1
+ // src/server/lib/gcs.ts
2
+ import { Storage } from "@google-cloud/storage";
3
+ export const storage = new Storage({
4
+ projectId: process.env.GCP_PROJECT_ID,
5
+ credentials: {
6
+ client_email: process.env.GCP_CLIENT_EMAIL,
7
+ private_key: process.env.GCP_PRIVATE_KEY?.replace(/\\n/g, "\n"),
8
+ },
9
+ });
10
+ export const bucket = storage.bucket(process.env.GCP_BUCKET);
@@ -1,10 +1,11 @@
1
1
  import { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
2
2
  export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
3
3
  ctx: {
4
- db: import("src/generated/prisma").PrismaClient<import("src/generated/prisma").Prisma.PrismaClientOptions, never, import("src/generated/prisma/runtime/library").DefaultArgs>;
4
+ db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
5
5
  session: any;
6
6
  req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
7
7
  res: import("express").Response<any, Record<string, any>>;
8
+ cookies: Record<string, string | undefined>;
8
9
  };
9
10
  meta: object;
10
11
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
@@ -12,10 +13,11 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
12
13
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
13
14
  auth: import("@trpc/server").TRPCBuiltRouter<{
14
15
  ctx: {
15
- db: import("src/generated/prisma").PrismaClient<import("src/generated/prisma").Prisma.PrismaClientOptions, never, import("src/generated/prisma/runtime/library").DefaultArgs>;
16
+ db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
16
17
  session: any;
17
18
  req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
18
19
  res: import("express").Response<any, Record<string, any>>;
20
+ cookies: Record<string, string | undefined>;
19
21
  };
20
22
  meta: object;
21
23
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
@@ -34,13 +36,40 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
34
36
  };
35
37
  meta: object;
36
38
  }>;
39
+ login: import("@trpc/server").TRPCMutationProcedure<{
40
+ input: {
41
+ email: string;
42
+ password: string;
43
+ };
44
+ output: {
45
+ id: string;
46
+ email: string | null;
47
+ name: string | null;
48
+ };
49
+ meta: object;
50
+ }>;
51
+ getSession: import("@trpc/server").TRPCQueryProcedure<{
52
+ input: void;
53
+ output: {
54
+ id: string;
55
+ userId: string;
56
+ user: {
57
+ id: string;
58
+ email: string | null;
59
+ name: string | null;
60
+ image: string | null;
61
+ };
62
+ };
63
+ meta: object;
64
+ }>;
37
65
  }>>;
38
66
  workspace: import("@trpc/server").TRPCBuiltRouter<{
39
67
  ctx: {
40
- db: import("src/generated/prisma").PrismaClient<import("src/generated/prisma").Prisma.PrismaClientOptions, never, import("src/generated/prisma/runtime/library").DefaultArgs>;
68
+ db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
41
69
  session: any;
42
70
  req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
43
71
  res: import("express").Response<any, Record<string, any>>;
72
+ cookies: Record<string, string | undefined>;
44
73
  };
45
74
  meta: object;
46
75
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
@@ -48,47 +77,93 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
48
77
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
49
78
  list: import("@trpc/server").TRPCQueryProcedure<{
50
79
  input: void;
51
- output: void;
80
+ output: {
81
+ id: string;
82
+ createdAt: Date;
83
+ updatedAt: Date;
84
+ ownerId: string;
85
+ title: string;
86
+ description: string | null;
87
+ folderId: string | null;
88
+ }[];
52
89
  meta: object;
53
90
  }>;
54
91
  create: import("@trpc/server").TRPCMutationProcedure<{
55
- input: Record<string, never>;
56
- output: void;
92
+ input: {
93
+ name: string;
94
+ description?: string | undefined;
95
+ };
96
+ output: {
97
+ id: string;
98
+ createdAt: Date;
99
+ updatedAt: Date;
100
+ ownerId: string;
101
+ title: string;
102
+ description: string | null;
103
+ folderId: string | null;
104
+ };
57
105
  meta: object;
58
106
  }>;
59
107
  get: import("@trpc/server").TRPCQueryProcedure<{
60
108
  input: {
61
109
  id: string;
62
110
  };
63
- output: void;
111
+ output: {
112
+ id: string;
113
+ createdAt: Date;
114
+ updatedAt: Date;
115
+ ownerId: string;
116
+ title: string;
117
+ description: string | null;
118
+ folderId: string | null;
119
+ } | null;
64
120
  meta: object;
65
121
  }>;
66
122
  update: import("@trpc/server").TRPCMutationProcedure<{
67
123
  input: {
68
124
  id: string;
125
+ name?: string | undefined;
126
+ description?: string | undefined;
127
+ };
128
+ output: {
129
+ id: string;
130
+ createdAt: Date;
131
+ updatedAt: Date;
132
+ ownerId: string;
133
+ title: string;
134
+ description: string | null;
135
+ folderId: string | null;
69
136
  };
70
- output: void;
71
137
  meta: object;
72
138
  }>;
73
139
  delete: import("@trpc/server").TRPCMutationProcedure<{
74
140
  input: {
75
141
  id: string;
76
142
  };
77
- output: void;
143
+ output: boolean;
78
144
  meta: object;
79
145
  }>;
80
- upload: import("@trpc/server").TRPCMutationProcedure<{
146
+ uploadFiles: import("@trpc/server").TRPCMutationProcedure<{
81
147
  input: {
82
- file: string;
148
+ id: string;
149
+ files: {
150
+ filename: string;
151
+ contentType: string;
152
+ size: number;
153
+ }[];
83
154
  };
84
- output: void;
155
+ output: {
156
+ fileId: string;
157
+ uploadUrl: string;
158
+ }[];
85
159
  meta: object;
86
160
  }>;
87
- deleteFile: import("@trpc/server").TRPCMutationProcedure<{
161
+ deleteFiles: import("@trpc/server").TRPCMutationProcedure<{
88
162
  input: {
89
- fileId: string;
163
+ fileId: string[];
164
+ id: string;
90
165
  };
91
- output: void;
166
+ output: import("@prisma/client").Prisma.BatchPayload;
92
167
  meta: object;
93
168
  }>;
94
169
  }>>;
@@ -96,4 +171,3 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
96
171
  export type AppRouter = typeof appRouter;
97
172
  export type RouterInputs = inferRouterInputs<AppRouter>;
98
173
  export type RouterOutputs = inferRouterOutputs<AppRouter>;
99
- //# sourceMappingURL=_app.d.ts.map
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appRouter = void 0;
4
- const trpc_1 = require("../trpc");
5
- const auth_1 = require("./auth");
6
- const workspace_1 = require("./workspace");
7
- exports.appRouter = (0, trpc_1.router)({
8
- auth: auth_1.auth,
9
- workspace: workspace_1.workspace
1
+ import { router } from '../trpc.js';
2
+ import { auth } from './auth.js';
3
+ import { workspace } from './workspace.js';
4
+ export const appRouter = router({
5
+ auth,
6
+ workspace
10
7
  });
@@ -1,9 +1,10 @@
1
1
  export declare const auth: import("@trpc/server").TRPCBuiltRouter<{
2
2
  ctx: {
3
- db: import("src/generated/prisma").PrismaClient<import("src/generated/prisma").Prisma.PrismaClientOptions, never, import("src/generated/prisma/runtime/library").DefaultArgs>;
3
+ db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
4
4
  session: any;
5
5
  req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
6
6
  res: import("express").Response<any, Record<string, any>>;
7
+ cookies: Record<string, string | undefined>;
7
8
  };
8
9
  meta: object;
9
10
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
@@ -22,5 +23,30 @@ export declare const auth: import("@trpc/server").TRPCBuiltRouter<{
22
23
  };
23
24
  meta: object;
24
25
  }>;
26
+ login: import("@trpc/server").TRPCMutationProcedure<{
27
+ input: {
28
+ email: string;
29
+ password: string;
30
+ };
31
+ output: {
32
+ id: string;
33
+ email: string | null;
34
+ name: string | null;
35
+ };
36
+ meta: object;
37
+ }>;
38
+ getSession: import("@trpc/server").TRPCQueryProcedure<{
39
+ input: void;
40
+ output: {
41
+ id: string;
42
+ userId: string;
43
+ user: {
44
+ id: string;
45
+ email: string | null;
46
+ name: string | null;
47
+ image: string | null;
48
+ };
49
+ };
50
+ meta: object;
51
+ }>;
25
52
  }>>;
26
- //# sourceMappingURL=auth.d.ts.map
@@ -1,18 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.auth = void 0;
7
- const zod_1 = require("zod");
8
- const trpc_1 = require("../trpc");
9
- const bcryptjs_1 = __importDefault(require("bcryptjs"));
10
- exports.auth = (0, trpc_1.router)({
11
- signup: trpc_1.publicProcedure
12
- .input(zod_1.z.object({
13
- name: zod_1.z.string().min(1),
14
- email: zod_1.z.string().email(),
15
- password: zod_1.z.string().min(6),
1
+ import { z } from 'zod';
2
+ import { router, publicProcedure } from '../trpc.js';
3
+ import bcrypt from 'bcryptjs';
4
+ export const auth = router({
5
+ signup: publicProcedure
6
+ .input(z.object({
7
+ name: z.string().min(1),
8
+ email: z.string().email(),
9
+ password: z.string().min(6),
16
10
  }))
17
11
  .mutation(async ({ ctx, input }) => {
18
12
  const existing = await ctx.db.user.findUnique({
@@ -21,7 +15,7 @@ exports.auth = (0, trpc_1.router)({
21
15
  if (existing) {
22
16
  throw new Error("Email already registered");
23
17
  }
24
- const hash = await bcryptjs_1.default.hash(input.password, 10);
18
+ const hash = await bcrypt.hash(input.password, 10);
25
19
  const user = await ctx.db.user.create({
26
20
  data: {
27
21
  name: input.name,
@@ -32,4 +26,42 @@ exports.auth = (0, trpc_1.router)({
32
26
  });
33
27
  return { id: user.id, email: user.email, name: user.name };
34
28
  }),
29
+ login: publicProcedure
30
+ .input(z.object({
31
+ email: z.string().email(),
32
+ password: z.string().min(6),
33
+ }))
34
+ .mutation(async ({ ctx, input }) => {
35
+ const user = await ctx.db.user.findUnique({
36
+ where: { email: input.email },
37
+ });
38
+ if (!user) {
39
+ throw new Error("Invalid credentials");
40
+ }
41
+ const valid = await bcrypt.compare(input.password, user.passwordHash);
42
+ if (!valid) {
43
+ throw new Error("Invalid credentials");
44
+ }
45
+ return { id: user.id, email: user.email, name: user.name };
46
+ }),
47
+ getSession: publicProcedure.query(async ({ ctx }) => {
48
+ const session = await ctx.db.session.findUnique({
49
+ where: {
50
+ id: ctx.session?.id,
51
+ },
52
+ });
53
+ if (!session) {
54
+ throw new Error("Session not found");
55
+ }
56
+ if (session.expires < new Date()) {
57
+ throw new Error("Session expired");
58
+ }
59
+ const user = await ctx.db.user.findUnique({
60
+ where: { id: session.userId },
61
+ });
62
+ if (!user) {
63
+ throw new Error("User not found");
64
+ }
65
+ return { id: session.id, userId: session.userId, user: { id: user.id, email: user.email, name: user.name, image: user.image } };
66
+ }),
35
67
  });
@@ -1,9 +1,10 @@
1
1
  export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
2
2
  ctx: {
3
- db: import("src/generated/prisma").PrismaClient<import("src/generated/prisma").Prisma.PrismaClientOptions, never, import("src/generated/prisma/runtime/library").DefaultArgs>;
3
+ db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
4
4
  session: any;
5
5
  req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
6
6
  res: import("express").Response<any, Record<string, any>>;
7
+ cookies: Record<string, string | undefined>;
7
8
  };
8
9
  meta: object;
9
10
  errorShape: import("@trpc/server").TRPCDefaultErrorShape;
@@ -11,48 +12,93 @@ export declare const workspace: import("@trpc/server").TRPCBuiltRouter<{
11
12
  }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
12
13
  list: import("@trpc/server").TRPCQueryProcedure<{
13
14
  input: void;
14
- output: void;
15
+ output: {
16
+ id: string;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ ownerId: string;
20
+ title: string;
21
+ description: string | null;
22
+ folderId: string | null;
23
+ }[];
15
24
  meta: object;
16
25
  }>;
17
26
  create: import("@trpc/server").TRPCMutationProcedure<{
18
- input: Record<string, never>;
19
- output: void;
27
+ input: {
28
+ name: string;
29
+ description?: string | undefined;
30
+ };
31
+ output: {
32
+ id: string;
33
+ createdAt: Date;
34
+ updatedAt: Date;
35
+ ownerId: string;
36
+ title: string;
37
+ description: string | null;
38
+ folderId: string | null;
39
+ };
20
40
  meta: object;
21
41
  }>;
22
42
  get: import("@trpc/server").TRPCQueryProcedure<{
23
43
  input: {
24
44
  id: string;
25
45
  };
26
- output: void;
46
+ output: {
47
+ id: string;
48
+ createdAt: Date;
49
+ updatedAt: Date;
50
+ ownerId: string;
51
+ title: string;
52
+ description: string | null;
53
+ folderId: string | null;
54
+ } | null;
27
55
  meta: object;
28
56
  }>;
29
57
  update: import("@trpc/server").TRPCMutationProcedure<{
30
58
  input: {
31
59
  id: string;
60
+ name?: string | undefined;
61
+ description?: string | undefined;
62
+ };
63
+ output: {
64
+ id: string;
65
+ createdAt: Date;
66
+ updatedAt: Date;
67
+ ownerId: string;
68
+ title: string;
69
+ description: string | null;
70
+ folderId: string | null;
32
71
  };
33
- output: void;
34
72
  meta: object;
35
73
  }>;
36
74
  delete: import("@trpc/server").TRPCMutationProcedure<{
37
75
  input: {
38
76
  id: string;
39
77
  };
40
- output: void;
78
+ output: boolean;
41
79
  meta: object;
42
80
  }>;
43
- upload: import("@trpc/server").TRPCMutationProcedure<{
81
+ uploadFiles: import("@trpc/server").TRPCMutationProcedure<{
44
82
  input: {
45
- file: string;
83
+ id: string;
84
+ files: {
85
+ filename: string;
86
+ contentType: string;
87
+ size: number;
88
+ }[];
46
89
  };
47
- output: void;
90
+ output: {
91
+ fileId: string;
92
+ uploadUrl: string;
93
+ }[];
48
94
  meta: object;
49
95
  }>;
50
- deleteFile: import("@trpc/server").TRPCMutationProcedure<{
96
+ deleteFiles: import("@trpc/server").TRPCMutationProcedure<{
51
97
  input: {
52
- fileId: string;
98
+ fileId: string[];
99
+ id: string;
53
100
  };
54
- output: void;
101
+ output: import("@prisma/client").Prisma.BatchPayload;
55
102
  meta: object;
56
103
  }>;
57
104
  }>>;
58
- //# sourceMappingURL=workspace.d.ts.map