@zlooks.cn/resume-shared 0.0.0-stage → 0.1.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.
- package/dist/document.d.ts +227 -0
- package/dist/document.d.ts.map +1 -0
- package/dist/document.js +137 -0
- package/dist/document.js.map +1 -0
- package/dist/index.d.ts +1771 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -0
- package/dist/share-theme.d.ts +50 -0
- package/dist/share-theme.d.ts.map +1 -0
- package/dist/share-theme.js +15 -0
- package/dist/share-theme.js.map +1 -0
- package/package.json +30 -4
- package/README.md +0 -3
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const resumeSectionSchema: z.ZodEnum<{
|
|
3
|
+
educations: "educations";
|
|
4
|
+
jobPreference: "jobPreference";
|
|
5
|
+
projects: "projects";
|
|
6
|
+
skills: "skills";
|
|
7
|
+
summary: "summary";
|
|
8
|
+
supplements: "supplements";
|
|
9
|
+
workExperiences: "workExperiences";
|
|
10
|
+
}>;
|
|
11
|
+
export type ResumeSection = z.infer<typeof resumeSectionSchema>;
|
|
12
|
+
export declare const RESUME_SECTION_LABELS: Record<ResumeSection, string>;
|
|
13
|
+
export declare const workExperienceSchema: z.ZodObject<{
|
|
14
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
15
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
16
|
+
current: z.ZodBoolean;
|
|
17
|
+
id: z.ZodUUID;
|
|
18
|
+
company: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
19
|
+
position: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
20
|
+
description: z.ZodString;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export declare const projectSchema: z.ZodObject<{
|
|
23
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
24
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
25
|
+
current: z.ZodBoolean;
|
|
26
|
+
id: z.ZodUUID;
|
|
27
|
+
name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
28
|
+
role: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
29
|
+
description: z.ZodString;
|
|
30
|
+
contributions: z.ZodString;
|
|
31
|
+
outcome: z.ZodString;
|
|
32
|
+
url: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
export declare const educationSchema: z.ZodObject<{
|
|
35
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
36
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
37
|
+
current: z.ZodBoolean;
|
|
38
|
+
id: z.ZodUUID;
|
|
39
|
+
school: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
40
|
+
major: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
41
|
+
degree: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export declare const skillSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodUUID;
|
|
45
|
+
name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
46
|
+
category: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
47
|
+
level: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
export declare const supplementSchema: z.ZodObject<{
|
|
50
|
+
id: z.ZodUUID;
|
|
51
|
+
title: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
52
|
+
description: z.ZodString;
|
|
53
|
+
date: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
54
|
+
url: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
export declare const RESUME_ENTRY_LIMIT = 50;
|
|
57
|
+
export declare const RESUME_SKILL_LIMIT = 100;
|
|
58
|
+
export declare const resumeDocumentSchema: z.ZodObject<{
|
|
59
|
+
summary: z.ZodString;
|
|
60
|
+
jobPreference: z.ZodObject<{
|
|
61
|
+
role: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
62
|
+
cities: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
63
|
+
workMode: z.ZodEnum<{
|
|
64
|
+
hybrid: "hybrid";
|
|
65
|
+
onsite: "onsite";
|
|
66
|
+
remote: "remote";
|
|
67
|
+
unspecified: "unspecified";
|
|
68
|
+
}>;
|
|
69
|
+
availability: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
70
|
+
salary: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
workExperiences: z.ZodArray<z.ZodObject<{
|
|
73
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
74
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
75
|
+
current: z.ZodBoolean;
|
|
76
|
+
id: z.ZodUUID;
|
|
77
|
+
company: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
78
|
+
position: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
79
|
+
description: z.ZodString;
|
|
80
|
+
}, z.core.$strict>>;
|
|
81
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
82
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
83
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
84
|
+
current: z.ZodBoolean;
|
|
85
|
+
id: z.ZodUUID;
|
|
86
|
+
name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
87
|
+
role: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
88
|
+
description: z.ZodString;
|
|
89
|
+
contributions: z.ZodString;
|
|
90
|
+
outcome: z.ZodString;
|
|
91
|
+
url: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
educations: z.ZodArray<z.ZodObject<{
|
|
94
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
95
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
96
|
+
current: z.ZodBoolean;
|
|
97
|
+
id: z.ZodUUID;
|
|
98
|
+
school: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
99
|
+
major: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
100
|
+
degree: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
101
|
+
}, z.core.$strict>>;
|
|
102
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
103
|
+
id: z.ZodUUID;
|
|
104
|
+
name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
105
|
+
category: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
106
|
+
level: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
107
|
+
}, z.core.$strict>>;
|
|
108
|
+
supplements: z.ZodArray<z.ZodObject<{
|
|
109
|
+
id: z.ZodUUID;
|
|
110
|
+
title: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
111
|
+
description: z.ZodString;
|
|
112
|
+
date: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
113
|
+
url: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
basics: z.ZodObject<{
|
|
116
|
+
name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
117
|
+
title: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
118
|
+
avatarUrl: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
119
|
+
city: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
120
|
+
birthDate: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodISODate]>>;
|
|
121
|
+
workStartMonth: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
|
|
122
|
+
email: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodEmail]>;
|
|
123
|
+
phone: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
124
|
+
wechat: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
125
|
+
homepage: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
126
|
+
}, z.core.$strict>;
|
|
127
|
+
display: z.ZodObject<{
|
|
128
|
+
email: z.ZodBoolean;
|
|
129
|
+
phone: z.ZodBoolean;
|
|
130
|
+
wechat: z.ZodBoolean;
|
|
131
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
132
|
+
key: z.ZodEnum<{
|
|
133
|
+
educations: "educations";
|
|
134
|
+
jobPreference: "jobPreference";
|
|
135
|
+
projects: "projects";
|
|
136
|
+
skills: "skills";
|
|
137
|
+
summary: "summary";
|
|
138
|
+
supplements: "supplements";
|
|
139
|
+
workExperiences: "workExperiences";
|
|
140
|
+
}>;
|
|
141
|
+
visible: z.ZodBoolean;
|
|
142
|
+
}, z.core.$strict>>;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
export declare const resumePublicDocumentSchema: z.ZodObject<{
|
|
146
|
+
summary: z.ZodString;
|
|
147
|
+
jobPreference: z.ZodObject<{
|
|
148
|
+
role: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
149
|
+
cities: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
150
|
+
workMode: z.ZodEnum<{
|
|
151
|
+
hybrid: "hybrid";
|
|
152
|
+
onsite: "onsite";
|
|
153
|
+
remote: "remote";
|
|
154
|
+
unspecified: "unspecified";
|
|
155
|
+
}>;
|
|
156
|
+
availability: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
157
|
+
salary: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
workExperiences: z.ZodArray<z.ZodObject<{
|
|
160
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
161
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
162
|
+
current: z.ZodBoolean;
|
|
163
|
+
id: z.ZodUUID;
|
|
164
|
+
company: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
165
|
+
position: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
166
|
+
description: z.ZodString;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
169
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
170
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
171
|
+
current: z.ZodBoolean;
|
|
172
|
+
id: z.ZodUUID;
|
|
173
|
+
name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
174
|
+
role: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
175
|
+
description: z.ZodString;
|
|
176
|
+
contributions: z.ZodString;
|
|
177
|
+
outcome: z.ZodString;
|
|
178
|
+
url: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
179
|
+
}, z.core.$strict>>;
|
|
180
|
+
educations: z.ZodArray<z.ZodObject<{
|
|
181
|
+
startMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
182
|
+
endMonth: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
183
|
+
current: z.ZodBoolean;
|
|
184
|
+
id: z.ZodUUID;
|
|
185
|
+
school: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
186
|
+
major: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
187
|
+
degree: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
188
|
+
}, z.core.$strict>>;
|
|
189
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
190
|
+
id: z.ZodUUID;
|
|
191
|
+
name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
192
|
+
category: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
193
|
+
level: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
194
|
+
}, z.core.$strict>>;
|
|
195
|
+
supplements: z.ZodArray<z.ZodObject<{
|
|
196
|
+
id: z.ZodUUID;
|
|
197
|
+
title: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
198
|
+
description: z.ZodString;
|
|
199
|
+
date: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
|
|
200
|
+
url: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
201
|
+
}, z.core.$strict>>;
|
|
202
|
+
basics: z.ZodObject<{
|
|
203
|
+
name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
204
|
+
title: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
205
|
+
avatarUrl: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
206
|
+
city: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
207
|
+
birthDate: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodISODate]>>;
|
|
208
|
+
workStartMonth: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>;
|
|
209
|
+
homepage: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>;
|
|
210
|
+
email: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodEmail]>>;
|
|
211
|
+
phone: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
212
|
+
wechat: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
213
|
+
}, z.core.$strict>;
|
|
214
|
+
sectionOrder: z.ZodArray<z.ZodEnum<{
|
|
215
|
+
educations: "educations";
|
|
216
|
+
jobPreference: "jobPreference";
|
|
217
|
+
projects: "projects";
|
|
218
|
+
skills: "skills";
|
|
219
|
+
summary: "summary";
|
|
220
|
+
supplements: "supplements";
|
|
221
|
+
workExperiences: "workExperiences";
|
|
222
|
+
}>>;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
export type ResumeDocument = z.infer<typeof resumeDocumentSchema>;
|
|
225
|
+
export type ResumePublicDocument = z.infer<typeof resumePublicDocumentSchema>;
|
|
226
|
+
export declare const emptyResumeDocument: ResumeDocument;
|
|
227
|
+
//# sourceMappingURL=document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../src/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,mBAAmB;;;;;;;;EAE9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAQ/D,CAAC;AAuBF,eAAO,MAAM,oBAAoB;;;;;;;;kBAMK,CAAC;AACvC,eAAO,MAAM,aAAa;;;;;;;;;;;kBASU,CAAC;AACrC,eAAO,MAAM,eAAe;;;;;;;;kBAMU,CAAC;AACvC,eAAO,MAAM,WAAW;;;;;kBAKtB,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;kBAM3B,CAAC;AAEH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAuBtC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAWqE,CAAC;AAEvG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBASrC,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,mBAAmB,EAAE,cAehC,CAAC"}
|
package/dist/document.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const markdown = (limit) => z.string()
|
|
3
|
+
.refine((value) => !value.includes('\u0000'), '内容不能包含空字符')
|
|
4
|
+
.refine((value) => Array.from(value).length <= limit, '内容超过允许长度');
|
|
5
|
+
const text = (limit) => z.string()
|
|
6
|
+
.transform((value) => value.trim().normalize('NFKC'))
|
|
7
|
+
.pipe(markdown(limit));
|
|
8
|
+
const url = z.union([z.literal(''), z.url({ protocol: /^https?$/ }).max(2048)]);
|
|
9
|
+
const month = z.union([z.literal(''), z.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/)]);
|
|
10
|
+
const id = z.uuid();
|
|
11
|
+
export const resumeSectionSchema = z.enum([
|
|
12
|
+
'summary', 'jobPreference', 'workExperiences', 'projects', 'educations', 'skills', 'supplements',
|
|
13
|
+
]);
|
|
14
|
+
export const RESUME_SECTION_LABELS = {
|
|
15
|
+
summary: '个人简介',
|
|
16
|
+
jobPreference: '求职意向',
|
|
17
|
+
workExperiences: '工作经历',
|
|
18
|
+
projects: '项目经历',
|
|
19
|
+
educations: '教育经历',
|
|
20
|
+
skills: '专业技能',
|
|
21
|
+
supplements: '补充信息',
|
|
22
|
+
};
|
|
23
|
+
const basics = z.strictObject({
|
|
24
|
+
name: text(160),
|
|
25
|
+
title: text(160),
|
|
26
|
+
avatarUrl: url,
|
|
27
|
+
city: text(100),
|
|
28
|
+
birthDate: z.union([z.literal(''), z.iso.date()]).default(''),
|
|
29
|
+
workStartMonth: month.default(''),
|
|
30
|
+
email: z.union([z.literal(''), z.email().max(320)]),
|
|
31
|
+
phone: text(80),
|
|
32
|
+
wechat: text(100),
|
|
33
|
+
homepage: url,
|
|
34
|
+
});
|
|
35
|
+
const period = {
|
|
36
|
+
startMonth: month,
|
|
37
|
+
endMonth: month,
|
|
38
|
+
current: z.boolean(),
|
|
39
|
+
};
|
|
40
|
+
const validPeriod = (entry) => (!entry.current || !entry.endMonth)
|
|
41
|
+
&& (!entry.startMonth || !entry.endMonth || entry.endMonth >= entry.startMonth);
|
|
42
|
+
export const workExperienceSchema = z.strictObject({
|
|
43
|
+
id,
|
|
44
|
+
company: text(200),
|
|
45
|
+
position: text(160),
|
|
46
|
+
...period,
|
|
47
|
+
description: markdown(10000),
|
|
48
|
+
}).refine(validPeriod, '请检查工作经历的起止时间');
|
|
49
|
+
export const projectSchema = z.strictObject({
|
|
50
|
+
id,
|
|
51
|
+
name: text(200),
|
|
52
|
+
role: text(200),
|
|
53
|
+
...period,
|
|
54
|
+
description: markdown(10000),
|
|
55
|
+
contributions: markdown(10000),
|
|
56
|
+
outcome: markdown(5000),
|
|
57
|
+
url,
|
|
58
|
+
}).refine(validPeriod, '请检查项目的起止时间');
|
|
59
|
+
export const educationSchema = z.strictObject({
|
|
60
|
+
id,
|
|
61
|
+
school: text(200),
|
|
62
|
+
major: text(160),
|
|
63
|
+
degree: text(80),
|
|
64
|
+
...period,
|
|
65
|
+
}).refine(validPeriod, '请检查教育经历的起止时间');
|
|
66
|
+
export const skillSchema = z.strictObject({
|
|
67
|
+
id,
|
|
68
|
+
name: text(100),
|
|
69
|
+
category: text(100),
|
|
70
|
+
level: text(80),
|
|
71
|
+
});
|
|
72
|
+
export const supplementSchema = z.strictObject({
|
|
73
|
+
id,
|
|
74
|
+
title: text(200),
|
|
75
|
+
description: markdown(5000),
|
|
76
|
+
date: month,
|
|
77
|
+
url,
|
|
78
|
+
});
|
|
79
|
+
export const RESUME_ENTRY_LIMIT = 50;
|
|
80
|
+
export const RESUME_SKILL_LIMIT = 100;
|
|
81
|
+
function entries(schema, limit = RESUME_ENTRY_LIMIT) {
|
|
82
|
+
return z.array(schema).max(limit).refine((items) => new Set(items.map((item) => item.id)).size === items.length, '条目标识不能重复');
|
|
83
|
+
}
|
|
84
|
+
const content = {
|
|
85
|
+
summary: markdown(4000),
|
|
86
|
+
jobPreference: z.strictObject({
|
|
87
|
+
role: text(160),
|
|
88
|
+
cities: text(300),
|
|
89
|
+
workMode: z.enum(['unspecified', 'onsite', 'remote', 'hybrid']),
|
|
90
|
+
availability: text(160),
|
|
91
|
+
salary: text(160),
|
|
92
|
+
}),
|
|
93
|
+
workExperiences: entries(workExperienceSchema),
|
|
94
|
+
projects: entries(projectSchema),
|
|
95
|
+
educations: entries(educationSchema),
|
|
96
|
+
skills: entries(skillSchema, RESUME_SKILL_LIMIT),
|
|
97
|
+
supplements: entries(supplementSchema),
|
|
98
|
+
};
|
|
99
|
+
export const resumeDocumentSchema = z.strictObject({
|
|
100
|
+
basics,
|
|
101
|
+
...content,
|
|
102
|
+
display: z.strictObject({
|
|
103
|
+
email: z.boolean(),
|
|
104
|
+
phone: z.boolean(),
|
|
105
|
+
wechat: z.boolean(),
|
|
106
|
+
sections: z.array(z.strictObject({ key: resumeSectionSchema, visible: z.boolean() }))
|
|
107
|
+
.length(resumeSectionSchema.options.length)
|
|
108
|
+
.refine((items) => new Set(items.map((item) => item.key)).size === items.length, '章节不能重复'),
|
|
109
|
+
}),
|
|
110
|
+
}).refine((document) => new TextEncoder().encode(JSON.stringify(document)).length <= 262144, '简历内容过大');
|
|
111
|
+
export const resumePublicDocumentSchema = z.strictObject({
|
|
112
|
+
basics: basics.omit({ email: true, phone: true, wechat: true }).extend({
|
|
113
|
+
email: basics.shape.email.optional(),
|
|
114
|
+
phone: basics.shape.phone.optional(),
|
|
115
|
+
wechat: basics.shape.wechat.optional(),
|
|
116
|
+
}),
|
|
117
|
+
...content,
|
|
118
|
+
sectionOrder: z.array(resumeSectionSchema).max(resumeSectionSchema.options.length)
|
|
119
|
+
.refine((items) => new Set(items).size === items.length),
|
|
120
|
+
});
|
|
121
|
+
export const emptyResumeDocument = resumeDocumentSchema.parse({
|
|
122
|
+
basics: { name: '', title: '', avatarUrl: '', city: '', email: '', phone: '', wechat: '', homepage: '' },
|
|
123
|
+
summary: '',
|
|
124
|
+
jobPreference: { role: '', cities: '', workMode: 'unspecified', availability: '', salary: '' },
|
|
125
|
+
workExperiences: [],
|
|
126
|
+
projects: [],
|
|
127
|
+
educations: [],
|
|
128
|
+
skills: [],
|
|
129
|
+
supplements: [],
|
|
130
|
+
display: {
|
|
131
|
+
email: true,
|
|
132
|
+
phone: false,
|
|
133
|
+
wechat: false,
|
|
134
|
+
sections: resumeSectionSchema.options.map((key) => ({ key, visible: true })),
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../src/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE;KAC3C,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;KACzD,MAAM,C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