@sekolaos/shared-schema 0.0.0-stage → 1.0.1

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 (73) hide show
  1. package/README.md +118 -3
  2. package/dist/cjs/academic/academic-year.schema.js +43 -0
  3. package/dist/cjs/academic/academic-year.schema.js.map +1 -0
  4. package/dist/cjs/academic/class-room.schema.js +29 -0
  5. package/dist/cjs/academic/class-room.schema.js.map +1 -0
  6. package/dist/cjs/attendance/attendance-class.schema.js +19 -0
  7. package/dist/cjs/attendance/attendance-class.schema.js.map +1 -0
  8. package/dist/cjs/attendance/attendance-kiosk.schema.js +35 -0
  9. package/dist/cjs/attendance/attendance-kiosk.schema.js.map +1 -0
  10. package/dist/cjs/attendance/barcode-rolling.schema.js +18 -0
  11. package/dist/cjs/attendance/barcode-rolling.schema.js.map +1 -0
  12. package/dist/cjs/auth/auth.schema.js +25 -0
  13. package/dist/cjs/auth/auth.schema.js.map +1 -0
  14. package/dist/cjs/auth/role.schema.js +34 -0
  15. package/dist/cjs/auth/role.schema.js.map +1 -0
  16. package/dist/cjs/common/common.schema.js +23 -0
  17. package/dist/cjs/common/common.schema.js.map +1 -0
  18. package/dist/cjs/common/pagination.schema.js +22 -0
  19. package/dist/cjs/common/pagination.schema.js.map +1 -0
  20. package/dist/cjs/index.js +30 -0
  21. package/dist/cjs/index.js.map +1 -0
  22. package/dist/cjs/package.json +3 -0
  23. package/dist/cjs/tenant/attendance-shift.schema.js +59 -0
  24. package/dist/cjs/tenant/attendance-shift.schema.js.map +1 -0
  25. package/dist/cjs/tenant/tenant.schema.js +23 -0
  26. package/dist/cjs/tenant/tenant.schema.js.map +1 -0
  27. package/dist/cjs/user/student.schema.js +65 -0
  28. package/dist/cjs/user/student.schema.js.map +1 -0
  29. package/dist/cjs/user/user.schema.js +56 -0
  30. package/dist/cjs/user/user.schema.js.map +1 -0
  31. package/dist/esm/academic/academic-year.schema.js +40 -0
  32. package/dist/esm/academic/academic-year.schema.js.map +1 -0
  33. package/dist/esm/academic/class-room.schema.js +26 -0
  34. package/dist/esm/academic/class-room.schema.js.map +1 -0
  35. package/dist/esm/attendance/attendance-class.schema.js +16 -0
  36. package/dist/esm/attendance/attendance-class.schema.js.map +1 -0
  37. package/dist/esm/attendance/attendance-kiosk.schema.js +32 -0
  38. package/dist/esm/attendance/attendance-kiosk.schema.js.map +1 -0
  39. package/dist/esm/attendance/barcode-rolling.schema.js +15 -0
  40. package/dist/esm/attendance/barcode-rolling.schema.js.map +1 -0
  41. package/dist/esm/auth/auth.schema.js +22 -0
  42. package/dist/esm/auth/auth.schema.js.map +1 -0
  43. package/dist/esm/auth/role.schema.js +31 -0
  44. package/dist/esm/auth/role.schema.js.map +1 -0
  45. package/dist/esm/common/common.schema.js +19 -0
  46. package/dist/esm/common/common.schema.js.map +1 -0
  47. package/dist/esm/common/pagination.schema.js +18 -0
  48. package/dist/esm/common/pagination.schema.js.map +1 -0
  49. package/dist/esm/index.js +14 -0
  50. package/dist/esm/index.js.map +1 -0
  51. package/dist/esm/tenant/attendance-shift.schema.js +56 -0
  52. package/dist/esm/tenant/attendance-shift.schema.js.map +1 -0
  53. package/dist/esm/tenant/tenant.schema.js +20 -0
  54. package/dist/esm/tenant/tenant.schema.js.map +1 -0
  55. package/dist/esm/user/student.schema.js +62 -0
  56. package/dist/esm/user/student.schema.js.map +1 -0
  57. package/dist/esm/user/user.schema.js +53 -0
  58. package/dist/esm/user/user.schema.js.map +1 -0
  59. package/dist/types/academic/academic-year.schema.d.ts +95 -0
  60. package/dist/types/academic/class-room.schema.d.ts +86 -0
  61. package/dist/types/attendance/attendance-class.schema.d.ts +55 -0
  62. package/dist/types/attendance/attendance-kiosk.schema.d.ts +108 -0
  63. package/dist/types/attendance/barcode-rolling.schema.d.ts +35 -0
  64. package/dist/types/auth/auth.schema.d.ts +105 -0
  65. package/dist/types/auth/role.schema.d.ts +57 -0
  66. package/dist/types/common/common.schema.d.ts +51 -0
  67. package/dist/types/common/pagination.schema.d.ts +58 -0
  68. package/dist/types/index.d.ts +13 -0
  69. package/dist/types/tenant/attendance-shift.schema.d.ts +97 -0
  70. package/dist/types/tenant/tenant.schema.d.ts +54 -0
  71. package/dist/types/user/student.schema.d.ts +234 -0
  72. package/dist/types/user/user.schema.d.ts +154 -0
  73. package/package.json +55 -6
