opensoma 0.5.0 → 0.6.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/package.json +5 -1
- package/dist/src/agent-browser-launcher.d.ts +43 -0
- package/dist/src/agent-browser-launcher.d.ts.map +1 -0
- package/dist/src/agent-browser-launcher.js +97 -0
- package/dist/src/agent-browser-launcher.js.map +1 -0
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +3 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/client.d.ts +36 -7
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +231 -63
- package/dist/src/client.js.map +1 -1
- package/dist/src/commands/agent-browser.d.ts +3 -0
- package/dist/src/commands/agent-browser.d.ts.map +1 -0
- package/dist/src/commands/agent-browser.js +27 -0
- package/dist/src/commands/agent-browser.js.map +1 -0
- package/dist/src/commands/auth.d.ts +1 -1
- package/dist/src/commands/auth.d.ts.map +1 -1
- package/dist/src/commands/auth.js +4 -2
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/dashboard.d.ts +13 -0
- package/dist/src/commands/dashboard.d.ts.map +1 -1
- package/dist/src/commands/dashboard.js +10 -18
- package/dist/src/commands/dashboard.js.map +1 -1
- package/dist/src/commands/helpers.d.ts +1 -1
- package/dist/src/commands/helpers.d.ts.map +1 -1
- package/dist/src/commands/helpers.js +2 -2
- package/dist/src/commands/helpers.js.map +1 -1
- package/dist/src/commands/index.d.ts +2 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +2 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/mentoring.d.ts.map +1 -1
- package/dist/src/commands/mentoring.js +54 -29
- package/dist/src/commands/mentoring.js.map +1 -1
- package/dist/src/commands/notice.d.ts.map +1 -1
- package/dist/src/commands/notice.js +2 -1
- package/dist/src/commands/notice.js.map +1 -1
- package/dist/src/commands/report.d.ts.map +1 -1
- package/dist/src/commands/report.js +4 -2
- package/dist/src/commands/report.js.map +1 -1
- package/dist/src/commands/room.d.ts.map +1 -1
- package/dist/src/commands/room.js +125 -2
- package/dist/src/commands/room.js.map +1 -1
- package/dist/src/commands/schedule.d.ts +3 -0
- package/dist/src/commands/schedule.d.ts.map +1 -0
- package/dist/src/commands/schedule.js +27 -0
- package/dist/src/commands/schedule.js.map +1 -0
- package/dist/src/commands/team.d.ts.map +1 -1
- package/dist/src/commands/team.js +55 -4
- package/dist/src/commands/team.js.map +1 -1
- package/dist/src/constants.d.ts +5 -5
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +20 -8
- package/dist/src/constants.js.map +1 -1
- package/dist/src/credential-manager.d.ts +9 -0
- package/dist/src/credential-manager.d.ts.map +1 -1
- package/dist/src/credential-manager.js +24 -0
- package/dist/src/credential-manager.js.map +1 -1
- package/dist/src/formatters.d.ts +11 -3
- package/dist/src/formatters.d.ts.map +1 -1
- package/dist/src/formatters.js +281 -52
- package/dist/src/formatters.js.map +1 -1
- package/dist/src/http.d.ts +8 -0
- package/dist/src/http.d.ts.map +1 -1
- package/dist/src/http.js +29 -1
- package/dist/src/http.js.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/shared/utils/swmaestro.d.ts +34 -1
- package/dist/src/shared/utils/swmaestro.d.ts.map +1 -1
- package/dist/src/shared/utils/swmaestro.js +102 -43
- package/dist/src/shared/utils/swmaestro.js.map +1 -1
- package/dist/src/shared/utils/team-action-params.d.ts +3 -0
- package/dist/src/shared/utils/team-action-params.d.ts.map +1 -0
- package/dist/src/shared/utils/team-action-params.js +10 -0
- package/dist/src/shared/utils/team-action-params.js.map +1 -0
- package/dist/src/shared/utils/team-params.d.ts +12 -0
- package/dist/src/shared/utils/team-params.d.ts.map +1 -0
- package/dist/src/shared/utils/team-params.js +38 -0
- package/dist/src/shared/utils/team-params.js.map +1 -0
- package/dist/src/types.d.ts +147 -10
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +74 -6
- package/dist/src/types.js.map +1 -1
- package/package.json +5 -1
- package/src/agent-browser-launcher.test.ts +263 -0
- package/src/agent-browser-launcher.ts +159 -0
- package/src/cli.ts +4 -2
- package/src/client.test.ts +801 -140
- package/src/client.ts +293 -79
- package/src/commands/agent-browser.ts +33 -0
- package/src/commands/auth.test.ts +83 -32
- package/src/commands/auth.ts +5 -3
- package/src/commands/dashboard.test.ts +57 -0
- package/src/commands/dashboard.ts +22 -19
- package/src/commands/helpers.test.ts +79 -32
- package/src/commands/helpers.ts +3 -3
- package/src/commands/index.ts +2 -1
- package/src/commands/mentoring.ts +60 -29
- package/src/commands/notice.ts +2 -1
- package/src/commands/report.test.ts +7 -7
- package/src/commands/report.ts +4 -2
- package/src/commands/room.ts +160 -1
- package/src/commands/schedule.ts +32 -0
- package/src/commands/team.ts +73 -5
- package/src/constants.ts +20 -8
- package/src/credential-manager.test.ts +49 -5
- package/src/credential-manager.ts +27 -0
- package/src/formatters.test.ts +548 -53
- package/src/formatters.ts +309 -55
- package/src/http.test.ts +108 -39
- package/src/http.ts +41 -2
- package/src/index.ts +10 -1
- package/src/shared/utils/mentoring-params.test.ts +16 -16
- package/src/shared/utils/swmaestro.test.ts +326 -11
- package/src/shared/utils/swmaestro.ts +150 -52
- package/src/shared/utils/team-action-params.test.ts +32 -0
- package/src/shared/utils/team-action-params.ts +10 -0
- package/src/shared/utils/team-params.test.ts +141 -0
- package/src/shared/utils/team-params.ts +53 -0
- package/src/shared/utils/toz.test.ts +12 -7
- package/src/token-extractor.test.ts +12 -12
- package/src/toz-http.test.ts +11 -11
- package/src/types.test.ts +235 -206
- package/src/types.ts +87 -7
- package/dist/src/commands/event.d.ts +0 -3
- package/dist/src/commands/event.d.ts.map +0 -1
- package/dist/src/commands/event.js +0 -58
- package/dist/src/commands/event.js.map +0 -1
- package/src/commands/event.ts +0 -73
package/src/types.test.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { describe, expect,
|
|
1
|
+
import { describe, expect, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ApplicationHistoryItemSchema,
|
|
5
5
|
ApprovalListItemSchema,
|
|
6
6
|
CredentialsSchema,
|
|
7
7
|
DashboardSchema,
|
|
8
|
-
EventListItemSchema,
|
|
9
8
|
MemberInfoSchema,
|
|
10
9
|
MentoringDetailSchema,
|
|
11
10
|
MentoringListItemSchema,
|
|
@@ -16,230 +15,260 @@ import {
|
|
|
16
15
|
ReportDetailSchema,
|
|
17
16
|
ReportListItemSchema,
|
|
18
17
|
RoomCardSchema,
|
|
18
|
+
ScheduleListItemSchema,
|
|
19
19
|
TeamInfoSchema,
|
|
20
20
|
} from './types'
|
|
21
21
|
|
|
22
22
|
describe('schemas', () => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
it('preserves valid MentoringListItem values through parse', () => {
|
|
24
|
+
const input = {
|
|
25
|
+
id: 9572,
|
|
26
|
+
title: 'AI 멘토링',
|
|
27
|
+
type: '자유 멘토링' as const,
|
|
28
|
+
registrationPeriod: { start: '2026-04-01', end: '2026-04-10' },
|
|
29
|
+
sessionDate: '2026-04-11',
|
|
30
|
+
sessionTime: { start: '14:00', end: '15:30' },
|
|
31
|
+
attendees: { current: 3, max: 4 },
|
|
32
|
+
approved: true,
|
|
33
|
+
status: '접수중' as const,
|
|
34
|
+
author: '전수열',
|
|
35
|
+
createdAt: '2026-04-01',
|
|
36
|
+
}
|
|
37
|
+
expect(MentoringListItemSchema.parse(input)).toEqual(input)
|
|
38
|
+
})
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
).
|
|
40
|
+
it('preserves valid MentoringDetail values through parse', () => {
|
|
41
|
+
const input = {
|
|
42
|
+
id: 9572,
|
|
43
|
+
title: 'AI 멘토링',
|
|
44
|
+
type: '멘토 특강' as const,
|
|
45
|
+
registrationPeriod: { start: '2026-04-01', end: '2026-04-10' },
|
|
46
|
+
sessionDate: '2026-04-11',
|
|
47
|
+
sessionTime: { start: '14:00', end: '15:30' },
|
|
48
|
+
attendees: { current: 6, max: 20 },
|
|
49
|
+
approved: false,
|
|
50
|
+
status: '마감' as const,
|
|
51
|
+
author: '전수열',
|
|
52
|
+
createdAt: '2026-04-01',
|
|
53
|
+
content: '<p>내용</p>',
|
|
54
|
+
venue: '온라인(Webex)',
|
|
55
|
+
applicants: [],
|
|
56
|
+
}
|
|
57
|
+
expect(MentoringDetailSchema.parse(input)).toEqual(input)
|
|
58
|
+
})
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
).
|
|
60
|
+
it('preserves valid RoomCard values through parse', () => {
|
|
61
|
+
const input = {
|
|
62
|
+
itemId: 17,
|
|
63
|
+
name: '스페이스 A1',
|
|
64
|
+
capacity: 4,
|
|
65
|
+
availablePeriod: { start: '2026-04-01', end: '2026-12-31' },
|
|
66
|
+
description: '소회의실 : 4인',
|
|
67
|
+
timeSlots: [
|
|
68
|
+
{ time: '09:00', available: true },
|
|
69
|
+
{ time: '09:30', available: false, reservation: { title: '팀 회의', bookedBy: '전수열' } },
|
|
70
|
+
],
|
|
71
|
+
}
|
|
72
|
+
expect(RoomCardSchema.parse(input)).toEqual(input)
|
|
73
|
+
})
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
75
|
+
it('preserves valid Dashboard values through parse', () => {
|
|
76
|
+
const input = {
|
|
77
|
+
name: '전수열',
|
|
78
|
+
role: '멘토',
|
|
79
|
+
organization: 'Indent',
|
|
80
|
+
position: '',
|
|
81
|
+
team: { name: '오픈소마', members: '전수열, 김개발', mentor: '전수열' },
|
|
82
|
+
teams: [],
|
|
83
|
+
mentoringSessions: [{ title: 'AI 멘토링', url: '/mentoring/1', status: '접수중' }],
|
|
84
|
+
roomReservations: [{ title: 'A1 회의', url: '/room/1', status: '예약완료' }],
|
|
85
|
+
}
|
|
86
|
+
expect(DashboardSchema.parse(input)).toEqual(input)
|
|
87
|
+
})
|
|
84
88
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
).
|
|
89
|
+
it('preserves valid NoticeListItem values through parse', () => {
|
|
90
|
+
const input = {
|
|
91
|
+
id: 1,
|
|
92
|
+
title: '공지',
|
|
93
|
+
author: '관리자',
|
|
94
|
+
createdAt: '2026-04-01',
|
|
95
|
+
}
|
|
96
|
+
expect(NoticeListItemSchema.parse(input)).toEqual(input)
|
|
97
|
+
})
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
).
|
|
99
|
+
it('preserves valid NoticeDetail values through parse', () => {
|
|
100
|
+
const input = {
|
|
101
|
+
id: 1,
|
|
102
|
+
title: '공지',
|
|
103
|
+
author: '관리자',
|
|
104
|
+
createdAt: '2026-04-01',
|
|
105
|
+
content: '<p>내용</p>',
|
|
106
|
+
}
|
|
107
|
+
expect(NoticeDetailSchema.parse(input)).toEqual(input)
|
|
108
|
+
})
|
|
103
109
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
it('preserves valid TeamInfo values through parse', () => {
|
|
111
|
+
const input = {
|
|
112
|
+
teams: [
|
|
113
|
+
{
|
|
114
|
+
name: '오픈소마',
|
|
115
|
+
projectName: 'Previzion',
|
|
116
|
+
ownerId: 'owner-1',
|
|
117
|
+
teamId: 'team-a',
|
|
118
|
+
leader: '전수열',
|
|
119
|
+
members: [
|
|
120
|
+
{ name: '전수열', userId: 'uid-1' },
|
|
121
|
+
{ name: '강동우', userId: 'uid-2' },
|
|
122
|
+
],
|
|
123
|
+
mentors: [{ name: '문승현', userId: 'uid-m1' }],
|
|
124
|
+
ictCategoryMajor: 'SW·SI',
|
|
125
|
+
ictCategoryMinor: '응용SW',
|
|
126
|
+
teamCompleted: true,
|
|
127
|
+
mentorCompleted: false,
|
|
128
|
+
joinStatus: '완료',
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
currentTeams: 1,
|
|
132
|
+
maxTeams: 100,
|
|
133
|
+
}
|
|
134
|
+
expect(TeamInfoSchema.parse(input)).toEqual(input)
|
|
135
|
+
})
|
|
114
136
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
).
|
|
137
|
+
it('preserves valid MemberInfo values through parse', () => {
|
|
138
|
+
const input = {
|
|
139
|
+
email: 'neo@example.com',
|
|
140
|
+
name: '전수열',
|
|
141
|
+
gender: '남자',
|
|
142
|
+
birthDate: '1995-01-14',
|
|
143
|
+
phone: '01012345678',
|
|
144
|
+
organization: 'Indent',
|
|
145
|
+
position: '',
|
|
146
|
+
}
|
|
147
|
+
expect(MemberInfoSchema.parse(input)).toEqual(input)
|
|
148
|
+
})
|
|
126
149
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}),
|
|
137
|
-
).toBeDefined()
|
|
150
|
+
it('preserves valid ScheduleListItem values through parse', () => {
|
|
151
|
+
const input = {
|
|
152
|
+
id: 1,
|
|
153
|
+
category: '교육',
|
|
154
|
+
title: '[교육] 디자인씽킹 교육',
|
|
155
|
+
period: { start: '2026-04-21', end: '2026-04-26' },
|
|
156
|
+
}
|
|
157
|
+
expect(ScheduleListItemSchema.parse(input)).toEqual(input)
|
|
158
|
+
})
|
|
138
159
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
).
|
|
160
|
+
it('preserves valid ApplicationHistoryItem values through parse', () => {
|
|
161
|
+
const input = {
|
|
162
|
+
id: 99,
|
|
163
|
+
category: '멘토 특강',
|
|
164
|
+
title: 'AI 멘토링',
|
|
165
|
+
author: '전수열',
|
|
166
|
+
sessionDate: '2026-04-11',
|
|
167
|
+
appliedAt: '2026-04-02 09:00',
|
|
168
|
+
applicationStatus: '신청완료',
|
|
169
|
+
approvalStatus: 'OK',
|
|
170
|
+
applicationDetail: '승인대기',
|
|
171
|
+
note: '-',
|
|
172
|
+
}
|
|
173
|
+
expect(ApplicationHistoryItemSchema.parse(input)).toEqual(input)
|
|
174
|
+
})
|
|
153
175
|
|
|
154
|
-
|
|
176
|
+
it('preserves valid Pagination values through parse', () => {
|
|
177
|
+
const input = { total: 23, currentPage: 2, totalPages: 3 }
|
|
178
|
+
expect(PaginationSchema.parse(input)).toEqual(input)
|
|
179
|
+
})
|
|
155
180
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
).
|
|
181
|
+
it('preserves valid Credentials values through parse', () => {
|
|
182
|
+
const input = {
|
|
183
|
+
sessionCookie: 'session-token',
|
|
184
|
+
csrfToken: 'csrf-token',
|
|
185
|
+
username: 'neo@example.com',
|
|
186
|
+
loggedInAt: '2026-04-09T00:00:00.000Z',
|
|
187
|
+
}
|
|
188
|
+
expect(CredentialsSchema.parse(input)).toEqual(input)
|
|
189
|
+
})
|
|
164
190
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
).
|
|
191
|
+
it('preserves valid ReportListItem values through parse', () => {
|
|
192
|
+
const input = {
|
|
193
|
+
id: 1,
|
|
194
|
+
category: '멘토링',
|
|
195
|
+
title: 'AI 멘토링 보고서',
|
|
196
|
+
progressDate: '2026-04-10',
|
|
197
|
+
status: '승인완료',
|
|
198
|
+
author: '전수열',
|
|
199
|
+
createdAt: '2026-04-11',
|
|
200
|
+
acceptedTime: '2시간',
|
|
201
|
+
payAmount: '100000',
|
|
202
|
+
}
|
|
203
|
+
expect(ReportListItemSchema.parse(input)).toEqual(input)
|
|
204
|
+
})
|
|
178
205
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
).
|
|
206
|
+
it('preserves valid ReportDetail values through parse', () => {
|
|
207
|
+
const input = {
|
|
208
|
+
id: 1,
|
|
209
|
+
category: '멘토링',
|
|
210
|
+
title: 'AI 멘토링 보고서',
|
|
211
|
+
progressDate: '2026-04-10',
|
|
212
|
+
status: '승인완료',
|
|
213
|
+
author: '전수열',
|
|
214
|
+
createdAt: '2026-04-11',
|
|
215
|
+
acceptedTime: '2시간',
|
|
216
|
+
payAmount: '100000',
|
|
217
|
+
content: '멘토링 진행 내용',
|
|
218
|
+
subject: 'AI 기술 멘토링',
|
|
219
|
+
menteeRegion: 'S',
|
|
220
|
+
reportType: 'MRC010',
|
|
221
|
+
teamNames: '오픈소마',
|
|
222
|
+
venue: '스페이스 A1',
|
|
223
|
+
attendanceCount: 4,
|
|
224
|
+
attendanceNames: '김개발, 박코딩, 이알고, 최리즘',
|
|
225
|
+
progressStartTime: '14:00',
|
|
226
|
+
progressEndTime: '16:00',
|
|
227
|
+
exceptStartTime: '',
|
|
228
|
+
exceptEndTime: '',
|
|
229
|
+
exceptReason: '',
|
|
230
|
+
mentorOpinion: '우수',
|
|
231
|
+
nonAttendanceNames: '',
|
|
232
|
+
etc: '',
|
|
233
|
+
files: [],
|
|
234
|
+
}
|
|
235
|
+
expect(ReportDetailSchema.parse(input)).toEqual(input)
|
|
236
|
+
})
|
|
209
237
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
).
|
|
238
|
+
it('preserves valid ApprovalListItem values through parse', () => {
|
|
239
|
+
const input = {
|
|
240
|
+
id: 1,
|
|
241
|
+
category: '멘토링',
|
|
242
|
+
title: 'AI 멘토링 보고서',
|
|
243
|
+
progressDate: '2026-04-10',
|
|
244
|
+
status: '승인완료',
|
|
245
|
+
author: '전수열',
|
|
246
|
+
createdAt: '2026-04-11',
|
|
247
|
+
acceptedTime: '2시간',
|
|
248
|
+
travelExpense: '50000',
|
|
249
|
+
mentoringAllowance: '100000',
|
|
250
|
+
}
|
|
251
|
+
expect(ApprovalListItemSchema.parse(input)).toEqual(input)
|
|
252
|
+
})
|
|
224
253
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
).
|
|
254
|
+
it('preserves valid ReportCreateOptions values through parse', () => {
|
|
255
|
+
const input = {
|
|
256
|
+
menteeRegion: 'S',
|
|
257
|
+
reportType: 'MRC010',
|
|
258
|
+
progressDate: '2026-04-10',
|
|
259
|
+
venue: '스페이스 A1',
|
|
260
|
+
attendanceCount: 4,
|
|
261
|
+
attendanceNames: '김개발, 박코딩, 이알고, 최리즘',
|
|
262
|
+
progressStartTime: '14:00',
|
|
263
|
+
progressEndTime: '16:00',
|
|
264
|
+
subject: 'AI 멘토링 진행 보고',
|
|
265
|
+
content:
|
|
266
|
+
'이번 멘토링에서는 AI 기술의 기초 개념과 실제 적용 사례에 대해 다루었습니다. 참가자들은 머신러닝의 기본 원리와 딥러닝의 구조에 대해 학습하고, 실습을 통해 모델을 구현해보았습니다.',
|
|
267
|
+
}
|
|
268
|
+
expect(ReportCreateOptionsSchema.parse(input)).toEqual(input)
|
|
240
269
|
})
|
|
241
270
|
|
|
242
|
-
|
|
271
|
+
it('rejects invalid values for every schema', () => {
|
|
243
272
|
expect(() => MentoringListItemSchema.parse({})).toThrow()
|
|
244
273
|
expect(() => MentoringDetailSchema.parse({ content: 123 })).toThrow()
|
|
245
274
|
expect(() => RoomCardSchema.parse({ itemId: '17' })).toThrow()
|
|
@@ -250,7 +279,7 @@ describe('schemas', () => {
|
|
|
250
279
|
).toThrow()
|
|
251
280
|
expect(() => TeamInfoSchema.parse({ teams: [{ name: '김개발' }], currentTeams: 1, maxTeams: 100 })).toThrow()
|
|
252
281
|
expect(() => MemberInfoSchema.parse({ email: 1, name: '전수열' })).toThrow()
|
|
253
|
-
expect(() =>
|
|
282
|
+
expect(() => ScheduleListItemSchema.parse({ id: 1, category: '교육', title: '강의' })).toThrow()
|
|
254
283
|
expect(() => ApplicationHistoryItemSchema.parse({ id: 1, status: '신청완료' })).toThrow()
|
|
255
284
|
expect(() => PaginationSchema.parse({ total: '23', currentPage: 2, totalPages: 3 })).toThrow()
|
|
256
285
|
expect(() => CredentialsSchema.parse({ sessionCookie: 'cookie' })).toThrow()
|
package/src/types.ts
CHANGED
|
@@ -18,9 +18,22 @@ const DashboardStatusItemSchema = z.object({
|
|
|
18
18
|
venue: z.string().optional(),
|
|
19
19
|
type: z.enum(['자유 멘토링', '멘토 특강']).optional(),
|
|
20
20
|
})
|
|
21
|
+
const TeamMemberSchema = z.object({
|
|
22
|
+
name: z.string(),
|
|
23
|
+
userId: z.string(),
|
|
24
|
+
})
|
|
21
25
|
const TeamListItemSchema = z.object({
|
|
22
26
|
name: z.string(),
|
|
23
|
-
|
|
27
|
+
projectName: z.string(),
|
|
28
|
+
ownerId: z.string(),
|
|
29
|
+
teamId: z.string(),
|
|
30
|
+
leader: z.string(),
|
|
31
|
+
members: z.array(TeamMemberSchema),
|
|
32
|
+
mentors: z.array(TeamMemberSchema),
|
|
33
|
+
ictCategoryMajor: z.string(),
|
|
34
|
+
ictCategoryMinor: z.string(),
|
|
35
|
+
teamCompleted: z.boolean(),
|
|
36
|
+
mentorCompleted: z.boolean(),
|
|
24
37
|
joinStatus: z.string(),
|
|
25
38
|
})
|
|
26
39
|
|
|
@@ -54,6 +67,23 @@ export const MentoringDetailSchema = MentoringListItemSchema.extend({
|
|
|
54
67
|
})
|
|
55
68
|
export type MentoringDetail = z.infer<typeof MentoringDetailSchema>
|
|
56
69
|
|
|
70
|
+
export const MentoringEditFormSchema = z.object({
|
|
71
|
+
id: z.number(),
|
|
72
|
+
title: z.string(),
|
|
73
|
+
reportCd: z.string(),
|
|
74
|
+
receiptType: z.enum(['UNTIL_LECTURE', 'DIRECT']),
|
|
75
|
+
bgndeDate: z.string(),
|
|
76
|
+
bgndeTime: z.string(),
|
|
77
|
+
enddeDate: z.string(),
|
|
78
|
+
enddeTime: z.string(),
|
|
79
|
+
eventDt: z.string(),
|
|
80
|
+
eventStime: z.string(),
|
|
81
|
+
eventEtime: z.string(),
|
|
82
|
+
applyCnt: z.number(),
|
|
83
|
+
place: z.string(),
|
|
84
|
+
})
|
|
85
|
+
export type MentoringEditForm = z.infer<typeof MentoringEditFormSchema>
|
|
86
|
+
|
|
57
87
|
export const RoomCardSchema = z.object({
|
|
58
88
|
itemId: z.number(),
|
|
59
89
|
name: z.string(),
|
|
@@ -64,11 +94,55 @@ export const RoomCardSchema = z.object({
|
|
|
64
94
|
})
|
|
65
95
|
export type RoomCard = z.infer<typeof RoomCardSchema>
|
|
66
96
|
|
|
97
|
+
export const RoomReservationStatusSchema = z.enum(['confirmed', 'cancelled', 'unknown'])
|
|
98
|
+
export type RoomReservationStatus = z.infer<typeof RoomReservationStatusSchema>
|
|
99
|
+
|
|
100
|
+
export const RoomReservationDetailSchema = z.object({
|
|
101
|
+
rentId: z.number(),
|
|
102
|
+
itemId: z.number(),
|
|
103
|
+
title: z.string(),
|
|
104
|
+
date: z.string(),
|
|
105
|
+
startTime: z.string(),
|
|
106
|
+
endTime: z.string(),
|
|
107
|
+
attendees: z.number(),
|
|
108
|
+
notes: z.string(),
|
|
109
|
+
status: RoomReservationStatusSchema,
|
|
110
|
+
statusCode: z.string(),
|
|
111
|
+
})
|
|
112
|
+
export type RoomReservationDetail = z.infer<typeof RoomReservationDetailSchema>
|
|
113
|
+
|
|
114
|
+
export const RoomReservationListItemSchema = z.object({
|
|
115
|
+
rentId: z.number(),
|
|
116
|
+
venue: z.string(),
|
|
117
|
+
title: z.string(),
|
|
118
|
+
date: z.string(),
|
|
119
|
+
startTime: z.string(),
|
|
120
|
+
endTime: z.string(),
|
|
121
|
+
author: z.string(),
|
|
122
|
+
status: RoomReservationStatusSchema,
|
|
123
|
+
statusLabel: z.string(),
|
|
124
|
+
registeredAt: z.string(),
|
|
125
|
+
})
|
|
126
|
+
export type RoomReservationListItem = z.infer<typeof RoomReservationListItemSchema>
|
|
127
|
+
|
|
128
|
+
export const RoomUpdateOptionsSchema = z.object({
|
|
129
|
+
title: z.string().optional(),
|
|
130
|
+
roomId: z.number().optional(),
|
|
131
|
+
date: z.string().optional(),
|
|
132
|
+
slots: z.array(z.string()).optional(),
|
|
133
|
+
attendees: z.number().optional(),
|
|
134
|
+
notes: z.string().optional(),
|
|
135
|
+
})
|
|
136
|
+
export type RoomUpdateOptions = z.infer<typeof RoomUpdateOptionsSchema>
|
|
137
|
+
|
|
67
138
|
export const DashboardSchema = z.object({
|
|
68
139
|
name: z.string(),
|
|
69
140
|
role: z.string(),
|
|
70
141
|
organization: z.string(),
|
|
71
142
|
position: z.string(),
|
|
143
|
+
// Mirrors the single team the native dashboard HTML renders in `ul.dash-box`.
|
|
144
|
+
// The native page only ever surfaces one team here even when the user belongs
|
|
145
|
+
// to multiple. For the full set, see `teams` below.
|
|
72
146
|
team: z
|
|
73
147
|
.object({
|
|
74
148
|
name: z.string(),
|
|
@@ -76,6 +150,9 @@ export const DashboardSchema = z.object({
|
|
|
76
150
|
mentor: z.string(),
|
|
77
151
|
})
|
|
78
152
|
.optional(),
|
|
153
|
+
// Enriched from `team.list()` so consumers see every team the user belongs to,
|
|
154
|
+
// not just the one the native dashboard chose to render.
|
|
155
|
+
teams: z.array(TeamListItemSchema),
|
|
79
156
|
mentoringSessions: z.array(DashboardStatusItemSchema),
|
|
80
157
|
roomReservations: z.array(DashboardStatusItemSchema),
|
|
81
158
|
})
|
|
@@ -94,6 +171,8 @@ export const NoticeDetailSchema = NoticeListItemSchema.extend({
|
|
|
94
171
|
})
|
|
95
172
|
export type NoticeDetail = z.infer<typeof NoticeDetailSchema>
|
|
96
173
|
|
|
174
|
+
export type TeamMember = z.infer<typeof TeamMemberSchema>
|
|
175
|
+
export type TeamListItem = z.infer<typeof TeamListItemSchema>
|
|
97
176
|
export const TeamInfoSchema = z.object({
|
|
98
177
|
teams: z.array(TeamListItemSchema),
|
|
99
178
|
currentTeams: z.number(),
|
|
@@ -112,21 +191,19 @@ export const MemberInfoSchema = z.object({
|
|
|
112
191
|
})
|
|
113
192
|
export type MemberInfo = z.infer<typeof MemberInfoSchema>
|
|
114
193
|
|
|
115
|
-
export const
|
|
194
|
+
export const ScheduleListItemSchema = z.object({
|
|
116
195
|
id: z.number(),
|
|
117
196
|
category: z.string(),
|
|
118
197
|
title: z.string(),
|
|
119
|
-
|
|
120
|
-
eventPeriod: DateRangeSchema,
|
|
121
|
-
status: z.string(),
|
|
122
|
-
createdAt: z.string(),
|
|
198
|
+
period: DateRangeSchema,
|
|
123
199
|
})
|
|
124
|
-
export type
|
|
200
|
+
export type ScheduleListItem = z.infer<typeof ScheduleListItemSchema>
|
|
125
201
|
|
|
126
202
|
export const ApplicationHistoryItemSchema = z.object({
|
|
127
203
|
id: z.number(),
|
|
128
204
|
category: z.string(),
|
|
129
205
|
title: z.string(),
|
|
206
|
+
url: z.string().optional(),
|
|
130
207
|
author: z.string(),
|
|
131
208
|
sessionDate: z.string(),
|
|
132
209
|
appliedAt: z.string(),
|
|
@@ -294,8 +371,11 @@ export const MentoringCreateOptionsSchema = z.object({
|
|
|
294
371
|
endTime: z.string(),
|
|
295
372
|
venue: z.string(),
|
|
296
373
|
maxAttendees: z.number().optional(),
|
|
374
|
+
receiptType: z.enum(['UNTIL_LECTURE', 'DIRECT']).optional(),
|
|
297
375
|
regStart: z.string().optional(),
|
|
376
|
+
regStartTime: z.string().optional(),
|
|
298
377
|
regEnd: z.string().optional(),
|
|
378
|
+
regEndTime: z.string().optional(),
|
|
299
379
|
content: z.string().optional(),
|
|
300
380
|
})
|
|
301
381
|
export type MentoringCreateOptions = z.infer<typeof MentoringCreateOptionsSchema>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/commands/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAkDnC,eAAO,MAAM,YAAY,SAsBtB,CAAA"}
|