@resumekit/schema 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +27 -2
- package/dist/collections.d.ts +572 -0
- package/dist/collections.d.ts.map +1 -0
- package/dist/collections.js +479 -0
- package/dist/export-contract.d.ts +52 -0
- package/dist/export-contract.d.ts.map +1 -0
- package/dist/export-contract.js +17 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/letter.d.ts +13 -0
- package/dist/letter.d.ts.map +1 -0
- package/dist/letter.js +1 -0
- package/dist/library.d.ts +60 -0
- package/dist/library.d.ts.map +1 -0
- package/dist/library.js +118 -0
- package/dist/locale.d.ts +11 -0
- package/dist/locale.d.ts.map +1 -0
- package/dist/locale.js +6 -0
- package/dist/resume-dates.d.ts +122 -0
- package/dist/resume-dates.d.ts.map +1 -0
- package/dist/resume-dates.js +185 -0
- package/dist/resume.d.ts +271 -0
- package/dist/resume.d.ts.map +1 -0
- package/dist/resume.js +367 -0
- package/dist/template.d.ts +2049 -0
- package/dist/template.d.ts.map +1 -0
- package/dist/template.js +2050 -0
- package/package.json +51 -3
- package/src/collections.ts +595 -0
- package/src/export-contract.ts +64 -0
- package/src/index.ts +8 -0
- package/src/letter.ts +12 -0
- package/src/library.ts +179 -0
- package/src/locale.ts +8 -0
- package/src/resume-dates.ts +252 -0
- package/src/resume.ts +410 -0
- package/src/template.ts +2360 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rocket Byte
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @resumekit/schema
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Zod schemas for a structured resume and for how it is presented: the resume object, the
|
|
4
|
+
template catalog, the presentation overlay a person's edits are recorded in, collections,
|
|
5
|
+
date checks and the export contract. Depends on nothing but `zod` (a peer dependency).
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @resumekit/schema zod
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import {
|
|
13
|
+
ResumeObjectSchema,
|
|
14
|
+
TEMPLATES,
|
|
15
|
+
TemplateIdSchema,
|
|
16
|
+
applyPresentation,
|
|
17
|
+
type ResumeObject,
|
|
18
|
+
} from '@resumekit/schema';
|
|
19
|
+
|
|
20
|
+
const resume: ResumeObject = ResumeObjectSchema.parse(input);
|
|
21
|
+
TemplateIdSchema.parse('harvard'); // throws for an id the catalog does not contain
|
|
22
|
+
Object.keys(TEMPLATES); // every template, as data
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The same schemas type `@resumekit/react`, so a resume validated here is one every template can
|
|
26
|
+
draw.
|
|
27
|
+
|
|
28
|
+
MIT licensed.
|
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type ResumeObject } from './resume.js';
|
|
3
|
+
/**
|
|
4
|
+
* Every repeatable location in a résumé, declared as data.
|
|
5
|
+
*
|
|
6
|
+
* The table exists so that "may the candidate add one of these?" is answered in
|
|
7
|
+
* ONE place, by a field, rather than by each surface remembering. A control that
|
|
8
|
+
* has to know the professional summary is singular is a control that can forget;
|
|
9
|
+
* `arity: 'one'` cannot.
|
|
10
|
+
*
|
|
11
|
+
* Framework-free, in the manner of `TEMPLATES` and `PLANS`: no component, no
|
|
12
|
+
* React import, and no knowledge of which template draws it.
|
|
13
|
+
*/
|
|
14
|
+
/** How many items a location holds. `one` is what suppresses an add control. */
|
|
15
|
+
export type Arity = 'one' | 'many';
|
|
16
|
+
/**
|
|
17
|
+
* What an item is drawn as, which is the only thing a template needs to supply.
|
|
18
|
+
*
|
|
19
|
+
* `entry` is a block with fields of its own; `bullet` is a line in a list;
|
|
20
|
+
* `inline` is a comma-run inside a line; `field` is a single value with no list
|
|
21
|
+
* around it; `section` is a heading with entries under it.
|
|
22
|
+
*/
|
|
23
|
+
export type CollectionShape = 'field' | 'entry' | 'bullet' | 'inline' | 'section';
|
|
24
|
+
export interface CollectionDef {
|
|
25
|
+
/**
|
|
26
|
+
* Where the location lives, with `*` standing for an index the caller
|
|
27
|
+
* supplies — `experience.*.bullets` is one collection, not one per role.
|
|
28
|
+
*/
|
|
29
|
+
readonly path: string;
|
|
30
|
+
readonly arity: Arity;
|
|
31
|
+
readonly shape: CollectionShape;
|
|
32
|
+
/** Whether the candidate may change the order of what is here. */
|
|
33
|
+
readonly reorderable: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* How few items may remain. Removing below it is refused and explained —
|
|
36
|
+
* an experience entry with no bullets is a heading with nothing under it.
|
|
37
|
+
*/
|
|
38
|
+
readonly min: number;
|
|
39
|
+
/**
|
|
40
|
+
* A blank item. NEVER a populated one: what a minted entry carries is
|
|
41
|
+
* guidance, and guidance is not a value. See {@link PLACEHOLDERS}.
|
|
42
|
+
*/
|
|
43
|
+
readonly mint: () => unknown;
|
|
44
|
+
/** The item's own schema, for validating an addition before it is applied. */
|
|
45
|
+
readonly item: z.ZodTypeAny;
|
|
46
|
+
/**
|
|
47
|
+
* What to call one of these to a candidate.
|
|
48
|
+
*
|
|
49
|
+
* Data rather than a prop at every call site, so "a bullet", "a role" and "a
|
|
50
|
+
* skills group" are named once and every control, label and refusal reads the
|
|
51
|
+
* same word — including the refusal for a minimum, which used to be a
|
|
52
|
+
* bullet-specific constant in a bullet-specific component.
|
|
53
|
+
*/
|
|
54
|
+
readonly noun: string;
|
|
55
|
+
/**
|
|
56
|
+
* What the SECTION is called, for a control that has to say where it is
|
|
57
|
+
* acting — "Experience · Role 2" tells a candidate which of two roles and
|
|
58
|
+
* which of six sections in one line.
|
|
59
|
+
*/
|
|
60
|
+
readonly label: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The guidance a minted item shows in each of its fields.
|
|
64
|
+
*
|
|
65
|
+
* Keyed by the field's own name so a template needs no table of its own. These
|
|
66
|
+
* strings reach `EditableText`'s `placeholder` prop, which has been documented
|
|
67
|
+
* as "never saved" since the editor was written — they are what the candidate
|
|
68
|
+
* reads in an empty field, and they are never stored, exported or extractable.
|
|
69
|
+
*/
|
|
70
|
+
export declare const PLACEHOLDERS: Record<string, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Draft-tolerant item schemas.
|
|
73
|
+
*
|
|
74
|
+
* The writer's schemas require every text field to be non-empty, and that is
|
|
75
|
+
* right for the writer: a role with no employer is a role the model failed to
|
|
76
|
+
* ground. A MINTED entry is the opposite case — it is empty because the
|
|
77
|
+
* candidate has not typed yet, and refusing it would mean an added entry could
|
|
78
|
+
* not appear until it was already complete.
|
|
79
|
+
*
|
|
80
|
+
* `z.infer` of `z.string().min(1)` and of `z.string()` is the same type, so
|
|
81
|
+
* these are structurally identical to the strict schemas and nothing downstream
|
|
82
|
+
* changes shape. Only the runtime check differs.
|
|
83
|
+
*/
|
|
84
|
+
export declare const DraftExperienceSchema: z.ZodObject<{
|
|
85
|
+
location: z.ZodOptional<z.ZodString>;
|
|
86
|
+
company: z.ZodString;
|
|
87
|
+
title: z.ZodString;
|
|
88
|
+
start: z.ZodString;
|
|
89
|
+
end: z.ZodString;
|
|
90
|
+
bullets: z.ZodArray<z.ZodString>;
|
|
91
|
+
tech: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export declare const DraftEducationSchema: z.ZodObject<{
|
|
94
|
+
degree: z.ZodOptional<z.ZodString>;
|
|
95
|
+
field: z.ZodOptional<z.ZodString>;
|
|
96
|
+
location: z.ZodOptional<z.ZodString>;
|
|
97
|
+
start: z.ZodOptional<z.ZodString>;
|
|
98
|
+
end: z.ZodOptional<z.ZodString>;
|
|
99
|
+
school: z.ZodString;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
export declare const DraftSkillGroupSchema: z.ZodObject<{
|
|
102
|
+
category: z.ZodString;
|
|
103
|
+
items: z.ZodArray<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export declare const DraftCustomEntrySchema: z.ZodObject<{
|
|
106
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
107
|
+
title: z.ZodString;
|
|
108
|
+
bullets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
export declare const DraftCustomSectionSchema: z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
author: z.ZodEnum<{
|
|
113
|
+
candidate: "candidate";
|
|
114
|
+
}>;
|
|
115
|
+
heading: z.ZodString;
|
|
116
|
+
entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
117
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
118
|
+
title: z.ZodString;
|
|
119
|
+
bullets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
120
|
+
}, z.core.$strip>>>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
/**
|
|
123
|
+
* A link whose address has not been typed yet.
|
|
124
|
+
*
|
|
125
|
+
* `LinkSchema` requires a non-empty `url`, and that is right for the writer: a
|
|
126
|
+
* link with no address is not a link. It was also the ONE item schema a minted
|
|
127
|
+
* item could not satisfy — every other collection already had a draft schema
|
|
128
|
+
* for exactly this — and the failure was silent in both places that read it.
|
|
129
|
+
* `collectionOrder` skips an append whose entry does not parse, and `applyEdits`
|
|
130
|
+
* skips it again, so pressing "Add links" appended an edit that nothing would
|
|
131
|
+
* ever draw. The candidate pressed a control and the document did not change.
|
|
132
|
+
*
|
|
133
|
+
* `collections.spec.ts` now asserts the general rule rather than this instance:
|
|
134
|
+
* what a collection mints, its own schema accepts.
|
|
135
|
+
*/
|
|
136
|
+
export declare const DraftLinkSchema: z.ZodObject<{
|
|
137
|
+
label: z.ZodOptional<z.ZodString>;
|
|
138
|
+
url: z.ZodString;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
/** A minted achievement, course or passion, before either field is typed. */
|
|
141
|
+
export declare const DraftDescribedEntrySchema: z.ZodObject<{
|
|
142
|
+
description: z.ZodString;
|
|
143
|
+
title: z.ZodString;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
/**
|
|
146
|
+
* A minted language, before either field is chosen.
|
|
147
|
+
*
|
|
148
|
+
* `level` widens to the enum OR the empty string, which is the unchosen state —
|
|
149
|
+
* not a sixth level. Nothing renders a meter for it, and the stored schema still
|
|
150
|
+
* refuses it, so an empty level cannot reach a saved résumé.
|
|
151
|
+
*/
|
|
152
|
+
export declare const DraftLanguageSchema: z.ZodObject<{
|
|
153
|
+
name: z.ZodString;
|
|
154
|
+
level: z.ZodUnion<readonly [z.ZodEnum<{
|
|
155
|
+
native: "native";
|
|
156
|
+
fluent: "fluent";
|
|
157
|
+
advanced: "advanced";
|
|
158
|
+
intermediate: "intermediate";
|
|
159
|
+
beginner: "beginner";
|
|
160
|
+
}>, z.ZodLiteral<"">]>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
/**
|
|
163
|
+
* The résumé AS DRAWN: the writer's shape, tolerating the empty fields of an
|
|
164
|
+
* entry the candidate has added and not yet filled in.
|
|
165
|
+
*
|
|
166
|
+
* Distinct from `ResumeObjectSchema`, which stays exactly as strict as it was —
|
|
167
|
+
* it is embedded in `TailoredResumeSchema` and is therefore the writer's
|
|
168
|
+
* contract. Relaxing that to make room for a draft would let the model's own
|
|
169
|
+
* output degrade silently, which is the opposite of what this is for.
|
|
170
|
+
*/
|
|
171
|
+
export declare const PresentedResumeSchema: z.ZodObject<{
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
contact: z.ZodObject<{
|
|
174
|
+
email: z.ZodOptional<z.ZodString>;
|
|
175
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
176
|
+
location: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
179
|
+
summary: z.ZodString;
|
|
180
|
+
section_headings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
181
|
+
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
182
|
+
label: z.ZodOptional<z.ZodString>;
|
|
183
|
+
url: z.ZodString;
|
|
184
|
+
}, z.core.$strip>>>;
|
|
185
|
+
experience: z.ZodArray<z.ZodObject<{
|
|
186
|
+
location: z.ZodOptional<z.ZodString>;
|
|
187
|
+
company: z.ZodString;
|
|
188
|
+
title: z.ZodString;
|
|
189
|
+
start: z.ZodString;
|
|
190
|
+
end: z.ZodString;
|
|
191
|
+
bullets: z.ZodArray<z.ZodString>;
|
|
192
|
+
tech: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
education: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
195
|
+
degree: z.ZodOptional<z.ZodString>;
|
|
196
|
+
field: z.ZodOptional<z.ZodString>;
|
|
197
|
+
location: z.ZodOptional<z.ZodString>;
|
|
198
|
+
start: z.ZodOptional<z.ZodString>;
|
|
199
|
+
end: z.ZodOptional<z.ZodString>;
|
|
200
|
+
school: z.ZodString;
|
|
201
|
+
}, z.core.$strip>>>;
|
|
202
|
+
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
203
|
+
category: z.ZodString;
|
|
204
|
+
items: z.ZodArray<z.ZodString>;
|
|
205
|
+
}, z.core.$strip>>>;
|
|
206
|
+
certifications: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
207
|
+
achievements: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
208
|
+
description: z.ZodString;
|
|
209
|
+
title: z.ZodString;
|
|
210
|
+
}, z.core.$strip>>>;
|
|
211
|
+
courses: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
212
|
+
description: z.ZodString;
|
|
213
|
+
title: z.ZodString;
|
|
214
|
+
}, z.core.$strip>>>;
|
|
215
|
+
passions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
216
|
+
description: z.ZodString;
|
|
217
|
+
title: z.ZodString;
|
|
218
|
+
}, z.core.$strip>>>;
|
|
219
|
+
languages: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
level: z.ZodUnion<readonly [z.ZodEnum<{
|
|
222
|
+
native: "native";
|
|
223
|
+
fluent: "fluent";
|
|
224
|
+
advanced: "advanced";
|
|
225
|
+
intermediate: "intermediate";
|
|
226
|
+
beginner: "beginner";
|
|
227
|
+
}>, z.ZodLiteral<"">]>;
|
|
228
|
+
}, z.core.$strip>>>;
|
|
229
|
+
custom_sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
230
|
+
id: z.ZodString;
|
|
231
|
+
author: z.ZodEnum<{
|
|
232
|
+
candidate: "candidate";
|
|
233
|
+
}>;
|
|
234
|
+
heading: z.ZodString;
|
|
235
|
+
entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
236
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
237
|
+
title: z.ZodString;
|
|
238
|
+
bullets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
239
|
+
}, z.core.$strip>>>;
|
|
240
|
+
}, z.core.$strip>>>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
/**
|
|
243
|
+
* The résumé a document draws.
|
|
244
|
+
*
|
|
245
|
+
* Structurally identical to {@link ResumeObject} — `.min(1)` constrains values,
|
|
246
|
+
* not types — so every template, serializer and renderer takes it unchanged.
|
|
247
|
+
* The alias exists to name the runtime difference at the places that care.
|
|
248
|
+
*/
|
|
249
|
+
export type PresentedResume = ResumeObject;
|
|
250
|
+
export declare const COLLECTIONS: {
|
|
251
|
+
readonly summary: {
|
|
252
|
+
readonly path: "summary";
|
|
253
|
+
readonly noun: "summary";
|
|
254
|
+
readonly label: "Summary";
|
|
255
|
+
readonly arity: "one";
|
|
256
|
+
readonly shape: "field";
|
|
257
|
+
readonly reorderable: false;
|
|
258
|
+
readonly min: 1;
|
|
259
|
+
readonly mint: () => string;
|
|
260
|
+
readonly item: z.ZodString;
|
|
261
|
+
};
|
|
262
|
+
readonly links: {
|
|
263
|
+
readonly path: "links";
|
|
264
|
+
readonly noun: "link";
|
|
265
|
+
readonly label: "Links";
|
|
266
|
+
readonly arity: "many";
|
|
267
|
+
readonly shape: "inline";
|
|
268
|
+
readonly reorderable: true;
|
|
269
|
+
readonly min: 0;
|
|
270
|
+
readonly mint: () => {
|
|
271
|
+
label: string;
|
|
272
|
+
url: string;
|
|
273
|
+
};
|
|
274
|
+
readonly item: z.ZodObject<{
|
|
275
|
+
label: z.ZodOptional<z.ZodString>;
|
|
276
|
+
url: z.ZodString;
|
|
277
|
+
}, z.core.$strip>;
|
|
278
|
+
};
|
|
279
|
+
readonly experience: {
|
|
280
|
+
readonly path: "experience";
|
|
281
|
+
readonly noun: "role";
|
|
282
|
+
readonly label: "Experience";
|
|
283
|
+
readonly arity: "many";
|
|
284
|
+
readonly shape: "entry";
|
|
285
|
+
readonly reorderable: true;
|
|
286
|
+
readonly min: 0;
|
|
287
|
+
readonly mint: () => {
|
|
288
|
+
company: string;
|
|
289
|
+
title: string;
|
|
290
|
+
location: string;
|
|
291
|
+
start: string;
|
|
292
|
+
end: string;
|
|
293
|
+
bullets: string[];
|
|
294
|
+
tech: never[];
|
|
295
|
+
};
|
|
296
|
+
readonly item: z.ZodObject<{
|
|
297
|
+
location: z.ZodOptional<z.ZodString>;
|
|
298
|
+
company: z.ZodString;
|
|
299
|
+
title: z.ZodString;
|
|
300
|
+
start: z.ZodString;
|
|
301
|
+
end: z.ZodString;
|
|
302
|
+
bullets: z.ZodArray<z.ZodString>;
|
|
303
|
+
tech: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
};
|
|
306
|
+
readonly experience_bullets: {
|
|
307
|
+
readonly path: "experience.*.bullets";
|
|
308
|
+
readonly noun: "bullet";
|
|
309
|
+
readonly label: "Experience";
|
|
310
|
+
readonly arity: "many";
|
|
311
|
+
readonly shape: "bullet";
|
|
312
|
+
readonly reorderable: true;
|
|
313
|
+
readonly min: 1;
|
|
314
|
+
readonly mint: () => string;
|
|
315
|
+
readonly item: z.ZodString;
|
|
316
|
+
};
|
|
317
|
+
readonly education: {
|
|
318
|
+
readonly path: "education";
|
|
319
|
+
readonly noun: "qualification";
|
|
320
|
+
readonly label: "Education";
|
|
321
|
+
readonly arity: "many";
|
|
322
|
+
readonly shape: "entry";
|
|
323
|
+
readonly reorderable: true;
|
|
324
|
+
readonly min: 0;
|
|
325
|
+
readonly mint: () => {
|
|
326
|
+
school: string;
|
|
327
|
+
degree: string;
|
|
328
|
+
field: string;
|
|
329
|
+
location: string;
|
|
330
|
+
start: string;
|
|
331
|
+
end: string;
|
|
332
|
+
};
|
|
333
|
+
readonly item: z.ZodObject<{
|
|
334
|
+
degree: z.ZodOptional<z.ZodString>;
|
|
335
|
+
field: z.ZodOptional<z.ZodString>;
|
|
336
|
+
location: z.ZodOptional<z.ZodString>;
|
|
337
|
+
start: z.ZodOptional<z.ZodString>;
|
|
338
|
+
end: z.ZodOptional<z.ZodString>;
|
|
339
|
+
school: z.ZodString;
|
|
340
|
+
}, z.core.$strip>;
|
|
341
|
+
};
|
|
342
|
+
readonly skills: {
|
|
343
|
+
readonly path: "skills";
|
|
344
|
+
readonly noun: "skills group";
|
|
345
|
+
readonly label: "Skills";
|
|
346
|
+
readonly arity: "many";
|
|
347
|
+
readonly shape: "entry";
|
|
348
|
+
readonly reorderable: true;
|
|
349
|
+
readonly min: 0;
|
|
350
|
+
readonly mint: () => {
|
|
351
|
+
category: string;
|
|
352
|
+
items: string[];
|
|
353
|
+
};
|
|
354
|
+
readonly item: z.ZodObject<{
|
|
355
|
+
category: z.ZodString;
|
|
356
|
+
items: z.ZodArray<z.ZodString>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
};
|
|
359
|
+
readonly skill_items: {
|
|
360
|
+
readonly path: "skills.*.items";
|
|
361
|
+
readonly noun: "skill";
|
|
362
|
+
readonly label: "Skills";
|
|
363
|
+
readonly arity: "many";
|
|
364
|
+
readonly shape: "inline";
|
|
365
|
+
readonly reorderable: true;
|
|
366
|
+
readonly min: 1;
|
|
367
|
+
readonly mint: () => string;
|
|
368
|
+
readonly item: z.ZodString;
|
|
369
|
+
};
|
|
370
|
+
readonly certifications: {
|
|
371
|
+
readonly path: "certifications";
|
|
372
|
+
readonly noun: "certification";
|
|
373
|
+
readonly label: "Certifications";
|
|
374
|
+
readonly arity: "many";
|
|
375
|
+
readonly shape: "inline";
|
|
376
|
+
readonly reorderable: true;
|
|
377
|
+
readonly min: 0;
|
|
378
|
+
readonly mint: () => string;
|
|
379
|
+
readonly item: z.ZodString;
|
|
380
|
+
};
|
|
381
|
+
readonly achievements: {
|
|
382
|
+
readonly path: "achievements";
|
|
383
|
+
readonly noun: "achievement";
|
|
384
|
+
readonly label: "Achievements";
|
|
385
|
+
readonly arity: "many";
|
|
386
|
+
readonly shape: "entry";
|
|
387
|
+
readonly reorderable: true;
|
|
388
|
+
readonly min: 0;
|
|
389
|
+
readonly mint: () => {
|
|
390
|
+
title: string;
|
|
391
|
+
description: string;
|
|
392
|
+
};
|
|
393
|
+
readonly item: z.ZodObject<{
|
|
394
|
+
description: z.ZodString;
|
|
395
|
+
title: z.ZodString;
|
|
396
|
+
}, z.core.$strip>;
|
|
397
|
+
};
|
|
398
|
+
readonly courses: {
|
|
399
|
+
readonly path: "courses";
|
|
400
|
+
readonly noun: "course";
|
|
401
|
+
readonly label: "Courses";
|
|
402
|
+
readonly arity: "many";
|
|
403
|
+
readonly shape: "entry";
|
|
404
|
+
readonly reorderable: true;
|
|
405
|
+
readonly min: 0;
|
|
406
|
+
readonly mint: () => {
|
|
407
|
+
title: string;
|
|
408
|
+
description: string;
|
|
409
|
+
};
|
|
410
|
+
readonly item: z.ZodObject<{
|
|
411
|
+
description: z.ZodString;
|
|
412
|
+
title: z.ZodString;
|
|
413
|
+
}, z.core.$strip>;
|
|
414
|
+
};
|
|
415
|
+
readonly passions: {
|
|
416
|
+
readonly path: "passions";
|
|
417
|
+
readonly noun: "interest";
|
|
418
|
+
readonly label: "Passions";
|
|
419
|
+
readonly arity: "many";
|
|
420
|
+
readonly shape: "entry";
|
|
421
|
+
readonly reorderable: true;
|
|
422
|
+
readonly min: 0;
|
|
423
|
+
readonly mint: () => {
|
|
424
|
+
title: string;
|
|
425
|
+
description: string;
|
|
426
|
+
};
|
|
427
|
+
readonly item: z.ZodObject<{
|
|
428
|
+
description: z.ZodString;
|
|
429
|
+
title: z.ZodString;
|
|
430
|
+
}, z.core.$strip>;
|
|
431
|
+
};
|
|
432
|
+
readonly languages: {
|
|
433
|
+
readonly path: "languages";
|
|
434
|
+
readonly noun: "language";
|
|
435
|
+
readonly label: "Languages";
|
|
436
|
+
readonly arity: "many";
|
|
437
|
+
readonly shape: "entry";
|
|
438
|
+
readonly reorderable: true;
|
|
439
|
+
readonly min: 0;
|
|
440
|
+
readonly mint: () => {
|
|
441
|
+
name: string;
|
|
442
|
+
level: string;
|
|
443
|
+
};
|
|
444
|
+
readonly item: z.ZodObject<{
|
|
445
|
+
name: z.ZodString;
|
|
446
|
+
level: z.ZodUnion<readonly [z.ZodEnum<{
|
|
447
|
+
native: "native";
|
|
448
|
+
fluent: "fluent";
|
|
449
|
+
advanced: "advanced";
|
|
450
|
+
intermediate: "intermediate";
|
|
451
|
+
beginner: "beginner";
|
|
452
|
+
}>, z.ZodLiteral<"">]>;
|
|
453
|
+
}, z.core.$strip>;
|
|
454
|
+
};
|
|
455
|
+
readonly custom_sections: {
|
|
456
|
+
readonly path: "custom_sections";
|
|
457
|
+
readonly noun: "section";
|
|
458
|
+
readonly label: "Sections";
|
|
459
|
+
readonly arity: "many";
|
|
460
|
+
readonly shape: "section";
|
|
461
|
+
readonly reorderable: true;
|
|
462
|
+
readonly min: 0;
|
|
463
|
+
readonly mint: () => {
|
|
464
|
+
heading: string;
|
|
465
|
+
entries: {
|
|
466
|
+
title: string;
|
|
467
|
+
bullets: string[];
|
|
468
|
+
}[];
|
|
469
|
+
};
|
|
470
|
+
readonly item: z.ZodObject<{
|
|
471
|
+
id: z.ZodString;
|
|
472
|
+
author: z.ZodEnum<{
|
|
473
|
+
candidate: "candidate";
|
|
474
|
+
}>;
|
|
475
|
+
heading: z.ZodString;
|
|
476
|
+
entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
477
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
478
|
+
title: z.ZodString;
|
|
479
|
+
bullets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
480
|
+
}, z.core.$strip>>>;
|
|
481
|
+
}, z.core.$strip>;
|
|
482
|
+
};
|
|
483
|
+
readonly custom_entries: {
|
|
484
|
+
readonly path: "custom_sections.*.entries";
|
|
485
|
+
readonly noun: "entry";
|
|
486
|
+
readonly label: "Section";
|
|
487
|
+
readonly arity: "many";
|
|
488
|
+
readonly shape: "entry";
|
|
489
|
+
readonly reorderable: true;
|
|
490
|
+
readonly min: 1;
|
|
491
|
+
readonly mint: () => {
|
|
492
|
+
title: string;
|
|
493
|
+
bullets: string[];
|
|
494
|
+
};
|
|
495
|
+
readonly item: z.ZodObject<{
|
|
496
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
497
|
+
title: z.ZodString;
|
|
498
|
+
bullets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
};
|
|
501
|
+
readonly custom_bullets: {
|
|
502
|
+
readonly path: "custom_sections.*.entries.*.bullets";
|
|
503
|
+
readonly noun: "bullet";
|
|
504
|
+
readonly label: "Section";
|
|
505
|
+
readonly arity: "many";
|
|
506
|
+
readonly shape: "bullet";
|
|
507
|
+
readonly reorderable: true;
|
|
508
|
+
readonly min: 0;
|
|
509
|
+
readonly mint: () => string;
|
|
510
|
+
readonly item: z.ZodString;
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
export type CollectionId = keyof typeof COLLECTIONS;
|
|
514
|
+
export declare const CollectionIdSchema: z.ZodEnum<{
|
|
515
|
+
links: "links";
|
|
516
|
+
summary: "summary";
|
|
517
|
+
skills: "skills";
|
|
518
|
+
experience: "experience";
|
|
519
|
+
education: "education";
|
|
520
|
+
certifications: "certifications";
|
|
521
|
+
achievements: "achievements";
|
|
522
|
+
courses: "courses";
|
|
523
|
+
passions: "passions";
|
|
524
|
+
languages: "languages";
|
|
525
|
+
custom_sections: "custom_sections";
|
|
526
|
+
experience_bullets: "experience_bullets";
|
|
527
|
+
skill_items: "skill_items";
|
|
528
|
+
custom_entries: "custom_entries";
|
|
529
|
+
custom_bullets: "custom_bullets";
|
|
530
|
+
}>;
|
|
531
|
+
/** Whether anything can be added here. The one place the question is answered. */
|
|
532
|
+
export declare function canAddTo(id: CollectionId): boolean;
|
|
533
|
+
/**
|
|
534
|
+
* The collections that live at the résumé's top level, which are the ones an
|
|
535
|
+
* `append` edit can name.
|
|
536
|
+
*
|
|
537
|
+
* A nested collection (`experience.*.bullets`, a custom section's entries) is
|
|
538
|
+
* reached through the entry that owns it, and its content is stored with that
|
|
539
|
+
* entry — so appending to one is not a separate operation on the overlay.
|
|
540
|
+
*/
|
|
541
|
+
export declare const TOP_LEVEL_COLLECTIONS: ("links" | "summary" | "skills" | "experience" | "education" | "certifications" | "achievements" | "courses" | "passions" | "languages" | "custom_sections" | "experience_bullets" | "skill_items" | "custom_entries" | "custom_bullets")[];
|
|
542
|
+
/**
|
|
543
|
+
* Resolve a collection's path for a particular set of indices.
|
|
544
|
+
*
|
|
545
|
+
* `experience.*.bullets` with `[2]` is `experience.2.bullets`. Supplying the
|
|
546
|
+
* wrong number of indices is a programming error, not a data one, so it throws.
|
|
547
|
+
*/
|
|
548
|
+
export declare function collectionPath(id: CollectionId, indices?: readonly number[]): string;
|
|
549
|
+
/**
|
|
550
|
+
* Whether an item holds nothing the candidate typed.
|
|
551
|
+
*
|
|
552
|
+
* This is what makes a placeholder an absence rather than a value: an entry
|
|
553
|
+
* every field of which is still empty has no content, so it is omitted from the
|
|
554
|
+
* export rather than shipped as guidance somebody will read as a claim.
|
|
555
|
+
*
|
|
556
|
+
* Recursive over arrays and objects, and blind to which collection it is
|
|
557
|
+
* looking at, because "unfilled" is the same question everywhere.
|
|
558
|
+
*/
|
|
559
|
+
export declare function isUnfilled(value: unknown): boolean;
|
|
560
|
+
/**
|
|
561
|
+
* Which experience entries are out of reverse-chronological order.
|
|
562
|
+
*
|
|
563
|
+
* The knowledge base requires reverse chronological, so a free reorder lets a
|
|
564
|
+
* candidate produce a résumé the product's own rulebook calls wrong. Returning
|
|
565
|
+
* the offending positions rather than a boolean is deliberate: this is shown to
|
|
566
|
+
* the candidate as a cost, never used to refuse the ordering.
|
|
567
|
+
*
|
|
568
|
+
* `Present` sorts above every date. An unparseable date is not an offence —
|
|
569
|
+
* the candidate is mid-typing, and a warning about a half-typed date is noise.
|
|
570
|
+
*/
|
|
571
|
+
export declare function chronologyWarnings(resume: PresentedResume): number[];
|
|
572
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../src/collections.ts"],"names":[],"mappings":"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"}
|