@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.
@@ -0,0 +1,6 @@
1
+ import z from "zod";
2
+ export declare const AuthUserSchema: z.ZodObject<{
3
+ email: z.ZodEmail;
4
+ password: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type AuthUser = z.infer<typeof AuthUserSchema>;
@@ -0,0 +1,5 @@
1
+ import z from "zod";
2
+ export const AuthUserSchema = z.object({
3
+ email: z.email().min(1),
4
+ password: z.string().min(1),
5
+ });
@@ -0,0 +1,3 @@
1
+ export declare enum Language {
2
+ Japanese = "JAPANESE"
3
+ }
@@ -0,0 +1,4 @@
1
+ export var Language;
2
+ (function (Language) {
3
+ Language["Japanese"] = "JAPANESE";
4
+ })(Language || (Language = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum Role {
2
+ Student = "STUDENT",
3
+ Teacher = "TEACHER",
4
+ Admin = "ADMIN"
5
+ }
@@ -0,0 +1,6 @@
1
+ export var Role;
2
+ (function (Role) {
3
+ Role["Student"] = "STUDENT";
4
+ Role["Teacher"] = "TEACHER";
5
+ Role["Admin"] = "ADMIN";
6
+ })(Role || (Role = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum StudyItemState {
2
+ Draft = "DRAFT",
3
+ ToDo = "TODO",
4
+ Submitted = "SUBMITTED",
5
+ Marked = "MARKED"
6
+ }
@@ -0,0 +1,7 @@
1
+ export var StudyItemState;
2
+ (function (StudyItemState) {
3
+ StudyItemState["Draft"] = "DRAFT";
4
+ StudyItemState["ToDo"] = "TODO";
5
+ StudyItemState["Submitted"] = "SUBMITTED";
6
+ StudyItemState["Marked"] = "MARKED";
7
+ })(StudyItemState || (StudyItemState = {}));
@@ -0,0 +1,4 @@
1
+ export * from "./schema/authUser.schema";
2
+ export * from "./schema/studyItem.schema";
3
+ export * from "./schema/studyQuestion.schema";
4
+ export * from "./schema/user.schema";
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./schema/authUser.schema";
2
+ export * from "./schema/studyItem.schema";
3
+ export * from "./schema/studyQuestion.schema";
4
+ export * from "./schema/user.schema";
@@ -0,0 +1,6 @@
1
+ import z from "zod";
2
+ export declare const AuthUserSchema: z.ZodObject<{
3
+ email: z.ZodEmail;
4
+ password: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type AuthUser = z.infer<typeof AuthUserSchema>;
@@ -0,0 +1,5 @@
1
+ import z from "zod";
2
+ export const AuthUserSchema = z.object({
3
+ email: z.email().min(1),
4
+ password: z.string().min(1),
5
+ });
@@ -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,7 @@
1
+ import z from "zod";
2
+ export const StudyQuestionSchema = z.object({
3
+ question: z.string().min(1),
4
+ answer: z.string().min(1),
5
+ correct: z.boolean(),
6
+ teacherComment: z.string(),
7
+ });
@@ -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>;
@@ -0,0 +1,7 @@
1
+ import z from "zod";
2
+ import { Role } from "../enum/role.enum";
3
+ export const UserSchema = z.object({
4
+ uid: z.string().min(1),
5
+ email: z.email().min(1),
6
+ role: z.enum(Object.values(Role))
7
+ });
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
+ }