@singi-labs/sifa-sdk 0.19.44 → 0.19.46
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/atproto/index.js +9 -3
- package/dist/atproto/index.js.map +1 -1
- package/dist/badge/index.cjs.map +1 -1
- package/dist/badge/index.js +5 -141
- package/dist/badge/index.js.map +1 -1
- package/dist/cards/adult-content.js +14 -0
- package/dist/cards/adult-content.js.map +1 -0
- package/dist/cards/app-url-patterns.js +369 -0
- package/dist/cards/app-url-patterns.js.map +1 -0
- package/dist/cards/index.js +24 -0
- package/dist/cards/index.js.map +1 -0
- package/dist/cards/resolve-card-url.js +198 -0
- package/dist/cards/resolve-card-url.js.map +1 -0
- package/dist/cards/visibility.js +45 -0
- package/dist/cards/visibility.js.map +1 -0
- package/dist/flags/index.js +4 -3
- package/dist/flags/index.js.map +1 -1
- package/dist/format/collapse-contributors.js +19 -0
- package/dist/format/collapse-contributors.js.map +1 -0
- package/dist/format/company-name.js +61 -0
- package/dist/format/company-name.js.map +1 -0
- package/dist/format/compare-text.js +9 -0
- package/dist/format/compare-text.js.map +1 -0
- package/dist/format/doi.js +8 -0
- package/dist/format/doi.js.map +1 -0
- package/dist/format/embed.js +131 -0
- package/dist/format/embed.js.map +1 -0
- package/dist/format/endorsement-context.js +35 -0
- package/dist/format/endorsement-context.js.map +1 -0
- package/dist/format/format-display-url.js +42 -0
- package/dist/format/format-display-url.js.map +1 -0
- package/dist/format/format-duration.js +13 -0
- package/dist/format/format-duration.js.map +1 -0
- package/dist/format/format-time.js +30 -0
- package/dist/format/format-time.js.map +1 -0
- package/dist/format/handle-utils.js +19 -0
- package/dist/format/handle-utils.js.map +1 -0
- package/dist/format/index.js +106 -0
- package/dist/format/index.js.map +1 -0
- package/dist/format/location-segments.js +29 -0
- package/dist/format/location-segments.js.map +1 -0
- package/dist/format/location-utils.js +42 -0
- package/dist/format/location-utils.js.map +1 -0
- package/dist/format/meta-description.js +35 -0
- package/dist/format/meta-description.js.map +1 -0
- package/dist/format/normalize-company-key.js +12 -0
- package/dist/format/normalize-company-key.js.map +1 -0
- package/dist/format/normalize-legal-form.js +71 -0
- package/dist/format/normalize-legal-form.js.map +1 -0
- package/dist/format/pds-utils.js +73 -0
- package/dist/format/pds-utils.js.map +1 -0
- package/dist/format/sort-by-date.js +39 -0
- package/dist/format/sort-by-date.js.map +1 -0
- package/dist/format/summarize-deliveries.js +37 -0
- package/dist/format/summarize-deliveries.js.map +1 -0
- package/dist/format/talk-slug.js +21 -0
- package/dist/format/talk-slug.js.map +1 -0
- package/dist/format/text-sanitize.js +29 -0
- package/dist/format/text-sanitize.js.map +1 -0
- package/dist/format/text-truncate.js +14 -0
- package/dist/format/text-truncate.js.map +1 -0
- package/dist/format/time-utils.js +19 -0
- package/dist/format/time-utils.js.map +1 -0
- package/dist/format/timeline.js +33 -0
- package/dist/format/timeline.js.map +1 -0
- package/dist/format/wcag-contrast.js +34 -0
- package/dist/format/wcag-contrast.js.map +1 -0
- package/dist/import/index.js +22 -0
- package/dist/import/index.js.map +1 -0
- package/dist/import/presentation-csv.js +116 -0
- package/dist/import/presentation-csv.js.map +1 -0
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +677 -7086
- package/dist/index.js.map +1 -1
- package/dist/jev/index.js +18 -5
- package/dist/jev/index.js.map +1 -1
- package/dist/jsonld/index.cjs.map +1 -1
- package/dist/jsonld/index.js +30 -987
- package/dist/jsonld/index.js.map +1 -1
- package/dist/jsonld/profile.js +222 -0
- package/dist/jsonld/profile.js.map +1 -0
- package/dist/jsonld/terms.js +496 -0
- package/dist/jsonld/terms.js.map +1 -0
- package/dist/jsonld/url.js +17 -0
- package/dist/jsonld/url.js.map +1 -0
- package/dist/jsonld/works-graph.js +41 -0
- package/dist/jsonld/works-graph.js.map +1 -0
- package/dist/jsonld/works.js +178 -0
- package/dist/jsonld/works.js.map +1 -0
- package/dist/logic/actor-identity.js +8 -0
- package/dist/logic/actor-identity.js.map +1 -0
- package/dist/logic/agent-ref.js +24 -0
- package/dist/logic/agent-ref.js.map +1 -0
- package/dist/logic/company-page-indexable.js +23 -0
- package/dist/logic/company-page-indexable.js.map +1 -0
- package/dist/logic/date-lookahead.js +33 -0
- package/dist/logic/date-lookahead.js.map +1 -0
- package/dist/logic/domain-detect.js +43 -0
- package/dist/logic/domain-detect.js.map +1 -0
- package/dist/logic/entity-disambiguation.js +24 -0
- package/dist/logic/entity-disambiguation.js.map +1 -0
- package/dist/logic/entity-ref-anchor.js +33 -0
- package/dist/logic/entity-ref-anchor.js.map +1 -0
- package/dist/logic/index.js +91 -0
- package/dist/logic/index.js.map +1 -0
- package/dist/logic/org-floor.js +66 -0
- package/dist/logic/org-floor.js.map +1 -0
- package/dist/logic/primary-item.js +9 -0
- package/dist/logic/primary-item.js.map +1 -0
- package/dist/logic/primary-position.js +16 -0
- package/dist/logic/primary-position.js.map +1 -0
- package/dist/logic/profile-completeness.js +21 -0
- package/dist/logic/profile-completeness.js.map +1 -0
- package/dist/logic/profile-dimensions.js +50 -0
- package/dist/logic/profile-dimensions.js.map +1 -0
- package/dist/logic/profile-summary.js +23 -0
- package/dist/logic/profile-summary.js.map +1 -0
- package/dist/logic/pseudo-employer.js +34 -0
- package/dist/logic/pseudo-employer.js.map +1 -0
- package/dist/logic/recent-activity.js +10 -0
- package/dist/logic/recent-activity.js.map +1 -0
- package/dist/logic/self-app.js +10 -0
- package/dist/logic/self-app.js.map +1 -0
- package/dist/{org-BCrvebcf.d.ts → org-CxTEjjrm.d.ts} +1 -1
- package/dist/{org-settings-C73Sin5E.d.ts → org-settings-BShvhyFp.d.ts} +1 -1
- package/dist/profile/headline-role-dedupe.js +12 -0
- package/dist/profile/headline-role-dedupe.js.map +1 -0
- package/dist/profile/highlights.js +200 -0
- package/dist/profile/highlights.js.map +1 -0
- package/dist/profile/index.js +66 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/profile/involvement-grouping.js +31 -0
- package/dist/profile/involvement-grouping.js.map +1 -0
- package/dist/profile/language-sort.js +24 -0
- package/dist/profile/language-sort.js.map +1 -0
- package/dist/profile/publication-versions.js +98 -0
- package/dist/profile/publication-versions.js.map +1 -0
- package/dist/profile/range-sort.js +14 -0
- package/dist/profile/range-sort.js.map +1 -0
- package/dist/profile/section-model.js +122 -0
- package/dist/profile/section-model.js.map +1 -0
- package/dist/profile/section-sorts.js +33 -0
- package/dist/profile/section-sorts.js.map +1 -0
- package/dist/publishers/index.js +16 -0
- package/dist/publishers/index.js.map +1 -0
- package/dist/publishers/registry.js +87 -0
- package/dist/publishers/registry.js.map +1 -0
- package/dist/publishing/index.js +46 -184
- package/dist/publishing/index.js.map +1 -1
- package/dist/publishing/linkblog.js +42 -0
- package/dist/publishing/linkblog.js.map +1 -0
- package/dist/publishing/registry.js +32 -0
- package/dist/publishing/registry.js.map +1 -0
- package/dist/publishing/schemas.js +74 -0
- package/dist/publishing/schemas.js.map +1 -0
- package/dist/publishing/types.js +32 -0
- package/dist/publishing/types.js.map +1 -0
- package/dist/query/client.js +119 -0
- package/dist/query/client.js.map +1 -0
- package/dist/query/config.js +23 -0
- package/dist/query/config.js.map +1 -0
- package/dist/query/fetchers/accounts.js +29 -0
- package/dist/query/fetchers/accounts.js.map +1 -0
- package/dist/query/fetchers/activity-items-hide.js +31 -0
- package/dist/query/fetchers/activity-items-hide.js.map +1 -0
- package/dist/query/fetchers/activity.js +61 -0
- package/dist/query/fetchers/activity.js.map +1 -0
- package/dist/query/fetchers/actor.js +30 -0
- package/dist/query/fetchers/actor.js.map +1 -0
- package/dist/query/fetchers/admin-feature-allowlists.js +41 -0
- package/dist/query/fetchers/admin-feature-allowlists.js.map +1 -0
- package/dist/query/fetchers/admin-review-queues.js +30 -0
- package/dist/query/fetchers/admin-review-queues.js.map +1 -0
- package/dist/query/fetchers/apps.js +31 -0
- package/dist/query/fetchers/apps.js.map +1 -0
- package/dist/query/fetchers/bsky-preferences.js +55 -0
- package/dist/query/fetchers/bsky-preferences.js.map +1 -0
- package/dist/query/fetchers/confirmations.js +55 -0
- package/dist/query/fetchers/confirmations.js.map +1 -0
- package/dist/query/fetchers/destructive.js +34 -0
- package/dist/query/fetchers/destructive.js.map +1 -0
- package/dist/query/fetchers/discovery.js +67 -0
- package/dist/query/fetchers/discovery.js.map +1 -0
- package/dist/query/fetchers/education.js +23 -0
- package/dist/query/fetchers/education.js.map +1 -0
- package/dist/query/fetchers/endorsement-inbox.js +36 -0
- package/dist/query/fetchers/endorsement-inbox.js.map +1 -0
- package/dist/query/fetchers/endorsement.js +23 -0
- package/dist/query/fetchers/endorsement.js.map +1 -0
- package/dist/query/fetchers/endorsements.js +20 -0
- package/dist/query/fetchers/endorsements.js.map +1 -0
- package/dist/query/fetchers/entities.js +65 -0
- package/dist/query/fetchers/entities.js.map +1 -0
- package/dist/query/fetchers/external-accounts.js +74 -0
- package/dist/query/fetchers/external-accounts.js.map +1 -0
- package/dist/query/fetchers/follow-extras.js +38 -0
- package/dist/query/fetchers/follow-extras.js.map +1 -0
- package/dist/query/fetchers/follow.js +105 -0
- package/dist/query/fetchers/follow.js.map +1 -0
- package/dist/query/fetchers/get-profile-view.js +21 -0
- package/dist/query/fetchers/get-profile-view.js.map +1 -0
- package/dist/query/fetchers/github-prs.js +45 -0
- package/dist/query/fetchers/github-prs.js.map +1 -0
- package/dist/query/fetchers/inbox.js +29 -0
- package/dist/query/fetchers/inbox.js.map +1 -0
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.ts +2 -2
- package/dist/query/fetchers/index.js +360 -2045
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/fetchers/investments.js +18 -0
- package/dist/query/fetchers/investments.js.map +1 -0
- package/dist/query/fetchers/keytrace-claims.js +23 -0
- package/dist/query/fetchers/keytrace-claims.js.map +1 -0
- package/dist/query/fetchers/marque-domains.js +23 -0
- package/dist/query/fetchers/marque-domains.js.map +1 -0
- package/dist/query/fetchers/network-map.js +36 -0
- package/dist/query/fetchers/network-map.js.map +1 -0
- package/dist/query/fetchers/org.js +48 -0
- package/dist/query/fetchers/org.js.map +1 -0
- package/dist/query/fetchers/positions.js +77 -0
- package/dist/query/fetchers/positions.js.map +1 -0
- package/dist/query/fetchers/profile-completeness.js +45 -0
- package/dist/query/fetchers/profile-completeness.js.map +1 -0
- package/dist/query/fetchers/profile-items-hide.js +36 -0
- package/dist/query/fetchers/profile-items-hide.js.map +1 -0
- package/dist/query/fetchers/profile-locations.js +23 -0
- package/dist/query/fetchers/profile-locations.js.map +1 -0
- package/dist/query/fetchers/profile-mutations.js +82 -0
- package/dist/query/fetchers/profile-mutations.js.map +1 -0
- package/dist/query/fetchers/profile-summary.js +14 -0
- package/dist/query/fetchers/profile-summary.js.map +1 -0
- package/dist/query/fetchers/profile.js +31 -0
- package/dist/query/fetchers/profile.js.map +1 -0
- package/dist/query/fetchers/publications.js +66 -0
- package/dist/query/fetchers/publications.js.map +1 -0
- package/dist/query/fetchers/quoted-posts.js +40 -0
- package/dist/query/fetchers/quoted-posts.js.map +1 -0
- package/dist/query/fetchers/reactions.js +85 -0
- package/dist/query/fetchers/reactions.js.map +1 -0
- package/dist/query/fetchers/received-endorsements.js +20 -0
- package/dist/query/fetchers/received-endorsements.js.map +1 -0
- package/dist/query/fetchers/reciprocity.js +23 -0
- package/dist/query/fetchers/reciprocity.js.map +1 -0
- package/dist/query/fetchers/records.js +27 -0
- package/dist/query/fetchers/records.js.map +1 -0
- package/dist/query/fetchers/repo-inventory.js +23 -0
- package/dist/query/fetchers/repo-inventory.js.map +1 -0
- package/dist/query/fetchers/roadmap.js +73 -0
- package/dist/query/fetchers/roadmap.js.map +1 -0
- package/dist/query/fetchers/rpg.js +36 -0
- package/dist/query/fetchers/rpg.js.map +1 -0
- package/dist/query/fetchers/search.js +78 -0
- package/dist/query/fetchers/search.js.map +1 -0
- package/dist/query/fetchers/section-primary.js +23 -0
- package/dist/query/fetchers/section-primary.js.map +1 -0
- package/dist/query/fetchers/skills.js +30 -0
- package/dist/query/fetchers/skills.js.map +1 -0
- package/dist/query/fetchers/speakers.js +42 -0
- package/dist/query/fetchers/speakers.js.map +1 -0
- package/dist/query/fetchers/stats.js +16 -0
- package/dist/query/fetchers/stats.js.map +1 -0
- package/dist/query/fetchers/stream.js +30 -0
- package/dist/query/fetchers/stream.js.map +1 -0
- package/dist/query/fetchers/unlinked-positions.js +30 -0
- package/dist/query/fetchers/unlinked-positions.js.map +1 -0
- package/dist/query/hooks/index.d.ts +3 -3
- package/dist/query/hooks/index.js +283 -3555
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/hooks/use-accounts.js +19 -0
- package/dist/query/hooks/use-accounts.js.map +1 -0
- package/dist/query/hooks/use-activity-items-hide.js +52 -0
- package/dist/query/hooks/use-activity-items-hide.js.map +1 -0
- package/dist/query/hooks/use-activity.js +44 -0
- package/dist/query/hooks/use-activity.js.map +1 -0
- package/dist/query/hooks/use-admin-review-queues.js +21 -0
- package/dist/query/hooks/use-admin-review-queues.js.map +1 -0
- package/dist/query/hooks/use-apps.js +31 -0
- package/dist/query/hooks/use-apps.js.map +1 -0
- package/dist/query/hooks/use-bsky-content-prefs.js +45 -0
- package/dist/query/hooks/use-bsky-content-prefs.js.map +1 -0
- package/dist/query/hooks/use-confirmations.js +121 -0
- package/dist/query/hooks/use-confirmations.js.map +1 -0
- package/dist/query/hooks/use-create-position.js +28 -0
- package/dist/query/hooks/use-create-position.js.map +1 -0
- package/dist/query/hooks/use-destructive.js +63 -0
- package/dist/query/hooks/use-destructive.js.map +1 -0
- package/dist/query/hooks/use-discovery.js +53 -0
- package/dist/query/hooks/use-discovery.js.map +1 -0
- package/dist/query/hooks/use-education-mutations.js +67 -0
- package/dist/query/hooks/use-education-mutations.js.map +1 -0
- package/dist/query/hooks/use-endorsement-inbox.js +80 -0
- package/dist/query/hooks/use-endorsement-inbox.js.map +1 -0
- package/dist/query/hooks/use-endorsement-mutations.js +33 -0
- package/dist/query/hooks/use-endorsement-mutations.js.map +1 -0
- package/dist/query/hooks/use-endorsement.js +20 -0
- package/dist/query/hooks/use-endorsement.js.map +1 -0
- package/dist/query/hooks/use-entity-search.js +73 -0
- package/dist/query/hooks/use-entity-search.js.map +1 -0
- package/dist/query/hooks/use-external-accounts.js +143 -0
- package/dist/query/hooks/use-external-accounts.js.map +1 -0
- package/dist/query/hooks/use-feature-allowlist.js +104 -0
- package/dist/query/hooks/use-feature-allowlist.js.map +1 -0
- package/dist/query/hooks/use-follow-extras.js +38 -0
- package/dist/query/hooks/use-follow-extras.js.map +1 -0
- package/dist/query/hooks/use-follow.js +113 -0
- package/dist/query/hooks/use-follow.js.map +1 -0
- package/dist/query/hooks/use-get-profile-view.js +20 -0
- package/dist/query/hooks/use-get-profile-view.js.map +1 -0
- package/dist/query/hooks/use-github-prs.js +21 -0
- package/dist/query/hooks/use-github-prs.js.map +1 -0
- package/dist/query/hooks/use-inbox.js +19 -0
- package/dist/query/hooks/use-inbox.js.map +1 -0
- package/dist/query/hooks/use-investment-mutations.js +65 -0
- package/dist/query/hooks/use-investment-mutations.js.map +1 -0
- package/dist/query/hooks/use-keytrace-claims.js +50 -0
- package/dist/query/hooks/use-keytrace-claims.js.map +1 -0
- package/dist/query/hooks/use-location-mutations.js +71 -0
- package/dist/query/hooks/use-location-mutations.js.map +1 -0
- package/dist/query/hooks/use-marque-domains.js +50 -0
- package/dist/query/hooks/use-marque-domains.js.map +1 -0
- package/dist/query/hooks/use-org-claim.js +29 -0
- package/dist/query/hooks/use-org-claim.js.map +1 -0
- package/dist/query/hooks/use-org-domains.js +28 -0
- package/dist/query/hooks/use-org-domains.js.map +1 -0
- package/dist/query/hooks/use-org-notification-emails.js +28 -0
- package/dist/query/hooks/use-org-notification-emails.js.map +1 -0
- package/dist/query/hooks/use-org-profile-settings.js +29 -0
- package/dist/query/hooks/use-org-profile-settings.js.map +1 -0
- package/dist/query/hooks/use-org-profile.js +21 -0
- package/dist/query/hooks/use-org-profile.js.map +1 -0
- package/dist/query/hooks/use-position-mutations.js +128 -0
- package/dist/query/hooks/use-position-mutations.js.map +1 -0
- package/dist/query/hooks/use-profile-completeness.js +21 -0
- package/dist/query/hooks/use-profile-completeness.js.map +1 -0
- package/dist/query/hooks/use-profile-items-hide.js +53 -0
- package/dist/query/hooks/use-profile-items-hide.js.map +1 -0
- package/dist/query/hooks/use-profile-mutations.js +143 -0
- package/dist/query/hooks/use-profile-mutations.js.map +1 -0
- package/dist/query/hooks/use-profile.js +30 -0
- package/dist/query/hooks/use-profile.js.map +1 -0
- package/dist/query/hooks/use-publication-mutations.js +90 -0
- package/dist/query/hooks/use-publication-mutations.js.map +1 -0
- package/dist/query/hooks/use-reaction-mutations.js +48 -0
- package/dist/query/hooks/use-reaction-mutations.js.map +1 -0
- package/dist/query/hooks/use-reactions.js +32 -0
- package/dist/query/hooks/use-reactions.js.map +1 -0
- package/dist/query/hooks/use-received-endorsements.js +23 -0
- package/dist/query/hooks/use-received-endorsements.js.map +1 -0
- package/dist/query/hooks/use-reciprocity.js +19 -0
- package/dist/query/hooks/use-reciprocity.js.map +1 -0
- package/dist/query/hooks/use-record-mutations.js +67 -0
- package/dist/query/hooks/use-record-mutations.js.map +1 -0
- package/dist/query/hooks/use-repo-inventory.js +43 -0
- package/dist/query/hooks/use-repo-inventory.js.map +1 -0
- package/dist/query/hooks/use-roadmap-mutations.js +51 -0
- package/dist/query/hooks/use-roadmap-mutations.js.map +1 -0
- package/dist/query/hooks/use-roadmap.js +31 -0
- package/dist/query/hooks/use-roadmap.js.map +1 -0
- package/dist/query/hooks/use-search.js +63 -0
- package/dist/query/hooks/use-search.js.map +1 -0
- package/dist/query/hooks/use-section-primary-mutations.js +53 -0
- package/dist/query/hooks/use-section-primary-mutations.js.map +1 -0
- package/dist/query/hooks/use-skill-mutations.js +91 -0
- package/dist/query/hooks/use-skill-mutations.js.map +1 -0
- package/dist/query/hooks/use-stats.js +19 -0
- package/dist/query/hooks/use-stats.js.map +1 -0
- package/dist/query/hooks/use-stream.js +20 -0
- package/dist/query/hooks/use-stream.js.map +1 -0
- package/dist/query/hooks/use-unlinked-positions.js +45 -0
- package/dist/query/hooks/use-unlinked-positions.js.map +1 -0
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.ts +4 -4
- package/dist/query/index.js +685 -3744
- package/dist/query/index.js.map +1 -1
- package/dist/query/keys.js +138 -0
- package/dist/query/keys.js.map +1 -0
- package/dist/repo/groups.js +81 -0
- package/dist/repo/groups.js.map +1 -0
- package/dist/repo/index.js +9 -0
- package/dist/repo/index.js.map +1 -0
- package/dist/repo/labels.js +121 -0
- package/dist/repo/labels.js.map +1 -0
- package/dist/repo/types.js +1 -0
- package/dist/repo/types.js.map +1 -0
- package/dist/resume/index.js +5 -179
- package/dist/resume/index.js.map +1 -1
- package/dist/resume/json-resume.js +153 -0
- package/dist/resume/json-resume.js.map +1 -0
- package/dist/roadmap/index.js +101 -0
- package/dist/roadmap/index.js.map +1 -0
- package/dist/rpg/catalog.js +101 -0
- package/dist/rpg/catalog.js.map +1 -0
- package/dist/rpg/index.js +13 -116
- package/dist/rpg/index.js.map +1 -1
- package/dist/rpg/unlocks.js +21 -0
- package/dist/rpg/unlocks.js.map +1 -0
- package/dist/schemas/blob-ref.js +12 -0
- package/dist/schemas/blob-ref.js.map +1 -0
- package/dist/schemas/confirmation.js +23 -0
- package/dist/schemas/confirmation.js.map +1 -0
- package/dist/schemas/endorsement-confirmation.js +18 -0
- package/dist/schemas/endorsement-confirmation.js.map +1 -0
- package/dist/schemas/endorsement.js +19 -0
- package/dist/schemas/endorsement.js.map +1 -0
- package/dist/schemas/entity.js +74 -0
- package/dist/schemas/entity.js.map +1 -0
- package/dist/schemas/feed.js +73 -0
- package/dist/schemas/feed.js.map +1 -0
- package/dist/schemas/follow-profile.js +32 -0
- package/dist/schemas/follow-profile.js.map +1 -0
- package/dist/schemas/graph-follow.js +19 -0
- package/dist/schemas/graph-follow.js.map +1 -0
- package/dist/schemas/index.js +164 -629
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/org-employment-attestation.js +28 -0
- package/dist/schemas/org-employment-attestation.js.map +1 -0
- package/dist/schemas/org-profile.js +64 -0
- package/dist/schemas/org-profile.js.map +1 -0
- package/dist/schemas/profile-certification.js +28 -0
- package/dist/schemas/profile-certification.js.map +1 -0
- package/dist/schemas/profile-course.js +32 -0
- package/dist/schemas/profile-course.js.map +1 -0
- package/dist/schemas/profile-education.js +33 -0
- package/dist/schemas/profile-education.js.map +1 -0
- package/dist/schemas/profile-external-account.js +15 -0
- package/dist/schemas/profile-external-account.js.map +1 -0
- package/dist/schemas/profile-honor.js +18 -0
- package/dist/schemas/profile-honor.js.map +1 -0
- package/dist/schemas/profile-investment.js +48 -0
- package/dist/schemas/profile-investment.js.map +1 -0
- package/dist/schemas/profile-involvement.js +47 -0
- package/dist/schemas/profile-involvement.js.map +1 -0
- package/dist/schemas/profile-language.js +12 -0
- package/dist/schemas/profile-language.js.map +1 -0
- package/dist/schemas/profile-position.js +42 -0
- package/dist/schemas/profile-position.js.map +1 -0
- package/dist/schemas/profile-presentation-delivery.js +38 -0
- package/dist/schemas/profile-presentation-delivery.js.map +1 -0
- package/dist/schemas/profile-presentation.js +36 -0
- package/dist/schemas/profile-presentation.js.map +1 -0
- package/dist/schemas/profile-project.js +48 -0
- package/dist/schemas/profile-project.js.map +1 -0
- package/dist/schemas/profile-publication.js +30 -0
- package/dist/schemas/profile-publication.js.map +1 -0
- package/dist/schemas/profile-self.js +22 -0
- package/dist/schemas/profile-self.js.map +1 -0
- package/dist/schemas/profile-skill.js +13 -0
- package/dist/schemas/profile-skill.js.map +1 -0
- package/dist/schemas/profile-volunteering.js +20 -0
- package/dist/schemas/profile-volunteering.js.map +1 -0
- package/dist/schemas/shared.js +56 -0
- package/dist/schemas/shared.js.map +1 -0
- package/dist/schemas/write/certification.js +16 -0
- package/dist/schemas/write/certification.js.map +1 -0
- package/dist/schemas/write/course.js +36 -0
- package/dist/schemas/write/course.js.map +1 -0
- package/dist/schemas/write/education.js +18 -0
- package/dist/schemas/write/education.js.map +1 -0
- package/dist/schemas/write/external-account.js +13 -0
- package/dist/schemas/write/external-account.js.map +1 -0
- package/dist/schemas/write/honor.js +14 -0
- package/dist/schemas/write/honor.js.map +1 -0
- package/dist/schemas/write/index.d.ts +1 -1
- package/dist/schemas/write/index.js +89 -593
- package/dist/schemas/write/index.js.map +1 -1
- package/dist/schemas/write/investment.js +32 -0
- package/dist/schemas/write/investment.js.map +1 -0
- package/dist/schemas/write/involvement.js +34 -0
- package/dist/schemas/write/involvement.js.map +1 -0
- package/dist/schemas/write/language.js +10 -0
- package/dist/schemas/write/language.js.map +1 -0
- package/dist/schemas/write/org-claim.js +56 -0
- package/dist/schemas/write/org-claim.js.map +1 -0
- package/dist/schemas/write/org-employment-attestation.js +19 -0
- package/dist/schemas/write/org-employment-attestation.js.map +1 -0
- package/dist/schemas/write/org-profile.js +54 -0
- package/dist/schemas/write/org-profile.js.map +1 -0
- package/dist/schemas/write/org-settings.js +81 -0
- package/dist/schemas/write/org-settings.js.map +1 -0
- package/dist/schemas/write/position.js +24 -0
- package/dist/schemas/write/position.js.map +1 -0
- package/dist/schemas/write/presentation-delivery.js +34 -0
- package/dist/schemas/write/presentation-delivery.js.map +1 -0
- package/dist/schemas/write/presentation.js +23 -0
- package/dist/schemas/write/presentation.js.map +1 -0
- package/dist/schemas/write/profile-location.js +21 -0
- package/dist/schemas/write/profile-location.js.map +1 -0
- package/dist/schemas/write/profile-self.js +27 -0
- package/dist/schemas/write/profile-self.js.map +1 -0
- package/dist/schemas/write/project.js +27 -0
- package/dist/schemas/write/project.js.map +1 -0
- package/dist/schemas/write/publication.js +41 -0
- package/dist/schemas/write/publication.js.map +1 -0
- package/dist/schemas/write/shared.js +96 -0
- package/dist/schemas/write/shared.js.map +1 -0
- package/dist/schemas/write/skill.js +18 -0
- package/dist/schemas/write/skill.js.map +1 -0
- package/dist/schemas/write/volunteering.js +16 -0
- package/dist/schemas/write/volunteering.js.map +1 -0
- package/dist/stream/activity-item.js +1 -0
- package/dist/stream/activity-item.js.map +1 -0
- package/dist/stream/index.js +49 -0
- package/dist/stream/index.js.map +1 -0
- package/dist/stream/stream-card-vm-schema.js +265 -0
- package/dist/stream/stream-card-vm-schema.js.map +1 -0
- package/dist/stream/stream-card-vm.js +1 -0
- package/dist/stream/stream-card-vm.js.map +1 -0
- package/dist/stream/to-stream-card-vm.js +793 -0
- package/dist/stream/to-stream-card-vm.js.map +1 -0
- package/dist/stream/two-tier.js +30 -0
- package/dist/stream/two-tier.js.map +1 -0
- package/dist/stream/verbs.js +120 -0
- package/dist/stream/verbs.js.map +1 -0
- package/dist/taxonomy/activity-tiers.js +956 -0
- package/dist/taxonomy/activity-tiers.js.map +1 -0
- package/dist/taxonomy/app-categories.js +42 -0
- package/dist/taxonomy/app-categories.js.map +1 -0
- package/dist/taxonomy/app-category-map.js +166 -0
- package/dist/taxonomy/app-category-map.js.map +1 -0
- package/dist/taxonomy/artifact-link-kind.js +29 -0
- package/dist/taxonomy/artifact-link-kind.js.map +1 -0
- package/dist/taxonomy/calendar-event.js +28 -0
- package/dist/taxonomy/calendar-event.js.map +1 -0
- package/dist/taxonomy/continents.js +215 -0
- package/dist/taxonomy/continents.js.map +1 -0
- package/dist/taxonomy/countries.js +203 -0
- package/dist/taxonomy/countries.js.map +1 -0
- package/dist/taxonomy/course-role.js +37 -0
- package/dist/taxonomy/course-role.js.map +1 -0
- package/dist/taxonomy/employment-type.js +82 -0
- package/dist/taxonomy/employment-type.js.map +1 -0
- package/dist/taxonomy/eqf-level.js +59 -0
- package/dist/taxonomy/eqf-level.js.map +1 -0
- package/dist/taxonomy/index.js +263 -0
- package/dist/taxonomy/index.js.map +1 -0
- package/dist/taxonomy/industry-taxonomy.js +281 -0
- package/dist/taxonomy/industry-taxonomy.js.map +1 -0
- package/dist/taxonomy/investment.js +54 -0
- package/dist/taxonomy/investment.js.map +1 -0
- package/dist/taxonomy/involvement-kind.js +30 -0
- package/dist/taxonomy/involvement-kind.js.map +1 -0
- package/dist/taxonomy/open-to.js +128 -0
- package/dist/taxonomy/open-to.js.map +1 -0
- package/dist/taxonomy/platforms.js +56 -0
- package/dist/taxonomy/platforms.js.map +1 -0
- package/dist/taxonomy/presentation-link-type.js +22 -0
- package/dist/taxonomy/presentation-link-type.js.map +1 -0
- package/dist/taxonomy/presentation-role.js +21 -0
- package/dist/taxonomy/presentation-role.js.map +1 -0
- package/dist/taxonomy/publication-type.js +54 -0
- package/dist/taxonomy/publication-type.js.map +1 -0
- package/dist/taxonomy/relational.js +25 -0
- package/dist/taxonomy/relational.js.map +1 -0
- package/dist/taxonomy/search-filter-defs.js +66 -0
- package/dist/taxonomy/search-filter-defs.js.map +1 -0
- package/dist/taxonomy/skill-categories.js +28 -0
- package/dist/taxonomy/skill-categories.js.map +1 -0
- package/dist/taxonomy/skill-display-groups.js +12 -0
- package/dist/taxonomy/skill-display-groups.js.map +1 -0
- package/dist/taxonomy/skill-grouping.js +90 -0
- package/dist/taxonomy/skill-grouping.js.map +1 -0
- package/dist/taxonomy/verification-providers.js +69 -0
- package/dist/taxonomy/verification-providers.js.map +1 -0
- package/dist/taxonomy/workplace-type.js +38 -0
- package/dist/taxonomy/workplace-type.js.map +1 -0
- package/dist/tokens/colors.js +11 -0
- package/dist/tokens/colors.js.map +1 -0
- package/dist/tokens/icons.js +15 -0
- package/dist/tokens/icons.js.map +1 -0
- package/dist/tokens/index.js +10 -39
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/typography.js +23 -0
- package/dist/tokens/typography.js.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/profile-view.js +1 -0
- package/dist/types/profile-view.js.map +1 -0
- package/dist/{use-org-notification-emails-0hjt-dEw.d.ts → use-org-notification-emails-CWWi1D8t.d.ts} +2 -2
- package/package.json +4 -3
package/dist/rpg/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rpg/
|
|
1
|
+
{"version":3,"sources":["../../src/rpg/index.ts"],"sourcesContent":["/**\n * `@singi-labs/sifa-sdk/rpg` -- the Sifa item catalog for rpg.actor and the\n * pure predicate that decides which items a profile has earned. No network\n * calls; safe to import anywhere.\n */\nexport {\n RPG_ITEMS,\n RpgItemSchema,\n RpgUnlockSchema,\n type RpgItem,\n type RpgUnlock,\n} from './catalog.js';\nexport { evaluateRpgUnlocks, type RpgUnlockResult, type RpgUnlockSignals } from './unlocks.js';\n"],"mappings":";AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,0BAAuE;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/rpg/unlocks.ts
|
|
2
|
+
import { RPG_ITEMS } from "./catalog.js";
|
|
3
|
+
function matches(u, s) {
|
|
4
|
+
switch (u.kind) {
|
|
5
|
+
case "hasRecord":
|
|
6
|
+
return s.collections.includes(u.collection);
|
|
7
|
+
case "hasExternalAccount":
|
|
8
|
+
return u.platforms.some((p) => s.externalPlatforms.includes(p));
|
|
9
|
+
case "usesApp":
|
|
10
|
+
return s.activeAppIds.includes(u.appId);
|
|
11
|
+
case "hasDoctorate":
|
|
12
|
+
return s.hasDoctorate;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function evaluateRpgUnlocks(signals, items = RPG_ITEMS) {
|
|
16
|
+
return items.filter((item) => item.enabled).map((item) => ({ item, earned: item.unlock.some((u) => matches(u, signals)) }));
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
evaluateRpgUnlocks
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=unlocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/rpg/unlocks.ts"],"sourcesContent":["import { RPG_ITEMS, type RpgItem, type RpgUnlock } from './catalog.js';\n\n/**\n * Profile signals the unlock rules are checked against. Callers must pass\n * lowercase platform codes (e.g. 'github', 'orcid') and registry app ids (e.g. 'tangled').\n */\nexport interface RpgUnlockSignals {\n collections: readonly string[];\n externalPlatforms: readonly string[];\n activeAppIds: readonly string[];\n hasDoctorate: boolean;\n}\n\n/** One enabled catalog item and whether the signals earn it. */\nexport interface RpgUnlockResult {\n item: RpgItem;\n earned: boolean;\n}\n\nfunction matches(u: RpgUnlock, s: RpgUnlockSignals): boolean {\n switch (u.kind) {\n case 'hasRecord':\n return s.collections.includes(u.collection);\n case 'hasExternalAccount':\n return u.platforms.some((p) => s.externalPlatforms.includes(p));\n case 'usesApp':\n return s.activeAppIds.includes(u.appId);\n case 'hasDoctorate':\n return s.hasDoctorate;\n }\n}\n\n/** Evaluate every enabled item (ANY matching unlock earns it); disabled items are omitted. */\nexport function evaluateRpgUnlocks(\n signals: RpgUnlockSignals,\n items: readonly RpgItem[] = RPG_ITEMS,\n): RpgUnlockResult[] {\n return items\n .filter((item) => item.enabled)\n .map((item) => ({ item, earned: item.unlock.some((u) => matches(u, signals)) }));\n}\n"],"mappings":";AAAA,SAAS,iBAA+C;AAmBxD,SAAS,QAAQ,GAAc,GAA8B;AAC3D,UAAQ,EAAE,MAAM;AAAA,IACd,KAAK;AACH,aAAO,EAAE,YAAY,SAAS,EAAE,UAAU;AAAA,IAC5C,KAAK;AACH,aAAO,EAAE,UAAU,KAAK,CAAC,MAAM,EAAE,kBAAkB,SAAS,CAAC,CAAC;AAAA,IAChE,KAAK;AACH,aAAO,EAAE,aAAa,SAAS,EAAE,KAAK;AAAA,IACxC,KAAK;AACH,aAAO,EAAE;AAAA,EACb;AACF;AAGO,SAAS,mBACd,SACA,QAA4B,WACT;AACnB,SAAO,MACJ,OAAO,CAAC,SAAS,KAAK,OAAO,EAC7B,IAAI,CAAC,UAAU,EAAE,MAAM,QAAQ,KAAK,OAAO,KAAK,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,EAAE,EAAE;AACnF;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/schemas/blob-ref.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var BlobRefSchema = z.object({
|
|
4
|
+
$type: z.literal("blob"),
|
|
5
|
+
ref: z.object({ $link: z.string().min(1) }),
|
|
6
|
+
mimeType: z.string().min(1).max(255),
|
|
7
|
+
size: z.number().int().nonnegative()
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
BlobRefSchema
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=blob-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/blob-ref.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Blob-ref passthrough shared by records that carry an uploaded blob (org logo,\n * presentation cover image, ...). Mirrors the `blobRefSchema` validated by the\n * sifa-api write endpoints -- the shape is validated, then written to the PDS\n * verbatim.\n */\nexport const BlobRefSchema = z.object({\n $type: z.literal('blob'),\n ref: z.object({ $link: z.string().min(1) }),\n mimeType: z.string().min(1).max(255),\n size: z.number().int().nonnegative(),\n});\n\nexport type BlobRef = z.infer<typeof BlobRefSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAQX,IAAM,gBAAgB,EAAE,OAAO;AAAA,EACpC,OAAO,EAAE,QAAQ,MAAM;AAAA,EACvB,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;AAAA,EAC1C,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACnC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AACrC,CAAC;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/schemas/confirmation.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { datetimeSchema, maxGraphemes, strongRefSchema } from "./shared.js";
|
|
4
|
+
var CONFIRMATION_RELATIONS = [
|
|
5
|
+
"id.sifa.defs#coSpeaker",
|
|
6
|
+
"id.sifa.defs#projectMember"
|
|
7
|
+
];
|
|
8
|
+
var ConfirmationRecordSchema = z.object({
|
|
9
|
+
subject: strongRefSchema,
|
|
10
|
+
relation: z.string().min(1),
|
|
11
|
+
/**
|
|
12
|
+
* Name the subject record carried at confirmation time. Lives in the
|
|
13
|
+
* confirming person's repo, out of the claimer's reach, so a rename after
|
|
14
|
+
* the fact is detectable.
|
|
15
|
+
*/
|
|
16
|
+
subjectName: z.string().refine(maxGraphemes(300)).max(3e3).optional(),
|
|
17
|
+
createdAt: datetimeSchema
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
CONFIRMATION_RELATIONS,
|
|
21
|
+
ConfirmationRecordSchema
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=confirmation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/confirmation.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes, strongRefSchema } from './shared.js';\n\n/**\n * Relations shipped today. The lexicon declares these as `knownValues`, not an\n * enum, so the schema accepts any string: a consumer that meets a relation it\n * does not recognise should still see that the named person affirmed something.\n */\nexport const CONFIRMATION_RELATIONS = [\n 'id.sifa.defs#coSpeaker',\n 'id.sifa.defs#projectMember',\n] as const;\n\nexport type ConfirmationRelation = (typeof CONFIRMATION_RELATIONS)[number];\n\n/**\n * Zod schema for `id.sifa.confirmation` records.\n *\n * The subject strongRef carries no collection constraint by design: one record\n * type affirms a co-speaker credit, a project membership, and whatever\n * people-link relations come next. Resolve it by AT-URI; the CID pins the\n * version seen at confirmation time and is an integrity hint, not a join key,\n * because the claimer editing their record changes its CID without\n * invalidating anything.\n */\nexport const ConfirmationRecordSchema = z.object({\n subject: strongRefSchema,\n relation: z.string().min(1),\n /**\n * Name the subject record carried at confirmation time. Lives in the\n * confirming person's repo, out of the claimer's reach, so a rename after\n * the fact is detectable.\n */\n subjectName: z.string().refine(maxGraphemes(300)).max(3000).optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ConfirmationRecord = z.infer<typeof ConfirmationRecordSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,gBAAgB,cAAc,uBAAuB;AAOvD,IAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AACF;AAcO,IAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,SAAS;AAAA,EACT,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1B,aAAa,EAAE,OAAO,EAAE,OAAO,aAAa,GAAG,CAAC,EAAE,IAAI,GAAI,EAAE,SAAS;AAAA,EACrE,WAAW;AACb,CAAC;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/schemas/endorsement-confirmation.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { datetimeSchema, strongRefSchema } from "./shared.js";
|
|
4
|
+
var EndorsementConfirmationRecordSchema = z.object({
|
|
5
|
+
endorsement: strongRefSchema,
|
|
6
|
+
/**
|
|
7
|
+
* Skill record this endorsement applies to. Set when the endorsement proposed
|
|
8
|
+
* a skill: the subject creates the record and links it here, because the
|
|
9
|
+
* endorser cannot write to the subject's repository. Also set when a proposed
|
|
10
|
+
* name matched a skill the subject already had.
|
|
11
|
+
*/
|
|
12
|
+
skill: strongRefSchema.optional(),
|
|
13
|
+
createdAt: datetimeSchema
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
EndorsementConfirmationRecordSchema
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=endorsement-confirmation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/endorsement-confirmation.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { datetimeSchema, strongRefSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.endorsement.confirmation` records.\n * Lives in the endorsee's PDS to approve display of an endorsement.\n */\nexport const EndorsementConfirmationRecordSchema = z.object({\n endorsement: strongRefSchema,\n /**\n * Skill record this endorsement applies to. Set when the endorsement proposed\n * a skill: the subject creates the record and links it here, because the\n * endorser cannot write to the subject's repository. Also set when a proposed\n * name matched a skill the subject already had.\n */\n skill: strongRefSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type EndorsementConfirmationRecord = z.infer<typeof EndorsementConfirmationRecordSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,gBAAgB,uBAAuB;AAMzC,IAAM,sCAAsC,EAAE,OAAO;AAAA,EAC1D,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOb,OAAO,gBAAgB,SAAS;AAAA,EAChC,WAAW;AACb,CAAC;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/schemas/endorsement.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { datetimeSchema, didSchema, maxGraphemes, strongRefSchema } from "./shared.js";
|
|
4
|
+
var EndorsementRecordSchema = z.object({
|
|
5
|
+
subject: didSchema,
|
|
6
|
+
/**
|
|
7
|
+
* Absent when the endorser is proposing a skill the subject has not listed,
|
|
8
|
+
* named by `skillName`. The record it becomes is linked from the subject's
|
|
9
|
+
* confirmation, since only they can write to their own repository.
|
|
10
|
+
*/
|
|
11
|
+
skill: strongRefSchema.optional(),
|
|
12
|
+
skillName: z.string().min(1).refine(maxGraphemes(64)).max(640),
|
|
13
|
+
comment: z.string().refine(maxGraphemes(300)).max(3e3).optional(),
|
|
14
|
+
createdAt: datetimeSchema
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
EndorsementRecordSchema
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=endorsement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/endorsement.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, strongRefSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.endorsement` records. Lives in the endorser's PDS;\n * the endorser identity is implicit (whoever owns the repository).\n */\nexport const EndorsementRecordSchema = z.object({\n subject: didSchema,\n /**\n * Absent when the endorser is proposing a skill the subject has not listed,\n * named by `skillName`. The record it becomes is linked from the subject's\n * confirmation, since only they can write to their own repository.\n */\n skill: strongRefSchema.optional(),\n skillName: z.string().min(1).refine(maxGraphemes(64)).max(640),\n comment: z.string().refine(maxGraphemes(300)).max(3000).optional(),\n createdAt: datetimeSchema,\n});\n\nexport type EndorsementRecord = z.infer<typeof EndorsementRecordSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,gBAAgB,WAAW,cAAc,uBAAuB;AAMlE,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,OAAO,gBAAgB,SAAS;AAAA,EAChC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,aAAa,EAAE,CAAC,EAAE,IAAI,GAAG;AAAA,EAC7D,SAAS,EAAE,OAAO,EAAE,OAAO,aAAa,GAAG,CAAC,EAAE,IAAI,GAAI,EAAE,SAAS;AAAA,EACjE,WAAW;AACb,CAAC;","names":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/schemas/entity.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var httpUrlNullable = z.string().refine((s) => /^https?:\/\//i.test(s), { message: "must be an http(s) URL" }).nullable();
|
|
4
|
+
var searchResultCommon = {
|
|
5
|
+
kind: z.string(),
|
|
6
|
+
name: z.string(),
|
|
7
|
+
domain: z.string().nullable(),
|
|
8
|
+
country: z.string().nullable(),
|
|
9
|
+
logoUrl: httpUrlNullable,
|
|
10
|
+
parentName: z.string().nullable()
|
|
11
|
+
};
|
|
12
|
+
var EntitySearchResultSchema = z.discriminatedUnion("source", [
|
|
13
|
+
z.object({
|
|
14
|
+
source: z.literal("entity"),
|
|
15
|
+
entityId: z.number().int().positive(),
|
|
16
|
+
...searchResultCommon
|
|
17
|
+
}),
|
|
18
|
+
z.object({
|
|
19
|
+
source: z.literal("pdl"),
|
|
20
|
+
pdlId: z.string().min(1),
|
|
21
|
+
...searchResultCommon
|
|
22
|
+
})
|
|
23
|
+
]);
|
|
24
|
+
var EntitySearchResponseSchema = z.object({
|
|
25
|
+
results: z.array(EntitySearchResultSchema),
|
|
26
|
+
hasMore: z.boolean()
|
|
27
|
+
});
|
|
28
|
+
var EntitySelectRequestSchema = z.object({
|
|
29
|
+
entityId: z.number().int().positive().optional(),
|
|
30
|
+
pdlId: z.string().min(1).optional()
|
|
31
|
+
}).refine((v) => v.entityId != null !== (v.pdlId != null), {
|
|
32
|
+
message: "exactly one of entityId or pdlId is required"
|
|
33
|
+
});
|
|
34
|
+
var EntitySelectResponseSchema = z.object({
|
|
35
|
+
entityId: z.number().int().positive(),
|
|
36
|
+
slug: z.string(),
|
|
37
|
+
kind: z.string(),
|
|
38
|
+
canonicalName: z.string(),
|
|
39
|
+
domain: z.string().nullable(),
|
|
40
|
+
/**
|
|
41
|
+
* The entity's website, gated to sources trustworthy enough to prefill into a
|
|
42
|
+
* record the user signs. Narrower than `domain`, which is a display value and
|
|
43
|
+
* may come from a crawl. Null when the entity has no such source.
|
|
44
|
+
*/
|
|
45
|
+
website: httpUrlNullable.default(null),
|
|
46
|
+
/** Which tier `website` came from. Crawled is never an accepted source. */
|
|
47
|
+
websiteTier: z.enum(["org", "curated"]).nullable().default(null),
|
|
48
|
+
entityRef: httpUrlNullable
|
|
49
|
+
});
|
|
50
|
+
var EntityImportSearchResponseSchema = z.object({
|
|
51
|
+
results: z.array(EntitySearchResultSchema)
|
|
52
|
+
});
|
|
53
|
+
var EntityResolveDomainRequestSchema = z.object({
|
|
54
|
+
domain: z.string().min(1).max(253)
|
|
55
|
+
});
|
|
56
|
+
var EntityResolveDomainResponseSchema = z.object({
|
|
57
|
+
results: z.array(EntitySearchResultSchema),
|
|
58
|
+
canMint: z.boolean()
|
|
59
|
+
});
|
|
60
|
+
var EntityMintDomainResponseSchema = z.object({
|
|
61
|
+
result: EntitySearchResultSchema,
|
|
62
|
+
pending: z.boolean()
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
EntityImportSearchResponseSchema,
|
|
66
|
+
EntityMintDomainResponseSchema,
|
|
67
|
+
EntityResolveDomainRequestSchema,
|
|
68
|
+
EntityResolveDomainResponseSchema,
|
|
69
|
+
EntitySearchResponseSchema,
|
|
70
|
+
EntitySearchResultSchema,
|
|
71
|
+
EntitySelectRequestSchema,
|
|
72
|
+
EntitySelectResponseSchema
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/entity.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Organization entity-resolution payloads (#159). Shared by the typeahead,\n * selection, and grow-on-demand import-search endpoints on sifa-api.\n */\n\n/**\n * A nullable string constrained to an http(s) URL. Rejects `javascript:` and\n * other script-bearing schemes at the SDK boundary so a hostile API response\n * cannot smuggle an XSS payload into a rendered `href`/`src`. Note: Wikidata\n * entity URIs are canonically `http://`, so both http and https are allowed.\n */\nconst httpUrlNullable = z\n .string()\n .refine((s) => /^https?:\\/\\//i.test(s), { message: 'must be an http(s) URL' })\n .nullable();\n\nconst searchResultCommon = {\n kind: z.string(),\n name: z.string(),\n domain: z.string().nullable(),\n country: z.string().nullable(),\n logoUrl: httpUrlNullable,\n parentName: z.string().nullable(),\n};\n\n/**\n * A single typeahead row. Discriminated on `source`: a curated `entity` row\n * carries `entityId`, a `pdl` staging row carries `pdlId`. The union guarantees\n * the identifier for the row's source is always present, so a stable React key\n * can never be `entity:undefined`. The disambiguation fields\n * (domain/country/parentName) drive the dropdown display.\n */\nexport const EntitySearchResultSchema = z.discriminatedUnion('source', [\n z.object({\n source: z.literal('entity'),\n entityId: z.number().int().positive(),\n ...searchResultCommon,\n }),\n z.object({\n source: z.literal('pdl'),\n pdlId: z.string().min(1),\n ...searchResultCommon,\n }),\n]);\nexport type EntitySearchResult = z.infer<typeof EntitySearchResultSchema>;\n\n/** Response of `GET /api/entities/search`. */\nexport const EntitySearchResponseSchema = z.object({\n results: z.array(EntitySearchResultSchema),\n hasMore: z.boolean(),\n});\nexport type EntitySearchResponse = z.infer<typeof EntitySearchResponseSchema>;\n\n/**\n * Body of `POST /api/entities/select`: promote a PDL row OR bump an entity.\n * Exactly one of `entityId`/`pdlId` must be present -- supplying both is\n * ambiguous (the server would have to silently pick one) and is rejected.\n */\nexport const EntitySelectRequestSchema = z\n .object({\n entityId: z.number().int().positive().optional(),\n pdlId: z.string().min(1).optional(),\n })\n .refine((v) => (v.entityId != null) !== (v.pdlId != null), {\n message: 'exactly one of entityId or pdlId is required',\n });\nexport type EntitySelectRequest = z.infer<typeof EntitySelectRequestSchema>;\n\n/** Response of `POST /api/entities/select`. `entityRef` is the portable\n * Wikidata/ROR/LEI URI to write to the position record, or null for a\n * PDL-only entity (its resolution stays AppView-side). */\nexport const EntitySelectResponseSchema = z.object({\n entityId: z.number().int().positive(),\n slug: z.string(),\n kind: z.string(),\n canonicalName: z.string(),\n domain: z.string().nullable(),\n /**\n * The entity's website, gated to sources trustworthy enough to prefill into a\n * record the user signs. Narrower than `domain`, which is a display value and\n * may come from a crawl. Null when the entity has no such source.\n */\n website: httpUrlNullable.default(null),\n /** Which tier `website` came from. Crawled is never an accepted source. */\n websiteTier: z.enum(['org', 'curated']).nullable().default(null),\n entityRef: httpUrlNullable,\n});\nexport type EntitySelectResponse = z.infer<typeof EntitySelectResponseSchema>;\n\n/** Response of `POST /api/entities/import-search`. */\nexport const EntityImportSearchResponseSchema = z.object({\n results: z.array(EntitySearchResultSchema),\n});\nexport type EntityImportSearchResponse = z.infer<typeof EntityImportSearchResponseSchema>;\n\n/**\n * Body of the domain grow-on-demand endpoints (`POST /api/entities/resolve-domain`\n * and `POST /api/entities/mint-domain`). The server re-validates the value as a\n * registrable domain; 253 is the max DNS name length.\n */\nexport const EntityResolveDomainRequestSchema = z.object({\n domain: z.string().min(1).max(253),\n});\nexport type EntityResolveDomainRequest = z.infer<typeof EntityResolveDomainRequestSchema>;\n\n/**\n * Response of `POST /api/entities/resolve-domain` (grow-on-demand Branch 1). Any\n * notable companies whose official website is the domain, imported from Wikidata.\n * `canMint` is true when nothing notable matched AND the domain is eligible for\n * the user-initiated mint-from-domain path -- it drives the \"Add <domain>\"\n * affordance.\n */\nexport const EntityResolveDomainResponseSchema = z.object({\n results: z.array(EntitySearchResultSchema),\n canMint: z.boolean(),\n});\nexport type EntityResolveDomainResponse = z.infer<typeof EntityResolveDomainResponseSchema>;\n\n/**\n * Response of `POST /api/entities/mint-domain` (grow-on-demand Branch 2). The\n * linkable entity minted from (or already resolved for) the domain. A non-2xx\n * status (e.g. the domain is not mintable, a confusable look-alike, or the site\n * yielded nothing usable) surfaces as a thrown error, not a null result.\n *\n * `pending` is true when the entity is a fresh hidden-pending mint: the\n * requesting user's own link resolves to it immediately, but it stays out of\n * other users' typeahead + aggregation until an admin approves it. Clients should\n * reflect this (\"added -- pending review\") rather than \"added & live\".\n */\nexport const EntityMintDomainResponseSchema = z.object({\n result: EntitySearchResultSchema,\n pending: z.boolean(),\n});\nexport type EntityMintDomainResponse = z.infer<typeof EntityMintDomainResponseSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAalB,IAAM,kBAAkB,EACrB,OAAO,EACP,OAAO,CAAC,MAAM,gBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,yBAAyB,CAAC,EAC5E,SAAS;AAEZ,IAAM,qBAAqB;AAAA,EACzB,MAAM,EAAE,OAAO;AAAA,EACf,MAAM,EAAE,OAAO;AAAA,EACf,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,SAAS;AAAA,EACT,YAAY,EAAE,OAAO,EAAE,SAAS;AAClC;AASO,IAAM,2BAA2B,EAAE,mBAAmB,UAAU;AAAA,EACrE,EAAE,OAAO;AAAA,IACP,QAAQ,EAAE,QAAQ,QAAQ;AAAA,IAC1B,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,IACpC,GAAG;AAAA,EACL,CAAC;AAAA,EACD,EAAE,OAAO;AAAA,IACP,QAAQ,EAAE,QAAQ,KAAK;AAAA,IACvB,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,IACvB,GAAG;AAAA,EACL,CAAC;AACH,CAAC;AAIM,IAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,SAAS,EAAE,MAAM,wBAAwB;AAAA,EACzC,SAAS,EAAE,QAAQ;AACrB,CAAC;AAQM,IAAM,4BAA4B,EACtC,OAAO;AAAA,EACN,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AACpC,CAAC,EACA,OAAO,CAAC,MAAO,EAAE,YAAY,UAAW,EAAE,SAAS,OAAO;AAAA,EACzD,SAAS;AACX,CAAC;AAMI,IAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACpC,MAAM,EAAE,OAAO;AAAA,EACf,MAAM,EAAE,OAAO;AAAA,EACf,eAAe,EAAE,OAAO;AAAA,EACxB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5B,SAAS,gBAAgB,QAAQ,IAAI;AAAA;AAAA,EAErC,aAAa,EAAE,KAAK,CAAC,OAAO,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,IAAI;AAAA,EAC/D,WAAW;AACb,CAAC;AAIM,IAAM,mCAAmC,EAAE,OAAO;AAAA,EACvD,SAAS,EAAE,MAAM,wBAAwB;AAC3C,CAAC;AAQM,IAAM,mCAAmC,EAAE,OAAO;AAAA,EACvD,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AACnC,CAAC;AAUM,IAAM,oCAAoC,EAAE,OAAO;AAAA,EACxD,SAAS,EAAE,MAAM,wBAAwB;AAAA,EACzC,SAAS,EAAE,QAAQ;AACrB,CAAC;AAcM,IAAM,iCAAiC,EAAE,OAAO;AAAA,EACrD,QAAQ;AAAA,EACR,SAAS,EAAE,QAAQ;AACrB,CAAC;","names":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// src/schemas/feed.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { atUriSchema, cidSchema, datetimeSchema, didSchema } from "./shared.js";
|
|
4
|
+
var FeedActorSchema = z.object({
|
|
5
|
+
did: didSchema,
|
|
6
|
+
handle: z.string(),
|
|
7
|
+
displayName: z.string().optional(),
|
|
8
|
+
avatarUrl: z.string().optional()
|
|
9
|
+
});
|
|
10
|
+
var FeedItemBaseSchema = z.object({
|
|
11
|
+
id: z.string(),
|
|
12
|
+
actor: FeedActorSchema,
|
|
13
|
+
indexedAt: datetimeSchema,
|
|
14
|
+
eventType: z.string()
|
|
15
|
+
});
|
|
16
|
+
var SifaFeedItemSchema = FeedItemBaseSchema.extend({
|
|
17
|
+
source: z.literal("sifa"),
|
|
18
|
+
appId: z.literal("sifa").optional(),
|
|
19
|
+
payload: z.record(z.string(), z.unknown())
|
|
20
|
+
});
|
|
21
|
+
var AtmosphereFeedItemSchema = FeedItemBaseSchema.extend({
|
|
22
|
+
source: z.literal("atmosphere"),
|
|
23
|
+
appId: z.string(),
|
|
24
|
+
uri: atUriSchema.optional(),
|
|
25
|
+
cid: cidSchema.optional(),
|
|
26
|
+
payload: z.record(z.string(), z.unknown())
|
|
27
|
+
});
|
|
28
|
+
var FollowFeedItemSchema = z.discriminatedUnion("source", [
|
|
29
|
+
SifaFeedItemSchema,
|
|
30
|
+
AtmosphereFeedItemSchema
|
|
31
|
+
]);
|
|
32
|
+
var FollowFeedPageSchema = z.object({
|
|
33
|
+
items: z.array(FollowFeedItemSchema),
|
|
34
|
+
cursor: z.string().nullable()
|
|
35
|
+
});
|
|
36
|
+
var FeedCursorSchema = z.object({
|
|
37
|
+
indexedAt: datetimeSchema,
|
|
38
|
+
source: z.union([z.literal("sifa"), z.literal("atmosphere")]),
|
|
39
|
+
id: z.string().min(1)
|
|
40
|
+
});
|
|
41
|
+
function toBase64Url(input) {
|
|
42
|
+
const g = globalThis;
|
|
43
|
+
const b64 = typeof g.btoa === "function" ? g.btoa(unescape(encodeURIComponent(input))) : g.Buffer.from(input, "utf-8").toString("base64");
|
|
44
|
+
let end = b64.length;
|
|
45
|
+
while (end > 0 && b64.charCodeAt(end - 1) === 61) end--;
|
|
46
|
+
return b64.slice(0, end).replace(/\+/g, "-").replace(/\//g, "_");
|
|
47
|
+
}
|
|
48
|
+
function fromBase64Url(input) {
|
|
49
|
+
const padded = input.replace(/-/g, "+").replace(/_/g, "/") + "===".slice((input.length + 3) % 4);
|
|
50
|
+
const g = globalThis;
|
|
51
|
+
if (typeof g.atob === "function") {
|
|
52
|
+
return decodeURIComponent(escape(g.atob(padded)));
|
|
53
|
+
}
|
|
54
|
+
return g.Buffer.from(padded, "base64").toString("utf-8");
|
|
55
|
+
}
|
|
56
|
+
function encodeFeedCursor(cursor) {
|
|
57
|
+
return toBase64Url(JSON.stringify(cursor));
|
|
58
|
+
}
|
|
59
|
+
function decodeFeedCursor(encoded) {
|
|
60
|
+
const json = fromBase64Url(encoded);
|
|
61
|
+
const parsed = JSON.parse(json);
|
|
62
|
+
return FeedCursorSchema.parse(parsed);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
AtmosphereFeedItemSchema,
|
|
66
|
+
FeedActorSchema,
|
|
67
|
+
FollowFeedItemSchema,
|
|
68
|
+
FollowFeedPageSchema,
|
|
69
|
+
SifaFeedItemSchema,
|
|
70
|
+
decodeFeedCursor,
|
|
71
|
+
encodeFeedCursor
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=feed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/feed.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { atUriSchema, cidSchema, datetimeSchema, didSchema } from './shared.js';\n\n/**\n * Feed item from `GET /api/following/feed`. Discriminated on `source`:\n *\n * - `sifa`: a Sifa-native event (e.g. profile update, endorsement).\n * - `atmosphere`: a curated creation event from another ATproto app\n * (Barazo post, etc.). Payload is the hydrated `app.bsky.embed.*#view`\n * shape, NOT the raw record (per memory `sifa-hydrated-view-embed-types`).\n *\n * Both variants share `actor`, `indexedAt`, and `id` (the materialized\n * `feed_events.id` row identifier, used in the cursor).\n */\nexport const FeedActorSchema = z.object({\n did: didSchema,\n handle: z.string(),\n displayName: z.string().optional(),\n avatarUrl: z.string().optional(),\n});\n\nexport type FeedActor = z.infer<typeof FeedActorSchema>;\n\nconst FeedItemBaseSchema = z.object({\n id: z.string(),\n actor: FeedActorSchema,\n indexedAt: datetimeSchema,\n eventType: z.string(),\n});\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n * Stream are two distinct surfaces with different data paths (Barazo API\n * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n * types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport const SifaFeedItemSchema = FeedItemBaseSchema.extend({\n source: z.literal('sifa'),\n appId: z.literal('sifa').optional(),\n payload: z.record(z.string(), z.unknown()),\n});\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n * Stream are two distinct surfaces with different data paths (Barazo API\n * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n * types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport type SifaFeedItem = z.infer<typeof SifaFeedItemSchema>;\n\n/**\n * ATmosphere feed item. `payload` is intentionally permissive: it carries\n * a hydrated `app.bsky.embed.*#view` shape that varies by source app. The\n * AppView resolves the hydration; clients render via the existing\n * embed-view union (mirrors `sifa-web/src/components/stream/`).\n *\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n * Stream are two distinct surfaces with different data paths (Barazo API\n * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n * types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport const AtmosphereFeedItemSchema = FeedItemBaseSchema.extend({\n source: z.literal('atmosphere'),\n appId: z.string(),\n uri: atUriSchema.optional(),\n cid: cidSchema.optional(),\n payload: z.record(z.string(), z.unknown()),\n});\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n * Stream are two distinct surfaces with different data paths (Barazo API\n * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n * types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport type AtmosphereFeedItem = z.infer<typeof AtmosphereFeedItemSchema>;\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n * Stream are two distinct surfaces with different data paths (Barazo API\n * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n * types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport const FollowFeedItemSchema = z.discriminatedUnion('source', [\n SifaFeedItemSchema,\n AtmosphereFeedItemSchema,\n]);\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n * Stream are two distinct surfaces with different data paths (Barazo API\n * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n * types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport type FollowFeedItem = z.infer<typeof FollowFeedItemSchema>;\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n * Stream are two distinct surfaces with different data paths (Barazo API\n * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n * types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport const FollowFeedPageSchema = z.object({\n items: z.array(FollowFeedItemSchema),\n cursor: z.string().nullable(),\n});\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n * Stream are two distinct surfaces with different data paths (Barazo API\n * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n * types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport type FollowFeedPage = z.infer<typeof FollowFeedPageSchema>;\n\n/**\n * Composite feed cursor `(indexedAt DESC, source, id)`. Encoded as a\n * URL-safe base64 string so it survives `URLSearchParams` round-trips\n * without further encoding. Decoupling encode/decode from the API call\n * lets consumers persist cursors (e.g. for \"jump-back-here\" UX) and\n * lets us unit-test the format.\n */\nexport interface FeedCursor {\n indexedAt: string;\n source: 'sifa' | 'atmosphere';\n id: string;\n}\n\nconst FeedCursorSchema = z.object({\n indexedAt: datetimeSchema,\n source: z.union([z.literal('sifa'), z.literal('atmosphere')]),\n id: z.string().min(1),\n});\n\ninterface BufferLike {\n from: (input: string, encoding: 'utf-8' | 'base64') => { toString: (encoding: string) => string };\n}\n\ninterface Base64Global {\n btoa?: (input: string) => string;\n atob?: (input: string) => string;\n Buffer?: BufferLike;\n}\n\nfunction toBase64Url(input: string): string {\n const g = globalThis as unknown as Base64Global;\n const b64: string =\n typeof g.btoa === 'function'\n ? g.btoa(unescape(encodeURIComponent(input)))\n : (g.Buffer as BufferLike).from(input, 'utf-8').toString('base64');\n // Strip up to 2 trailing '=' (base64 padding). CodeQL flags `/=+$/` as a\n // polynomial regex on tainted input; we don't accept tainted input here,\n // but the deterministic loop sidesteps the alert.\n let end = b64.length;\n while (end > 0 && b64.charCodeAt(end - 1) === 61) end--;\n return b64.slice(0, end).replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n\nfunction fromBase64Url(input: string): string {\n const padded = input.replace(/-/g, '+').replace(/_/g, '/') + '==='.slice((input.length + 3) % 4);\n const g = globalThis as unknown as Base64Global;\n if (typeof g.atob === 'function') {\n return decodeURIComponent(escape(g.atob(padded)));\n }\n return (g.Buffer as BufferLike).from(padded, 'base64').toString('utf-8');\n}\n\nexport function encodeFeedCursor(cursor: FeedCursor): string {\n return toBase64Url(JSON.stringify(cursor));\n}\n\nexport function decodeFeedCursor(encoded: string): FeedCursor {\n const json = fromBase64Url(encoded);\n const parsed: unknown = JSON.parse(json);\n return FeedCursorSchema.parse(parsed);\n}\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,aAAa,WAAW,gBAAgB,iBAAiB;AAa3D,IAAM,kBAAkB,EAAE,OAAO;AAAA,EACtC,KAAK;AAAA,EACL,QAAQ,EAAE,OAAO;AAAA,EACjB,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAID,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,IAAI,EAAE,OAAO;AAAA,EACb,OAAO;AAAA,EACP,WAAW;AAAA,EACX,WAAW,EAAE,OAAO;AACtB,CAAC;AASM,IAAM,qBAAqB,mBAAmB,OAAO;AAAA,EAC1D,QAAQ,EAAE,QAAQ,MAAM;AAAA,EACxB,OAAO,EAAE,QAAQ,MAAM,EAAE,SAAS;AAAA,EAClC,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAC3C,CAAC;AAuBM,IAAM,2BAA2B,mBAAmB,OAAO;AAAA,EAChE,QAAQ,EAAE,QAAQ,YAAY;AAAA,EAC9B,OAAO,EAAE,OAAO;AAAA,EAChB,KAAK,YAAY,SAAS;AAAA,EAC1B,KAAK,UAAU,SAAS;AAAA,EACxB,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAC3C,CAAC;AAkBM,IAAM,uBAAuB,EAAE,mBAAmB,UAAU;AAAA,EACjE;AAAA,EACA;AACF,CAAC;AAkBM,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,OAAO,EAAE,MAAM,oBAAoB;AAAA,EACnC,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAwBD,IAAM,mBAAmB,EAAE,OAAO;AAAA,EAChC,WAAW;AAAA,EACX,QAAQ,EAAE,MAAM,CAAC,EAAE,QAAQ,MAAM,GAAG,EAAE,QAAQ,YAAY,CAAC,CAAC;AAAA,EAC5D,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC;AACtB,CAAC;AAYD,SAAS,YAAY,OAAuB;AAC1C,QAAM,IAAI;AACV,QAAM,MACJ,OAAO,EAAE,SAAS,aACd,EAAE,KAAK,SAAS,mBAAmB,KAAK,CAAC,CAAC,IACzC,EAAE,OAAsB,KAAK,OAAO,OAAO,EAAE,SAAS,QAAQ;AAIrE,MAAI,MAAM,IAAI;AACd,SAAO,MAAM,KAAK,IAAI,WAAW,MAAM,CAAC,MAAM,GAAI;AAClD,SAAO,IAAI,MAAM,GAAG,GAAG,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,GAAG;AACjE;AAEA,SAAS,cAAc,OAAuB;AAC5C,QAAM,SAAS,MAAM,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,GAAG,IAAI,MAAM,OAAO,MAAM,SAAS,KAAK,CAAC;AAC/F,QAAM,IAAI;AACV,MAAI,OAAO,EAAE,SAAS,YAAY;AAChC,WAAO,mBAAmB,OAAO,EAAE,KAAK,MAAM,CAAC,CAAC;AAAA,EAClD;AACA,SAAQ,EAAE,OAAsB,KAAK,QAAQ,QAAQ,EAAE,SAAS,OAAO;AACzE;AAEO,SAAS,iBAAiB,QAA4B;AAC3D,SAAO,YAAY,KAAK,UAAU,MAAM,CAAC;AAC3C;AAEO,SAAS,iBAAiB,SAA6B;AAC5D,QAAM,OAAO,cAAc,OAAO;AAClC,QAAM,SAAkB,KAAK,MAAM,IAAI;AACvC,SAAO,iBAAiB,MAAM,MAAM;AACtC;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/schemas/follow-profile.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { datetimeSchema, didSchema } from "./shared.js";
|
|
4
|
+
var FollowProfileSchema = z.object({
|
|
5
|
+
did: didSchema,
|
|
6
|
+
handle: z.string(),
|
|
7
|
+
displayName: z.string().optional(),
|
|
8
|
+
headline: z.string().optional(),
|
|
9
|
+
avatarUrl: z.string().optional(),
|
|
10
|
+
source: z.string(),
|
|
11
|
+
claimed: z.boolean(),
|
|
12
|
+
followedAt: datetimeSchema,
|
|
13
|
+
blueskyVerified: z.boolean().optional(),
|
|
14
|
+
blueskyVerifiedAt: datetimeSchema.nullable().optional()
|
|
15
|
+
});
|
|
16
|
+
var FollowProfilePageSchema = z.object({
|
|
17
|
+
items: z.array(FollowProfileSchema),
|
|
18
|
+
cursor: z.string().nullable()
|
|
19
|
+
});
|
|
20
|
+
var FeatureAllowlistEntrySchema = z.object({
|
|
21
|
+
did: didSchema,
|
|
22
|
+
addedAt: datetimeSchema,
|
|
23
|
+
note: z.string().nullable().optional()
|
|
24
|
+
});
|
|
25
|
+
var FEATURE_FLAGS = ["FEED_V5_ENABLED"];
|
|
26
|
+
export {
|
|
27
|
+
FEATURE_FLAGS,
|
|
28
|
+
FeatureAllowlistEntrySchema,
|
|
29
|
+
FollowProfilePageSchema,
|
|
30
|
+
FollowProfileSchema
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=follow-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/follow-profile.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { datetimeSchema, didSchema } from './shared.js';\n\n/**\n * Profile row shared across `/api/following`, `/api/profile/:handleOrDid/mutuals`,\n * and `/api/me/bluesky-suggestions`. Matches the existing `FollowProfile` TS\n * interface byte-for-byte but adds runtime validation for the SDK's pagination\n * helpers and the upcoming `sifa-app` consumer (where we can't trust the wire).\n *\n * Per `sifa-api#674` PR body: mutuals + bluesky-suggestions reuse this shape\n * exactly, so a single Zod schema covers all three endpoints.\n */\nexport const FollowProfileSchema = z.object({\n did: didSchema,\n handle: z.string(),\n displayName: z.string().optional(),\n headline: z.string().optional(),\n avatarUrl: z.string().optional(),\n source: z.string(),\n claimed: z.boolean(),\n followedAt: datetimeSchema,\n blueskyVerified: z.boolean().optional(),\n blueskyVerifiedAt: datetimeSchema.nullable().optional(),\n});\n\nexport type FollowProfileItem = z.infer<typeof FollowProfileSchema>;\n\n/**\n * Cursor-paginated page of {@link FollowProfileSchema} rows. Used by mutuals\n * + bluesky-suggestions. The legacy `/api/following` endpoint uses a different\n * wrapper key (`follows` instead of `items`) and is intentionally NOT covered\n * by this schema.\n */\nexport const FollowProfilePageSchema = z.object({\n items: z.array(FollowProfileSchema),\n cursor: z.string().nullable(),\n});\n\nexport type FollowProfilePage = z.infer<typeof FollowProfilePageSchema>;\n\n/**\n * Per-flag allowlist row returned by `GET /api/admin/feature-allowlists/:flag`.\n * Mirrors the `feature_allowlists` table; `note` is optional free-form text.\n */\nexport const FeatureAllowlistEntrySchema = z.object({\n did: didSchema,\n addedAt: datetimeSchema,\n note: z.string().nullable().optional(),\n});\n\nexport type FeatureAllowlistEntry = z.infer<typeof FeatureAllowlistEntrySchema>;\n\n/**\n * Known feature flags accepted by the admin allowlist endpoints. Mirrors the\n * server-side `FEATURE_FLAGS` const in `sifa-api`. Kept as a `const` tuple so\n * consumers can `as const`-narrow when building UIs.\n */\nexport const FEATURE_FLAGS = ['FEED_V5_ENABLED'] as const;\nexport type FeatureFlag = (typeof FEATURE_FLAGS)[number];\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,gBAAgB,iBAAiB;AAWnC,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,KAAK;AAAA,EACL,QAAQ,EAAE,OAAO;AAAA,EACjB,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,QAAQ,EAAE,OAAO;AAAA,EACjB,SAAS,EAAE,QAAQ;AAAA,EACnB,YAAY;AAAA,EACZ,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,mBAAmB,eAAe,SAAS,EAAE,SAAS;AACxD,CAAC;AAUM,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,OAAO,EAAE,MAAM,mBAAmB;AAAA,EAClC,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAQM,IAAM,8BAA8B,EAAE,OAAO;AAAA,EAClD,KAAK;AAAA,EACL,SAAS;AAAA,EACT,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AACvC,CAAC;AASM,IAAM,gBAAgB,CAAC,iBAAiB;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/schemas/graph-follow.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { datetimeSchema, didSchema, maxGraphemes } from "./shared.js";
|
|
4
|
+
var GraphFollowRecordSchema = z.object({
|
|
5
|
+
subject: didSchema,
|
|
6
|
+
createdAt: datetimeSchema,
|
|
7
|
+
note: z.string().refine(maxGraphemes(200), "note must be at most 200 graphemes").optional()
|
|
8
|
+
});
|
|
9
|
+
function makeGraphFollowRecordSchema(followerDid) {
|
|
10
|
+
return GraphFollowRecordSchema.refine((record) => record.subject !== followerDid, {
|
|
11
|
+
message: "Self-follow is not allowed",
|
|
12
|
+
path: ["subject"]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
GraphFollowRecordSchema,
|
|
17
|
+
makeGraphFollowRecordSchema
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=graph-follow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/graph-follow.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.graph.follow` records.\n *\n * One-way professional follow; the record lives in the follower's PDS. Per\n * iter-1 decisions (`plans/2026-06-01-in-sifa-follow-primitive.md`), this is\n * a **distinct** graph from `app.bsky.graph.follow`, not a superset — but\n * the required field shape (`subject` + `createdAt`) is intentionally\n * identical so generic Bluesky `listRecords` consumers get usable records.\n *\n * `note` is a Sifa addition: an optional reason for the follow (\"why I\n * followed\"). Capped at 200 graphemes to match other profile-flavored\n * lexicon fields.\n */\nexport const GraphFollowRecordSchema = z.object({\n subject: didSchema,\n createdAt: datetimeSchema,\n note: z.string().refine(maxGraphemes(200), 'note must be at most 200 graphemes').optional(),\n});\n\nexport type GraphFollowRecord = z.infer<typeof GraphFollowRecordSchema>;\n\n/**\n * Build a `GraphFollowRecordSchema` that rejects self-follow at the Zod\n * layer (CLAUDE.md mandatory standards #3 — input validation; sifa-api#673\n * E8 — defence in depth).\n *\n * Use this on the **client side** when constructing a new follow record\n * (the follower DID is the authenticated user). The plain\n * {@link GraphFollowRecordSchema} stays without the refine so firehose\n * consumers can validate records without context.\n */\nexport function makeGraphFollowRecordSchema(followerDid: string) {\n return GraphFollowRecordSchema.refine((record) => record.subject !== followerDid, {\n message: 'Self-follow is not allowed',\n path: ['subject'],\n });\n}\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,gBAAgB,WAAW,oBAAoB;AAejD,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM,EAAE,OAAO,EAAE,OAAO,aAAa,GAAG,GAAG,oCAAoC,EAAE,SAAS;AAC5F,CAAC;AAcM,SAAS,4BAA4B,aAAqB;AAC/D,SAAO,wBAAwB,OAAO,CAAC,WAAW,OAAO,YAAY,aAAa;AAAA,IAChF,SAAS;AAAA,IACT,MAAM,CAAC,SAAS;AAAA,EAClB,CAAC;AACH;","names":[]}
|