@goscribe/server 1.3.1 → 1.3.2
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 +2 -1
- package/dist/lib/stripe.d.ts +2 -1
- package/dist/routers/_app.d.ts +2 -2
- package/dist/routers/payment.d.ts +2 -2
- package/dist/trpc.d.ts +4 -4
- package/package.json +4 -2
- package/src/routers/payment.ts +2 -0
package/dist/context.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { CreateExpressContextOptions } from "@trpc/server/adapters/express";
|
|
2
2
|
import { prisma } from "./lib/prisma.js";
|
|
3
|
+
import cookie from "cookie";
|
|
3
4
|
export declare function createContext({ req, res }: CreateExpressContextOptions): Promise<{
|
|
4
5
|
db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
5
6
|
session: any;
|
|
6
7
|
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
7
8
|
res: import("express").Response<any, Record<string, any>>;
|
|
8
|
-
cookies:
|
|
9
|
+
cookies: cookie.Cookies;
|
|
9
10
|
}>;
|
|
10
11
|
/** Use `typeof prisma` for `db` so TS keeps generated model delegates (not a bare PrismaClient). */
|
|
11
12
|
export type Context = Omit<Awaited<ReturnType<typeof createContext>>, "db"> & {
|
package/dist/lib/stripe.d.ts
CHANGED
package/dist/routers/_app.d.ts
CHANGED
|
@@ -2612,7 +2612,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
2612
2612
|
planId: string;
|
|
2613
2613
|
};
|
|
2614
2614
|
output: {
|
|
2615
|
-
url:
|
|
2615
|
+
url: string | null;
|
|
2616
2616
|
};
|
|
2617
2617
|
meta: object;
|
|
2618
2618
|
}>;
|
|
@@ -2641,7 +2641,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
2641
2641
|
quantity?: number | undefined;
|
|
2642
2642
|
};
|
|
2643
2643
|
output: {
|
|
2644
|
-
url:
|
|
2644
|
+
url: string | null;
|
|
2645
2645
|
};
|
|
2646
2646
|
meta: object;
|
|
2647
2647
|
}>;
|
|
@@ -24,7 +24,7 @@ export declare const paymentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
24
24
|
planId: string;
|
|
25
25
|
};
|
|
26
26
|
output: {
|
|
27
|
-
url:
|
|
27
|
+
url: string | null;
|
|
28
28
|
};
|
|
29
29
|
meta: object;
|
|
30
30
|
}>;
|
|
@@ -53,7 +53,7 @@ export declare const paymentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
53
53
|
quantity?: number | undefined;
|
|
54
54
|
};
|
|
55
55
|
output: {
|
|
56
|
-
url:
|
|
56
|
+
url: string | null;
|
|
57
57
|
};
|
|
58
58
|
meta: object;
|
|
59
59
|
}>;
|
package/dist/trpc.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const authedProcedure: import("@trpc/server").TRPCProcedureBuilde
|
|
|
24
24
|
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
25
25
|
res: import("express").Response<any, Record<string, any>>;
|
|
26
26
|
db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
27
|
-
cookies:
|
|
27
|
+
cookies: import("cookie").Cookies;
|
|
28
28
|
}, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
29
29
|
export declare const verifiedProcedure: import("@trpc/server").TRPCProcedureBuilder<Context, object, {
|
|
30
30
|
userId: any;
|
|
@@ -32,7 +32,7 @@ export declare const verifiedProcedure: import("@trpc/server").TRPCProcedureBuil
|
|
|
32
32
|
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
33
33
|
res: import("express").Response<any, Record<string, any>>;
|
|
34
34
|
db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
35
|
-
cookies:
|
|
35
|
+
cookies: import("cookie").Cookies;
|
|
36
36
|
}, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
37
37
|
export declare const adminProcedure: import("@trpc/server").TRPCProcedureBuilder<Context, object, {
|
|
38
38
|
userId: any;
|
|
@@ -40,7 +40,7 @@ export declare const adminProcedure: import("@trpc/server").TRPCProcedureBuilder
|
|
|
40
40
|
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
41
41
|
res: import("express").Response<any, Record<string, any>>;
|
|
42
42
|
db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
43
|
-
cookies:
|
|
43
|
+
cookies: import("cookie").Cookies;
|
|
44
44
|
}, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
45
45
|
export declare const limitedProcedure: import("@trpc/server").TRPCProcedureBuilder<Context, object, {
|
|
46
46
|
userId: any;
|
|
@@ -48,5 +48,5 @@ export declare const limitedProcedure: import("@trpc/server").TRPCProcedureBuild
|
|
|
48
48
|
req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
49
49
|
res: import("express").Response<any, Record<string, any>>;
|
|
50
50
|
db: import("@prisma/client").PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
|
|
51
|
-
cookies:
|
|
51
|
+
cookies: import("cookie").Cookies;
|
|
52
52
|
}, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goscribe/server",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
"build": "npx prisma generate && tsc -p .",
|
|
17
17
|
"start": "node --experimental-specifier-resolution=node dist/server.js",
|
|
18
18
|
"test": "tsx --test src/lib/worksheet-generation.test.ts",
|
|
19
|
-
"test:activity": "tsx --test src/lib/activity_log_service.test.ts src/lib/activity_human_description.test.ts"
|
|
19
|
+
"test:activity": "tsx --test src/lib/activity_log_service.test.ts src/lib/activity_human_description.test.ts",
|
|
20
|
+
"generate": "npx prisma generate",
|
|
21
|
+
"prepublishOnly": "npm run generate && npm run build"
|
|
20
22
|
},
|
|
21
23
|
"prisma": {
|
|
22
24
|
"seed": "node --experimental-specifier-resolution=node prisma/seed.mjs"
|
package/src/routers/payment.ts
CHANGED
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
} from '../lib/notification-service.js';
|
|
12
12
|
import { upsertSubscriptionFromStripe } from '../lib/subscription_service.js';
|
|
13
13
|
import { ArtifactType } from '../lib/prisma.js';
|
|
14
|
+
import { PrismaClient } from '@prisma/client';
|
|
15
|
+
import { Stripe } from 'stripe';
|
|
14
16
|
|
|
15
17
|
const ArtifactTypeUnion = z.enum(['STUDY_GUIDE', 'FLASHCARD_SET', 'WORKSHEET', 'MEETING_SUMMARY', 'PODCAST_EPISODE', 'STORAGE']);
|
|
16
18
|
|