@@ -0,0 +1,97 @@
1
+ import { z } from "zod";
2
+ export declare const shiftTargetTypeEnum: z.ZodEnum<["SISWA", "GURU"]>;
3
+ export declare const attendanceShiftSchema: z.ZodEffects<z.ZodType<{
4
+ id: string;
5
+ name: string;
6
+ tenantId: string;
7
+ targetType: "SISWA" | "GURU";
8
+ checkInStart: string;
9
+ checkInEnd: string;
10
+ checkOutStart: string;
11
+ checkOutEnd: string;
12
+ lateToleranceMinutes?: number | undefined;
13
+ fridayCheckOutStart?: string | null | undefined;
14
+ fridayCheckOutEnd?: string | null | undefined;
15
+ }, z.ZodTypeDef, {
16
+ id: string;
17
+ name: string;
18
+ tenantId: string;
19
+ targetType: "SISWA" | "GURU";
20
+ checkInStart: string;
21
+ checkInEnd: string;
22
+ checkOutStart: string;
23
+ checkOutEnd: string;
24
+ lateToleranceMinutes?: number | undefined;
25
+ fridayCheckOutStart?: string | null | undefined;
26
+ fridayCheckOutEnd?: string | null | undefined;
27
+ }>, {
28
+ id: string;
29
+ name: string;
30
+ tenantId: string;
31
+ targetType: "SISWA" | "GURU";
32
+ checkInStart: string;
33
+ checkInEnd: string;
34
+ checkOutStart: string;
35
+ checkOutEnd: string;
36
+ lateToleranceMinutes?: number | undefined;
37
+ fridayCheckOutStart?: string | null | undefined;
38
+ fridayCheckOutEnd?: string | null | undefined;
39
+ }, {
40
+ id: string;
41
+ name: string;
42
+ tenantId: string;
43
+ targetType: "SISWA" | "GURU";
44
+ checkInStart: string;
45
+ checkInEnd: string;
46
+ checkOutStart: string;
47
+ checkOutEnd: string;
48
+ lateToleranceMinutes?: number | undefined;
49
+ fridayCheckOutStart?: string | null | undefined;
50
+ fridayCheckOutEnd?: string | null | undefined;
51
+ }>;
52
+ export declare const upsertAttendanceShiftSchema: z.ZodEffects<z.ZodType<{
53
+ name: string;
54
+ targetType: "SISWA" | "GURU";
55
+ checkInStart: string;
56
+ checkInEnd: string;
57
+ checkOutStart: string;
58
+ checkOutEnd: string;
59
+ lateToleranceMinutes?: number | undefined;
60
+ fridayCheckOutStart?: string | null | undefined;
61
+ fridayCheckOutEnd?: string | null | undefined;
62
+ }, z.ZodTypeDef, {
63
+ name: string;
64
+ targetType: "SISWA" | "GURU";
65
+ checkInStart: string;
66
+ checkInEnd: string;
67
+ checkOutStart: string;
68
+ checkOutEnd: string;
69
+ lateToleranceMinutes?: number | undefined;
70
+ fridayCheckOutStart?: string | null | undefined;
71
+ fridayCheckOutEnd?: string | null | undefined;
72
+ }>, {
73
+ name: string;
74
+ targetType: "SISWA" | "GURU";
75
+ checkInStart: string;
76
+ checkInEnd: string;
77
+ checkOutStart: string;
78
+ checkOutEnd: string;
79
+ lateToleranceMinutes?: number | undefined;
80
+ fridayCheckOutStart?: string | null | undefined;
81
+ fridayCheckOutEnd?: string | null | undefined;
82
+ }, {
83
+ name: string;
84
+ targetType: "SISWA" | "GURU";
85
+ checkInStart: string;
86
+ checkInEnd: string;
87
+ checkOutStart: string;
88
+ checkOutEnd: string;
89
+ lateToleranceMinutes?: number | undefined;
90
+ fridayCheckOutStart?: string | null | undefined;
91
+ fridayCheckOutEnd?: string | null | undefined;
92
+ }>;
93
+ export type ShiftTargetType = z.infer<typeof shiftTargetTypeEnum>;
94
+ export type AttendanceShift = z.infer<typeof attendanceShiftSchema>;
95
+ export type AttendanceShiftInput = z.input<typeof attendanceShiftSchema>;
96
+ export type UpsertAttendanceShiftInput = z.infer<typeof upsertAttendanceShiftSchema>;
97
+ export type UpsertAttendanceShiftSchemaInput = z.input<typeof upsertAttendanceShiftSchema>;
@@ -0,0 +1,54 @@
1
+ import { z } from "zod";
2
+ export declare const tenantSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ slug: z.ZodString;
5
+ name: z.ZodString;
6
+ npsn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
7
+ logoUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
8
+ timezone: z.ZodDefault<z.ZodString>;
9
+ createdAt: z.ZodString;
10
+ updatedAt: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ id: string;
13
+ slug: string;
14
+ name: string;
15
+ timezone: string;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ npsn?: string | null | undefined;
19
+ logoUrl?: string | null | undefined;
20
+ }, {
21
+ id: string;
22
+ slug: string;
23
+ name: string;
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ npsn?: string | null | undefined;
27
+ logoUrl?: string | null | undefined;
28
+ timezone?: string | undefined;
29
+ }>;
30
+ export declare const createTenantSchema: z.ZodObject<Pick<{
31
+ id: z.ZodString;
32
+ slug: z.ZodString;
33
+ name: z.ZodString;
34
+ npsn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
+ logoUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
36
+ timezone: z.ZodDefault<z.ZodString>;
37
+ createdAt: z.ZodString;
38
+ updatedAt: z.ZodString;
39
+ }, "slug" | "name" | "npsn" | "logoUrl" | "timezone">, "strip", z.ZodTypeAny, {
40
+ slug: string;
41
+ name: string;
42
+ timezone: string;
43
+ npsn?: string | null | undefined;
44
+ logoUrl?: string | null | undefined;
45
+ }, {
46
+ slug: string;
47
+ name: string;
48
+ npsn?: string | null | undefined;
49
+ logoUrl?: string | null | undefined;
50
+ timezone?: string | undefined;
51
+ }>;
52
+ export type Tenant = z.infer<typeof tenantSchema>;
53
+ export type CreateTenantInput = z.infer<typeof createTenantSchema>;
54
+ export type CreateTenantSchemaInput = z.input<typeof createTenantSchema>;
@@ -0,0 +1,234 @@
1
+ import { z } from "zod";
2
+ export declare const genderEnum: z.ZodEnum<["L", "P"]>;
3
+ export declare const nisSchema: z.ZodString;
4
+ export declare const nisnSchema: z.ZodString;
5
+ export declare const barcodeValueSchema: z.ZodString;
6
+ export declare const parentPhoneSchema: z.ZodString;
7
+ export declare const studentSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ tenantId: z.ZodString;
10
+ nis: z.ZodString;
11
+ nisn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
12
+ fullName: z.ZodString;
13
+ gender: z.ZodEnum<["L", "P"]>;
14
+ classRoomId: z.ZodString;
15
+ classRoomName: z.ZodString;
16
+ parentPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
17
+ barcodeValue: z.ZodString;
18
+ isActive: z.ZodDefault<z.ZodBoolean>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ id: string;
21
+ tenantId: string;
22
+ isActive: boolean;
23
+ fullName: string;
24
+ nis: string;
25
+ gender: "L" | "P";
26
+ classRoomId: string;
27
+ classRoomName: string;
28
+ barcodeValue: string;
29
+ nisn?: string | null | undefined;
30
+ parentPhone?: string | null | undefined;
31
+ }, {
32
+ id: string;
33
+ tenantId: string;
34
+ fullName: string;
35
+ nis: string;
36
+ gender: "L" | "P";
37
+ classRoomId: string;
38
+ classRoomName: string;
39
+ barcodeValue: string;
40
+ isActive?: boolean | undefined;
41
+ nisn?: string | null | undefined;
42
+ parentPhone?: string | null | undefined;
43
+ }>;
44
+ export declare const createStudentSchema: z.ZodObject<{
45
+ nis: z.ZodString;
46
+ nisn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
47
+ fullName: z.ZodString;
48
+ gender: z.ZodEnum<["L", "P"]>;
49
+ classRoomId: z.ZodString;
50
+ parentPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
51
+ barcodeValue: z.ZodOptional<z.ZodString>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ fullName: string;
54
+ nis: string;
55
+ gender: "L" | "P";
56
+ classRoomId: string;
57
+ nisn?: string | null | undefined;
58
+ parentPhone?: string | null | undefined;
59
+ barcodeValue?: string | undefined;
60
+ }, {
61
+ fullName: string;
62
+ nis: string;
63
+ gender: "L" | "P";
64
+ classRoomId: string;
65
+ nisn?: string | null | undefined;
66
+ parentPhone?: string | null | undefined;
67
+ barcodeValue?: string | undefined;
68
+ }>;
69
+ export declare const updateStudentSchema: z.ZodObject<{
70
+ nis: z.ZodOptional<z.ZodString>;
71
+ nisn: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
72
+ fullName: z.ZodOptional<z.ZodString>;
73
+ gender: z.ZodOptional<z.ZodEnum<["L", "P"]>>;
74
+ classRoomId: z.ZodOptional<z.ZodString>;
75
+ parentPhone: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
76
+ barcodeValue: z.ZodOptional<z.ZodOptional<z.ZodString>>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ fullName?: string | undefined;
79
+ nis?: string | undefined;
80
+ nisn?: string | null | undefined;
81
+ gender?: "L" | "P" | undefined;
82
+ classRoomId?: string | undefined;
83
+ parentPhone?: string | null | undefined;
84
+ barcodeValue?: string | undefined;
85
+ }, {
86
+ fullName?: string | undefined;
87
+ nis?: string | undefined;
88
+ nisn?: string | null | undefined;
89
+ gender?: "L" | "P" | undefined;
90
+ classRoomId?: string | undefined;
91
+ parentPhone?: string | null | undefined;
92
+ barcodeValue?: string | undefined;
93
+ }>;
94
+ export declare const studentOfflineSyncCacheSchema: z.ZodObject<Pick<{
95
+ id: z.ZodString;
96
+ tenantId: z.ZodString;
97
+ nis: z.ZodString;
98
+ nisn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
99
+ fullName: z.ZodString;
100
+ gender: z.ZodEnum<["L", "P"]>;
101
+ classRoomId: z.ZodString;
102
+ classRoomName: z.ZodString;
103
+ parentPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
104
+ barcodeValue: z.ZodString;
105
+ isActive: z.ZodDefault<z.ZodBoolean>;
106
+ }, "id" | "fullName" | "nis" | "classRoomId" | "classRoomName" | "barcodeValue">, "strip", z.ZodTypeAny, {
107
+ id: string;
108
+ fullName: string;
109
+ nis: string;
110
+ classRoomId: string;
111
+ classRoomName: string;
112
+ barcodeValue: string;
113
+ }, {
114
+ id: string;
115
+ fullName: string;
116
+ nis: string;
117
+ classRoomId: string;
118
+ classRoomName: string;
119
+ barcodeValue: string;
120
+ }>;
121
+ export declare const bulkImportStudentRowSchema: z.ZodObject<{
122
+ nis: z.ZodString;
123
+ nisn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
124
+ fullName: z.ZodString;
125
+ gender: z.ZodEnum<["L", "P"]>;
126
+ className: z.ZodString;
127
+ parentPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
128
+ }, "strip", z.ZodTypeAny, {
129
+ fullName: string;
130
+ nis: string;
131
+ gender: "L" | "P";
132
+ className: string;
133
+ nisn?: string | null | undefined;
134
+ parentPhone?: string | null | undefined;
135
+ }, {
136
+ fullName: string;
137
+ nis: string;
138
+ gender: "L" | "P";
139
+ className: string;
140
+ nisn?: string | null | undefined;
141
+ parentPhone?: string | null | undefined;
142
+ }>;
143
+ export declare const bulkImportStudentRequestSchema: z.ZodObject<{
144
+ academicYearId: z.ZodString;
145
+ defaultClassRoomId: z.ZodOptional<z.ZodString>;
146
+ students: z.ZodArray<z.ZodObject<{
147
+ nis: z.ZodString;
148
+ nisn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
149
+ fullName: z.ZodString;
150
+ gender: z.ZodEnum<["L", "P"]>;
151
+ className: z.ZodString;
152
+ parentPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ fullName: string;
155
+ nis: string;
156
+ gender: "L" | "P";
157
+ className: string;
158
+ nisn?: string | null | undefined;
159
+ parentPhone?: string | null | undefined;
160
+ }, {
161
+ fullName: string;
162
+ nis: string;
163
+ gender: "L" | "P";
164
+ className: string;
165
+ nisn?: string | null | undefined;
166
+ parentPhone?: string | null | undefined;
167
+ }>, "many">;
168
+ }, "strip", z.ZodTypeAny, {
169
+ academicYearId: string;
170
+ students: {
171
+ fullName: string;
172
+ nis: string;
173
+ gender: "L" | "P";
174
+ className: string;
175
+ nisn?: string | null | undefined;
176
+ parentPhone?: string | null | undefined;
177
+ }[];
178
+ defaultClassRoomId?: string | undefined;
179
+ }, {
180
+ academicYearId: string;
181
+ students: {
182
+ fullName: string;
183
+ nis: string;
184
+ gender: "L" | "P";
185
+ className: string;
186
+ nisn?: string | null | undefined;
187
+ parentPhone?: string | null | undefined;
188
+ }[];
189
+ defaultClassRoomId?: string | undefined;
190
+ }>;
191
+ export declare const bulkImportStudentResponseSchema: z.ZodObject<{
192
+ totalProcessed: z.ZodNumber;
193
+ totalSuccess: z.ZodNumber;
194
+ totalFailed: z.ZodNumber;
195
+ errors: z.ZodArray<z.ZodObject<{
196
+ row: z.ZodNumber;
197
+ nis: z.ZodOptional<z.ZodString>;
198
+ message: z.ZodString;
199
+ }, "strip", z.ZodTypeAny, {
200
+ message: string;
201
+ row: number;
202
+ nis?: string | undefined;
203
+ }, {
204
+ message: string;
205
+ row: number;
206
+ nis?: string | undefined;
207
+ }>, "many">;
208
+ }, "strip", z.ZodTypeAny, {
209
+ errors: {
210
+ message: string;
211
+ row: number;
212
+ nis?: string | undefined;
213
+ }[];
214
+ totalProcessed: number;
215
+ totalSuccess: number;
216
+ totalFailed: number;
217
+ }, {
218
+ errors: {
219
+ message: string;
220
+ row: number;
221
+ nis?: string | undefined;
222
+ }[];
223
+ totalProcessed: number;
224
+ totalSuccess: number;
225
+ totalFailed: number;
226
+ }>;
227
+ export type Gender = z.infer<typeof genderEnum>;
228
+ export type Student = z.infer<typeof studentSchema>;
229
+ export type CreateStudentInput = z.infer<typeof createStudentSchema>;
230
+ export type UpdateStudentInput = z.infer<typeof updateStudentSchema>;
231
+ export type StudentOfflineCache = z.infer<typeof studentOfflineSyncCacheSchema>;
232
+ export type BulkImportStudentRow = z.infer<typeof bulkImportStudentRowSchema>;
233
+ export type BulkImportStudentRequest = z.infer<typeof bulkImportStudentRequestSchema>;
234
+ export type BulkImportStudentResponse = z.infer<typeof bulkImportStudentResponseSchema>;
@@ -0,0 +1,154 @@
1
+ import { z } from "zod";
2
+ export declare const usernameSchema: z.ZodString;
3
+ export declare const passwordSchema: z.ZodString;
4
+ export declare const nipSchema: z.ZodString;
5
+ export declare const phoneNumberSchema: z.ZodString;
6
+ export declare const userSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ tenantId: z.ZodString;
9
+ username: z.ZodString;
10
+ email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
11
+ fullName: z.ZodString;
12
+ isActive: z.ZodDefault<z.ZodBoolean>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ id: string;
15
+ tenantId: string;
16
+ isActive: boolean;
17
+ username: string;
18
+ fullName: string;
19
+ email?: string | null | undefined;
20
+ }, {
21
+ id: string;
22
+ tenantId: string;
23
+ username: string;
24
+ fullName: string;
25
+ isActive?: boolean | undefined;
26
+ email?: string | null | undefined;
27
+ }>;
28
+ export declare const userProfileSchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ tenantId: z.ZodString;
31
+ username: z.ZodString;
32
+ email: z.ZodString;
33
+ fullName: z.ZodString;
34
+ nip: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
+ phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
36
+ isActive: z.ZodDefault<z.ZodBoolean>;
37
+ roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ roleId: z.ZodString;
39
+ roleName: z.ZodString;
40
+ roleSlug: z.ZodString;
41
+ permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ permissions: Record<string, string[]>;
44
+ roleId: string;
45
+ roleName: string;
46
+ roleSlug: string;
47
+ }, {
48
+ permissions: Record<string, string[]>;
49
+ roleId: string;
50
+ roleName: string;
51
+ roleSlug: string;
52
+ }>, "many">>;
53
+ createdAt: z.ZodString;
54
+ updatedAt: z.ZodString;
55
+ }, "strip", z.ZodTypeAny, {
56
+ id: string;
57
+ createdAt: string;
58
+ updatedAt: string;
59
+ tenantId: string;
60
+ isActive: boolean;
61
+ username: string;
62
+ email: string;
63
+ fullName: string;
64
+ nip?: string | null | undefined;
65
+ phoneNumber?: string | null | undefined;
66
+ roles?: {
67
+ permissions: Record<string, string[]>;
68
+ roleId: string;
69
+ roleName: string;
70
+ roleSlug: string;
71
+ }[] | undefined;
72
+ }, {
73
+ id: string;
74
+ createdAt: string;
75
+ updatedAt: string;
76
+ tenantId: string;
77
+ username: string;
78
+ email: string;
79
+ fullName: string;
80
+ isActive?: boolean | undefined;
81
+ nip?: string | null | undefined;
82
+ phoneNumber?: string | null | undefined;
83
+ roles?: {
84
+ permissions: Record<string, string[]>;
85
+ roleId: string;
86
+ roleName: string;
87
+ roleSlug: string;
88
+ }[] | undefined;
89
+ }>;
90
+ export declare const createUserSchema: z.ZodObject<{
91
+ username: z.ZodString;
92
+ email: z.ZodString;
93
+ password: z.ZodString;
94
+ fullName: z.ZodString;
95
+ nip: z.ZodNullable<z.ZodOptional<z.ZodString>>;
96
+ phoneNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
97
+ roleIds: z.ZodArray<z.ZodString, "many">;
98
+ academicYearId: z.ZodString;
99
+ }, "strip", z.ZodTypeAny, {
100
+ academicYearId: string;
101
+ password: string;
102
+ username: string;
103
+ email: string;
104
+ fullName: string;
105
+ roleIds: string[];
106
+ nip?: string | null | undefined;
107
+ phoneNumber?: string | null | undefined;
108
+ }, {
109
+ academicYearId: string;
110
+ password: string;
111
+ username: string;
112
+ email: string;
113
+ fullName: string;
114
+ roleIds: string[];
115
+ nip?: string | null | undefined;
116
+ phoneNumber?: string | null | undefined;
117
+ }>;
118
+ export declare const updateUserSchema: z.ZodObject<{
119
+ username: z.ZodOptional<z.ZodString>;
120
+ email: z.ZodOptional<z.ZodString>;
121
+ fullName: z.ZodOptional<z.ZodString>;
122
+ nip: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
123
+ phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ username?: string | undefined;
126
+ email?: string | undefined;
127
+ fullName?: string | undefined;
128
+ nip?: string | null | undefined;
129
+ phoneNumber?: string | null | undefined;
130
+ }, {
131
+ username?: string | undefined;
132
+ email?: string | undefined;
133
+ fullName?: string | undefined;
134
+ nip?: string | null | undefined;
135
+ phoneNumber?: string | null | undefined;
136
+ }>;
137
+ export declare const assignUserRolesRequestSchema: z.ZodObject<{
138
+ userId: z.ZodString;
139
+ academicYearId: z.ZodString;
140
+ roleIds: z.ZodArray<z.ZodString, "many">;
141
+ }, "strip", z.ZodTypeAny, {
142
+ userId: string;
143
+ academicYearId: string;
144
+ roleIds: string[];
145
+ }, {
146
+ userId: string;
147
+ academicYearId: string;
148
+ roleIds: string[];
149
+ }>;
150
+ export type User = z.infer<typeof userSchema>;
151
+ export type UserProfile = z.infer<typeof userProfileSchema>;
152
+ export type CreateUserInput = z.infer<typeof createUserSchema>;
153
+ export type UpdateUserInput = z.infer<typeof updateUserSchema>;
154
+ export type AssignUserRolesRequest = z.infer<typeof assignUserRolesRequestSchema>;
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
- {
2
- "name": "@sekolaos/shared-schema",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@sekolaos/shared-schema",
3
+ "version": "1.0.1",
4
+ "description": "Single source of truth untuk validasi skema data dan inferensi tipe TypeScript pada ekosistem Sekolaos (backend Express, kiosk presensi, dan modul lainnya).",
5
+ "license": "ISC",
6
+ "author": "Sekolaos",
7
+ "type": "module",
8
+ "main": "./dist/cjs/index.js",
9
+ "module": "./dist/esm/index.js",
10
+ "types": "./dist/types/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/types/index.d.ts",
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
16
+ },
17
+ "./package.json": "./package.json"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "sideEffects": false,
23
+ "engines": {
24
+ "node": ">=18.0.0"
25
+ },
26
+ "scripts": {
27
+ "clean": "rimraf dist",
28
+ "build": "pnpm run clean && pnpm run build:esm && pnpm run build:cjs && pnpm run build:types && node ./scripts/write-cjs-pkg.cjs",
29
+ "build:esm": "tsc -p tsconfig.esm.json",
30
+ "build:cjs": "tsc -p tsconfig.cjs.json",
31
+ "build:types": "tsc -p tsconfig.types.json",
32
+ "typecheck": "tsc -p tsconfig.json --noEmit",
33
+ "test": "vitest run",
34
+ "test:watch": "vitest",
35
+ "prepublishOnly": "pnpm run build && pnpm run test"
36
+ },
37
+ "peerDependencies": {
38
+ "zod": "^3.23.0"
39
+ },
40
+ "devDependencies": {
41
+ "rimraf": "^6.0.1",
42
+ "typescript": "^5.6.3",
43
+ "vitest": "^2.1.8",
44
+ "zod": "^3.23.8"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "keywords": [
50
+ "sekolaos",
51
+ "zod",
52
+ "schema",
53
+ "shared"
54
+ ]
55
+ }