@singi-labs/sifa-sdk 0.20.2 → 0.22.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.
Files changed (65) hide show
  1. package/dist/index.cjs +6 -92
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +3 -16
  4. package/dist/index.d.ts +3 -16
  5. package/dist/index.js +2 -7
  6. package/dist/index.js.map +1 -1
  7. package/dist/query/fetchers/index.cjs +33 -75
  8. package/dist/query/fetchers/index.cjs.map +1 -1
  9. package/dist/query/fetchers/index.d.cts +1 -1
  10. package/dist/query/fetchers/index.d.ts +1 -1
  11. package/dist/query/fetchers/index.js +1 -9
  12. package/dist/query/fetchers/index.js.map +1 -1
  13. package/dist/query/fetchers/roadmap.js +34 -71
  14. package/dist/query/fetchers/roadmap.js.map +1 -1
  15. package/dist/query/hooks/index.cjs +24 -135
  16. package/dist/query/hooks/index.cjs.map +1 -1
  17. package/dist/query/hooks/index.d.cts +2 -2
  18. package/dist/query/hooks/index.d.ts +2 -2
  19. package/dist/query/hooks/index.js +1 -11
  20. package/dist/query/hooks/index.js.map +1 -1
  21. package/dist/query/hooks/use-roadmap-mutations.js +5 -63
  22. package/dist/query/hooks/use-roadmap-mutations.js.map +1 -1
  23. package/dist/query/index.cjs +35 -150
  24. package/dist/query/index.cjs.map +1 -1
  25. package/dist/query/index.d.cts +3 -3
  26. package/dist/query/index.d.ts +3 -3
  27. package/dist/query/index.js +2 -17
  28. package/dist/query/index.js.map +1 -1
  29. package/dist/query/keys.js +0 -5
  30. package/dist/query/keys.js.map +1 -1
  31. package/dist/roadmap/index.js +0 -91
  32. package/dist/roadmap/index.js.map +1 -1
  33. package/dist/schemas/write/certification.js +3 -3
  34. package/dist/schemas/write/certification.js.map +1 -1
  35. package/dist/schemas/write/course.js +5 -10
  36. package/dist/schemas/write/course.js.map +1 -1
  37. package/dist/schemas/write/education.js +3 -3
  38. package/dist/schemas/write/education.js.map +1 -1
  39. package/dist/schemas/write/honor.js +2 -2
  40. package/dist/schemas/write/honor.js.map +1 -1
  41. package/dist/schemas/write/index.cjs +25 -26
  42. package/dist/schemas/write/index.cjs.map +1 -1
  43. package/dist/schemas/write/index.d.cts +19 -19
  44. package/dist/schemas/write/index.d.ts +19 -19
  45. package/dist/schemas/write/investment.js +3 -3
  46. package/dist/schemas/write/investment.js.map +1 -1
  47. package/dist/schemas/write/involvement.js +3 -3
  48. package/dist/schemas/write/involvement.js.map +1 -1
  49. package/dist/schemas/write/position.js +8 -3
  50. package/dist/schemas/write/position.js.map +1 -1
  51. package/dist/schemas/write/project.js +3 -3
  52. package/dist/schemas/write/project.js.map +1 -1
  53. package/dist/schemas/write/publication.js +2 -2
  54. package/dist/schemas/write/publication.js.map +1 -1
  55. package/dist/schemas/write/shared.js +6 -0
  56. package/dist/schemas/write/shared.js.map +1 -1
  57. package/dist/schemas/write/volunteering.js +3 -3
  58. package/dist/schemas/write/volunteering.js.map +1 -1
  59. package/dist/{use-user-settings-Cq_AHkkM.d.cts → use-user-settings-Bn6g8bgr.d.cts} +7 -22
  60. package/dist/{use-user-settings-DoNP3tNl.d.ts → use-user-settings-DQ6Dyby7.d.ts} +7 -22
  61. package/dist/{user-settings-CBtacio1.d.ts → user-settings-BdNrDa9O.d.ts} +16 -50
  62. package/dist/{user-settings-DDP76dZH.d.cts → user-settings-C8JUD4DM.d.cts} +16 -50
  63. package/package.json +1 -1
  64. package/dist/query/hooks/use-roadmap.js +0 -31
  65. package/dist/query/hooks/use-roadmap.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/roadmap/index.ts"],"sourcesContent":["/**\n * Canonical metadata for the votable Sifa roadmap items: a one-line description\n * and the sifa-workspace issue(s) tracking each item. Single source of truth\n * shared by the sifa-web /roadmap page (labels come from i18n; description and\n * issue links come from here) and the sifa-api operator script that writes the\n * matching userinput.app discussion bodies, so the two surfaces cannot drift.\n *\n * Keys match VOTABLE_KEYS in sifa-api and the roadmap item keys in sifa-web.\n * Descriptions are product voice.\n */\n\n/** Repository whose issues track roadmap items. */\nexport const ROADMAP_ISSUES_REPO = 'singi-labs/sifa-workspace';\n\nexport interface RoadmapItemMeta {\n /** One-line description of the item, in product voice. */\n description: string;\n /** sifa-workspace issue numbers tracking this item (may be empty). */\n issues: number[];\n}\n\nexport const ROADMAP_ITEM_META: Record<string, RoadmapItemMeta> = {\n endorsementsAttestations: {\n description:\n 'Let colleagues vouch for your skills and experience, recorded as attestations you carry with you.',\n issues: [3, 166],\n },\n notifications: {\n description:\n 'Get told when someone endorses you, links an organization, or acts on your profile.',\n issues: [158],\n },\n verifiedConnections: {\n description: 'Confirm real working relationships, not just follows.',\n issues: [],\n },\n profileAnalytics: {\n description: 'See who views your profile and how people find you.',\n issues: [],\n },\n jobProfiles: {\n description: 'Structured work history that stays with your identity across the network.',\n issues: [102],\n },\n eventRsvp: {\n description: \"Show the talks and events you're attending or speaking at.\",\n issues: [214],\n },\n companyPages: {\n description: 'Claimable organization pages that link the people who work there.',\n issues: [73],\n },\n advancedSearch: {\n description: 'Search across categories, with filters and forgiving name matching.',\n issues: [5],\n },\n multiAccountLinking: {\n description: 'Tie several atproto accounts to one professional identity.',\n issues: [8],\n },\n mobileApps: {\n description: 'Native iOS and Android apps.',\n issues: [114],\n },\n atmosphereStream: {\n description: 'One feed that gathers your activity from across the atproto network.',\n issues: [7, 12],\n },\n localizationMultiLanguage: {\n description: 'The interface in your own language.',\n issues: [218],\n },\n rssFediverseIngestion: {\n description: 'Fediverse posts are in your stream. RSS feeds are next.',\n issues: [111, 153],\n },\n githubFeedIngestion: {\n description:\n 'GitHub activity is in your track record. GitLab and org-owned repositories are next.',\n issues: [391, 392],\n },\n compensationInformation: {\n description: 'Add optional pay and compensation context to your roles.',\n issues: [81],\n },\n embedCustomization: {\n description: 'Choose which fields show in your embeddable profile card.',\n issues: [117],\n },\n academicLexicon: {\n description: 'Schema and features built for researchers and academics.',\n issues: [119, 148],\n },\n journalismLexicon: {\n description: 'Schema and features built for journalists.',\n issues: [121],\n },\n skillEvidenceGithub: {\n description: 'Back up skill claims with the languages in your GitHub repositories.',\n issues: [107],\n },\n latexCvExport: {\n description: 'Export your profile as a LaTeX CV.',\n issues: [113],\n },\n jsonResumeImportExport: {\n description: 'Move your profile in and out using the JSON Resume standard.',\n issues: [151],\n },\n linkedClaimsResearch: {\n description: 'Exploring the LinkedClaims spec for portable, verifiable endorsements.',\n issues: [155],\n },\n};\n\n/** The GitHub issue URL for a sifa-workspace issue number. */\nexport function roadmapIssueUrl(issue: number): string {\n return `https://github.com/${ROADMAP_ISSUES_REPO}/issues/${issue}`;\n}\n"],"mappings":";AAYO,IAAM,sBAAsB;AAS5B,IAAM,oBAAqD;AAAA,EAChE,0BAA0B;AAAA,IACxB,aACE;AAAA,IACF,QAAQ,CAAC,GAAG,GAAG;AAAA,EACjB;AAAA,EACA,eAAe;AAAA,IACb,aACE;AAAA,IACF,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,qBAAqB;AAAA,IACnB,aAAa;AAAA,IACb,QAAQ,CAAC;AAAA,EACX;AAAA,EACA,kBAAkB;AAAA,IAChB,aAAa;AAAA,IACb,QAAQ,CAAC;AAAA,EACX;AAAA,EACA,aAAa;AAAA,IACX,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,WAAW;AAAA,IACT,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,cAAc;AAAA,IACZ,aAAa;AAAA,IACb,QAAQ,CAAC,EAAE;AAAA,EACb;AAAA,EACA,gBAAgB;AAAA,IACd,aAAa;AAAA,IACb,QAAQ,CAAC,CAAC;AAAA,EACZ;AAAA,EACA,qBAAqB;AAAA,IACnB,aAAa;AAAA,IACb,QAAQ,CAAC,CAAC;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,kBAAkB;AAAA,IAChB,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG,EAAE;AAAA,EAChB;AAAA,EACA,2BAA2B;AAAA,IACzB,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,uBAAuB;AAAA,IACrB,aAAa;AAAA,IACb,QAAQ,CAAC,KAAK,GAAG;AAAA,EACnB;AAAA,EACA,qBAAqB;AAAA,IACnB,aACE;AAAA,IACF,QAAQ,CAAC,KAAK,GAAG;AAAA,EACnB;AAAA,EACA,yBAAyB;AAAA,IACvB,aAAa;AAAA,IACb,QAAQ,CAAC,EAAE;AAAA,EACb;AAAA,EACA,oBAAoB;AAAA,IAClB,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ,CAAC,KAAK,GAAG;AAAA,EACnB;AAAA,EACA,mBAAmB;AAAA,IACjB,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,qBAAqB;AAAA,IACnB,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,eAAe;AAAA,IACb,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,wBAAwB;AAAA,IACtB,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AAAA,EACA,sBAAsB;AAAA,IACpB,aAAa;AAAA,IACb,QAAQ,CAAC,GAAG;AAAA,EACd;AACF;AAGO,SAAS,gBAAgB,OAAuB;AACrD,SAAO,sBAAsB,mBAAmB,WAAW,KAAK;AAClE;","names":[]}
