@singi-labs/sifa-sdk 0.19.112 → 0.20.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/badge/index.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{network-map-CrkLq2Gz.d.ts → network-map-2OKh3wSB.d.ts} +2 -2
- package/dist/{network-map-BwM-Wvxt.d.cts → network-map-DJonNOl0.d.cts} +2 -2
- package/dist/{profile-summary-TkVxvll4.d.cts → profile-summary-BCOKt3qS.d.cts} +1 -1
- package/dist/{profile-summary-CwJymH9d.d.ts → profile-summary-DF8-evvA.d.ts} +1 -1
- package/dist/query/client.js +2 -1
- package/dist/query/client.js.map +1 -1
- package/dist/query/fetchers/index.cjs +2 -1
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +5 -5
- package/dist/query/fetchers/index.d.ts +5 -5
- package/dist/query/fetchers/org.js.map +1 -1
- package/dist/query/hooks/index.cjs +2 -1
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +3 -3
- package/dist/query/hooks/index.d.ts +3 -3
- package/dist/query/index.cjs +2 -1
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +8 -8
- package/dist/query/index.d.ts +8 -8
- package/dist/resume/index.cjs +148 -24
- package/dist/resume/index.cjs.map +1 -1
- package/dist/resume/index.d.cts +20 -5
- package/dist/resume/index.d.ts +20 -5
- package/dist/resume/json-resume.js +67 -5
- package/dist/resume/json-resume.js.map +1 -1
- package/dist/{types-CQA_vO39.d.ts → types-CkomzDlY.d.ts} +11 -2
- package/dist/{types-DMTHqi2m.d.cts → types-JydVIhN5.d.cts} +11 -2
- package/dist/{use-user-settings-1zgi6qwl.d.ts → use-user-settings-CrS3ZXoW.d.ts} +2 -2
- package/dist/{use-user-settings-BmuAd8D4.d.cts → use-user-settings-YIv1C3qN.d.cts} +2 -2
- package/dist/{user-settings-Btvrox4G.d.ts → user-settings-Bvafly0r.d.ts} +3 -2
- package/dist/{user-settings-D4vdBf0A.d.cts → user-settings-DWq91Gj-.d.cts} +3 -2
- package/package.json +1 -1
package/dist/resume/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as ExportContact } from '../export-contact-D_krcTBH.js';
|
|
2
2
|
export { a as EXPORT_CONTACT_LIMITS, b as ExportContactDraft, e as exportContactSchema, l as looksLikeEmail, n as normalizeExportContact, p as pickExportContact } from '../export-contact-D_krcTBH.js';
|
|
3
|
-
import { L as LocationValue, M as ProfileLocation, d as ProfilePosition, f as ProfileEducation, P as ProfileSkill, e as ProfileCertification, i as ProfileProject, j as ProfilePublication, S as ProfileVolunteering,
|
|
3
|
+
import { L as LocationValue, M as ProfileLocation, d as ProfilePosition, f as ProfileEducation, P as ProfileSkill, e as ProfileCertification, i as ProfileProject, j as ProfilePublication, S as ProfileVolunteering, k as ProfileInvolvement, G as ProfileCourse, Q as ProfilePresentation, a as ProfilePresentationDelivery, g as ProfileHonor, h as ProfileLanguage, p as ExternalAccount } from '../index-DDh2RLvx.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '../verification-providers-DeyGqaoC.js';
|
|
6
6
|
|
|
@@ -17,10 +17,13 @@ import '../verification-providers-DeyGqaoC.js';
|
|
|
17
17
|
* emitting it hands a user every JSON Resume theme, and the Typst CV templates
|
|
18
18
|
* on Typst Universe, without Sifa writing a renderer for any of them.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
20
|
+
* Involvement, talks and courses taken have no JSON Resume key of their own and
|
|
21
|
+
* go into the nearest standard section: involvement next to volunteering, talks
|
|
22
|
+
* as publications of type "Talks", courses as certificates. Strict consumers
|
|
23
|
+
* such as altacv refuse any unknown top-level key, so nothing new is added
|
|
24
|
+
* there. Fields with no reasonable slot -- endorsements, confirmations,
|
|
25
|
+
* investments, courses someone taught -- are dropped. The loss is documented
|
|
26
|
+
* for the user at the point of download.
|
|
24
27
|
*/
|
|
25
28
|
|
|
26
29
|
type Sanitizer = (input: string) => string;
|
|
@@ -72,6 +75,11 @@ interface JsonResumeProfileInput {
|
|
|
72
75
|
readonly projects?: ProfileProject[];
|
|
73
76
|
readonly publications?: ProfilePublication[];
|
|
74
77
|
readonly volunteering?: ProfileVolunteering[];
|
|
78
|
+
readonly involvement?: ProfileInvolvement[];
|
|
79
|
+
readonly courses?: ProfileCourse[];
|
|
80
|
+
readonly presentations?: ProfilePresentation[];
|
|
81
|
+
/** Deliveries not tied to a presentation record are listed here only. */
|
|
82
|
+
readonly presentationDeliveries?: ProfilePresentationDelivery[];
|
|
75
83
|
readonly honors?: ProfileHonor[];
|
|
76
84
|
readonly languages?: ProfileLanguage[];
|
|
77
85
|
readonly externalAccounts?: ExternalAccount[];
|
|
@@ -146,9 +154,16 @@ interface JsonResumePublication {
|
|
|
146
154
|
readonly releaseDate?: string;
|
|
147
155
|
readonly url?: string;
|
|
148
156
|
readonly summary?: string;
|
|
157
|
+
/**
|
|
158
|
+
* "Talks" for a talk. Not in the JSON Resume schema, which allows extra
|
|
159
|
+
* fields; CV templates such as altacv group publications by it.
|
|
160
|
+
*/
|
|
161
|
+
readonly type?: string;
|
|
149
162
|
}
|
|
163
|
+
/** A skill category, with the skills in it as keywords. */
|
|
150
164
|
interface JsonResumeSkill {
|
|
151
165
|
readonly name: string;
|
|
166
|
+
readonly keywords: string[];
|
|
152
167
|
}
|
|
153
168
|
interface JsonResumeLanguage {
|
|
154
169
|
readonly language: string;
|
|
@@ -12,6 +12,10 @@ import {
|
|
|
12
12
|
sortPublications
|
|
13
13
|
} from "../profile/section-sorts.js";
|
|
14
14
|
import { sortByActiveDateRange } from "../profile/range-sort.js";
|
|
15
|
+
import { isTeachingCourse } from "../taxonomy/course-role.js";
|
|
16
|
+
import { getInvolvementKindLabel } from "../taxonomy/involvement-kind.js";
|
|
17
|
+
import { CATEGORY_LABELS } from "../taxonomy/skill-categories.js";
|
|
18
|
+
import { groupSkillsByCategory } from "../taxonomy/skill-grouping.js";
|
|
15
19
|
import { normaliseBaseUrl, profileUrl } from "../jsonld/url.js";
|
|
16
20
|
import { normalizeExportContact } from "./export-contact.js";
|
|
17
21
|
var SCHEMA_VERSION = "v1.0.0";
|
|
@@ -72,6 +76,41 @@ function text(value, s) {
|
|
|
72
76
|
function orgName(entityName, stored, s) {
|
|
73
77
|
return text(entityName, s) ?? text(stored, s);
|
|
74
78
|
}
|
|
79
|
+
var TALK_EVENTS_SHOWN = 3;
|
|
80
|
+
function byDateDesc(a, b) {
|
|
81
|
+
return (b.date ?? "").localeCompare(a.date ?? "");
|
|
82
|
+
}
|
|
83
|
+
function mapTalks(profile, s) {
|
|
84
|
+
const standalone = filterHidden(profile.presentationDeliveries).filter(
|
|
85
|
+
(d) => !d.presentationRkey
|
|
86
|
+
);
|
|
87
|
+
const talks = filterHidden(profile.presentations).map((talk) => {
|
|
88
|
+
const deliveries = filterHidden(talk.deliveries).sort(byDateDesc);
|
|
89
|
+
const events = [
|
|
90
|
+
...new Set(deliveries.map((d) => text(d.eventName ?? void 0, s)).filter(Boolean))
|
|
91
|
+
];
|
|
92
|
+
const shown = events.slice(0, TALK_EVENTS_SHOWN).join(", ");
|
|
93
|
+
const more = events.length - TALK_EVENTS_SHOWN;
|
|
94
|
+
return compact({
|
|
95
|
+
name: s(talk.title),
|
|
96
|
+
publisher: more > 0 ? `${shown} and ${more} more` : shown || void 0,
|
|
97
|
+
releaseDate: toResumeDate(deliveries[0]?.date ?? void 0),
|
|
98
|
+
url: link(talk.links?.[0]?.uri, s),
|
|
99
|
+
summary: text(talk.description ?? void 0, s),
|
|
100
|
+
type: "Talks"
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
const loose = standalone.map(
|
|
104
|
+
(d) => compact({
|
|
105
|
+
name: s(d.title?.trim() || d.eventName?.trim() || ""),
|
|
106
|
+
publisher: text(d.eventName ?? void 0, s),
|
|
107
|
+
releaseDate: toResumeDate(d.date ?? void 0),
|
|
108
|
+
url: link(d.links?.[0]?.uri, s),
|
|
109
|
+
type: "Talks"
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
return [...talks, ...loose].filter((t) => t.name).sort((a, b) => byDateDesc({ date: a.releaseDate }, { date: b.releaseDate }));
|
|
113
|
+
}
|
|
75
114
|
function profileToJsonResume(profile, options = {}) {
|
|
76
115
|
const s = options.sanitize ?? identity;
|
|
77
116
|
const baseUrl = normaliseBaseUrl(options.baseUrl);
|
|
@@ -105,15 +144,22 @@ function profileToJsonResume(profile, options = {}) {
|
|
|
105
144
|
endDate: toResumeDate(position.endedAt)
|
|
106
145
|
})
|
|
107
146
|
);
|
|
108
|
-
const volunteer = sortByActiveDateRange(
|
|
109
|
-
(entry) =>
|
|
147
|
+
const volunteer = sortByActiveDateRange([
|
|
148
|
+
...filterHidden(profile.volunteering).map((entry) => ({
|
|
110
149
|
organization: orgName(entry.entityName, entry.organization, s),
|
|
111
150
|
position: text(entry.role, s),
|
|
112
151
|
summary: text(entry.description, s),
|
|
113
152
|
startDate: toResumeDate(entry.startDate),
|
|
114
153
|
endDate: toResumeDate(entry.endDate)
|
|
115
|
-
})
|
|
116
|
-
|
|
154
|
+
})),
|
|
155
|
+
...filterHidden(profile.involvement).map((entry) => ({
|
|
156
|
+
organization: orgName(entry.entityName, entry.upstream, s),
|
|
157
|
+
position: text(entry.role, s) ?? text(getInvolvementKindLabel(entry.kind), s),
|
|
158
|
+
summary: text(entry.description, s),
|
|
159
|
+
startDate: toResumeDate(entry.startedAt),
|
|
160
|
+
endDate: toResumeDate(entry.endedAt)
|
|
161
|
+
}))
|
|
162
|
+
]).map((entry) => compact(entry));
|
|
117
163
|
const education = sortEducation(filterHidden(profile.education)).map(
|
|
118
164
|
(entry) => compact({
|
|
119
165
|
institution: orgName(entry.entityName, entry.institution, s),
|
|
@@ -142,6 +188,18 @@ function profileToJsonResume(profile, options = {}) {
|
|
|
142
188
|
url: link(cert.credentialUrl, s)
|
|
143
189
|
})
|
|
144
190
|
);
|
|
191
|
+
const listedCredentials = new Set(filterHidden(profile.certifications).map((c) => c.rkey));
|
|
192
|
+
for (const course of filterHidden(profile.courses)) {
|
|
193
|
+
if (isTeachingCourse(course)) continue;
|
|
194
|
+
if (course.credentialRkey && listedCredentials.has(course.credentialRkey)) continue;
|
|
195
|
+
certificates.push(
|
|
196
|
+
compact({
|
|
197
|
+
name: s(course.name),
|
|
198
|
+
date: toResumeDate(course.completedAt),
|
|
199
|
+
issuer: orgName(course.entityName, course.institution, s)
|
|
200
|
+
})
|
|
201
|
+
);
|
|
202
|
+
}
|
|
145
203
|
const publications = sortPublications(filterHidden(profile.publications)).map(
|
|
146
204
|
(publication) => compact({
|
|
147
205
|
name: s(publication.title),
|
|
@@ -151,7 +209,11 @@ function profileToJsonResume(profile, options = {}) {
|
|
|
151
209
|
summary: text(publication.description, s)
|
|
152
210
|
})
|
|
153
211
|
);
|
|
154
|
-
|
|
212
|
+
publications.push(...mapTalks(profile, s));
|
|
213
|
+
const skills = groupSkillsByCategory(profile.skills ?? []).map(([category, items]) => ({
|
|
214
|
+
name: CATEGORY_LABELS[category] ?? category,
|
|
215
|
+
keywords: items.map((skill) => s(skill.name))
|
|
216
|
+
}));
|
|
155
217
|
const languages = sortLanguages(filterHidden(profile.languages)).map(
|
|
156
218
|
(language) => compact({
|
|
157
219
|
language: s(language.language),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/resume/json-resume.ts"],"sourcesContent":["/**\n * JSON Resume v1.0.0 emitter for a Sifa profile.\n *\n * https://jsonresume.org/schema/\n *\n * One pure function, no fetching, no DOM, no framework -- the same shape as the\n * JSON-LD emitter next door, and for the same reason: sifa.id, page.sifa.id and\n * any future consumer should emit one document from one implementation.\n *\n * Why this format earns its place: it is the lingua franca of CV tooling, so\n * emitting it hands a user every JSON Resume theme, and the Typst CV templates\n * on Typst Universe, without Sifa writing a renderer for any of them.\n *\n * Fields Sifa holds that JSON Resume has no slot for -- endorsements,\n * confirmations, involvement, investments, presentations, courses -- are\n * dropped rather than smuggled into a nearby field. The loss is documented for\n * the user at the point of download.\n */\n\nimport { parseLocationString } from '../format/location-utils.js';\nimport { formatStructuredName } from '../format/pds-utils.js';\nimport { filterHidden } from '../profile/section-model.js';\nimport {\n sortCertifications,\n sortEducation,\n sortHonors,\n sortLanguages,\n sortPositions,\n sortProjects,\n sortPublications,\n} from '../profile/section-sorts.js';\nimport { sortByActiveDateRange } from '../profile/range-sort.js';\nimport type {\n ExternalAccount,\n LanguageProficiency,\n LocationValue,\n ProfileCertification,\n ProfileEducation,\n ProfileHonor,\n ProfileLanguage,\n ProfileLocation,\n ProfilePosition,\n ProfileProject,\n ProfilePublication,\n ProfileSkill,\n ProfileVolunteering,\n} from '../types/index.js';\nimport { normaliseBaseUrl, profileUrl } from '../jsonld/url.js';\nimport { normalizeExportContact, type ExportContact } from './export-contact.js';\n\nexport type Sanitizer = (input: string) => string;\n\nexport interface JsonResumeOptions {\n /** Canonical origin for the profile URL. Defaults to `https://sifa.id`. */\n readonly baseUrl?: string;\n /** Applied to every user-authored string. Defaults to identity. */\n readonly sanitize?: Sanitizer;\n /**\n * Absolute URL of the profile this resume describes. Defaults to\n * `${baseUrl}/p/${handle}`. A personal site served from a custom domain is\n * not at that path.\n */\n readonly canonicalUrl?: string;\n /**\n * Email, phone and postal address to print. Sifa holds none of these; the\n * owner types them on the export page. Without it the resume has no\n * `email`, `phone` or `location.address`. Personal details in the same object\n * (driver's license, right to work, nationality) are left out: JSON Resume\n * has no field for them, and strict consumers such as altacv refuse a file\n * with an unknown key.\n */\n readonly contact?: ExportContact;\n}\n\n/**\n * The subset of `Profile` this emitter reads. Deliberately structural rather\n * than the full `Profile`, so a caller holding a partially hydrated profile --\n * or a test -- does not have to invent forty unrelated fields.\n */\nexport interface JsonResumeProfileInput {\n readonly handle: string;\n readonly displayName?: string;\n readonly givenName?: string;\n readonly familyName?: string;\n readonly avatar?: string;\n readonly headline?: string;\n readonly about?: string;\n readonly website?: string;\n /**\n * The structured location. The profile API sends a display string here\n * instead; the emitter then reads the primary entry of `locations`.\n */\n readonly location?: LocationValue | string | null;\n readonly locations?: ProfileLocation[];\n readonly positions?: ProfilePosition[];\n readonly education?: ProfileEducation[];\n readonly skills?: ProfileSkill[];\n readonly certifications?: ProfileCertification[];\n readonly projects?: ProfileProject[];\n readonly publications?: ProfilePublication[];\n readonly volunteering?: ProfileVolunteering[];\n readonly honors?: ProfileHonor[];\n readonly languages?: ProfileLanguage[];\n readonly externalAccounts?: ExternalAccount[];\n}\n\nexport interface JsonResumeLocation {\n /** Street address; lines are separated by `\\n`, as the schema asks. */\n readonly address?: string;\n readonly city?: string;\n readonly region?: string;\n readonly countryCode?: string;\n readonly postalCode?: string;\n}\n\nexport interface JsonResumeProfileLink {\n readonly network: string;\n readonly username?: string;\n readonly url?: string;\n}\n\nexport interface JsonResumeBasics {\n readonly name: string;\n readonly label?: string;\n readonly image?: string;\n readonly url?: string;\n readonly email?: string;\n readonly phone?: string;\n readonly summary?: string;\n readonly location?: JsonResumeLocation;\n readonly profiles?: JsonResumeProfileLink[];\n}\n\nexport interface JsonResumeWork {\n readonly name?: string;\n readonly position: string;\n readonly summary?: string;\n readonly startDate?: string;\n readonly endDate?: string;\n}\n\nexport interface JsonResumeVolunteer {\n /**\n * Omitted when the record carries no organization name at all. Emitting an\n * empty string would render as a blank organization line in a CV template.\n */\n readonly organization?: string;\n readonly position?: string;\n readonly summary?: string;\n readonly startDate?: string;\n readonly endDate?: string;\n}\n\nexport interface JsonResumeEducation {\n /** Omitted when the record carries no institution name. See volunteer. */\n readonly institution?: string;\n readonly area?: string;\n readonly studyType?: string;\n readonly startDate?: string;\n readonly endDate?: string;\n}\n\nexport interface JsonResumeAward {\n readonly title: string;\n readonly date?: string;\n readonly awarder?: string;\n readonly summary?: string;\n}\n\nexport interface JsonResumeCertificate {\n readonly name: string;\n readonly date?: string;\n /** Expiry date. Not in the JSON Resume schema, which allows extra fields. */\n readonly endDate?: string;\n readonly issuer?: string;\n readonly url?: string;\n}\n\nexport interface JsonResumePublication {\n readonly name: string;\n readonly publisher?: string;\n readonly releaseDate?: string;\n readonly url?: string;\n readonly summary?: string;\n}\n\nexport interface JsonResumeSkill {\n readonly name: string;\n}\n\nexport interface JsonResumeLanguage {\n readonly language: string;\n readonly fluency?: string;\n}\n\nexport interface JsonResumeProject {\n readonly name: string;\n readonly description?: string;\n readonly url?: string;\n readonly startDate?: string;\n readonly endDate?: string;\n}\n\nexport interface JsonResumeMeta {\n readonly canonical: string;\n readonly version: string;\n readonly lastModified?: string;\n}\n\nexport interface JsonResume {\n readonly basics?: JsonResumeBasics;\n readonly work?: JsonResumeWork[];\n readonly volunteer?: JsonResumeVolunteer[];\n readonly education?: JsonResumeEducation[];\n readonly awards?: JsonResumeAward[];\n readonly certificates?: JsonResumeCertificate[];\n readonly publications?: JsonResumePublication[];\n readonly skills?: JsonResumeSkill[];\n readonly languages?: JsonResumeLanguage[];\n readonly projects?: JsonResumeProject[];\n readonly meta?: JsonResumeMeta;\n}\n\n/** Schema version this emitter targets, as JSON Resume writes it in `meta`. */\nconst SCHEMA_VERSION = 'v1.0.0';\n\n/**\n * A date JSON Resume will accept: `YYYY`, `YYYY-MM` or `YYYY-MM-DD`. Sifa\n * stores RFC 3339 for some fields, and a full timestamp pasted into a CV\n * template renders as `2020-03-04T00:00:00.000Z` on the page.\n */\nconst RESUME_DATE_RE = /^(\\d{4})(-\\d{2})?(-\\d{2})?/;\n\nexport function toResumeDate(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n if (!trimmed) return undefined;\n const match = RESUME_DATE_RE.exec(trimmed);\n return match ? match[0] : undefined;\n}\n\n/**\n * JSON Resume's `fluency` is free text, so these are display labels rather\n * than a mapped vocabulary. Kept in one place so export and a future import\n * agree on the spelling.\n */\nconst FLUENCY_LABELS: Record<LanguageProficiency, string> = {\n elementary: 'Elementary',\n limited_working: 'Limited working',\n professional_working: 'Professional working',\n full_professional: 'Full professional',\n native: 'Native or bilingual',\n};\n\nconst identity: Sanitizer = (input) => input;\n\n/** Drops keys whose value is undefined, so the document carries no empty slots. */\nfunction compact<T extends object>(value: T): T {\n return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined)) as T;\n}\n\n/** Adds the owner's street address to the profile's location. */\nfunction withAddress(\n location: JsonResumeLocation | undefined,\n address: string | undefined,\n): JsonResumeLocation | undefined {\n return address ? { address, ...location } : location;\n}\n\n/** Omits the key entirely when the mapped list came out empty. */\nfunction section<K extends string, T>(key: K, items: T[]): Record<K, T[]> | undefined {\n return items.length > 0 ? ({ [key]: items } as Record<K, T[]>) : undefined;\n}\n\n/**\n * The first of these that yields anything: the structured `location` object;\n * the primary entry of `locations` (or the first entry when none is marked\n * primary), which is what the profile API sends; a display-string `location`,\n * split into city and region. JSON Resume has no field for a country name, so a\n * country-only location maps to nothing.\n */\nfunction mapLocation(\n profile: Pick<JsonResumeProfileInput, 'location' | 'locations'>,\n s: Sanitizer,\n): JsonResumeLocation | undefined {\n const fromValue = (location: LocationValue | null | undefined) =>\n location\n ? compact<JsonResumeLocation>({\n city: text(location.locality || location.city, s),\n region: text(location.region, s),\n countryCode: text(location.countryCode, s),\n postalCode: text(location.postalCode, s),\n })\n : {};\n const entry = profile.locations?.find((l) => l.isPrimary) ?? profile.locations?.[0];\n const candidates: JsonResumeLocation[] = [\n typeof profile.location === 'object' ? fromValue(profile.location) : {},\n entry\n ? compact<JsonResumeLocation>({\n city: text((entry.locationLocality || entry.locationCity) ?? undefined, s),\n region: text(entry.locationRegion ?? undefined, s),\n countryCode: text(entry.countryCode ?? undefined, s),\n })\n : {},\n typeof profile.location === 'string' ? fromValue(parseLocationString(profile.location)) : {},\n ];\n return candidates.find((c) => Object.keys(c).length > 0);\n}\n\n/**\n * A link field as a valid URI. A bare domain (\"example.com\") gets `https://`;\n * anything else that does not parse is left out. JSON Resume declares these as\n * URIs, and strict consumers such as altacv refuse the whole file otherwise.\n */\nfunction link(value: string | undefined, s: Sanitizer): string | undefined {\n // No whitespace belongs in a link; a pasted space made altacv refuse a real\n // ORCID URL that the URL parser itself accepts.\n const t = value?.replace(/\\s+/g, '');\n if (!t) return undefined;\n // Checked before sanitizing, so the sanitizer still sees every value.\n if (/^[a-z][a-z0-9+.-]*:\\/\\//i.test(t)) return URL.canParse(t) ? s(t) : undefined;\n const withScheme = `https://${t}`;\n return /^[^\\s/]+\\.[^\\s/]+/.test(t) && URL.canParse(withScheme) ? s(withScheme) : undefined;\n}\n\n/** Trimmed, sanitised, and undefined when there is nothing left. */\nfunction text(value: string | undefined, s: Sanitizer): string | undefined {\n const trimmed = value?.trim();\n return trimmed ? s(trimmed) : undefined;\n}\n\n/**\n * The name to print for a linked organization. `entityName` is the AppView's\n * resolved current name and wins when present, matching how the profile itself\n * renders these.\n */\nfunction orgName(\n entityName: string | undefined,\n stored: string | undefined,\n s: Sanitizer,\n): string | undefined {\n return text(entityName, s) ?? text(stored, s);\n}\n\n/**\n * Build a JSON Resume v1.0.0 document from a Sifa profile.\n *\n * Hidden records are dropped. Keys are omitted rather than emitted empty, so a\n * profile with no publications produces a document with no `publications` key\n * instead of one a reader has to interpret.\n */\nexport function profileToJsonResume(\n profile: JsonResumeProfileInput,\n options: JsonResumeOptions = {},\n): JsonResume {\n const s = options.sanitize ?? identity;\n const baseUrl = normaliseBaseUrl(options.baseUrl);\n const canonical = options.canonicalUrl ?? profileUrl(baseUrl, profile.handle);\n const contact = normalizeExportContact(options.contact ?? {});\n\n const name =\n formatStructuredName(profile.givenName, profile.familyName) ??\n text(profile.displayName, s) ??\n profile.handle;\n\n const profiles = filterHidden(profile.externalAccounts).map((account) =>\n compact<JsonResumeProfileLink>({\n network: s(account.platform),\n username: text(account.label, s),\n url: link(account.url, s),\n }),\n );\n\n const basics = compact<JsonResumeBasics>({\n name,\n label: text(profile.headline, s),\n image: text(profile.avatar, s),\n email: text(contact.email, s),\n phone: text(contact.phone, s),\n url: link(profile.website, s) ?? canonical,\n summary: text(profile.about, s),\n location: withAddress(mapLocation(profile, s), text(contact.address, s)),\n ...section('profiles', profiles),\n });\n\n // Same order as the profile page and the other exports: newest first.\n const work = sortPositions(filterHidden(profile.positions)).map((position) =>\n compact<JsonResumeWork>({\n name: orgName(position.entityName, position.company, s),\n position: s(position.title),\n summary: text(position.description, s),\n startDate: toResumeDate(position.startedAt),\n endDate: toResumeDate(position.endedAt),\n }),\n );\n\n const volunteer = sortByActiveDateRange(filterHidden(profile.volunteering)).map((entry) =>\n compact<JsonResumeVolunteer>({\n organization: orgName(entry.entityName, entry.organization, s),\n position: text(entry.role, s),\n summary: text(entry.description, s),\n startDate: toResumeDate(entry.startDate),\n endDate: toResumeDate(entry.endDate),\n }),\n );\n\n const education = sortEducation(filterHidden(profile.education)).map((entry) =>\n compact<JsonResumeEducation>({\n institution: orgName(entry.entityName, entry.institution, s),\n area: text(entry.fieldOfStudy, s),\n studyType: text(entry.degree, s),\n startDate: toResumeDate(entry.startedAt),\n endDate: toResumeDate(entry.endedAt),\n }),\n );\n\n const awards = sortHonors(filterHidden(profile.honors)).map((honor) =>\n compact<JsonResumeAward>({\n title: s(honor.title),\n date: toResumeDate(honor.date),\n awarder: orgName(honor.entityName, honor.issuer, s),\n summary: text(honor.description, s),\n }),\n );\n\n const certificates = sortCertifications(filterHidden(profile.certifications)).map((cert) =>\n compact<JsonResumeCertificate>({\n name: s(cert.name),\n date: toResumeDate(cert.issueDate),\n endDate: toResumeDate(cert.expiryDate),\n // `issuingOrg` is the deprecated read-view alias for `authority`; records\n // indexed before the rename carry only the alias.\n issuer: orgName(cert.entityName, cert.authority ?? cert.issuingOrg, s),\n url: link(cert.credentialUrl, s),\n }),\n );\n\n const publications = sortPublications(filterHidden(profile.publications)).map((publication) =>\n compact<JsonResumePublication>({\n name: s(publication.title),\n publisher: text(publication.publisher, s),\n releaseDate: toResumeDate(publication.date),\n url: link(publication.url, s),\n summary: text(publication.description, s),\n }),\n );\n\n // One entry per skill rather than JSON Resume's grouped shape: Sifa stores one\n // record per skill, and keeping the two symmetric is what makes a round-trip\n // through a third-party editor safe. Category and endorsement counts have no\n // JSON Resume slot and are dropped. Skill records carry no `hidden` flag, so\n // there is nothing to filter here.\n const skills = (profile.skills ?? []).map((skill) => ({ name: s(skill.name) }));\n\n const languages = sortLanguages(filterHidden(profile.languages)).map((language) =>\n compact<JsonResumeLanguage>({\n language: s(language.language),\n fluency: language.proficiency ? FLUENCY_LABELS[language.proficiency] : undefined,\n }),\n );\n\n const projects = sortProjects(filterHidden(profile.projects)).map((project) =>\n compact<JsonResumeProject>({\n name: s(project.name),\n description: text(project.description, s),\n url: link(project.url, s),\n startDate: toResumeDate(project.startDate),\n endDate: toResumeDate(project.endDate),\n }),\n );\n\n return {\n basics,\n ...section('work', work),\n ...section('volunteer', volunteer),\n ...section('education', education),\n ...section('awards', awards),\n ...section('certificates', certificates),\n ...section('publications', publications),\n ...section('skills', skills),\n ...section('languages', languages),\n ...section('projects', projects),\n meta: { canonical, version: SCHEMA_VERSION },\n };\n}\n"],"mappings":";AAmBA,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AAgBtC,SAAS,kBAAkB,kBAAkB;AAC7C,SAAS,8BAAkD;AAgL3D,IAAM,iBAAiB;AAOvB,IAAM,iBAAiB;AAEhB,SAAS,aAAa,OAA+C;AAC1E,QAAM,UAAU,OAAO,KAAK;AAC5B,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,QAAQ,eAAe,KAAK,OAAO;AACzC,SAAO,QAAQ,MAAM,CAAC,IAAI;AAC5B;AAOA,IAAM,iBAAsD;AAAA,EAC1D,YAAY;AAAA,EACZ,iBAAiB;AAAA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E,QAA4B;AAAA,MAC1B,UAAU,EAAE,SAAS,QAAQ;AAAA,MAC7B,SAAS,SAAS,cAAc,eAAe,SAAS,WAAW,IAAI;AAAA,IACzE,CAAC;AAAA,EACH;AAEA,QAAM,WAAW,aAAa,aAAa,QAAQ,QAAQ,CAAC,EAAE;AAAA,IAAI,CAAC,YACjE,QAA2B;AAAA,MACzB,MAAM,EAAE,QAAQ,IAAI;AAAA,MACpB,aAAa,KAAK,QAAQ,aAAa,CAAC;AAAA,MACxC,KAAK,KAAK,QAAQ,KAAK,CAAC;AAAA,MACxB,WAAW,aAAa,QAAQ,SAAS;AAAA,MACzC,SAAS,aAAa,QAAQ,OAAO;AAAA,IACvC,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA,GAAG,QAAQ,QAAQ,IAAI;AAAA,IACvB,GAAG,QAAQ,aAAa,SAAS;AAAA,IACjC,GAAG,QAAQ,aAAa,SAAS;AAAA,IACjC,GAAG,QAAQ,UAAU,MAAM;AAAA,IAC3B,GAAG,QAAQ,gBAAgB,YAAY;AAAA,IACvC,GAAG,QAAQ,gBAAgB,YAAY;AAAA,IACvC,GAAG,QAAQ,UAAU,MAAM;AAAA,IAC3B,GAAG,QAAQ,aAAa,SAAS;AAAA,IACjC,GAAG,QAAQ,YAAY,QAAQ;AAAA,IAC/B,MAAM,EAAE,WAAW,SAAS,eAAe;AAAA,EAC7C;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/resume/json-resume.ts"],"sourcesContent":["/**\n * JSON Resume v1.0.0 emitter for a Sifa profile.\n *\n * https://jsonresume.org/schema/\n *\n * One pure function, no fetching, no DOM, no framework -- the same shape as the\n * JSON-LD emitter next door, and for the same reason: sifa.id, page.sifa.id and\n * any future consumer should emit one document from one implementation.\n *\n * Why this format earns its place: it is the lingua franca of CV tooling, so\n * emitting it hands a user every JSON Resume theme, and the Typst CV templates\n * on Typst Universe, without Sifa writing a renderer for any of them.\n *\n * Involvement, talks and courses taken have no JSON Resume key of their own and\n * go into the nearest standard section: involvement next to volunteering, talks\n * as publications of type \"Talks\", courses as certificates. Strict consumers\n * such as altacv refuse any unknown top-level key, so nothing new is added\n * there. Fields with no reasonable slot -- endorsements, confirmations,\n * investments, courses someone taught -- are dropped. The loss is documented\n * for the user at the point of download.\n */\n\nimport { parseLocationString } from '../format/location-utils.js';\nimport { formatStructuredName } from '../format/pds-utils.js';\nimport { filterHidden } from '../profile/section-model.js';\nimport {\n sortCertifications,\n sortEducation,\n sortHonors,\n sortLanguages,\n sortPositions,\n sortProjects,\n sortPublications,\n} from '../profile/section-sorts.js';\nimport { sortByActiveDateRange } from '../profile/range-sort.js';\nimport { isTeachingCourse } from '../taxonomy/course-role.js';\nimport { getInvolvementKindLabel } from '../taxonomy/involvement-kind.js';\nimport { CATEGORY_LABELS } from '../taxonomy/skill-categories.js';\nimport { groupSkillsByCategory } from '../taxonomy/skill-grouping.js';\nimport type {\n ExternalAccount,\n LanguageProficiency,\n LocationValue,\n ProfileCertification,\n ProfileCourse,\n ProfileEducation,\n ProfileHonor,\n ProfileInvolvement,\n ProfileLanguage,\n ProfileLocation,\n ProfilePosition,\n ProfilePresentation,\n ProfilePresentationDelivery,\n ProfileProject,\n ProfilePublication,\n ProfileSkill,\n ProfileVolunteering,\n} from '../types/index.js';\nimport { normaliseBaseUrl, profileUrl } from '../jsonld/url.js';\nimport { normalizeExportContact, type ExportContact } from './export-contact.js';\n\nexport type Sanitizer = (input: string) => string;\n\nexport interface JsonResumeOptions {\n /** Canonical origin for the profile URL. Defaults to `https://sifa.id`. */\n readonly baseUrl?: string;\n /** Applied to every user-authored string. Defaults to identity. */\n readonly sanitize?: Sanitizer;\n /**\n * Absolute URL of the profile this resume describes. Defaults to\n * `${baseUrl}/p/${handle}`. A personal site served from a custom domain is\n * not at that path.\n */\n readonly canonicalUrl?: string;\n /**\n * Email, phone and postal address to print. Sifa holds none of these; the\n * owner types them on the export page. Without it the resume has no\n * `email`, `phone` or `location.address`. Personal details in the same object\n * (driver's license, right to work, nationality) are left out: JSON Resume\n * has no field for them, and strict consumers such as altacv refuse a file\n * with an unknown key.\n */\n readonly contact?: ExportContact;\n}\n\n/**\n * The subset of `Profile` this emitter reads. Deliberately structural rather\n * than the full `Profile`, so a caller holding a partially hydrated profile --\n * or a test -- does not have to invent forty unrelated fields.\n */\nexport interface JsonResumeProfileInput {\n readonly handle: string;\n readonly displayName?: string;\n readonly givenName?: string;\n readonly familyName?: string;\n readonly avatar?: string;\n readonly headline?: string;\n readonly about?: string;\n readonly website?: string;\n /**\n * The structured location. The profile API sends a display string here\n * instead; the emitter then reads the primary entry of `locations`.\n */\n readonly location?: LocationValue | string | null;\n readonly locations?: ProfileLocation[];\n readonly positions?: ProfilePosition[];\n readonly education?: ProfileEducation[];\n readonly skills?: ProfileSkill[];\n readonly certifications?: ProfileCertification[];\n readonly projects?: ProfileProject[];\n readonly publications?: ProfilePublication[];\n readonly volunteering?: ProfileVolunteering[];\n readonly involvement?: ProfileInvolvement[];\n readonly courses?: ProfileCourse[];\n readonly presentations?: ProfilePresentation[];\n /** Deliveries not tied to a presentation record are listed here only. */\n readonly presentationDeliveries?: ProfilePresentationDelivery[];\n readonly honors?: ProfileHonor[];\n readonly languages?: ProfileLanguage[];\n readonly externalAccounts?: ExternalAccount[];\n}\n\nexport interface JsonResumeLocation {\n /** Street address; lines are separated by `\\n`, as the schema asks. */\n readonly address?: string;\n readonly city?: string;\n readonly region?: string;\n readonly countryCode?: string;\n readonly postalCode?: string;\n}\n\nexport interface JsonResumeProfileLink {\n readonly network: string;\n readonly username?: string;\n readonly url?: string;\n}\n\nexport interface JsonResumeBasics {\n readonly name: string;\n readonly label?: string;\n readonly image?: string;\n readonly url?: string;\n readonly email?: string;\n readonly phone?: string;\n readonly summary?: string;\n readonly location?: JsonResumeLocation;\n readonly profiles?: JsonResumeProfileLink[];\n}\n\nexport interface JsonResumeWork {\n readonly name?: string;\n readonly position: string;\n readonly summary?: string;\n readonly startDate?: string;\n readonly endDate?: string;\n}\n\nexport interface JsonResumeVolunteer {\n /**\n * Omitted when the record carries no organization name at all. Emitting an\n * empty string would render as a blank organization line in a CV template.\n */\n readonly organization?: string;\n readonly position?: string;\n readonly summary?: string;\n readonly startDate?: string;\n readonly endDate?: string;\n}\n\nexport interface JsonResumeEducation {\n /** Omitted when the record carries no institution name. See volunteer. */\n readonly institution?: string;\n readonly area?: string;\n readonly studyType?: string;\n readonly startDate?: string;\n readonly endDate?: string;\n}\n\nexport interface JsonResumeAward {\n readonly title: string;\n readonly date?: string;\n readonly awarder?: string;\n readonly summary?: string;\n}\n\nexport interface JsonResumeCertificate {\n readonly name: string;\n readonly date?: string;\n /** Expiry date. Not in the JSON Resume schema, which allows extra fields. */\n readonly endDate?: string;\n readonly issuer?: string;\n readonly url?: string;\n}\n\nexport interface JsonResumePublication {\n readonly name: string;\n readonly publisher?: string;\n readonly releaseDate?: string;\n readonly url?: string;\n readonly summary?: string;\n /**\n * \"Talks\" for a talk. Not in the JSON Resume schema, which allows extra\n * fields; CV templates such as altacv group publications by it.\n */\n readonly type?: string;\n}\n\n/** A skill category, with the skills in it as keywords. */\nexport interface JsonResumeSkill {\n readonly name: string;\n readonly keywords: string[];\n}\n\nexport interface JsonResumeLanguage {\n readonly language: string;\n readonly fluency?: string;\n}\n\nexport interface JsonResumeProject {\n readonly name: string;\n readonly description?: string;\n readonly url?: string;\n readonly startDate?: string;\n readonly endDate?: string;\n}\n\nexport interface JsonResumeMeta {\n readonly canonical: string;\n readonly version: string;\n readonly lastModified?: string;\n}\n\nexport interface JsonResume {\n readonly basics?: JsonResumeBasics;\n readonly work?: JsonResumeWork[];\n readonly volunteer?: JsonResumeVolunteer[];\n readonly education?: JsonResumeEducation[];\n readonly awards?: JsonResumeAward[];\n readonly certificates?: JsonResumeCertificate[];\n readonly publications?: JsonResumePublication[];\n readonly skills?: JsonResumeSkill[];\n readonly languages?: JsonResumeLanguage[];\n readonly projects?: JsonResumeProject[];\n readonly meta?: JsonResumeMeta;\n}\n\n/** Schema version this emitter targets, as JSON Resume writes it in `meta`. */\nconst SCHEMA_VERSION = 'v1.0.0';\n\n/**\n * A date JSON Resume will accept: `YYYY`, `YYYY-MM` or `YYYY-MM-DD`. Sifa\n * stores RFC 3339 for some fields, and a full timestamp pasted into a CV\n * template renders as `2020-03-04T00:00:00.000Z` on the page.\n */\nconst RESUME_DATE_RE = /^(\\d{4})(-\\d{2})?(-\\d{2})?/;\n\nexport function toResumeDate(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n if (!trimmed) return undefined;\n const match = RESUME_DATE_RE.exec(trimmed);\n return match ? match[0] : undefined;\n}\n\n/**\n * JSON Resume's `fluency` is free text, so these are display labels rather\n * than a mapped vocabulary. Kept in one place so export and a future import\n * agree on the spelling.\n */\nconst FLUENCY_LABELS: Record<LanguageProficiency, string> = {\n elementary: 'Elementary',\n limited_working: 'Limited working',\n professional_working: 'Professional working',\n full_professional: 'Full professional',\n native: 'Native or bilingual',\n};\n\nconst identity: Sanitizer = (input) => input;\n\n/** Drops keys whose value is undefined, so the document carries no empty slots. */\nfunction compact<T extends object>(value: T): T {\n return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined)) as T;\n}\n\n/** Adds the owner's street address to the profile's location. */\nfunction withAddress(\n location: JsonResumeLocation | undefined,\n address: string | undefined,\n): JsonResumeLocation | undefined {\n return address ? { address, ...location } : location;\n}\n\n/** Omits the key entirely when the mapped list came out empty. */\nfunction section<K extends string, T>(key: K, items: T[]): Record<K, T[]> | undefined {\n return items.length > 0 ? ({ [key]: items } as Record<K, T[]>) : undefined;\n}\n\n/**\n * The first of these that yields anything: the structured `location` object;\n * the primary entry of `locations` (or the first entry when none is marked\n * primary), which is what the profile API sends; a display-string `location`,\n * split into city and region. JSON Resume has no field for a country name, so a\n * country-only location maps to nothing.\n */\nfunction mapLocation(\n profile: Pick<JsonResumeProfileInput, 'location' | 'locations'>,\n s: Sanitizer,\n): JsonResumeLocation | undefined {\n const fromValue = (location: LocationValue | null | undefined) =>\n location\n ? compact<JsonResumeLocation>({\n city: text(location.locality || location.city, s),\n region: text(location.region, s),\n countryCode: text(location.countryCode, s),\n postalCode: text(location.postalCode, s),\n })\n : {};\n const entry = profile.locations?.find((l) => l.isPrimary) ?? profile.locations?.[0];\n const candidates: JsonResumeLocation[] = [\n typeof profile.location === 'object' ? fromValue(profile.location) : {},\n entry\n ? compact<JsonResumeLocation>({\n city: text((entry.locationLocality || entry.locationCity) ?? undefined, s),\n region: text(entry.locationRegion ?? undefined, s),\n countryCode: text(entry.countryCode ?? undefined, s),\n })\n : {},\n typeof profile.location === 'string' ? fromValue(parseLocationString(profile.location)) : {},\n ];\n return candidates.find((c) => Object.keys(c).length > 0);\n}\n\n/**\n * A link field as a valid URI. A bare domain (\"example.com\") gets `https://`;\n * anything else that does not parse is left out. JSON Resume declares these as\n * URIs, and strict consumers such as altacv refuse the whole file otherwise.\n */\nfunction link(value: string | undefined, s: Sanitizer): string | undefined {\n // No whitespace belongs in a link; a pasted space made altacv refuse a real\n // ORCID URL that the URL parser itself accepts.\n const t = value?.replace(/\\s+/g, '');\n if (!t) return undefined;\n // Checked before sanitizing, so the sanitizer still sees every value.\n if (/^[a-z][a-z0-9+.-]*:\\/\\//i.test(t)) return URL.canParse(t) ? s(t) : undefined;\n const withScheme = `https://${t}`;\n return /^[^\\s/]+\\.[^\\s/]+/.test(t) && URL.canParse(withScheme) ? s(withScheme) : undefined;\n}\n\n/** Trimmed, sanitised, and undefined when there is nothing left. */\nfunction text(value: string | undefined, s: Sanitizer): string | undefined {\n const trimmed = value?.trim();\n return trimmed ? s(trimmed) : undefined;\n}\n\n/**\n * The name to print for a linked organization. `entityName` is the AppView's\n * resolved current name and wins when present, matching how the profile itself\n * renders these.\n */\nfunction orgName(\n entityName: string | undefined,\n stored: string | undefined,\n s: Sanitizer,\n): string | undefined {\n return text(entityName, s) ?? text(stored, s);\n}\n\n/** Event names a talk shows: the most recent ones, then how many more. */\nconst TALK_EVENTS_SHOWN = 3;\n\n/** Newest first; undated last. */\nfunction byDateDesc(a: { date?: string | null }, b: { date?: string | null }): number {\n return (b.date ?? '').localeCompare(a.date ?? '');\n}\n\n/**\n * Talks as publications of type \"Talks\": one per talk, with the events it was\n * given at (newest first) as the publisher and the latest date. A delivery not\n * tied to a talk record is a talk of its own. Newest first.\n */\nfunction mapTalks(profile: JsonResumeProfileInput, s: Sanitizer): JsonResumePublication[] {\n const standalone = filterHidden(profile.presentationDeliveries).filter(\n (d) => !d.presentationRkey,\n );\n const talks = filterHidden(profile.presentations).map((talk) => {\n const deliveries = filterHidden(talk.deliveries).sort(byDateDesc);\n const events = [\n ...new Set(deliveries.map((d) => text(d.eventName ?? undefined, s)).filter(Boolean)),\n ] as string[];\n const shown = events.slice(0, TALK_EVENTS_SHOWN).join(', ');\n const more = events.length - TALK_EVENTS_SHOWN;\n return compact<JsonResumePublication>({\n name: s(talk.title),\n publisher: more > 0 ? `${shown} and ${more} more` : shown || undefined,\n releaseDate: toResumeDate(deliveries[0]?.date ?? undefined),\n url: link(talk.links?.[0]?.uri, s),\n summary: text(talk.description ?? undefined, s),\n type: 'Talks',\n });\n });\n const loose = standalone.map((d) =>\n compact<JsonResumePublication>({\n name: s(d.title?.trim() || d.eventName?.trim() || ''),\n publisher: text(d.eventName ?? undefined, s),\n releaseDate: toResumeDate(d.date ?? undefined),\n url: link(d.links?.[0]?.uri, s),\n type: 'Talks',\n }),\n );\n return [...talks, ...loose]\n .filter((t) => t.name)\n .sort((a, b) => byDateDesc({ date: a.releaseDate }, { date: b.releaseDate }));\n}\n\n/**\n * Build a JSON Resume v1.0.0 document from a Sifa profile.\n *\n * Hidden records are dropped. Keys are omitted rather than emitted empty, so a\n * profile with no publications produces a document with no `publications` key\n * instead of one a reader has to interpret.\n */\nexport function profileToJsonResume(\n profile: JsonResumeProfileInput,\n options: JsonResumeOptions = {},\n): JsonResume {\n const s = options.sanitize ?? identity;\n const baseUrl = normaliseBaseUrl(options.baseUrl);\n const canonical = options.canonicalUrl ?? profileUrl(baseUrl, profile.handle);\n const contact = normalizeExportContact(options.contact ?? {});\n\n const name =\n formatStructuredName(profile.givenName, profile.familyName) ??\n text(profile.displayName, s) ??\n profile.handle;\n\n const profiles = filterHidden(profile.externalAccounts).map((account) =>\n compact<JsonResumeProfileLink>({\n network: s(account.platform),\n username: text(account.label, s),\n url: link(account.url, s),\n }),\n );\n\n const basics = compact<JsonResumeBasics>({\n name,\n label: text(profile.headline, s),\n image: text(profile.avatar, s),\n email: text(contact.email, s),\n phone: text(contact.phone, s),\n url: link(profile.website, s) ?? canonical,\n summary: text(profile.about, s),\n location: withAddress(mapLocation(profile, s), text(contact.address, s)),\n ...section('profiles', profiles),\n });\n\n // Same order as the profile page and the other exports: newest first.\n const work = sortPositions(filterHidden(profile.positions)).map((position) =>\n compact<JsonResumeWork>({\n name: orgName(position.entityName, position.company, s),\n position: s(position.title),\n summary: text(position.description, s),\n startDate: toResumeDate(position.startedAt),\n endDate: toResumeDate(position.endedAt),\n }),\n );\n\n // Involvement (open source, communities, civic roles) has no JSON Resume key\n // and sits next to volunteering, sorted together.\n const volunteer = sortByActiveDateRange([\n ...filterHidden(profile.volunteering).map((entry) => ({\n organization: orgName(entry.entityName, entry.organization, s),\n position: text(entry.role, s),\n summary: text(entry.description, s),\n startDate: toResumeDate(entry.startDate),\n endDate: toResumeDate(entry.endDate),\n })),\n ...filterHidden(profile.involvement).map((entry) => ({\n organization: orgName(entry.entityName, entry.upstream, s),\n position: text(entry.role, s) ?? text(getInvolvementKindLabel(entry.kind), s),\n summary: text(entry.description, s),\n startDate: toResumeDate(entry.startedAt),\n endDate: toResumeDate(entry.endedAt),\n })),\n ]).map((entry) => compact<JsonResumeVolunteer>(entry));\n\n const education = sortEducation(filterHidden(profile.education)).map((entry) =>\n compact<JsonResumeEducation>({\n institution: orgName(entry.entityName, entry.institution, s),\n area: text(entry.fieldOfStudy, s),\n studyType: text(entry.degree, s),\n startDate: toResumeDate(entry.startedAt),\n endDate: toResumeDate(entry.endedAt),\n }),\n );\n\n const awards = sortHonors(filterHidden(profile.honors)).map((honor) =>\n compact<JsonResumeAward>({\n title: s(honor.title),\n date: toResumeDate(honor.date),\n awarder: orgName(honor.entityName, honor.issuer, s),\n summary: text(honor.description, s),\n }),\n );\n\n const certificates = sortCertifications(filterHidden(profile.certifications)).map((cert) =>\n compact<JsonResumeCertificate>({\n name: s(cert.name),\n date: toResumeDate(cert.issueDate),\n endDate: toResumeDate(cert.expiryDate),\n // `issuingOrg` is the deprecated read-view alias for `authority`; records\n // indexed before the rename carry only the alias.\n issuer: orgName(cert.entityName, cert.authority ?? cert.issuingOrg, s),\n url: link(cert.credentialUrl, s),\n }),\n );\n // Courses taken, after the certifications. A course whose credential is\n // already listed as a certification would print twice, and courses someone\n // taught are not certificates.\n const listedCredentials = new Set(filterHidden(profile.certifications).map((c) => c.rkey));\n for (const course of filterHidden(profile.courses)) {\n if (isTeachingCourse(course)) continue;\n if (course.credentialRkey && listedCredentials.has(course.credentialRkey)) continue;\n certificates.push(\n compact<JsonResumeCertificate>({\n name: s(course.name),\n date: toResumeDate(course.completedAt),\n issuer: orgName(course.entityName, course.institution, s),\n }),\n );\n }\n\n const publications = sortPublications(filterHidden(profile.publications)).map((publication) =>\n compact<JsonResumePublication>({\n name: s(publication.title),\n publisher: text(publication.publisher, s),\n releaseDate: toResumeDate(publication.date),\n url: link(publication.url, s),\n summary: text(publication.description, s),\n }),\n );\n publications.push(...mapTalks(profile, s));\n\n // JSON Resume's grouped shape: one group per category, in the profile's\n // category order, named as the profile names it. CV templates print the\n // group name as a label. Endorsement counts have no slot and are dropped.\n // Skill records carry no `hidden` flag, so there is nothing to filter here.\n const skills = groupSkillsByCategory(profile.skills ?? []).map(([category, items]) => ({\n name: CATEGORY_LABELS[category as keyof typeof CATEGORY_LABELS] ?? category,\n keywords: items.map((skill) => s(skill.name)),\n }));\n\n const languages = sortLanguages(filterHidden(profile.languages)).map((language) =>\n compact<JsonResumeLanguage>({\n language: s(language.language),\n fluency: language.proficiency ? FLUENCY_LABELS[language.proficiency] : undefined,\n }),\n );\n\n const projects = sortProjects(filterHidden(profile.projects)).map((project) =>\n compact<JsonResumeProject>({\n name: s(project.name),\n description: text(project.description, s),\n url: link(project.url, s),\n startDate: toResumeDate(project.startDate),\n endDate: toResumeDate(project.endDate),\n }),\n );\n\n return {\n basics,\n ...section('work', work),\n ...section('volunteer', volunteer),\n ...section('education', education),\n ...section('awards', awards),\n ...section('certificates', certificates),\n ...section('publications', publications),\n ...section('skills', skills),\n ...section('languages', languages),\n ...section('projects', projects),\n meta: { canonical, version: SCHEMA_VERSION },\n };\n}\n"],"mappings":";AAsBA,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AAoBtC,SAAS,kBAAkB,kBAAkB;AAC7C,SAAS,8BAAkD;AA4L3D,IAAM,iBAAiB;AAOvB,IAAM,iBAAiB;AAEhB,SAAS,aAAa,OAA+C;AAC1E,QAAM,UAAU,OAAO,KAAK;AAC5B,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,QAAQ,eAAe,KAAK,OAAO;AACzC,SAAO,QAAQ,MAAM,CAAC,IAAI;AAC5B;AAOA,IAAM,iBAAsD;AAAA,EAC1D,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,mBAAmB;AAAA,EACnB,QAAQ;AACV;AAEA,IAAM,WAAsB,CAAC,UAAU;AAGvC,SAAS,QAA0B,OAAa;AAC9C,SAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,MAAM,MAAS,CAAC;AACpF;AAG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IAAI;AAAA,MACpB,aAAa,KAAK,QAAQ,aAAa,CAAC;AAAA,MACxC,KAAK,KAAK,QAAQ,KAAK,CAAC;AAAA,MACxB,WAAW,aAAa,QAAQ,SAAS;AAAA,MACzC,SAAS,aAAa,QAAQ,OAAO;AAAA,IACvC,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA,GAAG,QAAQ,QAAQ,IAAI;AAAA,IACvB,GAAG,QAAQ,aAAa,SAAS;AAAA,IACjC,GAAG,QAAQ,aAAa,SAAS;AAAA,IACjC,GAAG,QAAQ,UAAU,MAAM;AAAA,IAC3B,GAAG,QAAQ,gBAAgB,YAAY;AAAA,IACvC,GAAG,QAAQ,gBAAgB,YAAY;AAAA,IACvC,GAAG,QAAQ,UAAU,MAAM;AAAA,IAC3B,GAAG,QAAQ,aAAa,SAAS;AAAA,IACjC,GAAG,QAAQ,YAAY,QAAQ;AAAA,IAC/B,MAAM,EAAE,WAAW,SAAS,eAAe;AAAA,EAC7C;AACF;","names":[]}
|
|
@@ -449,6 +449,13 @@ interface WriteFailure {
|
|
|
449
449
|
* "try again in N seconds" instead of a generic failure.
|
|
450
450
|
*/
|
|
451
451
|
retryAfterSeconds?: number;
|
|
452
|
+
/**
|
|
453
|
+
* Stable, machine-readable error code from the response body (for example
|
|
454
|
+
* `'CustomDomainRequired'`), when sifa-api sends one (sifa-workspace#736).
|
|
455
|
+
* Branch on this instead of matching the `error` text, which can change.
|
|
456
|
+
* Present only when the body carries a non-empty string `code`.
|
|
457
|
+
*/
|
|
458
|
+
code?: string;
|
|
452
459
|
}
|
|
453
460
|
/**
|
|
454
461
|
* Successful branch of a {@link WriteResult}: the response body fields
|
|
@@ -475,12 +482,14 @@ type CreateResult = WriteResult<{
|
|
|
475
482
|
* never-throws contract used by all sifa-web mutations: returns a
|
|
476
483
|
* structured {@link WriteResult} on both success and failure, and
|
|
477
484
|
* preserves the `pdsHost` field when the AppView reports a PDS-side
|
|
478
|
-
* failure (issue #167)
|
|
485
|
+
* failure (issue #167) and the `code` field when the AppView sends a
|
|
486
|
+
* stable error code.
|
|
479
487
|
*
|
|
480
488
|
* On success: returns `{ success: true, ...payload }` where `payload` is
|
|
481
489
|
* whatever the server returned in JSON (or `{}` for 204).
|
|
482
490
|
*
|
|
483
|
-
* On failure: returns `{ success: false, error,
|
|
491
|
+
* On failure: returns `{ success: false, error, status?, retryAfterSeconds?,
|
|
492
|
+
* pdsHost?, code? }`. Never throws.
|
|
484
493
|
*
|
|
485
494
|
* Use {@link apiWriteCreate} when you specifically need the `rkey` from a
|
|
486
495
|
* create response folded into the result shape.
|
|
@@ -449,6 +449,13 @@ interface WriteFailure {
|
|
|
449
449
|
* "try again in N seconds" instead of a generic failure.
|
|
450
450
|
*/
|
|
451
451
|
retryAfterSeconds?: number;
|
|
452
|
+
/**
|
|
453
|
+
* Stable, machine-readable error code from the response body (for example
|
|
454
|
+
* `'CustomDomainRequired'`), when sifa-api sends one (sifa-workspace#736).
|
|
455
|
+
* Branch on this instead of matching the `error` text, which can change.
|
|
456
|
+
* Present only when the body carries a non-empty string `code`.
|
|
457
|
+
*/
|
|
458
|
+
code?: string;
|
|
452
459
|
}
|
|
453
460
|
/**
|
|
454
461
|
* Successful branch of a {@link WriteResult}: the response body fields
|
|
@@ -475,12 +482,14 @@ type CreateResult = WriteResult<{
|
|
|
475
482
|
* never-throws contract used by all sifa-web mutations: returns a
|
|
476
483
|
* structured {@link WriteResult} on both success and failure, and
|
|
477
484
|
* preserves the `pdsHost` field when the AppView reports a PDS-side
|
|
478
|
-
* failure (issue #167)
|
|
485
|
+
* failure (issue #167) and the `code` field when the AppView sends a
|
|
486
|
+
* stable error code.
|
|
479
487
|
*
|
|
480
488
|
* On success: returns `{ success: true, ...payload }` where `payload` is
|
|
481
489
|
* whatever the server returned in JSON (or `{}` for 204).
|
|
482
490
|
*
|
|
483
|
-
* On failure: returns `{ success: false, error,
|
|
491
|
+
* On failure: returns `{ success: false, error, status?, retryAfterSeconds?,
|
|
492
|
+
* pdsHost?, code? }`. Never throws.
|
|
484
493
|
*
|
|
485
494
|
* Use {@link apiWriteCreate} when you specifically need the `rkey` from a
|
|
486
495
|
* create response folded into the result shape.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { a1 as SifaApiConfig, a0 as ApiFetchOptions, a2 as WriteResult, o as ProfileView, a3 as CreateResult, a5 as FilterOptions, S as SearchFilters, a8 as SearchResponse, a9 as SkillSearchResult, ai as CompanySearchFilters, aj as CompanySearchResponse, u as RepoDeleteResult, x as RepoInventory } from './types-
|
|
3
|
+
import { a1 as SifaApiConfig, a0 as ApiFetchOptions, a2 as WriteResult, o as ProfileView, a3 as CreateResult, a5 as FilterOptions, S as SearchFilters, a8 as SearchResponse, a9 as SkillSearchResult, ai as CompanySearchFilters, aj as CompanySearchResponse, u as RepoDeleteResult, x as RepoInventory } from './types-CkomzDlY.js';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { UseQueryOptions, UseMutationOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import { c as Profile, d as ProfilePosition, Y as SkillRef, p as ExternalAccount, Z as SkillSuggestion, s as OrgFloorVerdict } from './index-DDh2RLvx.js';
|
|
7
|
-
import { s as sifaQueryKeys, aJ as RefreshPdsResult, b6 as UpdateProfileOverrideInput, b7 as UpdateProfileSelfInput, b8 as UploadAvatarResult, b9 as UploadPronunciationAudioResult, at as PrimarySection, a$ as SubCategoryBulkResult, ay as ProfileLocationInput, q as ExternalAccountInput, n as CreateExternalAccountResult, bd as VerifyExternalAccountResult, E as EndorsementInput, l as ConfirmationInput, m as ConfirmationSubjectInput, a3 as GivenConfirmation, as as PendingConfirmationsPage, ae as InboxCounts, p as DismissUnlinkedPositionInput, b4 as UnlinkedPositionsResult, o as DismissCompletenessSignalInput, au as ProfileCompleteness, aR as RpgClaimableResponse, aV as RpgStatusResponse, aI as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, ad as HideProfileItemInput, a8 as HiddenActivityItem, ac as HideActivityItemInput, b2 as UnhideActivityItemInput, f as ActivityPreferences, aZ as SiteActivityPresetResponse, b5 as UpdateActivityPreferencesInput, a_ as StatsResponse, i as AppRegistryEntry, a9 as HiddenApp, b as AccountSummary, r as FeaturedProfile, aY as SimilarProfile, Q as FetchSuggestionsOptions, b1 as SuggestionsResponse, W as FollowUserResult, y as FetchFollowListOptions, T as FollowListPage, a0 as FollowingResponse, G as FetchFollowingFeedOptions, _ as FollowingFeedResponse, $ as FollowingFeedVersion, z as FetchFollowProfilePageOptions, V as FollowProfilePageResponse, F as FeatureAllowlistResponse, h as AdminReviewQueues, u as FetchActivityFeedOptions, c as ActivityFeedResponse, g as ActivityTeaserResponse, a7 as HeatmapResponse, ag as MyGithubPullRequestsResponse, A as AccountCheckResult, aH as ReactionStatus, aG as ReactionResult, aF as ReactionError, aQ as RoadmapVotesResponse, j as CastRoadmapVoteResult, D as DeleteAccountResult, aL as ResetProfileResult, be as WipePreview, aK as RepoDeleteInput, ai as OrgClaimResult, ao as OrgProfileUpdateResult, aj as OrgDomainChallengeResult, ak as OrgDomainVerifyResult, al as OrgNotificationEmailAddResult, am as OrgNotificationEmailRemoveResult, ba as UserSettings } from './user-settings-
|
|
7
|
+
import { s as sifaQueryKeys, aJ as RefreshPdsResult, b6 as UpdateProfileOverrideInput, b7 as UpdateProfileSelfInput, b8 as UploadAvatarResult, b9 as UploadPronunciationAudioResult, at as PrimarySection, a$ as SubCategoryBulkResult, ay as ProfileLocationInput, q as ExternalAccountInput, n as CreateExternalAccountResult, bd as VerifyExternalAccountResult, E as EndorsementInput, l as ConfirmationInput, m as ConfirmationSubjectInput, a3 as GivenConfirmation, as as PendingConfirmationsPage, ae as InboxCounts, p as DismissUnlinkedPositionInput, b4 as UnlinkedPositionsResult, o as DismissCompletenessSignalInput, au as ProfileCompleteness, aR as RpgClaimableResponse, aV as RpgStatusResponse, aI as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, ad as HideProfileItemInput, a8 as HiddenActivityItem, ac as HideActivityItemInput, b2 as UnhideActivityItemInput, f as ActivityPreferences, aZ as SiteActivityPresetResponse, b5 as UpdateActivityPreferencesInput, a_ as StatsResponse, i as AppRegistryEntry, a9 as HiddenApp, b as AccountSummary, r as FeaturedProfile, aY as SimilarProfile, Q as FetchSuggestionsOptions, b1 as SuggestionsResponse, W as FollowUserResult, y as FetchFollowListOptions, T as FollowListPage, a0 as FollowingResponse, G as FetchFollowingFeedOptions, _ as FollowingFeedResponse, $ as FollowingFeedVersion, z as FetchFollowProfilePageOptions, V as FollowProfilePageResponse, F as FeatureAllowlistResponse, h as AdminReviewQueues, u as FetchActivityFeedOptions, c as ActivityFeedResponse, g as ActivityTeaserResponse, a7 as HeatmapResponse, ag as MyGithubPullRequestsResponse, A as AccountCheckResult, aH as ReactionStatus, aG as ReactionResult, aF as ReactionError, aQ as RoadmapVotesResponse, j as CastRoadmapVoteResult, D as DeleteAccountResult, aL as ResetProfileResult, be as WipePreview, aK as RepoDeleteInput, ai as OrgClaimResult, ao as OrgProfileUpdateResult, aj as OrgDomainChallengeResult, ak as OrgDomainVerifyResult, al as OrgNotificationEmailAddResult, am as OrgNotificationEmailRemoveResult, ba as UserSettings } from './user-settings-Bvafly0r.js';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { i as EntitySearchResponse, E as EntitySearchResult, c as EntityMintDomainResponse, g as EntityResolveDomainResponse, n as EntitySelectResponse, l as EntitySelectRequest, r as FeatureFlag } from './follow-profile-CVcA2w1v.js';
|
|
10
10
|
import { O as OrgClaimRequestInput, h as OrgProfileUpdateRequestInput, b as OrgDomainChallengeRequestInput, d as OrgDomainVerifyRequestInput, f as OrgNotificationEmailRequestInput } from './org-settings-BShvhyFp.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { a1 as SifaApiConfig, a0 as ApiFetchOptions, a2 as WriteResult, o as ProfileView, a3 as CreateResult, a5 as FilterOptions, S as SearchFilters, a8 as SearchResponse, a9 as SkillSearchResult, ai as CompanySearchFilters, aj as CompanySearchResponse, u as RepoDeleteResult, x as RepoInventory } from './types-
|
|
3
|
+
import { a1 as SifaApiConfig, a0 as ApiFetchOptions, a2 as WriteResult, o as ProfileView, a3 as CreateResult, a5 as FilterOptions, S as SearchFilters, a8 as SearchResponse, a9 as SkillSearchResult, ai as CompanySearchFilters, aj as CompanySearchResponse, u as RepoDeleteResult, x as RepoInventory } from './types-JydVIhN5.cjs';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { UseQueryOptions, UseMutationOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import { c as Profile, d as ProfilePosition, Y as SkillRef, p as ExternalAccount, Z as SkillSuggestion, s as OrgFloorVerdict } from './index-BQAKeEoj.cjs';
|
|
7
|
-
import { s as sifaQueryKeys, aJ as RefreshPdsResult, b6 as UpdateProfileOverrideInput, b7 as UpdateProfileSelfInput, b8 as UploadAvatarResult, b9 as UploadPronunciationAudioResult, at as PrimarySection, a$ as SubCategoryBulkResult, ay as ProfileLocationInput, q as ExternalAccountInput, n as CreateExternalAccountResult, bd as VerifyExternalAccountResult, E as EndorsementInput, l as ConfirmationInput, m as ConfirmationSubjectInput, a3 as GivenConfirmation, as as PendingConfirmationsPage, ae as InboxCounts, p as DismissUnlinkedPositionInput, b4 as UnlinkedPositionsResult, o as DismissCompletenessSignalInput, au as ProfileCompleteness, aR as RpgClaimableResponse, aV as RpgStatusResponse, aI as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, ad as HideProfileItemInput, a8 as HiddenActivityItem, ac as HideActivityItemInput, b2 as UnhideActivityItemInput, f as ActivityPreferences, aZ as SiteActivityPresetResponse, b5 as UpdateActivityPreferencesInput, a_ as StatsResponse, i as AppRegistryEntry, a9 as HiddenApp, b as AccountSummary, r as FeaturedProfile, aY as SimilarProfile, Q as FetchSuggestionsOptions, b1 as SuggestionsResponse, W as FollowUserResult, y as FetchFollowListOptions, T as FollowListPage, a0 as FollowingResponse, G as FetchFollowingFeedOptions, _ as FollowingFeedResponse, $ as FollowingFeedVersion, z as FetchFollowProfilePageOptions, V as FollowProfilePageResponse, F as FeatureAllowlistResponse, h as AdminReviewQueues, u as FetchActivityFeedOptions, c as ActivityFeedResponse, g as ActivityTeaserResponse, a7 as HeatmapResponse, ag as MyGithubPullRequestsResponse, A as AccountCheckResult, aH as ReactionStatus, aG as ReactionResult, aF as ReactionError, aQ as RoadmapVotesResponse, j as CastRoadmapVoteResult, D as DeleteAccountResult, aL as ResetProfileResult, be as WipePreview, aK as RepoDeleteInput, ai as OrgClaimResult, ao as OrgProfileUpdateResult, aj as OrgDomainChallengeResult, ak as OrgDomainVerifyResult, al as OrgNotificationEmailAddResult, am as OrgNotificationEmailRemoveResult, ba as UserSettings } from './user-settings-
|
|
7
|
+
import { s as sifaQueryKeys, aJ as RefreshPdsResult, b6 as UpdateProfileOverrideInput, b7 as UpdateProfileSelfInput, b8 as UploadAvatarResult, b9 as UploadPronunciationAudioResult, at as PrimarySection, a$ as SubCategoryBulkResult, ay as ProfileLocationInput, q as ExternalAccountInput, n as CreateExternalAccountResult, bd as VerifyExternalAccountResult, E as EndorsementInput, l as ConfirmationInput, m as ConfirmationSubjectInput, a3 as GivenConfirmation, as as PendingConfirmationsPage, ae as InboxCounts, p as DismissUnlinkedPositionInput, b4 as UnlinkedPositionsResult, o as DismissCompletenessSignalInput, au as ProfileCompleteness, aR as RpgClaimableResponse, aV as RpgStatusResponse, aI as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, ad as HideProfileItemInput, a8 as HiddenActivityItem, ac as HideActivityItemInput, b2 as UnhideActivityItemInput, f as ActivityPreferences, aZ as SiteActivityPresetResponse, b5 as UpdateActivityPreferencesInput, a_ as StatsResponse, i as AppRegistryEntry, a9 as HiddenApp, b as AccountSummary, r as FeaturedProfile, aY as SimilarProfile, Q as FetchSuggestionsOptions, b1 as SuggestionsResponse, W as FollowUserResult, y as FetchFollowListOptions, T as FollowListPage, a0 as FollowingResponse, G as FetchFollowingFeedOptions, _ as FollowingFeedResponse, $ as FollowingFeedVersion, z as FetchFollowProfilePageOptions, V as FollowProfilePageResponse, F as FeatureAllowlistResponse, h as AdminReviewQueues, u as FetchActivityFeedOptions, c as ActivityFeedResponse, g as ActivityTeaserResponse, a7 as HeatmapResponse, ag as MyGithubPullRequestsResponse, A as AccountCheckResult, aH as ReactionStatus, aG as ReactionResult, aF as ReactionError, aQ as RoadmapVotesResponse, j as CastRoadmapVoteResult, D as DeleteAccountResult, aL as ResetProfileResult, be as WipePreview, aK as RepoDeleteInput, ai as OrgClaimResult, ao as OrgProfileUpdateResult, aj as OrgDomainChallengeResult, ak as OrgDomainVerifyResult, al as OrgNotificationEmailAddResult, am as OrgNotificationEmailRemoveResult, ba as UserSettings } from './user-settings-DWq91Gj-.cjs';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { i as EntitySearchResponse, E as EntitySearchResult, c as EntityMintDomainResponse, g as EntityResolveDomainResponse, n as EntitySelectResponse, l as EntitySelectRequest, r as FeatureFlag } from './follow-profile-CgLLLQtJ.cjs';
|
|
10
10
|
import { O as OrgClaimRequestInput, a as OrgProfileUpdateRequestInput, b as OrgDomainChallengeRequestInput, c as OrgDomainVerifyRequestInput, d as OrgNotificationEmailRequestInput } from './org-settings-C73Sin5E.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a2 as WriteResult, a1 as SifaApiConfig, a0 as ApiFetchOptions, a3 as CreateResult, K as SiteActivityPreset, b as ActivityLabel, u as RepoDeleteResult, x as RepoInventory } from './types-
|
|
1
|
+
import { a2 as WriteResult, a1 as SifaApiConfig, a0 as ApiFetchOptions, a3 as CreateResult, K as SiteActivityPreset, b as ActivityLabel, u as RepoDeleteResult, x as RepoInventory } from './types-CkomzDlY.js';
|
|
2
2
|
import { p as ExternalAccount, B as PositionViewerConfirmation } from './index-DDh2RLvx.js';
|
|
3
3
|
import { a as AccountVerification } from './verification-providers-DeyGqaoC.js';
|
|
4
4
|
import { s as FollowProfileItem, p as FeatureAllowlistEntry, r as FeatureFlag } from './follow-profile-CVcA2w1v.js';
|
|
@@ -1930,7 +1930,8 @@ interface OrgNotificationEmailRemoveResult {
|
|
|
1930
1930
|
* Finalize an org profile claim (`POST /api/org/claim`). Auth-gated (org-claim
|
|
1931
1931
|
* JIT scope) and floor-checked server-side. Never throws -- returns the
|
|
1932
1932
|
* structured {@link OrgClaimResult} folded into a {@link WriteResult} on success,
|
|
1933
|
-
* or `{ success: false, error, pdsHost? }` on failure.
|
|
1933
|
+
* or `{ success: false, error, pdsHost?, code? }` on failure. A claim refused for
|
|
1934
|
+
* a handle without a custom domain carries `code: 'CustomDomainRequired'`.
|
|
1934
1935
|
*/
|
|
1935
1936
|
declare function submitOrgClaim(config: SifaApiConfig, body: OrgClaimRequestInput, options?: Omit<ApiFetchOptions, 'method' | 'body'>): Promise<WriteResult<Partial<OrgClaimResult>>>;
|
|
1936
1937
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a2 as WriteResult, a1 as SifaApiConfig, a0 as ApiFetchOptions, a3 as CreateResult, K as SiteActivityPreset, b as ActivityLabel, u as RepoDeleteResult, x as RepoInventory } from './types-
|
|
1
|
+
import { a2 as WriteResult, a1 as SifaApiConfig, a0 as ApiFetchOptions, a3 as CreateResult, K as SiteActivityPreset, b as ActivityLabel, u as RepoDeleteResult, x as RepoInventory } from './types-JydVIhN5.cjs';
|
|
2
2
|
import { p as ExternalAccount, B as PositionViewerConfirmation } from './index-BQAKeEoj.cjs';
|
|
3
3
|
import { a as AccountVerification } from './verification-providers-DeyGqaoC.cjs';
|
|
4
4
|
import { s as FollowProfileItem, p as FeatureAllowlistEntry, r as FeatureFlag } from './follow-profile-CgLLLQtJ.cjs';
|
|
@@ -1930,7 +1930,8 @@ interface OrgNotificationEmailRemoveResult {
|
|
|
1930
1930
|
* Finalize an org profile claim (`POST /api/org/claim`). Auth-gated (org-claim
|
|
1931
1931
|
* JIT scope) and floor-checked server-side. Never throws -- returns the
|
|
1932
1932
|
* structured {@link OrgClaimResult} folded into a {@link WriteResult} on success,
|
|
1933
|
-
* or `{ success: false, error, pdsHost? }` on failure.
|
|
1933
|
+
* or `{ success: false, error, pdsHost?, code? }` on failure. A claim refused for
|
|
1934
|
+
* a handle without a custom domain carries `code: 'CustomDomainRequired'`.
|
|
1934
1935
|
*/
|
|
1935
1936
|
declare function submitOrgClaim(config: SifaApiConfig, body: OrgClaimRequestInput, options?: Omit<ApiFetchOptions, 'method' | 'body'>): Promise<WriteResult<Partial<OrgClaimResult>>>;
|
|
1936
1937
|
/**
|
package/package.json
CHANGED