@resumekit/schema 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,479 @@
1
+ import { z } from 'zod';
2
+ import { isPresentDate } from './resume-dates.js';
3
+ import { CustomEntrySchema, CustomSectionSchema, DescribedEntrySchema, EducationSchema, ExperienceSchema, LanguageLevelSchema, LanguageSchema, LinkSchema, ResumeObjectSchema, SkillGroupSchema, } from './resume.js';
4
+ /**
5
+ * The guidance a minted item shows in each of its fields.
6
+ *
7
+ * Keyed by the field's own name so a template needs no table of its own. These
8
+ * strings reach `EditableText`'s `placeholder` prop, which has been documented
9
+ * as "never saved" since the editor was written — they are what the candidate
10
+ * reads in an empty field, and they are never stored, exported or extractable.
11
+ */
12
+ export const PLACEHOLDERS = {
13
+ /*
14
+ * The header's own fields, which had none — and a field with no guidance is
15
+ * a field a candidate cannot see is missing. A résumé whose writer produced
16
+ * no phone number rendered no phone number, and there was nothing on the page
17
+ * to say one belonged there or to click on to add it.
18
+ */
19
+ location: 'City, Country',
20
+ email: 'you@example.com',
21
+ phone: 'Phone number',
22
+ company: 'Employer',
23
+ title: 'Your role',
24
+ start: 'YYYY-MM',
25
+ end: 'YYYY-MM or Present',
26
+ school: 'Institution',
27
+ degree: 'Degree',
28
+ field: 'Field of study',
29
+ category: 'Skill group, e.g. Languages',
30
+ heading: 'Section heading',
31
+ detail: 'Organisation or date range',
32
+ bullet: 'What you did, and what changed because of it.',
33
+ item: 'Keyword',
34
+ certification: 'Certification name',
35
+ label: 'Link text',
36
+ url: 'https://',
37
+ /*
38
+ * The two fields a résumé can be missing entirely, and therefore the two a
39
+ * candidate starting from scratch could not reach.
40
+ *
41
+ * A template omits a section it has no data for, so an empty `summary`
42
+ * rendered NOTHING — no heading, no field, nowhere to click — on a document
43
+ * whose whole purpose was to be typed into. The section renders while the
44
+ * document is being authored now, and this is what stands in it.
45
+ *
46
+ * Guidance, never an EXAMPLE. A specimen sentence in a field is something a
47
+ * candidate edits around rather than replaces, and the half they leave is a
48
+ * claim about their career that they did not make. These say what belongs
49
+ * there and nothing about whose career it is.
50
+ */
51
+ summary: 'Two or three lines: what you do, how long, and what you are best at.',
52
+ headline: 'The role you are applying for.',
53
+ /*
54
+ * The LIST fields, guided by what the whole list is and how it is separated.
55
+ *
56
+ * Named for the field rather than for one of its items, because that is what
57
+ * the candidate is looking at: an inline list is one run of text, and the
58
+ * comma is the whole of how a second skill is added to it. A group added to
59
+ * Harvard's skills rendered as a category, a colon, and then nothing at all —
60
+ * an empty span with no width — so there was no way to see that the skills
61
+ * went there, and nothing to click on to type them.
62
+ */
63
+ items: 'Skills, separated by commas',
64
+ certifications: 'Certifications, separated by commas',
65
+ /*
66
+ * The supporting sections' fields.
67
+ *
68
+ * Keyed per SECTION rather than by the bare field name, because `title` is
69
+ * already the experience entry's and means "Your role" there. An achievement
70
+ * guided as a job title would be worse than unguided. `DescribedEntries` looks
71
+ * up its own pair from the section id it is given, so no template carries a
72
+ * table for this.
73
+ */
74
+ achievement_title: 'What you achieved',
75
+ achievement_description: 'One or two lines: what you did, and what it changed.',
76
+ course_title: 'Course or qualification',
77
+ course_description: 'One or two lines: what it covered, and who ran it.',
78
+ passion_title: 'An interest',
79
+ passion_description: 'One or two lines on what draws you to it.',
80
+ /* Keyed `language`, not `name`: `blank-document.spec.tsx` asserts that no
81
+ guidance string appears as document text, and "Language" is a substring
82
+ of the "Languages" heading right above the field. */
83
+ language: 'e.g. Spanish',
84
+ };
85
+ /** A blank experience entry: every field empty, every field guided. */
86
+ const mintExperience = () => ({
87
+ company: '',
88
+ title: '',
89
+ location: '',
90
+ start: '',
91
+ end: '',
92
+ bullets: [''],
93
+ tech: [],
94
+ });
95
+ const mintEducation = () => ({
96
+ school: '',
97
+ degree: '',
98
+ field: '',
99
+ location: '',
100
+ start: '',
101
+ end: '',
102
+ });
103
+ const mintSkillGroup = () => ({ category: '', items: [''] });
104
+ const mintCustomEntry = () => ({ title: '', bullets: [''] });
105
+ const mintCustomSection = () => ({ heading: '', entries: [mintCustomEntry()] });
106
+ const mintLink = () => ({ label: '', url: '' });
107
+ /** A blank achievement, course or passion: a title and a paragraph, both empty. */
108
+ const mintDescribedEntry = () => ({ title: '', description: '' });
109
+ /*
110
+ * A blank language: no name, and NO LEVEL.
111
+ *
112
+ * Minting a level would mint a claim. `native` is not a neutral default — it is
113
+ * a statement about the candidate's fluency that the candidate has not made,
114
+ * and `collections.spec.ts` holds every mint to "guidance, never content" for
115
+ * exactly this reason. So the empty string is the unchosen state, the draft
116
+ * schema below is what tolerates it, and a template draws no meter until a
117
+ * level exists.
118
+ */
119
+ const mintLanguage = () => ({ name: '', level: '' });
120
+ const mintString = () => '';
121
+ /**
122
+ * Draft-tolerant item schemas.
123
+ *
124
+ * The writer's schemas require every text field to be non-empty, and that is
125
+ * right for the writer: a role with no employer is a role the model failed to
126
+ * ground. A MINTED entry is the opposite case — it is empty because the
127
+ * candidate has not typed yet, and refusing it would mean an added entry could
128
+ * not appear until it was already complete.
129
+ *
130
+ * `z.infer` of `z.string().min(1)` and of `z.string()` is the same type, so
131
+ * these are structurally identical to the strict schemas and nothing downstream
132
+ * changes shape. Only the runtime check differs.
133
+ */
134
+ export const DraftExperienceSchema = ExperienceSchema.extend({
135
+ company: z.string(),
136
+ title: z.string(),
137
+ start: z.string(),
138
+ end: z.string(),
139
+ bullets: z.array(z.string()),
140
+ tech: z.array(z.string()).default([]),
141
+ });
142
+ export const DraftEducationSchema = EducationSchema.extend({
143
+ school: z.string(),
144
+ });
145
+ export const DraftSkillGroupSchema = SkillGroupSchema.extend({
146
+ category: z.string(),
147
+ items: z.array(z.string()),
148
+ });
149
+ export const DraftCustomEntrySchema = CustomEntrySchema.extend({
150
+ title: z.string(),
151
+ bullets: z.array(z.string()).default([]),
152
+ });
153
+ export const DraftCustomSectionSchema = CustomSectionSchema.extend({
154
+ heading: z.string(),
155
+ entries: z.array(DraftCustomEntrySchema).default([]),
156
+ });
157
+ /**
158
+ * A link whose address has not been typed yet.
159
+ *
160
+ * `LinkSchema` requires a non-empty `url`, and that is right for the writer: a
161
+ * link with no address is not a link. It was also the ONE item schema a minted
162
+ * item could not satisfy — every other collection already had a draft schema
163
+ * for exactly this — and the failure was silent in both places that read it.
164
+ * `collectionOrder` skips an append whose entry does not parse, and `applyEdits`
165
+ * skips it again, so pressing "Add links" appended an edit that nothing would
166
+ * ever draw. The candidate pressed a control and the document did not change.
167
+ *
168
+ * `collections.spec.ts` now asserts the general rule rather than this instance:
169
+ * what a collection mints, its own schema accepts.
170
+ */
171
+ export const DraftLinkSchema = LinkSchema.extend({
172
+ url: z.string(),
173
+ });
174
+ /** A minted achievement, course or passion, before either field is typed. */
175
+ export const DraftDescribedEntrySchema = DescribedEntrySchema.extend({
176
+ title: z.string(),
177
+ });
178
+ /**
179
+ * A minted language, before either field is chosen.
180
+ *
181
+ * `level` widens to the enum OR the empty string, which is the unchosen state —
182
+ * not a sixth level. Nothing renders a meter for it, and the stored schema still
183
+ * refuses it, so an empty level cannot reach a saved résumé.
184
+ */
185
+ export const DraftLanguageSchema = LanguageSchema.extend({
186
+ name: z.string(),
187
+ level: z.union([LanguageLevelSchema, z.literal('')]),
188
+ });
189
+ /**
190
+ * The résumé AS DRAWN: the writer's shape, tolerating the empty fields of an
191
+ * entry the candidate has added and not yet filled in.
192
+ *
193
+ * Distinct from `ResumeObjectSchema`, which stays exactly as strict as it was —
194
+ * it is embedded in `TailoredResumeSchema` and is therefore the writer's
195
+ * contract. Relaxing that to make room for a draft would let the model's own
196
+ * output degrade silently, which is the opposite of what this is for.
197
+ */
198
+ export const PresentedResumeSchema = ResumeObjectSchema.extend({
199
+ links: z.array(DraftLinkSchema).default([]),
200
+ experience: z.array(DraftExperienceSchema),
201
+ education: z.array(DraftEducationSchema).default([]),
202
+ skills: z.array(DraftSkillGroupSchema).default([]),
203
+ certifications: z.array(z.string()).default([]),
204
+ achievements: z.array(DraftDescribedEntrySchema).default([]),
205
+ courses: z.array(DraftDescribedEntrySchema).default([]),
206
+ passions: z.array(DraftDescribedEntrySchema).default([]),
207
+ languages: z.array(DraftLanguageSchema).default([]),
208
+ custom_sections: z.array(DraftCustomSectionSchema).default([]),
209
+ });
210
+ export const COLLECTIONS = {
211
+ summary: {
212
+ path: 'summary',
213
+ noun: 'summary',
214
+ label: 'Summary',
215
+ arity: 'one',
216
+ shape: 'field',
217
+ reorderable: false,
218
+ min: 1,
219
+ mint: mintString,
220
+ item: z.string(),
221
+ },
222
+ links: {
223
+ path: 'links',
224
+ noun: 'link',
225
+ label: 'Links',
226
+ arity: 'many',
227
+ shape: 'inline',
228
+ reorderable: true,
229
+ min: 0,
230
+ mint: mintLink,
231
+ item: DraftLinkSchema,
232
+ },
233
+ experience: {
234
+ path: 'experience',
235
+ noun: 'role',
236
+ label: 'Experience',
237
+ arity: 'many',
238
+ shape: 'entry',
239
+ reorderable: true,
240
+ min: 0,
241
+ mint: mintExperience,
242
+ item: DraftExperienceSchema,
243
+ },
244
+ experience_bullets: {
245
+ path: 'experience.*.bullets',
246
+ noun: 'bullet',
247
+ label: 'Experience',
248
+ arity: 'many',
249
+ shape: 'bullet',
250
+ reorderable: true,
251
+ // An entry with no bullets is a heading with nothing under it — the rule
252
+ // #29 wrote into `EditableBulletList`, now stated where every list reads it.
253
+ min: 1,
254
+ mint: mintString,
255
+ item: z.string(),
256
+ },
257
+ education: {
258
+ path: 'education',
259
+ noun: 'qualification',
260
+ label: 'Education',
261
+ arity: 'many',
262
+ shape: 'entry',
263
+ reorderable: true,
264
+ min: 0,
265
+ mint: mintEducation,
266
+ item: DraftEducationSchema,
267
+ },
268
+ skills: {
269
+ path: 'skills',
270
+ noun: 'skills group',
271
+ label: 'Skills',
272
+ arity: 'many',
273
+ shape: 'entry',
274
+ reorderable: true,
275
+ min: 0,
276
+ mint: mintSkillGroup,
277
+ item: DraftSkillGroupSchema,
278
+ },
279
+ skill_items: {
280
+ path: 'skills.*.items',
281
+ noun: 'skill',
282
+ label: 'Skills',
283
+ arity: 'many',
284
+ shape: 'inline',
285
+ reorderable: true,
286
+ min: 1,
287
+ mint: mintString,
288
+ item: z.string(),
289
+ },
290
+ certifications: {
291
+ path: 'certifications',
292
+ noun: 'certification',
293
+ label: 'Certifications',
294
+ arity: 'many',
295
+ shape: 'inline',
296
+ reorderable: true,
297
+ min: 0,
298
+ mint: mintString,
299
+ item: z.string(),
300
+ },
301
+ achievements: {
302
+ path: 'achievements',
303
+ noun: 'achievement',
304
+ label: 'Achievements',
305
+ arity: 'many',
306
+ shape: 'entry',
307
+ reorderable: true,
308
+ min: 0,
309
+ mint: mintDescribedEntry,
310
+ item: DraftDescribedEntrySchema,
311
+ },
312
+ courses: {
313
+ path: 'courses',
314
+ noun: 'course',
315
+ label: 'Courses',
316
+ arity: 'many',
317
+ shape: 'entry',
318
+ reorderable: true,
319
+ min: 0,
320
+ mint: mintDescribedEntry,
321
+ item: DraftDescribedEntrySchema,
322
+ },
323
+ passions: {
324
+ path: 'passions',
325
+ noun: 'interest',
326
+ label: 'Passions',
327
+ arity: 'many',
328
+ shape: 'entry',
329
+ reorderable: true,
330
+ min: 0,
331
+ mint: mintDescribedEntry,
332
+ item: DraftDescribedEntrySchema,
333
+ },
334
+ languages: {
335
+ path: 'languages',
336
+ noun: 'language',
337
+ label: 'Languages',
338
+ arity: 'many',
339
+ shape: 'entry',
340
+ reorderable: true,
341
+ min: 0,
342
+ mint: mintLanguage,
343
+ item: DraftLanguageSchema,
344
+ },
345
+ custom_sections: {
346
+ path: 'custom_sections',
347
+ noun: 'section',
348
+ label: 'Sections',
349
+ arity: 'many',
350
+ shape: 'section',
351
+ reorderable: true,
352
+ min: 0,
353
+ mint: mintCustomSection,
354
+ item: DraftCustomSectionSchema,
355
+ },
356
+ custom_entries: {
357
+ path: 'custom_sections.*.entries',
358
+ noun: 'entry',
359
+ label: 'Section',
360
+ arity: 'many',
361
+ shape: 'entry',
362
+ reorderable: true,
363
+ min: 1,
364
+ mint: mintCustomEntry,
365
+ item: DraftCustomEntrySchema,
366
+ },
367
+ custom_bullets: {
368
+ path: 'custom_sections.*.entries.*.bullets',
369
+ noun: 'bullet',
370
+ label: 'Section',
371
+ arity: 'many',
372
+ shape: 'bullet',
373
+ reorderable: true,
374
+ min: 0,
375
+ mint: mintString,
376
+ item: z.string(),
377
+ },
378
+ };
379
+ export const CollectionIdSchema = z.enum(Object.keys(COLLECTIONS));
380
+ /** Whether anything can be added here. The one place the question is answered. */
381
+ export function canAddTo(id) {
382
+ return COLLECTIONS[id].arity === 'many';
383
+ }
384
+ /**
385
+ * The collections that live at the résumé's top level, which are the ones an
386
+ * `append` edit can name.
387
+ *
388
+ * A nested collection (`experience.*.bullets`, a custom section's entries) is
389
+ * reached through the entry that owns it, and its content is stored with that
390
+ * entry — so appending to one is not a separate operation on the overlay.
391
+ */
392
+ export const TOP_LEVEL_COLLECTIONS = Object.entries(COLLECTIONS)
393
+ .filter(([, def]) => def.arity === 'many' && !def.path.includes('*'))
394
+ .map(([id]) => id);
395
+ /**
396
+ * Resolve a collection's path for a particular set of indices.
397
+ *
398
+ * `experience.*.bullets` with `[2]` is `experience.2.bullets`. Supplying the
399
+ * wrong number of indices is a programming error, not a data one, so it throws.
400
+ */
401
+ export function collectionPath(id, indices = []) {
402
+ const template = COLLECTIONS[id].path;
403
+ let used = 0;
404
+ const resolved = template
405
+ .split('.')
406
+ .map((segment) => {
407
+ if (segment !== '*')
408
+ return segment;
409
+ const index = indices[used++];
410
+ if (index === undefined) {
411
+ throw new Error(`${id} needs ${template.split('*').length - 1} indices`);
412
+ }
413
+ return String(index);
414
+ })
415
+ .join('.');
416
+ if (used !== indices.length) {
417
+ throw new Error(`${id} takes ${used} indices, given ${indices.length}`);
418
+ }
419
+ return resolved;
420
+ }
421
+ /**
422
+ * Whether an item holds nothing the candidate typed.
423
+ *
424
+ * This is what makes a placeholder an absence rather than a value: an entry
425
+ * every field of which is still empty has no content, so it is omitted from the
426
+ * export rather than shipped as guidance somebody will read as a claim.
427
+ *
428
+ * Recursive over arrays and objects, and blind to which collection it is
429
+ * looking at, because "unfilled" is the same question everywhere.
430
+ */
431
+ export function isUnfilled(value) {
432
+ if (typeof value === 'string')
433
+ return value.trim().length === 0;
434
+ if (Array.isArray(value))
435
+ return value.every(isUnfilled);
436
+ if (value !== null && typeof value === 'object') {
437
+ return (Object.entries(value)
438
+ // `id` and `author` are bookkeeping the candidate never types.
439
+ .filter(([key]) => key !== 'id' && key !== 'author')
440
+ .every(([, v]) => isUnfilled(v)));
441
+ }
442
+ // A number or a boolean is a value; nothing in a résumé is either today.
443
+ return value === undefined || value === null;
444
+ }
445
+ /**
446
+ * Which experience entries are out of reverse-chronological order.
447
+ *
448
+ * The knowledge base requires reverse chronological, so a free reorder lets a
449
+ * candidate produce a résumé the product's own rulebook calls wrong. Returning
450
+ * the offending positions rather than a boolean is deliberate: this is shown to
451
+ * the candidate as a cost, never used to refuse the ordering.
452
+ *
453
+ * `Present` sorts above every date. An unparseable date is not an offence —
454
+ * the candidate is mid-typing, and a warning about a half-typed date is noise.
455
+ */
456
+ export function chronologyWarnings(resume) {
457
+ const rank = (end) => {
458
+ const value = end.trim();
459
+ if (value.length === 0)
460
+ return null;
461
+ if (isPresentDate(value))
462
+ return Number.POSITIVE_INFINITY;
463
+ const match = /^(\d{4})(?:-(\d{2}))?/.exec(value);
464
+ if (!match)
465
+ return null;
466
+ return Number(match[1]) * 12 + (match[2] ? Number(match[2]) : 0);
467
+ };
468
+ const out = [];
469
+ let previous = null;
470
+ resume.experience.forEach((role, index) => {
471
+ const current = rank(role.end);
472
+ if (current === null)
473
+ return;
474
+ if (previous !== null && current > previous)
475
+ out.push(index);
476
+ previous = current;
477
+ });
478
+ return out;
479
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The contract between the API that builds an export and the browser that draws
3
+ * it — declared here, in the library that owns the document, so the two sides
4
+ * cannot describe it differently.
5
+ *
6
+ * It lives in `libs/core` — not beside the bundle — precisely so both sides can
7
+ * hold it without either depending on the other. `apps/api` builds the document
8
+ * and ships the bundle as an opaque asset; it imports no template, no component
9
+ * and no React, so no `scope:api → scope:templates` edge exists.
10
+ */
11
+ import type { Letter } from './letter.js';
12
+ import type { ResumeObject } from './resume.js';
13
+ import type { ResumePresentation } from './template.js';
14
+ /** The global the shell writes and the bundle reads. */
15
+ export declare const EXPORT_PAYLOAD_GLOBAL = "__CVGS_EXPORT__";
16
+ /** The global the bundle writes and the renderer waits on. */
17
+ export declare const EXPORT_STATE_GLOBAL = "__CVGS_EXPORT_STATE__";
18
+ /** The global carrying the page count, once the document has settled. */
19
+ export declare const EXPORT_PAGES_GLOBAL = "__CVGS_EXPORT_PAGES__";
20
+ /**
21
+ * What the renderer waits for.
22
+ *
23
+ * `waitForExpression` is given `ready`; `failed` exists so a document that
24
+ * cannot be drawn ends the wait immediately with a diagnosable state rather
25
+ * than burning the full timeout and reporting only that it expired.
26
+ */
27
+ export type ExportState = 'pending' | 'ready' | 'failed';
28
+ /** Everything the browser needs to draw a resume, and nothing else. */
29
+ export interface ResumeExportPayload {
30
+ resume: ResumeObject;
31
+ presentation?: ResumePresentation;
32
+ }
33
+ /**
34
+ * Everything the browser needs to draw a cover letter. The date line arrives
35
+ * already written, so the file does not depend on the renderer's locale or
36
+ * clock.
37
+ */
38
+ export interface LetterExportPayload {
39
+ letter: Letter;
40
+ date: string;
41
+ }
42
+ export type ExportPayload = ResumeExportPayload | LetterExportPayload;
43
+ export declare function isLetterPayload(payload: ExportPayload): payload is LetterExportPayload;
44
+ /**
45
+ * Paper has no gap between its pages.
46
+ *
47
+ * The single parameter separating the exported document from the one on screen.
48
+ * Named here rather than written as a bare `0` at the call site, so the reason
49
+ * travels with the value.
50
+ */
51
+ export declare const PRINT_SHEET_GAP = 0;
52
+ //# sourceMappingURL=export-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-contract.d.ts","sourceRoot":"","sources":["../src/export-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,wDAAwD;AACxD,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzD,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAEtE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,aAAa,GACrB,OAAO,IAAI,mBAAmB,CAEhC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** The global the shell writes and the bundle reads. */
2
+ export const EXPORT_PAYLOAD_GLOBAL = '__CVGS_EXPORT__';
3
+ /** The global the bundle writes and the renderer waits on. */
4
+ export const EXPORT_STATE_GLOBAL = '__CVGS_EXPORT_STATE__';
5
+ /** The global carrying the page count, once the document has settled. */
6
+ export const EXPORT_PAGES_GLOBAL = '__CVGS_EXPORT_PAGES__';
7
+ export function isLetterPayload(payload) {
8
+ return 'letter' in payload;
9
+ }
10
+ /**
11
+ * Paper has no gap between its pages.
12
+ *
13
+ * The single parameter separating the exported document from the one on screen.
14
+ * Named here rather than written as a bare `0` at the call site, so the reason
15
+ * travels with the value.
16
+ */
17
+ export const PRINT_SHEET_GAP = 0;
@@ -0,0 +1,9 @@
1
+ export * from './locale.js';
2
+ export * from './resume.js';
3
+ export * from './resume-dates.js';
4
+ export * from './collections.js';
5
+ export * from './template.js';
6
+ export * from './library.js';
7
+ export * from './letter.js';
8
+ export * from './export-contract.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from './locale.js';
2
+ export * from './resume.js';
3
+ export * from './resume-dates.js';
4
+ export * from './collections.js';
5
+ export * from './template.js';
6
+ export * from './library.js';
7
+ export * from './letter.js';
8
+ export * from './export-contract.js';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The content a letter document draws: who it is addressed to, its body and its
3
+ * sign-off. A shape, not a schema — whoever produces the letter validates it,
4
+ * and anything wider (a generator's notes, say) is still a `Letter`.
5
+ */
6
+ export interface Letter {
7
+ recipient?: string;
8
+ greeting: string;
9
+ paragraphs: string[];
10
+ closing: string;
11
+ signature: string;
12
+ }
13
+ //# sourceMappingURL=letter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"letter.d.ts","sourceRoot":"","sources":["../src/letter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB"}
package/dist/letter.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,60 @@
1
+ import type { ResumeObject } from './resume.js';
2
+ import type { APPENDABLE_SECTIONS } from './template.js';
3
+ /**
4
+ * Taking entries from the career profile into the resume being edited.
5
+ *
6
+ * The profile is the candidate's whole history; a resume carries the part
7
+ * chosen for it. These functions answer which of the profile's entries a
8
+ * resume does not carry yet, and how to name one in a list — pure, so the
9
+ * editor, its tests and any later surface agree on both. See
10
+ * `add-from-career-profile`.
11
+ */
12
+ export type LibrarySection = (typeof APPENDABLE_SECTIONS)[number];
13
+ /**
14
+ * What makes two entries the SAME entry, per section.
15
+ *
16
+ * A role is its employer and when it began — not its title or bullets, which a
17
+ * tailored resume rewrites, so a reworded role is still recognised as the one
18
+ * already on the page. Everything else is recognised by the name it is listed
19
+ * under.
20
+ */
21
+ export declare function entryIdentity(section: LibrarySection, item: unknown): string;
22
+ /** The profile's entries of `section` that `present` does not already carry. */
23
+ export declare function libraryCandidates(section: LibrarySection, present: readonly unknown[], library: ResumeObject | null | undefined): unknown[];
24
+ /** How an entry is named in a list: a title and, when there is one, a detail line. */
25
+ export declare function describeLibraryEntry(section: LibrarySection, item: unknown): {
26
+ title: string;
27
+ detail?: string;
28
+ };
29
+ /** The profile's version of a role on the resume: same employer, same start. */
30
+ export declare function libraryRole(role: {
31
+ company?: unknown;
32
+ start?: unknown;
33
+ }, library: ResumeObject | null | undefined): ResumeObject['experience'][number] | undefined;
34
+ /**
35
+ * The bullets the profile holds for this role that the resume's version of it
36
+ * does not — compared by their words, so a bullet that differs only in
37
+ * punctuation or case is not offered twice.
38
+ */
39
+ export declare function libraryBullets(role: {
40
+ company?: unknown;
41
+ start?: unknown;
42
+ }, present: readonly string[], library: ResumeObject | null | undefined): string[];
43
+ /** What the profile can add from a role on the resume. */
44
+ export interface ExperienceOffer {
45
+ /** The profile's bullets for THIS role that the resume's version lacks. */
46
+ bullets: string[];
47
+ /** The profile's roles the resume does not carry at all. */
48
+ roles: ResumeObject['experience'];
49
+ }
50
+ /**
51
+ * Everything the profile can add, seen from one role: more of this role, and
52
+ * other roles. One answer for both, so a role already on the page never hides
53
+ * the bullets the resume left out of it.
54
+ */
55
+ export declare function experienceOffer(role: {
56
+ company?: unknown;
57
+ start?: unknown;
58
+ bullets?: readonly string[];
59
+ }, present: readonly unknown[], library: ResumeObject | null | undefined): ExperienceOffer;
60
+ //# sourceMappingURL=library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../src/library.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD;;;;;;;;GAQG;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AASlE;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAqB5E;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,SAAS,OAAO,EAAE,EAC3B,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,EAAE,CAQX;AAED,sFAAsF;AACtF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,OAAO,GACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAyCpC;AAQD,gFAAgF;AAChF,wBAAgB,WAAW,CACzB,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,EAC5C,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACvC,YAAY,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAMhD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,EAC5C,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACvC,MAAM,EAAE,CAQV;AAED,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,4DAA4D;IAC5D,KAAK,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EACzE,OAAO,EAAE,SAAS,OAAO,EAAE,EAC3B,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACvC,eAAe,CASjB"}