1
+ {"version":3,"sources":["../../src/roadmap/index.ts"],"sourcesContent":["/**\n * Where Sifa roadmap items are tracked. The items themselves live on Sifa's\n * userinput.app board; see `fetchRoadmap` and `splitRoadmapBody`.\n */\n\n/** Repository whose issues track roadmap items. */\nexport const ROADMAP_ISSUES_REPO = 'singi-labs/sifa-workspace';\n\n/** The GitHub issue URL for a sifa-workspace issue number. */\nexport function roadmapIssueUrl(issue: number): string {\n return `https://github.com/${ROADMAP_ISSUES_REPO}/issues/${issue}`;\n}\n"],"mappings":";AAMO,IAAM,sBAAsB;AAG5B,SAAS,gBAAgB,OAAuB;AACrD,SAAO,sBAAsB,mBAAmB,WAAW,KAAK;AAClE;","names":[]}
@@ -1,14 +1,14 @@
1
1
  // src/schemas/write/certification.ts
2
2
  import { z } from "zod";
3
- import { entityRefSchema, optionalUrl } from "./shared.js";
3
+ import { entityRefSchema, optionalUrl, partialDateFieldSchema } from "./shared.js";
4
4
  var CertificationWriteSchema = z.object({
5
5
  name: z.string().min(1).max(256),
6
6
  authority: z.string().max(256).nullable().optional(),
7
7
  entityRef: entityRefSchema,
8
8
  credentialId: z.string().max(256).nullable().optional(),
9
9
  credentialUrl: optionalUrl(),
10
- issuedAt: z.string().nullable().optional(),
11
- expiresAt: z.string().nullable().optional()
10
+ issuedAt: partialDateFieldSchema,
11
+ expiresAt: partialDateFieldSchema
12
12
  });
