@flantastic/study-time-types 1.0.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/auth.schema.d.ts +6 -0
- package/dist/auth.schema.js +5 -0
- package/dist/enum/language.enum.d.ts +3 -0
- package/dist/enum/language.enum.js +4 -0
- package/dist/enum/role.enum.d.ts +5 -0
- package/dist/enum/role.enum.js +6 -0
- package/dist/enum/studyItemState.enum.d.ts +6 -0
- package/dist/enum/studyItemState.enum.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/schema/authUser.schema.d.ts +6 -0
- package/dist/schema/authUser.schema.js +5 -0
- package/dist/schema/studyItem.schema.d.ts +26 -0
- package/dist/schema/studyItem.schema.js +14 -0
- package/dist/schema/studyQuestion.schema.d.ts +8 -0
- package/dist/schema/studyQuestion.schema.js +7 -0
- package/dist/schema/user.schema.d.ts +12 -0
- package/dist/schema/user.schema.js +7 -0
- package/package.json +26 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { Language } from "../enum/language.enum";
|
|
3
|
+
import { StudyItemState } from "../enum/studyItemState.enum";
|
|
4
|
+
export declare const StudyItemSchema: z.ZodObject<{
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
language: z.ZodEnum<{
|
|
8
|
+
JAPANESE: Language.Japanese;
|
|
9
|
+
}>;
|
|
10
|
+
state: z.ZodEnum<{
|
|
11
|
+
DRAFT: StudyItemState.Draft;
|
|
12
|
+
TODO: StudyItemState.ToDo;
|
|
13
|
+
SUBMITTED: StudyItemState.Submitted;
|
|
14
|
+
MARKED: StudyItemState.Marked;
|
|
15
|
+
}>;
|
|
16
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
17
|
+
question: z.ZodString;
|
|
18
|
+
answer: z.ZodString;
|
|
19
|
+
correct: z.ZodBoolean;
|
|
20
|
+
teacherComment: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
teacherComment: z.ZodString;
|
|
23
|
+
assignedStudent: z.ZodString;
|
|
24
|
+
assignedTeacher: z.ZodString;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type StudyItem = z.infer<typeof StudyItemSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { Language } from "../enum/language.enum";
|
|
3
|
+
import { StudyItemState } from "../enum/studyItemState.enum";
|
|
4
|
+
import { StudyQuestionSchema } from "./studyQuestion.schema";
|
|
5
|
+
export const StudyItemSchema = z.object({
|
|
6
|
+
title: z.string().min(1),
|
|
7
|
+
description: z.string().min(1),
|
|
8
|
+
language: z.enum(Object.values(Language)),
|
|
9
|
+
state: z.enum(Object.values(StudyItemState)),
|
|
10
|
+
questions: z.array(StudyQuestionSchema),
|
|
11
|
+
teacherComment: z.string(),
|
|
12
|
+
assignedStudent: z.string().min(1),
|
|
13
|
+
assignedTeacher: z.string().min(1),
|
|
14
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare const StudyQuestionSchema: z.ZodObject<{
|
|
3
|
+
question: z.ZodString;
|
|
4
|
+
answer: z.ZodString;
|
|
5
|
+
correct: z.ZodBoolean;
|
|
6
|
+
teacherComment: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type StudyQuestion = z.infer<typeof StudyQuestionSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { Role } from "../enum/role.enum";
|
|
3
|
+
export declare const UserSchema: z.ZodObject<{
|
|
4
|
+
uid: z.ZodString;
|
|
5
|
+
email: z.ZodEmail;
|
|
6
|
+
role: z.ZodEnum<{
|
|
7
|
+
STUDENT: Role.Student;
|
|
8
|
+
TEACHER: Role.Teacher;
|
|
9
|
+
ADMIN: Role.Admin;
|
|
10
|
+
}>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type User = z.infer<typeof UserSchema>;
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flantastic/study-time-types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"keywords": [],
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "^25.0.6",
|
|
17
|
+
"eslint": "^9.39.2",
|
|
18
|
+
"prettier": "^3.7.4",
|
|
19
|
+
"ts-node": "^10.9.2",
|
|
20
|
+
"typescript": "^5.9.3"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"zod": "^4.3.5"
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist"]
|
|
26
|
+
}
|