@studious-lms/server 1.1.15 → 1.1.17
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/lib/jsonConversion.d.ts +1 -1
- package/dist/lib/jsonConversion.d.ts.map +1 -1
- package/dist/lib/jsonConversion.js +291 -125
- package/dist/routers/_app.d.ts +180 -0
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +2 -0
- package/dist/routers/assignment.d.ts +15 -0
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/class.d.ts +5 -0
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/class.js +7 -0
- package/dist/routers/file.d.ts +2 -0
- package/dist/routers/file.d.ts.map +1 -1
- package/dist/routers/labChat.js +4 -3
- package/dist/routers/marketing.d.ts +70 -0
- package/dist/routers/marketing.d.ts.map +1 -0
- package/dist/routers/marketing.js +65 -0
- package/dist/seedDatabase.d.ts.map +1 -1
- package/dist/seedDatabase.js +1459 -24
- package/dist/utils/inference.js +2 -2
- package/package.json +2 -1
- package/prisma/schema.prisma +30 -0
- package/src/lib/NotoSans-Bold.ttf +0 -0
- package/src/lib/NotoSans-Italic.ttf +0 -0
- package/src/lib/NotoSans-Regular.ttf +0 -0
- package/src/lib/jsonConversion.ts +347 -136
- package/src/routers/_app.ts +2 -0
- package/src/routers/class.ts +7 -0
- package/src/routers/labChat.ts +6 -3
- package/src/routers/marketing.ts +69 -0
- package/src/seedDatabase.ts +1512 -21
- package/src/utils/inference.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/routers/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/routers/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsVrB,CAAC"}
|
package/dist/routers/labChat.js
CHANGED
|
@@ -6,8 +6,8 @@ import { TRPCError } from '@trpc/server';
|
|
|
6
6
|
import { inferenceClient, sendAIMessage } from '../utils/inference.js';
|
|
7
7
|
import { logger } from '../utils/logger.js';
|
|
8
8
|
import { isAIUser } from '../utils/aiUser.js';
|
|
9
|
-
import { uploadFile } from '
|
|
10
|
-
import { createPdf } from "
|
|
9
|
+
import { uploadFile } from '../lib/googleCloudStorage.js';
|
|
10
|
+
import { createPdf } from "../lib/jsonConversion.js";
|
|
11
11
|
import { v4 as uuidv4 } from "uuid";
|
|
12
12
|
export const labChatRouter = createTRPCRouter({
|
|
13
13
|
create: protectedProcedure
|
|
@@ -720,7 +720,7 @@ WHEN CREATING COURSE MATERIALS (docs field):
|
|
|
720
720
|
- Colors must be hex strings: "#RGB" or "#RRGGBB".
|
|
721
721
|
- Headings (0-5): content is a single string; you may set metadata.align.
|
|
722
722
|
- Paragraphs (6) and Quotes (12): content is a single string.
|
|
723
|
-
- Bullets (7) and Numbered (8): content is an array of strings (one item per list entry).
|
|
723
|
+
- Bullets (7) and Numbered (8): content is an array of strings (one item per list entry). DO NOT include bullet symbols (*) or numbers (1. 2. 3.) in the content - the format will automatically add these.
|
|
724
724
|
- Code blocks (11): prefer content as an array of lines; preserve indentation via leading tabs/spaces. If using a single string, include \n between lines.
|
|
725
725
|
- Table (9) and Image (10) are not supported by the renderer now; do not emit them.
|
|
726
726
|
- Use metadata sparingly; omit fields you don't need. For code blocks you may set metadata.paddingX, paddingY, background, and font (1 for Courier).
|
|
@@ -816,6 +816,7 @@ WHEN CREATING COURSE MATERIALS (docs field):
|
|
|
816
816
|
const attachmentIds = [];
|
|
817
817
|
// Generate PDFs if docs are provided
|
|
818
818
|
if (jsonData.docs && Array.isArray(jsonData.docs)) {
|
|
819
|
+
console.log('Generating PDFs', { labChatId, docs: JSON.stringify(jsonData.docs, null, 2) });
|
|
819
820
|
for (let i = 0; i < jsonData.docs.length; i++) {
|
|
820
821
|
const doc = jsonData.docs[i];
|
|
821
822
|
if (!doc.title || !doc.blocks || !Array.isArray(doc.blocks)) {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const marketingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
|
+
ctx: import("../trpc.js").Context;
|
|
4
|
+
meta: object;
|
|
5
|
+
errorShape: {
|
|
6
|
+
data: {
|
|
7
|
+
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
+
prismaError: import("../utils/prismaErrorHandler.js").PrismaErrorInfo | null;
|
|
9
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
10
|
+
httpStatus: number;
|
|
11
|
+
path?: string;
|
|
12
|
+
stack?: string;
|
|
13
|
+
};
|
|
14
|
+
message: string;
|
|
15
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
16
|
+
};
|
|
17
|
+
transformer: false;
|
|
18
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
19
|
+
createSchoolDevelopementProgram: import("@trpc/server").TRPCMutationProcedure<{
|
|
20
|
+
input: {
|
|
21
|
+
type: string;
|
|
22
|
+
name: string;
|
|
23
|
+
address: string;
|
|
24
|
+
city: string;
|
|
25
|
+
country: string;
|
|
26
|
+
numberOfStudents: number;
|
|
27
|
+
numberOfTeachers: number;
|
|
28
|
+
website?: string | undefined;
|
|
29
|
+
contactName?: string | undefined;
|
|
30
|
+
contactRole?: string | undefined;
|
|
31
|
+
contactEmail?: string | undefined;
|
|
32
|
+
contactPhone?: string | undefined;
|
|
33
|
+
eligibilityInformation?: string | undefined;
|
|
34
|
+
whyHelp?: string | undefined;
|
|
35
|
+
additionalInformation?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
output: {
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
meta: object;
|
|
41
|
+
}>;
|
|
42
|
+
searchSchoolDevelopementPrograms: import("@trpc/server").TRPCQueryProcedure<{
|
|
43
|
+
input: {
|
|
44
|
+
id: string;
|
|
45
|
+
};
|
|
46
|
+
output: {
|
|
47
|
+
type: string;
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
status: string;
|
|
51
|
+
website: string | null;
|
|
52
|
+
submittedAt: Date | null;
|
|
53
|
+
address: string;
|
|
54
|
+
city: string;
|
|
55
|
+
country: string;
|
|
56
|
+
numberOfStudents: number;
|
|
57
|
+
numberOfTeachers: number;
|
|
58
|
+
contactName: string | null;
|
|
59
|
+
contactRole: string | null;
|
|
60
|
+
contactEmail: string | null;
|
|
61
|
+
contactPhone: string | null;
|
|
62
|
+
eligibilityInformation: string | null;
|
|
63
|
+
whyHelp: string | null;
|
|
64
|
+
additionalInformation: string | null;
|
|
65
|
+
reviewedAt: Date | null;
|
|
66
|
+
} | null;
|
|
67
|
+
meta: object;
|
|
68
|
+
}>;
|
|
69
|
+
}>>;
|
|
70
|
+
//# sourceMappingURL=marketing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketing.d.ts","sourceRoot":"","sources":["../../src/routers/marketing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+D1B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createTRPCRouter, publicProcedure } from "../trpc.js";
|
|
3
|
+
import { prisma } from "../lib/prisma.js";
|
|
4
|
+
import { v4 } from "uuid";
|
|
5
|
+
export const marketingRouter = createTRPCRouter({
|
|
6
|
+
createSchoolDevelopementProgram: publicProcedure
|
|
7
|
+
.input(z.object({
|
|
8
|
+
name: z.string(),
|
|
9
|
+
type: z.string(),
|
|
10
|
+
address: z.string(),
|
|
11
|
+
city: z.string(),
|
|
12
|
+
country: z.string(),
|
|
13
|
+
numberOfStudents: z.number(),
|
|
14
|
+
numberOfTeachers: z.number(),
|
|
15
|
+
website: z.string().optional(),
|
|
16
|
+
contactName: z.string().optional(),
|
|
17
|
+
contactRole: z.string().optional(),
|
|
18
|
+
contactEmail: z.string().optional(),
|
|
19
|
+
contactPhone: z.string().optional(),
|
|
20
|
+
eligibilityInformation: z.string().optional(),
|
|
21
|
+
whyHelp: z.string().optional(),
|
|
22
|
+
additionalInformation: z.string().optional(),
|
|
23
|
+
}))
|
|
24
|
+
.mutation(async ({ ctx, input }) => {
|
|
25
|
+
const { name, type, address, city, country, numberOfStudents, numberOfTeachers, website, contactName, contactRole, contactEmail, contactPhone, eligibilityInformation, whyHelp, additionalInformation } = input;
|
|
26
|
+
const date = new Date();
|
|
27
|
+
const id = name.slice(0, 3).toUpperCase() + date.getFullYear() + '-' + v4();
|
|
28
|
+
const schoolDevelopementProgram = await prisma.schoolDevelopementProgram.create({
|
|
29
|
+
data: {
|
|
30
|
+
id,
|
|
31
|
+
name,
|
|
32
|
+
type,
|
|
33
|
+
address,
|
|
34
|
+
city,
|
|
35
|
+
country,
|
|
36
|
+
numberOfStudents,
|
|
37
|
+
numberOfTeachers,
|
|
38
|
+
website,
|
|
39
|
+
contactName,
|
|
40
|
+
contactRole,
|
|
41
|
+
contactEmail,
|
|
42
|
+
contactPhone,
|
|
43
|
+
eligibilityInformation,
|
|
44
|
+
whyHelp,
|
|
45
|
+
additionalInformation,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
id: schoolDevelopementProgram.id,
|
|
50
|
+
};
|
|
51
|
+
}),
|
|
52
|
+
searchSchoolDevelopementPrograms: publicProcedure
|
|
53
|
+
.input(z.object({
|
|
54
|
+
id: z.string(),
|
|
55
|
+
}))
|
|
56
|
+
.query(async ({ input }) => {
|
|
57
|
+
const { id } = input;
|
|
58
|
+
const schoolDevelopementProgram = await prisma.schoolDevelopementProgram.findUnique({
|
|
59
|
+
where: {
|
|
60
|
+
id,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
return schoolDevelopementProgram;
|
|
64
|
+
}),
|
|
65
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedDatabase.d.ts","sourceRoot":"","sources":["../src/seedDatabase.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,
|
|
1
|
+
{"version":3,"file":"seedDatabase.d.ts","sourceRoot":"","sources":["../src/seedDatabase.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,kBAsClC;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;GAOjF;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;GAQnF;AAED,eAAO,MAAM,YAAY,qBAq+CxB,CAAC"}
|