13
13
  export {
14
14
  CertificationWriteSchema
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/schemas/write/certification.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema, optionalUrl } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */\nexport const CertificationWriteSchema = z.object({\n name: z.string().min(1).max(256),\n authority: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n credentialId: z.string().max(256).nullable().optional(),\n credentialUrl: optionalUrl(),\n issuedAt: z.string().nullable().optional(),\n expiresAt: z.string().nullable().optional(),\n});\n\nexport type CertificationWriteInput = z.infer<typeof CertificationWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,mBAAmB;AAGtC,IAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACnD,WAAW;AAAA,EACX,cAAc,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACtD,eAAe,YAAY;AAAA,EAC3B,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACzC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC5C,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/schemas/write/certification.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema, optionalUrl, partialDateFieldSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */\nexport const CertificationWriteSchema = z.object({\n name: z.string().min(1).max(256),\n authority: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n credentialId: z.string().max(256).nullable().optional(),\n credentialUrl: optionalUrl(),\n issuedAt: partialDateFieldSchema,\n expiresAt: partialDateFieldSchema,\n});\n\nexport type CertificationWriteInput = z.infer<typeof CertificationWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,aAAa,8BAA8B;AAG9D,IAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACnD,WAAW;AAAA,EACX,cAAc,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACtD,eAAe,YAAY;AAAA,EAC3B,UAAU;AAAA,EACV,WAAW;AACb,CAAC;","names":[]}
@@ -1,8 +1,7 @@
1
1
  // src/schemas/write/course.ts
2
2
  import { z } from "zod";
3
- import { entityRefSchema, isValidPartialDate } from "./shared.js";
3
+ import { entityRefSchema, partialDateFieldSchema } from "./shared.js";
4
4
  var AT_URI_RE = /^at:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+$/;
5
- var teachingDate = z.string().refine(isValidPartialDate, "must be a valid YYYY, YYYY-MM or YYYY-MM-DD date").nullable().optional();
6
5
  var CourseWriteSchema = z.object({
7
6
  name: z.string().min(1).max(200),
8
7
  number: z.string().max(50).nullable().optional(),
@@ -14,17 +13,13 @@ var CourseWriteSchema = z.object({
14
13
  * stored and later split into a bogus rkey.
15
14
  */
16
15
  credential: z.string().max(512).regex(AT_URI_RE, "must be an at-uri").nullable().optional(),
17
- /**
18
- * RFC 3339 datetime the course was completed. The editor collects month
19
- * granularity (YYYY-MM) and converts to a datetime before the write; stored
20
- * and passed through as-is, mirroring `certification.issuedAt`.
21
- */
22
- completedAt: z.string().nullable().optional(),
16
+ /** Completion date of a taken course (YYYY, YYYY-MM or YYYY-MM-DD). */
17
+ completedAt: partialDateFieldSchema,
23
18
  /** `id.sifa.defs#courseRole` token. Absent or null means the user took the course. */
24
19
  role: z.string().max(64).nullable().optional(),
25
20
  /** Teaching period of a taught or assisted course (YYYY, YYYY-MM or YYYY-MM-DD). */
26
- startedAt: teachingDate,
27
- endedAt: teachingDate,
21
+ startedAt: partialDateFieldSchema,
22
+ endedAt: partialDateFieldSchema,
28
23
  /** at-uri of the `id.sifa.profile.position` the course was part of (taken or taught). */
29
24
  position: z.string().max(512).regex(AT_URI_RE, "must be an at-uri").nullable().optional(),
30
25
  /** at-uri of the `id.sifa.profile.education` the course was part of. */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/schemas/write/course.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema, isValidPartialDate } from './shared.js';\n\nconst AT_URI_RE = /^at:\\/\\/[^/\\s]+\\/[^/\\s]+\\/[^/\\s]+$/;\nconst teachingDate = z\n .string()\n .refine(isValidPartialDate, 'must be a valid YYYY, YYYY-MM or YYYY-MM-DD date')\n .nullable()\n .optional();\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.course`. */\nexport const CourseWriteSchema = z.object({\n name: z.string().min(1).max(200),\n number: z.string().max(50).nullable().optional(),\n institution: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n /**\n * at-uri of the linked `id.sifa.profile.certification` record. Structurally\n * validated (`at://authority/collection/rkey`) so a bad value can't be\n * stored and later split into a bogus rkey.\n */\n credential: z.string().max(512).regex(AT_URI_RE, 'must be an at-uri').nullable().optional(),\n /**\n * RFC 3339 datetime the course was completed. The editor collects month\n * granularity (YYYY-MM) and converts to a datetime before the write; stored\n * and passed through as-is, mirroring `certification.issuedAt`.\n */\n completedAt: z.string().nullable().optional(),\n /** `id.sifa.defs#courseRole` token. Absent or null means the user took the course. */\n role: z.string().max(64).nullable().optional(),\n /** Teaching period of a taught or assisted course (YYYY, YYYY-MM or YYYY-MM-DD). */\n startedAt: teachingDate,\n endedAt: teachingDate,\n /** at-uri of the `id.sifa.profile.position` the course was part of (taken or taught). */\n position: z.string().max(512).regex(AT_URI_RE, 'must be an at-uri').nullable().optional(),\n /** at-uri of the `id.sifa.profile.education` the course was part of. */\n education: z.string().max(512).regex(AT_URI_RE, 'must be an at-uri').nullable().optional(),\n});\n\nexport type CourseWriteInput = z.infer<typeof CourseWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,0BAA0B;AAEpD,IAAM,YAAY;AAClB,IAAM,eAAe,EAClB,OAAO,EACP,OAAO,oBAAoB,kDAAkD,EAC7E,SAAS,EACT,SAAS;AAGL,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACrD,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMX,YAAY,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,MAAM,WAAW,mBAAmB,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1F,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA,EAE5C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA,EAE7C,WAAW;AAAA,EACX,SAAS;AAAA;AAAA,EAET,UAAU,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,MAAM,WAAW,mBAAmB,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA,EAExF,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,MAAM,WAAW,mBAAmB,EAAE,SAAS,EAAE,SAAS;AAC3F,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/schemas/write/course.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema, partialDateFieldSchema } from './shared.js';\n\nconst AT_URI_RE = /^at:\\/\\/[^/\\s]+\\/[^/\\s]+\\/[^/\\s]+$/;\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.course`. */\nexport const CourseWriteSchema = z.object({\n name: z.string().min(1).max(200),\n number: z.string().max(50).nullable().optional(),\n institution: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n /**\n * at-uri of the linked `id.sifa.profile.certification` record. Structurally\n * validated (`at://authority/collection/rkey`) so a bad value can't be\n * stored and later split into a bogus rkey.\n */\n credential: z.string().max(512).regex(AT_URI_RE, 'must be an at-uri').nullable().optional(),\n /** Completion date of a taken course (YYYY, YYYY-MM or YYYY-MM-DD). */\n completedAt: partialDateFieldSchema,\n /** `id.sifa.defs#courseRole` token. Absent or null means the user took the course. */\n role: z.string().max(64).nullable().optional(),\n /** Teaching period of a taught or assisted course (YYYY, YYYY-MM or YYYY-MM-DD). */\n startedAt: partialDateFieldSchema,\n endedAt: partialDateFieldSchema,\n /** at-uri of the `id.sifa.profile.position` the course was part of (taken or taught). */\n position: z.string().max(512).regex(AT_URI_RE, 'must be an at-uri').nullable().optional(),\n /** at-uri of the `id.sifa.profile.education` the course was part of. */\n education: z.string().max(512).regex(AT_URI_RE, 'must be an at-uri').nullable().optional(),\n});\n\nexport type CourseWriteInput = z.infer<typeof CourseWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,8BAA8B;AAExD,IAAM,YAAY;AAGX,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACrD,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMX,YAAY,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,MAAM,WAAW,mBAAmB,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA,EAE1F,aAAa;AAAA;AAAA,EAEb,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA,EAE7C,WAAW;AAAA,EACX,SAAS;AAAA;AAAA,EAET,UAAU,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,MAAM,WAAW,mBAAmB,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA,EAExF,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,MAAM,WAAW,mBAAmB,EAAE,SAAS,EAAE,SAAS;AAC3F,CAAC;","names":[]}
@@ -1,6 +1,6 @@
1
1
  // src/schemas/write/education.ts
2
2
  import { z } from "zod";
3
- import { entityRefSchema } from "./shared.js";
3
+ import { entityRefSchema, partialDateFieldSchema } from "./shared.js";
4
4
  var EducationWriteSchema = z.object({
5
5
  institution: z.string().min(1).max(256),
6
6
  entityRef: entityRefSchema,
@@ -9,8 +9,8 @@ var EducationWriteSchema = z.object({
9
9
  eqfLevel: z.number().int().min(1).max(8).nullable().optional(),
10
10
  description: z.string().max(5e4).nullable().optional(),
11
11
  activities: z.string().max(1e3).nullable().optional(),
12
- startedAt: z.string().nullable().optional(),
13
- endedAt: z.string().nullable().optional()
12
+ startedAt: partialDateFieldSchema,
13
+ endedAt: partialDateFieldSchema
14
14
  });
15
15
  export {
16
16
  EducationWriteSchema
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/schemas/write/education.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by `POST /profile/education` on sifa-api. */\nexport const EducationWriteSchema = z.object({\n institution: z.string().min(1).max(256),\n entityRef: entityRefSchema,\n degree: z.string().max(256).nullable().optional(),\n fieldOfStudy: z.string().max(256).nullable().optional(),\n eqfLevel: z.number().int().min(1).max(8).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n activities: z.string().max(1000).nullable().optional(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type EducationWriteInput = z.infer<typeof EducationWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,uBAAuB;AAGzB,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACtC,WAAW;AAAA,EACX,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAChD,cAAc,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACtD,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS;AAAA,EAC7D,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,YAAY,EAAE,OAAO,EAAE,IAAI,GAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EACrD,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC1C,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC1C,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/schemas/write/education.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema, partialDateFieldSchema } from './shared.js';\n\n/** Schema enforced by `POST /profile/education` on sifa-api. */\nexport const EducationWriteSchema = z.object({\n institution: z.string().min(1).max(256),\n entityRef: entityRefSchema,\n degree: z.string().max(256).nullable().optional(),\n fieldOfStudy: z.string().max(256).nullable().optional(),\n eqfLevel: z.number().int().min(1).max(8).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n activities: z.string().max(1000).nullable().optional(),\n startedAt: partialDateFieldSchema,\n endedAt: partialDateFieldSchema,\n});\n\nexport type EducationWriteInput = z.infer<typeof EducationWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,8BAA8B;AAGjD,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACtC,WAAW;AAAA,EACX,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAChD,cAAc,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACtD,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS;AAAA,EAC7D,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,YAAY,EAAE,OAAO,EAAE,IAAI,GAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EACrD,WAAW;AAAA,EACX,SAAS;AACX,CAAC;","names":[]}
@@ -1,12 +1,12 @@
1
1
  // src/schemas/write/honor.ts
2
2
  import { z } from "zod";
3
- import { entityRefSchema } from "./shared.js";
3
+ import { entityRefSchema, partialDateFieldSchema } from "./shared.js";
4
4
  var HonorWriteSchema = z.object({
5
5
  title: z.string().min(1).max(200),
6
6
  issuer: z.string().max(256).nullable().optional(),
7
7
  entityRef: entityRefSchema,
8
8
  description: z.string().max(5e4).nullable().optional(),
9
- awardedAt: z.string().nullable().optional()
9
+ awardedAt: partialDateFieldSchema
10
10
  });
11
11
  export {
12
12
  HonorWriteSchema
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/schemas/write/honor.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.honor`. */\nexport const HonorWriteSchema = z.object({\n title: z.string().min(1).max(200),\n issuer: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n description: z.string().max(50000).nullable().optional(),\n awardedAt: z.string().nullable().optional(),\n});\n\nexport type HonorWriteInput = z.infer<typeof HonorWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,uBAAuB;AAGzB,IAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAChC,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAChD,WAAW;AAAA,EACX,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC5C,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/schemas/write/honor.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema, partialDateFieldSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.honor`. */\nexport const HonorWriteSchema = z.object({\n title: z.string().min(1).max(200),\n issuer: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n description: z.string().max(50000).nullable().optional(),\n awardedAt: partialDateFieldSchema,\n});\n\nexport type HonorWriteInput = z.infer<typeof HonorWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,8BAA8B;AAGjD,IAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAChC,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAChD,WAAW;AAAA,EACX,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,WAAW;AACb,CAAC;","names":[]}
@@ -66,6 +66,11 @@ function isValidPartialDate(input) {
66
66
  if (typeof input !== "string") return false;
67
67
  return PARTIAL_DATE_RE.test(input) || isValidDateOnly(input);
68
68
  }
69
+ var DATETIME_DAY_RE = /^(\d{4}-\d{2}-\d{2})T\d{2}:\d{2}/;
70
+ var partialDateFieldSchema = zod.z.string().transform((v) => DATETIME_DAY_RE.exec(v)?.[1] ?? v).refine(
71
+ (v) => v === "" || isValidPartialDate(v),
72
+ "must be a valid YYYY, YYYY-MM or YYYY-MM-DD date"
73
+ ).nullable().optional();
69
74
  var entityRefSchema = zod.z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional();
70
75
  var artifactLinkSchema = zod.z.object({
71
76
  url: zod.z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
@@ -88,11 +93,10 @@ var CertificationWriteSchema = zod.z.object({
88
93
  entityRef: entityRefSchema,
89
94
  credentialId: zod.z.string().max(256).nullable().optional(),
90
95
  credentialUrl: optionalUrl(),
91
- issuedAt: zod.z.string().nullable().optional(),
92
- expiresAt: zod.z.string().nullable().optional()
96
+ issuedAt: partialDateFieldSchema,
97
+ expiresAt: partialDateFieldSchema
93
98
  });
94
99
  var AT_URI_RE = /^at:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+$/;
95
- var teachingDate = zod.z.string().refine(isValidPartialDate, "must be a valid YYYY, YYYY-MM or YYYY-MM-DD date").nullable().optional();
96
100
  var CourseWriteSchema = zod.z.object({
97
101
  name: zod.z.string().min(1).max(200),
98
102
  number: zod.z.string().max(50).nullable().optional(),
@@ -104,17 +108,13 @@ var CourseWriteSchema = zod.z.object({
104
108
  * stored and later split into a bogus rkey.
105
109
  */
106
110
  credential: zod.z.string().max(512).regex(AT_URI_RE, "must be an at-uri").nullable().optional(),
107
- /**
108
- * RFC 3339 datetime the course was completed. The editor collects month
109
- * granularity (YYYY-MM) and converts to a datetime before the write; stored
110
- * and passed through as-is, mirroring `certification.issuedAt`.
111
- */
112
- completedAt: zod.z.string().nullable().optional(),
111
+ /** Completion date of a taken course (YYYY, YYYY-MM or YYYY-MM-DD). */
112
+ completedAt: partialDateFieldSchema,
113
113
  /** `id.sifa.defs#courseRole` token. Absent or null means the user took the course. */
114
114
  role: zod.z.string().max(64).nullable().optional(),
115
115
  /** Teaching period of a taught or assisted course (YYYY, YYYY-MM or YYYY-MM-DD). */
116
- startedAt: teachingDate,
117
- endedAt: teachingDate,
116
+ startedAt: partialDateFieldSchema,
117
+ endedAt: partialDateFieldSchema,
118
118
  /** at-uri of the `id.sifa.profile.position` the course was part of (taken or taught). */
119
119
  position: zod.z.string().max(512).regex(AT_URI_RE, "must be an at-uri").nullable().optional(),
120
120
  /** at-uri of the `id.sifa.profile.education` the course was part of. */
@@ -128,8 +128,8 @@ var EducationWriteSchema = zod.z.object({
128
128
  eqfLevel: zod.z.number().int().min(1).max(8).nullable().optional(),
129
129
  description: zod.z.string().max(5e4).nullable().optional(),
130
130
  activities: zod.z.string().max(1e3).nullable().optional(),
131
- startedAt: zod.z.string().nullable().optional(),
132
- endedAt: zod.z.string().nullable().optional()
131
+ startedAt: partialDateFieldSchema,
132
+ endedAt: partialDateFieldSchema
133
133
  });
134
134
  var ExternalAccountWriteSchema = zod.z.object({
135
135
  platform: zod.z.enum(VALID_PLATFORMS),
@@ -143,7 +143,7 @@ var HonorWriteSchema = zod.z.object({
143
143
  issuer: zod.z.string().max(256).nullable().optional(),
144
144
  entityRef: entityRefSchema,
145
145
  description: zod.z.string().max(5e4).nullable().optional(),
146
- awardedAt: zod.z.string().nullable().optional()
146
+ awardedAt: partialDateFieldSchema
147
147
  });
148
148
  var projectMemberWriteSchema = zod.z.object({
149
149
  did: zod.z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID"),
@@ -167,8 +167,8 @@ var ProjectWriteSchema = zod.z.object({
167
167
  sameAs: externalRecordRefSchema.optional(),
168
168
  /** Calendar events this project organized or hosted. An empty list clears them. */
169
169
  events: zod.z.array(projectEventWriteSchema).max(200).optional(),
170
- startedAt: zod.z.string().nullable().optional(),
171
- endedAt: zod.z.string().nullable().optional()
170
+ startedAt: partialDateFieldSchema,
171
+ endedAt: partialDateFieldSchema
172
172
  });
173
173
 
174
174
  // src/schemas/write/involvement.ts
@@ -179,9 +179,8 @@ var InvolvementWriteSchema = zod.z.object({
179
179
  upstreamUrl: optionalUrl(),
180
180
  role: zod.z.string().max(2560).nullable().optional(),
181
181
  description: zod.z.string().max(5e4).nullable().optional(),
182
- // Freeform YYYY / YYYY-MM / YYYY-MM-DD; validated loosely so partial dates pass.
183
- startedAt: zod.z.string().max(32).nullable().optional(),
184
- endedAt: zod.z.string().max(32).nullable().optional(),
182
+ startedAt: partialDateFieldSchema,
183
+ endedAt: partialDateFieldSchema,
185
184
  links: zod.z.array(artifactLinkSchema).max(50).nullable().optional(),
186
185
  /** Other people who worked on this alongside you. Same shape as project members. */
187
186
  collaborators: zod.z.array(projectMemberWriteSchema).max(50).optional(),
@@ -211,8 +210,8 @@ var InvestmentWriteSchema = zod.z.object({
211
210
  value: zod.z.number().int().min(0),
212
211
  currency: zod.z.string().length(3)
213
212
  }).nullable().optional(),
214
- startedAt: zod.z.string().nullable().optional(),
215
- endedAt: zod.z.string().nullable().optional(),
213
+ startedAt: partialDateFieldSchema,
214
+ endedAt: partialDateFieldSchema,
216
215
  description: zod.z.string().max(5e4).nullable().optional(),
217
216
  links: zod.z.array(artifactLinkSchema).max(50).nullable().optional()
218
217
  });
@@ -519,8 +518,8 @@ var PositionWriteSchema = zod.z.object({
519
518
  onBehalfOfEntityRef: entityRefSchema.nullable(),
520
519
  workplaceType: zod.z.string().nullable().optional(),
521
520
  location: writeLocationSchema,
522
- startedAt: zod.z.string().nullable().optional(),
523
- endedAt: zod.z.string().nullable().optional(),
521
+ startedAt: partialDateFieldSchema,
522
+ endedAt: partialDateFieldSchema,
524
523
  skills: zod.z.array(skillRefSchema).max(50).nullable().optional()
525
524
  });
526
525
  var PresentationDeliveryWriteSchema = zod.z.object({
@@ -639,7 +638,7 @@ var PublicationWriteSchema = zod.z.object({
639
638
  publisher: zod.z.string().max(256).nullable().optional(),
640
639
  url: optionalUrl(),
641
640
  description: zod.z.string().max(5e4).nullable().optional(),
642
- publishedAt: zod.z.string().nullable().optional(),
641
+ publishedAt: partialDateFieldSchema,
643
642
  // Absent here until now, so the write route stripped every co-author before
644
643
  // it reached the PDS: the lexicon field, the indexer, the claim flattening
645
644
  // and the editor all existed, and nothing joined them. An object schema
@@ -670,8 +669,8 @@ var VolunteeringWriteSchema = zod.z.object({
670
669
  role: zod.z.string().max(256).nullable().optional(),
671
670
  cause: zod.z.string().max(256).nullable().optional(),
672
671
  description: zod.z.string().max(5e4).nullable().optional(),
673
- startedAt: zod.z.string().nullable().optional(),
674
- endedAt: zod.z.string().nullable().optional()
672
+ startedAt: partialDateFieldSchema,
673
+ endedAt: partialDateFieldSchema
675
674
  });
676
675
 
677
676
  exports.CertificationWriteSchema = CertificationWriteSchema;