@singi-labs/sifa-sdk 0.19.44 → 0.19.45
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.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 +100 -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 +29 -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 +1 -1
- package/dist/index.js +675 -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.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 +31 -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.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.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
|
@@ -1,2047 +1,362 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
// src/query/fetchers/index.ts
|
|
2
|
+
import {
|
|
3
|
+
ApiError,
|
|
4
|
+
apiFetch,
|
|
5
|
+
apiFetchOrNull,
|
|
6
|
+
apiWrite,
|
|
7
|
+
apiWriteCreate
|
|
8
|
+
} from "../client.js";
|
|
9
|
+
import { fetchAtFundLink, fetchProfile } from "./profile.js";
|
|
10
|
+
import { fetchGetProfileView } from "./get-profile-view.js";
|
|
11
|
+
import {
|
|
12
|
+
deleteAvatarOverride,
|
|
13
|
+
deleteNamePronunciationAudio,
|
|
14
|
+
refreshPds,
|
|
15
|
+
updateProfileOverride,
|
|
16
|
+
updateProfileSelf,
|
|
17
|
+
uploadAvatar,
|
|
18
|
+
uploadNamePronunciationAudio
|
|
19
|
+
} from "./profile-mutations.js";
|
|
20
|
+
import {
|
|
21
|
+
createPosition,
|
|
22
|
+
deletePosition,
|
|
23
|
+
linkSkillToPosition,
|
|
24
|
+
setPositionPrimary,
|
|
25
|
+
unlinkSkillFromPosition,
|
|
26
|
+
unsetPositionPrimary,
|
|
27
|
+
updatePosition
|
|
28
|
+
} from "./positions.js";
|
|
29
|
+
import { createEducation, deleteEducation, updateEducation } from "./education.js";
|
|
30
|
+
import { setSectionPrimary, unsetSectionPrimary } from "./section-primary.js";
|
|
31
|
+
import { createSkill, deleteSkill, updateSkill } from "./skills.js";
|
|
32
|
+
import { createRecord, deleteRecord, updateRecord } from "./records.js";
|
|
33
|
+
import {
|
|
34
|
+
createProfileLocation,
|
|
35
|
+
deleteProfileLocation,
|
|
36
|
+
updateProfileLocation
|
|
37
|
+
} from "./profile-locations.js";
|
|
38
|
+
import {
|
|
39
|
+
createExternalAccount,
|
|
40
|
+
deleteExternalAccount,
|
|
41
|
+
fetchExternalAccounts,
|
|
42
|
+
setExternalAccountPrimary,
|
|
43
|
+
unsetExternalAccountPrimary,
|
|
44
|
+
updateExternalAccount,
|
|
45
|
+
verifyExternalAccount
|
|
46
|
+
} from "./external-accounts.js";
|
|
47
|
+
import {
|
|
48
|
+
createEndorsement,
|
|
49
|
+
confirmEndorsement
|
|
50
|
+
} from "./endorsements.js";
|
|
51
|
+
import {
|
|
52
|
+
fetchReceivedEndorsements
|
|
53
|
+
} from "./received-endorsements.js";
|
|
54
|
+
import {
|
|
55
|
+
fetchReciprocityCandidate
|
|
56
|
+
} from "./reciprocity.js";
|
|
57
|
+
import {
|
|
58
|
+
fetchPendingEndorsements,
|
|
59
|
+
dismissEndorsement
|
|
60
|
+
} from "./endorsement-inbox.js";
|
|
61
|
+
import {
|
|
62
|
+
fetchPendingConfirmations,
|
|
63
|
+
fetchGivenConfirmations,
|
|
64
|
+
createConfirmation,
|
|
65
|
+
dismissConfirmation,
|
|
66
|
+
revokeConfirmation
|
|
67
|
+
} from "./confirmations.js";
|
|
68
|
+
import { fetchInboxCounts } from "./inbox.js";
|
|
69
|
+
import {
|
|
70
|
+
fetchUnlinkedPositions,
|
|
71
|
+
dismissUnlinkedPosition
|
|
72
|
+
} from "./unlinked-positions.js";
|
|
73
|
+
import {
|
|
74
|
+
fetchProfileCompleteness,
|
|
75
|
+
PROFILE_COMPLETENESS_SIGNALS
|
|
76
|
+
} from "./profile-completeness.js";
|
|
77
|
+
import { hideKeytraceClaim, unhideKeytraceClaim } from "./keytrace-claims.js";
|
|
78
|
+
import { revealMarqueDomain, unrevealMarqueDomain } from "./marque-domains.js";
|
|
79
|
+
import {
|
|
80
|
+
bulkHideStandardPublications,
|
|
81
|
+
bulkUnhideStandardPublications,
|
|
82
|
+
hideOrcidPublication,
|
|
83
|
+
hideSifaPublication,
|
|
84
|
+
hideStandardPublication,
|
|
85
|
+
refreshOrcidPublications,
|
|
86
|
+
unhideOrcidPublication,
|
|
87
|
+
unhideSifaPublication,
|
|
88
|
+
unhideStandardPublication
|
|
89
|
+
} from "./publications.js";
|
|
90
|
+
import {
|
|
91
|
+
bulkHideProfileItems,
|
|
92
|
+
bulkUnhideProfileItems,
|
|
93
|
+
hideProfileItem,
|
|
94
|
+
unhideProfileItem,
|
|
95
|
+
HIDDEN_ITEM_SOURCES,
|
|
96
|
+
HIDDEN_ITEM_TYPES
|
|
97
|
+
} from "./profile-items-hide.js";
|
|
98
|
+
import {
|
|
99
|
+
fetchHiddenActivityItems,
|
|
100
|
+
hideActivityItem,
|
|
101
|
+
unhideActivityItem
|
|
102
|
+
} from "./activity-items-hide.js";
|
|
103
|
+
import { fetchStats } from "./stats.js";
|
|
104
|
+
import {
|
|
105
|
+
fetchAppsRegistry,
|
|
106
|
+
fetchHiddenApps
|
|
107
|
+
} from "./apps.js";
|
|
108
|
+
import {
|
|
109
|
+
fetchAccounts,
|
|
110
|
+
switchAccount
|
|
111
|
+
} from "./accounts.js";
|
|
112
|
+
import {
|
|
113
|
+
fetchSearchCompanies,
|
|
114
|
+
fetchSearchFilters,
|
|
115
|
+
fetchSearchProfiles,
|
|
116
|
+
fetchSkillSuggestions,
|
|
117
|
+
searchSkills
|
|
118
|
+
} from "./search.js";
|
|
119
|
+
import {
|
|
120
|
+
fetchSpeakers,
|
|
121
|
+
fetchTalks
|
|
122
|
+
} from "./speakers.js";
|
|
123
|
+
import {
|
|
124
|
+
fetchFeaturedProfile,
|
|
125
|
+
fetchSimilarProfiles,
|
|
126
|
+
fetchSuggestionCount,
|
|
127
|
+
fetchSuggestions
|
|
128
|
+
} from "./discovery.js";
|
|
129
|
+
import {
|
|
130
|
+
fetchFollowing,
|
|
131
|
+
followUser,
|
|
132
|
+
getFollowers,
|
|
133
|
+
getFollowing,
|
|
134
|
+
fetchFollowingFeed,
|
|
135
|
+
unfollowUser
|
|
136
|
+
} from "./follow.js";
|
|
137
|
+
import {
|
|
138
|
+
getBlueskySuggestions,
|
|
139
|
+
getMutuals
|
|
140
|
+
} from "./follow-extras.js";
|
|
141
|
+
import {
|
|
142
|
+
addFeatureAllowlist,
|
|
143
|
+
listFeatureAllowlist,
|
|
144
|
+
removeFeatureAllowlist
|
|
145
|
+
} from "./admin-feature-allowlists.js";
|
|
146
|
+
import {
|
|
147
|
+
getAdminReviewQueues
|
|
148
|
+
} from "./admin-review-queues.js";
|
|
149
|
+
import {
|
|
150
|
+
fetchActivityFeed,
|
|
151
|
+
fetchActivityTeaser,
|
|
152
|
+
fetchHeatmapData
|
|
153
|
+
} from "./activity.js";
|
|
154
|
+
import {
|
|
155
|
+
fetchMyGithubPullRequests
|
|
156
|
+
} from "./github-prs.js";
|
|
157
|
+
import {
|
|
158
|
+
fetchRpgStatus,
|
|
159
|
+
RpgItemStatusSchema,
|
|
160
|
+
RpgStatusResponseSchema
|
|
161
|
+
} from "./rpg.js";
|
|
162
|
+
import { fetchEndorsementCount } from "./endorsement.js";
|
|
163
|
+
import { fetchNetworkStreamCount } from "./stream.js";
|
|
164
|
+
import {
|
|
165
|
+
checkAppAccount,
|
|
166
|
+
createReaction,
|
|
167
|
+
deleteReaction,
|
|
168
|
+
fetchReactionStatus
|
|
169
|
+
} from "./reactions.js";
|
|
170
|
+
import {
|
|
171
|
+
QUOTED_POSTS_BATCH_MAX,
|
|
172
|
+
resolveQuotedPosts
|
|
173
|
+
} from "./quoted-posts.js";
|
|
174
|
+
import {
|
|
175
|
+
castRoadmapVote,
|
|
176
|
+
fetchMyRoadmapVotes,
|
|
177
|
+
fetchRoadmapVotes,
|
|
178
|
+
retractRoadmapVote
|
|
179
|
+
} from "./roadmap.js";
|
|
180
|
+
import {
|
|
181
|
+
deleteAccount,
|
|
182
|
+
fetchWipePreview,
|
|
183
|
+
resetProfile
|
|
184
|
+
} from "./destructive.js";
|
|
185
|
+
import {
|
|
186
|
+
deleteRepoRecords,
|
|
187
|
+
fetchRepoInventory,
|
|
188
|
+
repoExportUrl
|
|
189
|
+
} from "./repo-inventory.js";
|
|
190
|
+
import {
|
|
191
|
+
checkNetworkMapJobStatus,
|
|
192
|
+
fetchNetworkMap,
|
|
193
|
+
initiateNetworkMapGeneration,
|
|
194
|
+
isNetworkMapResponse
|
|
195
|
+
} from "./network-map.js";
|
|
196
|
+
import { fetchEntitySearch, selectEntity, importSearchEntities } from "./entities.js";
|
|
197
|
+
import {
|
|
198
|
+
submitOrgClaim,
|
|
199
|
+
updateOrgProfile,
|
|
200
|
+
requestOrgDomainChallenge,
|
|
201
|
+
verifyOrgDomain,
|
|
202
|
+
addOrgNotificationEmail,
|
|
203
|
+
removeOrgNotificationEmail
|
|
204
|
+
} from "./org.js";
|
|
205
|
+
import { fetchProfileSummary } from "./profile-summary.js";
|
|
206
|
+
import { sifaQueryKeys } from "../keys.js";
|
|
207
|
+
import { createInvestment, updateInvestment, deleteInvestment } from "./investments.js";
|
|
208
|
+
export {
|
|
209
|
+
ApiError,
|
|
210
|
+
HIDDEN_ITEM_SOURCES,
|
|
211
|
+
HIDDEN_ITEM_TYPES,
|
|
212
|
+
PROFILE_COMPLETENESS_SIGNALS,
|
|
213
|
+
QUOTED_POSTS_BATCH_MAX,
|
|
214
|
+
RpgItemStatusSchema,
|
|
215
|
+
RpgStatusResponseSchema,
|
|
216
|
+
addFeatureAllowlist,
|
|
217
|
+
addOrgNotificationEmail,
|
|
218
|
+
apiFetch,
|
|
219
|
+
apiFetchOrNull,
|
|
220
|
+
apiWrite,
|
|
221
|
+
apiWriteCreate,
|
|
222
|
+
bulkHideProfileItems,
|
|
223
|
+
bulkHideStandardPublications,
|
|
224
|
+
bulkUnhideProfileItems,
|
|
225
|
+
bulkUnhideStandardPublications,
|
|
226
|
+
castRoadmapVote,
|
|
227
|
+
checkAppAccount,
|
|
228
|
+
checkNetworkMapJobStatus,
|
|
229
|
+
confirmEndorsement,
|
|
230
|
+
createConfirmation,
|
|
231
|
+
createEducation,
|
|
232
|
+
createEndorsement,
|
|
233
|
+
createExternalAccount,
|
|
234
|
+
createInvestment,
|
|
235
|
+
createPosition,
|
|
236
|
+
createProfileLocation,
|
|
237
|
+
createReaction,
|
|
238
|
+
createRecord,
|
|
239
|
+
createSkill,
|
|
240
|
+
deleteAccount,
|
|
241
|
+
deleteAvatarOverride,
|
|
242
|
+
deleteEducation,
|
|
243
|
+
deleteExternalAccount,
|
|
244
|
+
deleteInvestment,
|
|
245
|
+
deleteNamePronunciationAudio,
|
|
246
|
+
deletePosition,
|
|
247
|
+
deleteProfileLocation,
|
|
248
|
+
deleteReaction,
|
|
249
|
+
deleteRecord,
|
|
250
|
+
deleteRepoRecords,
|
|
251
|
+
deleteSkill,
|
|
252
|
+
dismissConfirmation,
|
|
253
|
+
dismissEndorsement,
|
|
254
|
+
dismissUnlinkedPosition,
|
|
255
|
+
fetchAccounts,
|
|
256
|
+
fetchActivityFeed,
|
|
257
|
+
fetchActivityTeaser,
|
|
258
|
+
fetchAppsRegistry,
|
|
259
|
+
fetchAtFundLink,
|
|
260
|
+
fetchEndorsementCount,
|
|
261
|
+
fetchEntitySearch,
|
|
262
|
+
fetchExternalAccounts,
|
|
263
|
+
fetchFeaturedProfile,
|
|
264
|
+
fetchFollowing,
|
|
265
|
+
fetchFollowingFeed,
|
|
266
|
+
fetchGetProfileView,
|
|
267
|
+
fetchGivenConfirmations,
|
|
268
|
+
fetchHeatmapData,
|
|
269
|
+
fetchHiddenActivityItems,
|
|
270
|
+
fetchHiddenApps,
|
|
271
|
+
fetchInboxCounts,
|
|
272
|
+
fetchMyGithubPullRequests,
|
|
273
|
+
fetchMyRoadmapVotes,
|
|
274
|
+
fetchNetworkMap,
|
|
275
|
+
fetchNetworkStreamCount,
|
|
276
|
+
fetchPendingConfirmations,
|
|
277
|
+
fetchPendingEndorsements,
|
|
278
|
+
fetchProfile,
|
|
279
|
+
fetchProfileCompleteness,
|
|
280
|
+
fetchProfileSummary,
|
|
281
|
+
fetchReactionStatus,
|
|
282
|
+
fetchReceivedEndorsements,
|
|
283
|
+
fetchReciprocityCandidate,
|
|
284
|
+
fetchRepoInventory,
|
|
285
|
+
fetchRoadmapVotes,
|
|
286
|
+
fetchRpgStatus,
|
|
287
|
+
fetchSearchCompanies,
|
|
288
|
+
fetchSearchFilters,
|
|
289
|
+
fetchSearchProfiles,
|
|
290
|
+
fetchSimilarProfiles,
|
|
291
|
+
fetchSkillSuggestions,
|
|
292
|
+
fetchSpeakers,
|
|
293
|
+
fetchStats,
|
|
294
|
+
fetchSuggestionCount,
|
|
295
|
+
fetchSuggestions,
|
|
296
|
+
fetchTalks,
|
|
297
|
+
fetchUnlinkedPositions,
|
|
298
|
+
fetchWipePreview,
|
|
299
|
+
followUser,
|
|
300
|
+
getAdminReviewQueues,
|
|
301
|
+
getBlueskySuggestions,
|
|
302
|
+
getFollowers,
|
|
303
|
+
getFollowing,
|
|
304
|
+
getMutuals,
|
|
305
|
+
hideActivityItem,
|
|
306
|
+
hideKeytraceClaim,
|
|
307
|
+
hideOrcidPublication,
|
|
308
|
+
hideProfileItem,
|
|
309
|
+
hideSifaPublication,
|
|
310
|
+
hideStandardPublication,
|
|
311
|
+
importSearchEntities,
|
|
312
|
+
initiateNetworkMapGeneration,
|
|
313
|
+
isNetworkMapResponse,
|
|
314
|
+
linkSkillToPosition,
|
|
315
|
+
listFeatureAllowlist,
|
|
316
|
+
refreshOrcidPublications,
|
|
317
|
+
refreshPds,
|
|
318
|
+
removeFeatureAllowlist,
|
|
319
|
+
removeOrgNotificationEmail,
|
|
320
|
+
repoExportUrl,
|
|
321
|
+
requestOrgDomainChallenge,
|
|
322
|
+
resetProfile,
|
|
323
|
+
resolveQuotedPosts,
|
|
324
|
+
retractRoadmapVote,
|
|
325
|
+
revealMarqueDomain,
|
|
326
|
+
revokeConfirmation,
|
|
327
|
+
searchSkills,
|
|
328
|
+
selectEntity,
|
|
329
|
+
setExternalAccountPrimary,
|
|
330
|
+
setPositionPrimary,
|
|
331
|
+
setSectionPrimary,
|
|
332
|
+
sifaQueryKeys,
|
|
333
|
+
submitOrgClaim,
|
|
334
|
+
switchAccount,
|
|
335
|
+
unfollowUser,
|
|
336
|
+
unhideActivityItem,
|
|
337
|
+
unhideKeytraceClaim,
|
|
338
|
+
unhideOrcidPublication,
|
|
339
|
+
unhideProfileItem,
|
|
340
|
+
unhideSifaPublication,
|
|
341
|
+
unhideStandardPublication,
|
|
342
|
+
unlinkSkillFromPosition,
|
|
343
|
+
unrevealMarqueDomain,
|
|
344
|
+
unsetExternalAccountPrimary,
|
|
345
|
+
unsetPositionPrimary,
|
|
346
|
+
unsetSectionPrimary,
|
|
347
|
+
updateEducation,
|
|
348
|
+
updateExternalAccount,
|
|
349
|
+
updateInvestment,
|
|
350
|
+
updateOrgProfile,
|
|
351
|
+
updatePosition,
|
|
352
|
+
updateProfileLocation,
|
|
353
|
+
updateProfileOverride,
|
|
354
|
+
updateProfileSelf,
|
|
355
|
+
updateRecord,
|
|
356
|
+
updateSkill,
|
|
357
|
+
uploadAvatar,
|
|
358
|
+
uploadNamePronunciationAudio,
|
|
359
|
+
verifyExternalAccount,
|
|
360
|
+
verifyOrgDomain
|
|
13
361
|
};
|
|
14
|
-
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
15
|
-
var MAX_RATE_LIMIT_RETRIES = 3;
|
|
16
|
-
var RATE_LIMIT_RETRY_CAP_SECONDS = 3;
|
|
17
|
-
function encodeIdentifier(value) {
|
|
18
|
-
let decoded = value;
|
|
19
|
-
try {
|
|
20
|
-
decoded = decodeURIComponent(value);
|
|
21
|
-
} catch {
|
|
22
|
-
}
|
|
23
|
-
return encodeURIComponent(decoded);
|
|
24
|
-
}
|
|
25
|
-
async function apiFetch(config, path, options = {}) {
|
|
26
|
-
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
27
|
-
const url = `${config.baseUrl}${path}`;
|
|
28
|
-
const maxRetries = options.retryOn429 ? MAX_RATE_LIMIT_RETRIES : 0;
|
|
29
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
30
|
-
const signal = options.signal ?? AbortSignal.timeout(options.timeoutMs ?? DEFAULT_TIMEOUT_MS);
|
|
31
|
-
const headers = { ...options.headers ?? {} };
|
|
32
|
-
let body;
|
|
33
|
-
if (options.body !== void 0) {
|
|
34
|
-
headers["Content-Type"] ??= "application/json";
|
|
35
|
-
body = JSON.stringify(options.body);
|
|
36
|
-
}
|
|
37
|
-
const init = {
|
|
38
|
-
method: options.method ?? "GET",
|
|
39
|
-
headers,
|
|
40
|
-
body,
|
|
41
|
-
signal,
|
|
42
|
-
credentials: options.credentials,
|
|
43
|
-
cache: options.cache,
|
|
44
|
-
...options.next ? { next: options.next } : {}
|
|
45
|
-
};
|
|
46
|
-
const res = await fetchFn(url, init);
|
|
47
|
-
if (res.status === 429 && attempt < maxRetries) {
|
|
48
|
-
const retryAfterRaw = res.headers.get("retry-after");
|
|
49
|
-
const retryAfter = retryAfterRaw ? Number.parseInt(retryAfterRaw, 10) : 2;
|
|
50
|
-
const waitSeconds = Math.min(
|
|
51
|
-
Number.isFinite(retryAfter) ? retryAfter : 2,
|
|
52
|
-
RATE_LIMIT_RETRY_CAP_SECONDS
|
|
53
|
-
);
|
|
54
|
-
await new Promise((r) => setTimeout(r, waitSeconds * 1e3));
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (!res.ok) {
|
|
58
|
-
let errBody;
|
|
59
|
-
try {
|
|
60
|
-
errBody = await res.json();
|
|
61
|
-
} catch {
|
|
62
|
-
try {
|
|
63
|
-
errBody = await res.text();
|
|
64
|
-
} catch {
|
|
65
|
-
errBody = void 0;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
throw new ApiError(`Sifa API ${res.status} on ${path}`, res.status, errBody);
|
|
69
|
-
}
|
|
70
|
-
if (res.status === 204 || res.status === 205) {
|
|
71
|
-
return void 0;
|
|
72
|
-
}
|
|
73
|
-
return await res.json();
|
|
74
|
-
}
|
|
75
|
-
throw new ApiError(`Sifa API exhausted retries on ${path}`, 429);
|
|
76
|
-
}
|
|
77
|
-
async function apiFetchOrNull(config, path, options = {}) {
|
|
78
|
-
try {
|
|
79
|
-
return await apiFetch(config, path, options);
|
|
80
|
-
} catch (e) {
|
|
81
|
-
if (e instanceof ApiError && e.status === 404) return null;
|
|
82
|
-
throw e;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function extractWriteError(data, status) {
|
|
86
|
-
const body = data ?? {};
|
|
87
|
-
return {
|
|
88
|
-
error: body.message ?? `Request failed (${status})`,
|
|
89
|
-
...body.pdsHost ? { pdsHost: body.pdsHost } : {}
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
async function apiWrite(config, path, method, options = {}) {
|
|
93
|
-
try {
|
|
94
|
-
const data = await apiFetch(config, path, {
|
|
95
|
-
method,
|
|
96
|
-
credentials: "include",
|
|
97
|
-
...options
|
|
98
|
-
});
|
|
99
|
-
return { success: true, ...data ?? {} };
|
|
100
|
-
} catch (e) {
|
|
101
|
-
if (e instanceof ApiError) {
|
|
102
|
-
return { success: false, ...extractWriteError(e.body, e.status) };
|
|
103
|
-
}
|
|
104
|
-
return { success: false, error: "Network error" };
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function apiWriteCreate(config, path, body, options = {}) {
|
|
108
|
-
return apiWrite(config, path, "POST", {
|
|
109
|
-
body,
|
|
110
|
-
...options
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// src/query/fetchers/profile.ts
|
|
115
|
-
function fetchProfile(config, handleOrDid, options = {}) {
|
|
116
|
-
const path = `/api/profile/${encodeIdentifier(handleOrDid)}`;
|
|
117
|
-
return apiFetchOrNull(config, path, {
|
|
118
|
-
retryOn429: true,
|
|
119
|
-
...options
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
async function fetchAtFundLink(config, did, options = {}) {
|
|
123
|
-
const path = `/api/profiles/${encodeIdentifier(did)}/at-fund-link`;
|
|
124
|
-
try {
|
|
125
|
-
const data = await apiFetch(config, path, {
|
|
126
|
-
next: { revalidate: 3600 },
|
|
127
|
-
timeoutMs: 5e3,
|
|
128
|
-
...options
|
|
129
|
-
});
|
|
130
|
-
return typeof data.url === "string" ? data.url : null;
|
|
131
|
-
} catch {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// src/query/fetchers/get-profile-view.ts
|
|
137
|
-
async function fetchGetProfileView(config, actor, options = {}) {
|
|
138
|
-
const path = `/xrpc/id.sifa.getProfileView?actor=${encodeIdentifier(actor)}`;
|
|
139
|
-
try {
|
|
140
|
-
return await apiFetch(config, path, { retryOn429: true, ...options });
|
|
141
|
-
} catch (e) {
|
|
142
|
-
if (e instanceof ApiError && e.status === 400 && typeof e.body === "object" && e.body !== null && e.body.error === "ProfileNotFound") {
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
throw e;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// src/query/fetchers/profile-mutations.ts
|
|
150
|
-
function updateProfileSelf(config, data, options = {}) {
|
|
151
|
-
return apiWrite(config, "/api/profile/self", "PUT", { body: data, ...options });
|
|
152
|
-
}
|
|
153
|
-
function updateProfileOverride(config, data, options = {}) {
|
|
154
|
-
return apiWrite(config, "/api/profile/override", "PUT", { body: data, ...options });
|
|
155
|
-
}
|
|
156
|
-
function refreshPds(config, options = {}) {
|
|
157
|
-
return apiWrite(
|
|
158
|
-
config,
|
|
159
|
-
"/api/profile/refresh-pds",
|
|
160
|
-
"POST",
|
|
161
|
-
options
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
async function uploadAvatar(config, file, options = {}) {
|
|
165
|
-
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
166
|
-
const url = `${config.baseUrl}/api/profile/avatar`;
|
|
167
|
-
const formData = new FormData();
|
|
168
|
-
formData.append("file", file);
|
|
169
|
-
try {
|
|
170
|
-
const res = await fetchFn(url, {
|
|
171
|
-
method: "POST",
|
|
172
|
-
credentials: options.credentials ?? "include",
|
|
173
|
-
body: formData,
|
|
174
|
-
signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 3e4),
|
|
175
|
-
headers: options.headers
|
|
176
|
-
});
|
|
177
|
-
if (!res.ok) {
|
|
178
|
-
const errBody = await res.json().catch(() => ({}));
|
|
179
|
-
const msg = errBody.message ?? `Request failed (${res.status})`;
|
|
180
|
-
const pdsHost = errBody.pdsHost;
|
|
181
|
-
return { success: false, error: msg, ...pdsHost ? { pdsHost } : {} };
|
|
182
|
-
}
|
|
183
|
-
const data = await res.json();
|
|
184
|
-
return { success: true, url: data.url };
|
|
185
|
-
} catch {
|
|
186
|
-
return { success: false, error: "Network error" };
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function deleteAvatarOverride(config, options = {}) {
|
|
190
|
-
return apiWrite(config, "/api/profile/avatar", "DELETE", options);
|
|
191
|
-
}
|
|
192
|
-
async function uploadNamePronunciationAudio(config, file, options = {}) {
|
|
193
|
-
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
194
|
-
const url = `${config.baseUrl}/api/profile/pronunciation-audio`;
|
|
195
|
-
const formData = new FormData();
|
|
196
|
-
formData.append("file", file);
|
|
197
|
-
try {
|
|
198
|
-
const res = await fetchFn(url, {
|
|
199
|
-
method: "POST",
|
|
200
|
-
credentials: options.credentials ?? "include",
|
|
201
|
-
body: formData,
|
|
202
|
-
signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 3e4),
|
|
203
|
-
headers: options.headers
|
|
204
|
-
});
|
|
205
|
-
if (!res.ok) {
|
|
206
|
-
const errBody = await res.json().catch(() => ({}));
|
|
207
|
-
const msg = errBody.message ?? `Request failed (${res.status})`;
|
|
208
|
-
const pdsHost = errBody.pdsHost;
|
|
209
|
-
return { success: false, error: msg, ...pdsHost ? { pdsHost } : {} };
|
|
210
|
-
}
|
|
211
|
-
const data = await res.json();
|
|
212
|
-
return { success: true, url: data.url };
|
|
213
|
-
} catch {
|
|
214
|
-
return { success: false, error: "Network error" };
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function deleteNamePronunciationAudio(config, options = {}) {
|
|
218
|
-
return apiWrite(config, "/api/profile/pronunciation-audio", "DELETE", options);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// src/query/fetchers/positions.ts
|
|
222
|
-
function createPosition(config, data, options = {}) {
|
|
223
|
-
return apiWriteCreate(config, "/api/profile/position", data, options);
|
|
224
|
-
}
|
|
225
|
-
function updatePosition(config, rkey, data, options = {}) {
|
|
226
|
-
return apiWrite(config, `/api/profile/position/${encodeURIComponent(rkey)}`, "PUT", {
|
|
227
|
-
body: data,
|
|
228
|
-
...options
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
function deletePosition(config, rkey, options = {}) {
|
|
232
|
-
return apiWrite(config, `/api/profile/position/${encodeURIComponent(rkey)}`, "DELETE", options);
|
|
233
|
-
}
|
|
234
|
-
function setPositionPrimary(config, rkey, options = {}) {
|
|
235
|
-
return apiWrite(
|
|
236
|
-
config,
|
|
237
|
-
`/api/profile/position/${encodeURIComponent(rkey)}/primary`,
|
|
238
|
-
"PUT",
|
|
239
|
-
options
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
function unsetPositionPrimary(config, rkey, options = {}) {
|
|
243
|
-
return apiWrite(
|
|
244
|
-
config,
|
|
245
|
-
`/api/profile/position/${encodeURIComponent(rkey)}/primary`,
|
|
246
|
-
"DELETE",
|
|
247
|
-
options
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
function buildPositionPayload(position, skills) {
|
|
251
|
-
return {
|
|
252
|
-
company: position.company,
|
|
253
|
-
title: position.title,
|
|
254
|
-
description: position.description,
|
|
255
|
-
startedAt: position.startedAt,
|
|
256
|
-
endedAt: position.endedAt,
|
|
257
|
-
location: position.location ?? void 0,
|
|
258
|
-
// Carry the form-controlled optional fields the AppView merge would
|
|
259
|
-
// otherwise clear when absent from the PUT body. Omitting them here made
|
|
260
|
-
// every link/unlink strip employmentType, workplaceType, and entityRef
|
|
261
|
-
// off the position (id.sifa.profile.position#skills round-trip).
|
|
262
|
-
employmentType: position.employmentType,
|
|
263
|
-
workplaceType: position.workplaceType,
|
|
264
|
-
entityRef: position.entityRef,
|
|
265
|
-
skills
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
function linkSkillToPosition(config, position, skillRef, options = {}) {
|
|
269
|
-
const currentSkills = position.skills ?? [];
|
|
270
|
-
if (currentSkills.some((s) => s.uri === skillRef.uri)) {
|
|
271
|
-
return Promise.resolve({ success: true });
|
|
272
|
-
}
|
|
273
|
-
return updatePosition(
|
|
274
|
-
config,
|
|
275
|
-
position.rkey,
|
|
276
|
-
buildPositionPayload(position, [...currentSkills, skillRef]),
|
|
277
|
-
options
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
function unlinkSkillFromPosition(config, position, skillRef, options = {}) {
|
|
281
|
-
const remaining = (position.skills ?? []).filter((s) => s.uri !== skillRef.uri);
|
|
282
|
-
return updatePosition(config, position.rkey, buildPositionPayload(position, remaining), options);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// src/query/fetchers/education.ts
|
|
286
|
-
function createEducation(config, data, options = {}) {
|
|
287
|
-
return apiWriteCreate(config, "/api/profile/education", data, options);
|
|
288
|
-
}
|
|
289
|
-
function updateEducation(config, rkey, data, options = {}) {
|
|
290
|
-
return apiWrite(config, `/api/profile/education/${encodeURIComponent(rkey)}`, "PUT", {
|
|
291
|
-
body: data,
|
|
292
|
-
...options
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
function deleteEducation(config, rkey, options = {}) {
|
|
296
|
-
return apiWrite(config, `/api/profile/education/${encodeURIComponent(rkey)}`, "DELETE", options);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// src/query/fetchers/section-primary.ts
|
|
300
|
-
function setSectionPrimary(config, section, rkey, options = {}) {
|
|
301
|
-
return apiWrite(
|
|
302
|
-
config,
|
|
303
|
-
`/api/profile/${section}/${encodeURIComponent(rkey)}/primary`,
|
|
304
|
-
"PUT",
|
|
305
|
-
options
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
function unsetSectionPrimary(config, section, rkey, options = {}) {
|
|
309
|
-
return apiWrite(
|
|
310
|
-
config,
|
|
311
|
-
`/api/profile/${section}/${encodeURIComponent(rkey)}/primary`,
|
|
312
|
-
"DELETE",
|
|
313
|
-
options
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
// src/query/fetchers/skills.ts
|
|
318
|
-
function createSkill(config, data, options = {}) {
|
|
319
|
-
return apiWriteCreate(config, "/api/profile/skill", data, options);
|
|
320
|
-
}
|
|
321
|
-
function updateSkill(config, rkey, data, options = {}) {
|
|
322
|
-
return apiWrite(config, `/api/profile/skill/${encodeURIComponent(rkey)}`, "PUT", {
|
|
323
|
-
body: data,
|
|
324
|
-
...options
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
function deleteSkill(config, rkey, options = {}) {
|
|
328
|
-
return apiWrite(config, `/api/profile/skill/${encodeURIComponent(rkey)}`, "DELETE", options);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
// src/query/fetchers/records.ts
|
|
332
|
-
function createRecord(config, collection, data, options = {}) {
|
|
333
|
-
return apiWriteCreate(
|
|
334
|
-
config,
|
|
335
|
-
`/api/profile/records/${encodeURIComponent(collection)}`,
|
|
336
|
-
data,
|
|
337
|
-
options
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
function updateRecord(config, collection, rkey, data, options = {}) {
|
|
341
|
-
const path = `/api/profile/records/${encodeURIComponent(collection)}/${encodeURIComponent(rkey)}`;
|
|
342
|
-
return apiWrite(config, path, "PUT", { body: data, ...options });
|
|
343
|
-
}
|
|
344
|
-
function deleteRecord(config, collection, rkey, options = {}) {
|
|
345
|
-
const path = `/api/profile/records/${encodeURIComponent(collection)}/${encodeURIComponent(rkey)}`;
|
|
346
|
-
return apiWrite(config, path, "DELETE", options);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// src/query/fetchers/profile-locations.ts
|
|
350
|
-
function createProfileLocation(config, data, options = {}) {
|
|
351
|
-
return apiWriteCreate(config, "/api/profile/location", data, options);
|
|
352
|
-
}
|
|
353
|
-
function updateProfileLocation(config, rkey, data, options = {}) {
|
|
354
|
-
return apiWrite(config, `/api/profile/location/${encodeURIComponent(rkey)}`, "PUT", {
|
|
355
|
-
body: data,
|
|
356
|
-
...options
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
function deleteProfileLocation(config, rkey, options = {}) {
|
|
360
|
-
return apiWrite(config, `/api/profile/location/${encodeURIComponent(rkey)}`, "DELETE", options);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// src/query/fetchers/external-accounts.ts
|
|
364
|
-
async function fetchExternalAccounts(config, handleOrDid, options = {}) {
|
|
365
|
-
const path = `/api/profile/${encodeIdentifier(handleOrDid)}/external-accounts`;
|
|
366
|
-
try {
|
|
367
|
-
const data = await apiFetch(config, path, {
|
|
368
|
-
credentials: "include",
|
|
369
|
-
...options
|
|
370
|
-
});
|
|
371
|
-
return data.accounts ?? [];
|
|
372
|
-
} catch {
|
|
373
|
-
return [];
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
function createExternalAccount(config, data, options = {}) {
|
|
377
|
-
return apiWrite(
|
|
378
|
-
config,
|
|
379
|
-
"/api/profile/external-accounts",
|
|
380
|
-
"POST",
|
|
381
|
-
{ body: data, ...options }
|
|
382
|
-
);
|
|
383
|
-
}
|
|
384
|
-
function updateExternalAccount(config, rkey, data, options = {}) {
|
|
385
|
-
return apiWrite(config, `/api/profile/external-accounts/${encodeURIComponent(rkey)}`, "PUT", {
|
|
386
|
-
body: data,
|
|
387
|
-
...options
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
function deleteExternalAccount(config, rkey, options = {}) {
|
|
391
|
-
return apiWrite(
|
|
392
|
-
config,
|
|
393
|
-
`/api/profile/external-accounts/${encodeURIComponent(rkey)}`,
|
|
394
|
-
"DELETE",
|
|
395
|
-
options
|
|
396
|
-
);
|
|
397
|
-
}
|
|
398
|
-
function setExternalAccountPrimary(config, rkey, options = {}) {
|
|
399
|
-
return apiWrite(
|
|
400
|
-
config,
|
|
401
|
-
`/api/profile/external-accounts/${encodeURIComponent(rkey)}/primary`,
|
|
402
|
-
"PUT",
|
|
403
|
-
options
|
|
404
|
-
);
|
|
405
|
-
}
|
|
406
|
-
function unsetExternalAccountPrimary(config, rkey, options = {}) {
|
|
407
|
-
return apiWrite(
|
|
408
|
-
config,
|
|
409
|
-
`/api/profile/external-accounts/${encodeURIComponent(rkey)}/primary`,
|
|
410
|
-
"DELETE",
|
|
411
|
-
options
|
|
412
|
-
);
|
|
413
|
-
}
|
|
414
|
-
function verifyExternalAccount(config, rkey, options = {}) {
|
|
415
|
-
return apiWrite(
|
|
416
|
-
config,
|
|
417
|
-
`/api/profile/external-accounts/${encodeURIComponent(rkey)}/verify`,
|
|
418
|
-
"POST",
|
|
419
|
-
{ body: {}, ...options }
|
|
420
|
-
);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
// src/query/fetchers/endorsements.ts
|
|
424
|
-
function createEndorsement(config, data, options = {}) {
|
|
425
|
-
return apiWriteCreate(config, "/api/endorsement", data, options);
|
|
426
|
-
}
|
|
427
|
-
function confirmEndorsement(config, data, options = {}) {
|
|
428
|
-
return apiWriteCreate(
|
|
429
|
-
config,
|
|
430
|
-
"/api/endorsement/confirm",
|
|
431
|
-
data,
|
|
432
|
-
options
|
|
433
|
-
);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
// src/query/fetchers/received-endorsements.ts
|
|
437
|
-
async function fetchReceivedEndorsements(config, did, options = {}) {
|
|
438
|
-
const { limit, ...fetchOptions } = options;
|
|
439
|
-
const qs = limit ? `?limit=${limit}` : "";
|
|
440
|
-
try {
|
|
441
|
-
const data = await apiFetch(
|
|
442
|
-
config,
|
|
443
|
-
`/api/endorsement/${encodeIdentifier(did)}${qs}`,
|
|
444
|
-
{ cache: "no-store", timeoutMs: 5e3, ...fetchOptions }
|
|
445
|
-
);
|
|
446
|
-
return { endorsements: data?.endorsements ?? [], cursor: data?.cursor };
|
|
447
|
-
} catch {
|
|
448
|
-
return { endorsements: [] };
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
// src/query/fetchers/reciprocity.ts
|
|
453
|
-
async function fetchReciprocityCandidate(config, options = {}) {
|
|
454
|
-
try {
|
|
455
|
-
const data = await apiFetch(
|
|
456
|
-
config,
|
|
457
|
-
"/api/endorsements/reciprocity-candidate",
|
|
458
|
-
{
|
|
459
|
-
cache: "no-store",
|
|
460
|
-
credentials: "include",
|
|
461
|
-
timeoutMs: 5e3,
|
|
462
|
-
...options
|
|
463
|
-
}
|
|
464
|
-
);
|
|
465
|
-
return data?.candidate ?? null;
|
|
466
|
-
} catch {
|
|
467
|
-
return null;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
// src/query/fetchers/endorsement-inbox.ts
|
|
472
|
-
var PENDING_ENDORSEMENTS_LXM = "id.sifa.endorsement.getPending";
|
|
473
|
-
async function fetchPendingEndorsements(config, options = {}) {
|
|
474
|
-
const { cookieHeader, ...rest } = options;
|
|
475
|
-
const headers = { ...rest.headers ?? {} };
|
|
476
|
-
if (cookieHeader) headers.cookie = cookieHeader;
|
|
477
|
-
if (config.getAuthToken) {
|
|
478
|
-
const token = await config.getAuthToken(PENDING_ENDORSEMENTS_LXM);
|
|
479
|
-
if (token) headers.Authorization = `Bearer ${token}`;
|
|
480
|
-
}
|
|
481
|
-
try {
|
|
482
|
-
const data = await apiFetch(config, "/api/endorsements/pending", {
|
|
483
|
-
cache: "no-store",
|
|
484
|
-
credentials: "include",
|
|
485
|
-
timeoutMs: 5e3,
|
|
486
|
-
...rest,
|
|
487
|
-
headers
|
|
488
|
-
});
|
|
489
|
-
return { endorsements: data?.endorsements ?? [], cursor: data?.cursor };
|
|
490
|
-
} catch {
|
|
491
|
-
return { endorsements: [] };
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function dismissEndorsement(config, data, options = {}) {
|
|
495
|
-
return apiWrite(config, "/api/endorsement/dismiss", "POST", { body: data, ...options });
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
// src/query/fetchers/confirmations.ts
|
|
499
|
-
async function fetchPendingConfirmations(config, options = {}) {
|
|
500
|
-
const { cookieHeader, ...rest } = options;
|
|
501
|
-
const headers = { ...rest.headers ?? {} };
|
|
502
|
-
if (cookieHeader) headers.cookie = cookieHeader;
|
|
503
|
-
try {
|
|
504
|
-
const data = await apiFetch(config, "/api/confirmations/pending", {
|
|
505
|
-
cache: "no-store",
|
|
506
|
-
credentials: "include",
|
|
507
|
-
timeoutMs: 5e3,
|
|
508
|
-
...rest,
|
|
509
|
-
headers
|
|
510
|
-
});
|
|
511
|
-
return { confirmations: data?.confirmations ?? [], cursor: data?.cursor };
|
|
512
|
-
} catch {
|
|
513
|
-
return { confirmations: [] };
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
async function fetchGivenConfirmations(config, options = {}) {
|
|
517
|
-
const { cookieHeader, ...rest } = options;
|
|
518
|
-
const headers = { ...rest.headers ?? {} };
|
|
519
|
-
if (cookieHeader) headers.cookie = cookieHeader;
|
|
520
|
-
try {
|
|
521
|
-
const data = await apiFetch(
|
|
522
|
-
config,
|
|
523
|
-
"/api/confirmations/mine",
|
|
524
|
-
{ cache: "no-store", credentials: "include", timeoutMs: 5e3, ...rest, headers }
|
|
525
|
-
);
|
|
526
|
-
return { confirmations: data?.confirmations ?? [] };
|
|
527
|
-
} catch {
|
|
528
|
-
return { confirmations: [] };
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
function createConfirmation(config, data, options = {}) {
|
|
532
|
-
return apiWriteCreate(config, "/api/confirmation", data, options);
|
|
533
|
-
}
|
|
534
|
-
function dismissConfirmation(config, data, options = {}) {
|
|
535
|
-
return apiWrite(config, "/api/confirmation/dismiss", "POST", { body: data, ...options });
|
|
536
|
-
}
|
|
537
|
-
function revokeConfirmation(config, data, options = {}) {
|
|
538
|
-
return apiWrite(config, "/api/confirmation/revoke", "POST", { body: data, ...options });
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
// src/query/fetchers/inbox.ts
|
|
542
|
-
function toCount(value) {
|
|
543
|
-
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.trunc(value) : 0;
|
|
544
|
-
}
|
|
545
|
-
async function fetchInboxCounts(config, options = {}) {
|
|
546
|
-
const { cookieHeader, ...rest } = options;
|
|
547
|
-
const headers = { ...rest.headers ?? {} };
|
|
548
|
-
if (cookieHeader) headers.cookie = cookieHeader;
|
|
549
|
-
try {
|
|
550
|
-
const data = await apiFetch(config, "/api/inbox/counts", {
|
|
551
|
-
cache: "no-store",
|
|
552
|
-
credentials: "include",
|
|
553
|
-
timeoutMs: 5e3,
|
|
554
|
-
...rest,
|
|
555
|
-
headers
|
|
556
|
-
});
|
|
557
|
-
return {
|
|
558
|
-
tasks: toCount(data?.tasks),
|
|
559
|
-
unreadNotifications: toCount(data?.unreadNotifications)
|
|
560
|
-
};
|
|
561
|
-
} catch {
|
|
562
|
-
return { tasks: 0, unreadNotifications: 0 };
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
// src/query/fetchers/unlinked-positions.ts
|
|
567
|
-
async function fetchUnlinkedPositions(config, options = {}) {
|
|
568
|
-
const { cookieHeader, ...rest } = options;
|
|
569
|
-
const headers = { ...rest.headers ?? {} };
|
|
570
|
-
if (cookieHeader) headers.cookie = cookieHeader;
|
|
571
|
-
try {
|
|
572
|
-
const data = await apiFetch(config, "/api/positions/unlinked", {
|
|
573
|
-
cache: "no-store",
|
|
574
|
-
credentials: "include",
|
|
575
|
-
timeoutMs: 5e3,
|
|
576
|
-
...rest,
|
|
577
|
-
headers
|
|
578
|
-
});
|
|
579
|
-
return { positions: Array.isArray(data?.positions) ? data.positions : [] };
|
|
580
|
-
} catch {
|
|
581
|
-
return { positions: [] };
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
function dismissUnlinkedPosition(config, data, options = {}) {
|
|
585
|
-
return apiWrite(config, "/api/positions/unlinked/dismiss", "POST", { body: data, ...options });
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
// src/query/fetchers/profile-completeness.ts
|
|
589
|
-
var PROFILE_COMPLETENESS_SIGNALS = [
|
|
590
|
-
"headline",
|
|
591
|
-
"about",
|
|
592
|
-
"position",
|
|
593
|
-
"education",
|
|
594
|
-
"skill",
|
|
595
|
-
"certification"
|
|
596
|
-
];
|
|
597
|
-
async function fetchProfileCompleteness(config, options = {}) {
|
|
598
|
-
const { cookieHeader, ...rest } = options;
|
|
599
|
-
const headers = { ...rest.headers ?? {} };
|
|
600
|
-
if (cookieHeader) headers.cookie = cookieHeader;
|
|
601
|
-
const empty = {
|
|
602
|
-
complete: true,
|
|
603
|
-
score: PROFILE_COMPLETENESS_SIGNALS.length,
|
|
604
|
-
total: PROFILE_COMPLETENESS_SIGNALS.length,
|
|
605
|
-
missing: []
|
|
606
|
-
};
|
|
607
|
-
try {
|
|
608
|
-
const data = await apiFetch(config, "/api/profile/completeness", {
|
|
609
|
-
cache: "no-store",
|
|
610
|
-
credentials: "include",
|
|
611
|
-
timeoutMs: 5e3,
|
|
612
|
-
...rest,
|
|
613
|
-
headers
|
|
614
|
-
});
|
|
615
|
-
if (!data) return empty;
|
|
616
|
-
const missing = Array.isArray(data.missing) ? data.missing : [];
|
|
617
|
-
return {
|
|
618
|
-
complete: data.complete ?? missing.length === 0,
|
|
619
|
-
score: data.score ?? PROFILE_COMPLETENESS_SIGNALS.length - missing.length,
|
|
620
|
-
total: data.total ?? PROFILE_COMPLETENESS_SIGNALS.length,
|
|
621
|
-
missing
|
|
622
|
-
};
|
|
623
|
-
} catch {
|
|
624
|
-
return empty;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
// src/query/fetchers/keytrace-claims.ts
|
|
629
|
-
function hideKeytraceClaim(config, rkey, options = {}) {
|
|
630
|
-
return apiWrite(
|
|
631
|
-
config,
|
|
632
|
-
`/api/profile/keytrace-claims/${encodeURIComponent(rkey)}/hide`,
|
|
633
|
-
"POST",
|
|
634
|
-
options
|
|
635
|
-
);
|
|
636
|
-
}
|
|
637
|
-
function unhideKeytraceClaim(config, rkey, options = {}) {
|
|
638
|
-
return apiWrite(
|
|
639
|
-
config,
|
|
640
|
-
`/api/profile/keytrace-claims/${encodeURIComponent(rkey)}/hide`,
|
|
641
|
-
"DELETE",
|
|
642
|
-
options
|
|
643
|
-
);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
// src/query/fetchers/marque-domains.ts
|
|
647
|
-
function revealMarqueDomain(config, domain, options = {}) {
|
|
648
|
-
return apiWrite(
|
|
649
|
-
config,
|
|
650
|
-
`/api/profile/marque-domains/${encodeURIComponent(domain)}/reveal`,
|
|
651
|
-
"POST",
|
|
652
|
-
options
|
|
653
|
-
);
|
|
654
|
-
}
|
|
655
|
-
function unrevealMarqueDomain(config, domain, options = {}) {
|
|
656
|
-
return apiWrite(
|
|
657
|
-
config,
|
|
658
|
-
`/api/profile/marque-domains/${encodeURIComponent(domain)}/reveal`,
|
|
659
|
-
"DELETE",
|
|
660
|
-
options
|
|
661
|
-
);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
// src/query/fetchers/publications.ts
|
|
665
|
-
function hideOrcidPublication(config, putCode, options = {}) {
|
|
666
|
-
return apiWrite(config, `/api/profile/orcid-publications/${putCode}/hide`, "POST", options);
|
|
667
|
-
}
|
|
668
|
-
function unhideOrcidPublication(config, putCode, options = {}) {
|
|
669
|
-
return apiWrite(config, `/api/profile/orcid-publications/${putCode}/hide`, "DELETE", options);
|
|
670
|
-
}
|
|
671
|
-
function hideStandardPublication(config, uri, options = {}) {
|
|
672
|
-
return apiWrite(
|
|
673
|
-
config,
|
|
674
|
-
`/api/profile/standard-publications/${encodeURIComponent(uri)}/hide`,
|
|
675
|
-
"POST",
|
|
676
|
-
options
|
|
677
|
-
);
|
|
678
|
-
}
|
|
679
|
-
function unhideStandardPublication(config, uri, options = {}) {
|
|
680
|
-
return apiWrite(
|
|
681
|
-
config,
|
|
682
|
-
`/api/profile/standard-publications/${encodeURIComponent(uri)}/hide`,
|
|
683
|
-
"DELETE",
|
|
684
|
-
options
|
|
685
|
-
);
|
|
686
|
-
}
|
|
687
|
-
function bulkHideStandardPublications(config, uris, options = {}) {
|
|
688
|
-
return apiWrite(config, "/api/profile/standard-publications/bulk-hide", "POST", {
|
|
689
|
-
body: { uris },
|
|
690
|
-
...options
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
function bulkUnhideStandardPublications(config, uris, options = {}) {
|
|
694
|
-
return apiWrite(config, "/api/profile/standard-publications/bulk-hide", "DELETE", {
|
|
695
|
-
body: { uris },
|
|
696
|
-
...options
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
function hideSifaPublication(config, rkey, options = {}) {
|
|
700
|
-
return apiWrite(config, `/api/profile/publications/${rkey}/hide`, "POST", options);
|
|
701
|
-
}
|
|
702
|
-
function unhideSifaPublication(config, rkey, options = {}) {
|
|
703
|
-
return apiWrite(config, `/api/profile/publications/${rkey}/hide`, "DELETE", options);
|
|
704
|
-
}
|
|
705
|
-
async function refreshOrcidPublications(config, options = {}) {
|
|
706
|
-
const result = await apiWrite(
|
|
707
|
-
config,
|
|
708
|
-
"/api/profile/orcid-publications/refresh",
|
|
709
|
-
"POST",
|
|
710
|
-
{ body: {}, ...options }
|
|
711
|
-
);
|
|
712
|
-
if (result.success && result.error) {
|
|
713
|
-
return { success: false, error: result.error };
|
|
714
|
-
}
|
|
715
|
-
return result;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
// src/query/fetchers/profile-items-hide.ts
|
|
719
|
-
var HIDDEN_ITEM_TYPES = [
|
|
720
|
-
"position",
|
|
721
|
-
"education",
|
|
722
|
-
"certification",
|
|
723
|
-
"project",
|
|
724
|
-
"volunteering",
|
|
725
|
-
"publication",
|
|
726
|
-
"course",
|
|
727
|
-
"honor",
|
|
728
|
-
"language",
|
|
729
|
-
"externalAccount"
|
|
730
|
-
];
|
|
731
|
-
var HIDDEN_ITEM_SOURCES = ["pds", "standard", "orcid"];
|
|
732
|
-
function hideProfileItem(config, input, options = {}) {
|
|
733
|
-
return apiWrite(config, "/api/profile/items/hide", "POST", { ...options, body: input });
|
|
734
|
-
}
|
|
735
|
-
function unhideProfileItem(config, input, options = {}) {
|
|
736
|
-
return apiWrite(config, "/api/profile/items/hide", "DELETE", { ...options, body: input });
|
|
737
|
-
}
|
|
738
|
-
function bulkHideProfileItems(config, input, options = {}) {
|
|
739
|
-
return apiWrite(config, "/api/profile/items/bulk-hide", "POST", { ...options, body: input });
|
|
740
|
-
}
|
|
741
|
-
function bulkUnhideProfileItems(config, input, options = {}) {
|
|
742
|
-
return apiWrite(config, "/api/profile/items/bulk-hide", "DELETE", { ...options, body: input });
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
// src/query/fetchers/activity-items-hide.ts
|
|
746
|
-
function hideActivityItem(config, input, options = {}) {
|
|
747
|
-
return apiWrite(config, "/api/activity/items/hide", "POST", { ...options, body: input });
|
|
748
|
-
}
|
|
749
|
-
function unhideActivityItem(config, input, options = {}) {
|
|
750
|
-
return apiWrite(config, "/api/activity/items/hide", "DELETE", { ...options, body: input });
|
|
751
|
-
}
|
|
752
|
-
async function fetchHiddenActivityItems(config, options = {}) {
|
|
753
|
-
const headers = { ...options.headers ?? {} };
|
|
754
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
755
|
-
try {
|
|
756
|
-
const data = await apiFetch(
|
|
757
|
-
config,
|
|
758
|
-
"/api/activity/hidden-items",
|
|
759
|
-
{ credentials: "include", ...options, headers }
|
|
760
|
-
);
|
|
761
|
-
return data.items;
|
|
762
|
-
} catch {
|
|
763
|
-
return [];
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
// src/query/fetchers/stats.ts
|
|
768
|
-
async function fetchStats(config, options = {}) {
|
|
769
|
-
try {
|
|
770
|
-
return await apiFetch(config, "/api/stats", {
|
|
771
|
-
next: { revalidate: 900 },
|
|
772
|
-
...options
|
|
773
|
-
});
|
|
774
|
-
} catch {
|
|
775
|
-
return null;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
// src/query/fetchers/apps.ts
|
|
780
|
-
async function fetchAppsRegistry(config, options = {}) {
|
|
781
|
-
try {
|
|
782
|
-
return await apiFetch(config, "/api/apps/registry", {
|
|
783
|
-
next: { revalidate: 86400 },
|
|
784
|
-
...options
|
|
785
|
-
});
|
|
786
|
-
} catch {
|
|
787
|
-
return [];
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
async function fetchHiddenApps(config, options = {}) {
|
|
791
|
-
const headers = { ...options.headers ?? {} };
|
|
792
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
793
|
-
try {
|
|
794
|
-
const data = await apiFetch(config, "/api/profile/hidden-apps", {
|
|
795
|
-
credentials: "include",
|
|
796
|
-
...options,
|
|
797
|
-
headers
|
|
798
|
-
});
|
|
799
|
-
return data.apps;
|
|
800
|
-
} catch {
|
|
801
|
-
return [];
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
// src/query/fetchers/accounts.ts
|
|
806
|
-
async function fetchAccounts(config, options = {}) {
|
|
807
|
-
const headers = { ...options.headers ?? {} };
|
|
808
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
809
|
-
try {
|
|
810
|
-
const data = await apiFetch(config, "/api/auth/accounts", {
|
|
811
|
-
credentials: "include",
|
|
812
|
-
...options,
|
|
813
|
-
headers
|
|
814
|
-
});
|
|
815
|
-
return data.accounts;
|
|
816
|
-
} catch {
|
|
817
|
-
return [];
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
async function switchAccount(config, did, options = {}) {
|
|
821
|
-
await apiFetch(config, "/oauth/switch", {
|
|
822
|
-
method: "POST",
|
|
823
|
-
body: { did },
|
|
824
|
-
credentials: "include",
|
|
825
|
-
...options
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
// src/query/fetchers/search.ts
|
|
830
|
-
var EMPTY_SEARCH = { profiles: [], total: 0, limit: 20, offset: 0 };
|
|
831
|
-
var EMPTY_FILTERS = { countries: [], industries: [], apps: [], openTo: [] };
|
|
832
|
-
var EMPTY_COMPANY_SEARCH = { results: [], hasMore: false };
|
|
833
|
-
async function fetchSearchProfiles(config, filters, options = {}) {
|
|
834
|
-
const params = new URLSearchParams();
|
|
835
|
-
if (filters.q) params.set("q", filters.q);
|
|
836
|
-
if (filters.skill) params.set("skill", filters.skill);
|
|
837
|
-
if (filters.country) params.set("country", filters.country);
|
|
838
|
-
if (filters.industry) params.set("industry", filters.industry);
|
|
839
|
-
if (filters.domain) params.set("domain", filters.domain);
|
|
840
|
-
if (filters.workplace) params.set("workplace", filters.workplace);
|
|
841
|
-
if (filters.app) params.set("app", filters.app);
|
|
842
|
-
if (filters.openTo && filters.openTo.length > 0) {
|
|
843
|
-
for (const token of filters.openTo) {
|
|
844
|
-
if (token) params.append("openTo", token);
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
if (filters.limit !== void 0) params.set("limit", String(filters.limit));
|
|
848
|
-
if (params.size === 0) return EMPTY_SEARCH;
|
|
849
|
-
return apiFetch(config, `/api/search/profiles?${params.toString()}`, {
|
|
850
|
-
cache: "no-store",
|
|
851
|
-
...options
|
|
852
|
-
});
|
|
853
|
-
}
|
|
854
|
-
async function fetchSearchCompanies(config, filters, options = {}) {
|
|
855
|
-
const q = filters.q?.trim();
|
|
856
|
-
if (!q) return EMPTY_COMPANY_SEARCH;
|
|
857
|
-
const params = new URLSearchParams({ q });
|
|
858
|
-
if (filters.country) params.set("country", filters.country);
|
|
859
|
-
if (filters.industry) params.set("industry", filters.industry);
|
|
860
|
-
if (filters.limit !== void 0) params.set("limit", String(filters.limit));
|
|
861
|
-
return apiFetch(config, `/api/search/companies?${params.toString()}`, {
|
|
862
|
-
cache: "no-store",
|
|
863
|
-
...options
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
async function fetchSkillSuggestions(config, query, options = {}) {
|
|
867
|
-
if (!query.trim()) return [];
|
|
868
|
-
const path = `/api/search/skills?q=${encodeURIComponent(query)}&limit=8`;
|
|
869
|
-
const data = await apiFetch(config, path, {
|
|
870
|
-
cache: "no-store",
|
|
871
|
-
...options
|
|
872
|
-
});
|
|
873
|
-
return data.skills ?? [];
|
|
874
|
-
}
|
|
875
|
-
async function fetchSearchFilters(config, options = {}) {
|
|
876
|
-
try {
|
|
877
|
-
return await apiFetch(config, "/api/search/filters", {
|
|
878
|
-
next: { revalidate: 300 },
|
|
879
|
-
...options
|
|
880
|
-
});
|
|
881
|
-
} catch {
|
|
882
|
-
return EMPTY_FILTERS;
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
async function searchSkills(config, query, limit = 10, options = {}) {
|
|
886
|
-
if (!query.trim()) return [];
|
|
887
|
-
const path = `/api/skills/search?q=${encodeURIComponent(query)}&limit=${limit}`;
|
|
888
|
-
try {
|
|
889
|
-
const data = await apiFetch(config, path, {
|
|
890
|
-
cache: "no-store",
|
|
891
|
-
...options
|
|
892
|
-
});
|
|
893
|
-
return data.skills ?? [];
|
|
894
|
-
} catch {
|
|
895
|
-
return [];
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
// src/query/fetchers/speakers.ts
|
|
900
|
-
var EMPTY_SPEAKERS = { speakers: [] };
|
|
901
|
-
var EMPTY_TALKS = { talks: [] };
|
|
902
|
-
function buildParams(filters) {
|
|
903
|
-
const params = new URLSearchParams();
|
|
904
|
-
const topic = filters.topic?.trim();
|
|
905
|
-
if (topic) params.set("topic", topic);
|
|
906
|
-
if (filters.limit !== void 0) params.set("limit", String(filters.limit));
|
|
907
|
-
return params;
|
|
908
|
-
}
|
|
909
|
-
async function fetchSpeakers(config, filters = {}, options = {}) {
|
|
910
|
-
const params = buildParams(filters);
|
|
911
|
-
const query = params.toString();
|
|
912
|
-
const path = query ? `/api/speakers?${query}` : "/api/speakers";
|
|
913
|
-
try {
|
|
914
|
-
return await apiFetch(config, path, {
|
|
915
|
-
cache: "no-store",
|
|
916
|
-
...options
|
|
917
|
-
});
|
|
918
|
-
} catch {
|
|
919
|
-
return EMPTY_SPEAKERS;
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
async function fetchTalks(config, filters = {}, options = {}) {
|
|
923
|
-
const params = buildParams(filters);
|
|
924
|
-
const query = params.toString();
|
|
925
|
-
const path = query ? `/api/talks?${query}` : "/api/talks";
|
|
926
|
-
try {
|
|
927
|
-
return await apiFetch(config, path, {
|
|
928
|
-
cache: "no-store",
|
|
929
|
-
...options
|
|
930
|
-
});
|
|
931
|
-
} catch {
|
|
932
|
-
return EMPTY_TALKS;
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
// src/query/fetchers/discovery.ts
|
|
937
|
-
async function fetchSimilarProfiles(config, did, opts = {}) {
|
|
938
|
-
const limit = opts.limit ?? 5;
|
|
939
|
-
const path = `/api/discover/similar/${encodeIdentifier(did)}?limit=${limit}`;
|
|
940
|
-
try {
|
|
941
|
-
const data = await apiFetch(config, path, {
|
|
942
|
-
next: { revalidate: 300 },
|
|
943
|
-
timeoutMs: 5e3,
|
|
944
|
-
...opts
|
|
945
|
-
});
|
|
946
|
-
return data.profiles ?? [];
|
|
947
|
-
} catch {
|
|
948
|
-
return [];
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
async function fetchSuggestions(config, opts = {}) {
|
|
952
|
-
const params = new URLSearchParams();
|
|
953
|
-
if (opts.source) params.set("source", opts.source);
|
|
954
|
-
if (opts.includeDismissed) params.set("include_dismissed", "true");
|
|
955
|
-
if (opts.cursor) params.set("cursor", opts.cursor);
|
|
956
|
-
if (opts.limit) params.set("limit", String(opts.limit));
|
|
957
|
-
const qs = params.toString();
|
|
958
|
-
const headers = { ...opts.headers ?? {} };
|
|
959
|
-
if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
|
|
960
|
-
try {
|
|
961
|
-
return await apiFetch(config, `/api/suggestions${qs ? `?${qs}` : ""}`, {
|
|
962
|
-
credentials: "include",
|
|
963
|
-
cache: "no-store",
|
|
964
|
-
timeoutMs: 8e3,
|
|
965
|
-
...opts,
|
|
966
|
-
headers
|
|
967
|
-
});
|
|
968
|
-
} catch {
|
|
969
|
-
return { onSifa: [], notOnSifa: [] };
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
async function fetchSuggestionCount(config, since, options = {}) {
|
|
973
|
-
const params = since ? `?since=${encodeURIComponent(since)}` : "";
|
|
974
|
-
try {
|
|
975
|
-
const data = await apiFetch(config, `/api/suggestions/count${params}`, {
|
|
976
|
-
credentials: "include",
|
|
977
|
-
cache: "no-store",
|
|
978
|
-
...options
|
|
979
|
-
});
|
|
980
|
-
return data.count ?? 0;
|
|
981
|
-
} catch {
|
|
982
|
-
return 0;
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
async function fetchFeaturedProfile(config, options = {}) {
|
|
986
|
-
try {
|
|
987
|
-
return await apiFetch(config, "/api/featured-profile", {
|
|
988
|
-
next: { revalidate: 900 },
|
|
989
|
-
...options
|
|
990
|
-
});
|
|
991
|
-
} catch {
|
|
992
|
-
return null;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
// src/query/fetchers/follow.ts
|
|
997
|
-
async function fetchFollowing(config, opts = {}) {
|
|
998
|
-
const params = new URLSearchParams();
|
|
999
|
-
if (opts.source) params.set("source", opts.source);
|
|
1000
|
-
if (opts.cursor) params.set("cursor", opts.cursor);
|
|
1001
|
-
if (opts.limit) params.set("limit", String(opts.limit));
|
|
1002
|
-
const qs = params.toString();
|
|
1003
|
-
try {
|
|
1004
|
-
return await apiFetch(config, `/api/following${qs ? `?${qs}` : ""}`, {
|
|
1005
|
-
credentials: "include",
|
|
1006
|
-
cache: "no-store",
|
|
1007
|
-
...opts
|
|
1008
|
-
});
|
|
1009
|
-
} catch {
|
|
1010
|
-
return { follows: [] };
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
function followUser(config, handle, opts = {}) {
|
|
1014
|
-
const { note, ...rest } = opts;
|
|
1015
|
-
return apiWrite(
|
|
1016
|
-
config,
|
|
1017
|
-
`/api/follow/${encodeIdentifier(handle)}`,
|
|
1018
|
-
"POST",
|
|
1019
|
-
{
|
|
1020
|
-
body: note !== void 0 ? { note } : void 0,
|
|
1021
|
-
...rest
|
|
1022
|
-
}
|
|
1023
|
-
);
|
|
1024
|
-
}
|
|
1025
|
-
function unfollowUser(config, handle, opts = {}) {
|
|
1026
|
-
return apiWrite(config, `/api/follow/${encodeIdentifier(handle)}`, "DELETE", opts);
|
|
1027
|
-
}
|
|
1028
|
-
function buildListPath(prefix, opts) {
|
|
1029
|
-
const params = new URLSearchParams();
|
|
1030
|
-
if (opts.cursor) params.set("cursor", opts.cursor);
|
|
1031
|
-
if (opts.limit) params.set("limit", String(opts.limit));
|
|
1032
|
-
const qs = params.toString();
|
|
1033
|
-
return `${prefix}${qs ? `?${qs}` : ""}`;
|
|
1034
|
-
}
|
|
1035
|
-
async function getFollowers(config, handle, opts = {}) {
|
|
1036
|
-
const headers = { ...opts.headers ?? {} };
|
|
1037
|
-
if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
|
|
1038
|
-
try {
|
|
1039
|
-
const res = await apiFetch(
|
|
1040
|
-
config,
|
|
1041
|
-
buildListPath(`/api/profile/${encodeIdentifier(handle)}/followers`, opts),
|
|
1042
|
-
{ credentials: "include", cache: "no-store", ...opts, headers }
|
|
1043
|
-
);
|
|
1044
|
-
return { follows: res.follows, cursor: res.cursor ?? null };
|
|
1045
|
-
} catch {
|
|
1046
|
-
return { follows: [], cursor: null };
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
async function getFollowing(config, handle, opts = {}) {
|
|
1050
|
-
const headers = { ...opts.headers ?? {} };
|
|
1051
|
-
if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
|
|
1052
|
-
try {
|
|
1053
|
-
const res = await apiFetch(
|
|
1054
|
-
config,
|
|
1055
|
-
buildListPath(`/api/profile/${encodeIdentifier(handle)}/following`, opts),
|
|
1056
|
-
{ credentials: "include", cache: "no-store", ...opts, headers }
|
|
1057
|
-
);
|
|
1058
|
-
return { follows: res.follows, cursor: res.cursor ?? null };
|
|
1059
|
-
} catch {
|
|
1060
|
-
return { follows: [], cursor: null };
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
var FOLLOWING_FEED_LXM = "id.sifa.feed.getFollowingFeed";
|
|
1064
|
-
async function fetchFollowingFeed(config, opts = {}) {
|
|
1065
|
-
const params = new URLSearchParams();
|
|
1066
|
-
if (opts.limit) params.set("limit", String(opts.limit));
|
|
1067
|
-
if (opts.app) params.set("app", opts.app);
|
|
1068
|
-
else if (opts.includeBluesky) params.set("includeBluesky", "true");
|
|
1069
|
-
const qs = params.toString();
|
|
1070
|
-
const headers = { ...opts.headers ?? {} };
|
|
1071
|
-
if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
|
|
1072
|
-
if (config.getAuthToken) {
|
|
1073
|
-
const token = await config.getAuthToken(FOLLOWING_FEED_LXM);
|
|
1074
|
-
if (token) headers.Authorization = `Bearer ${token}`;
|
|
1075
|
-
}
|
|
1076
|
-
try {
|
|
1077
|
-
return await apiFetch(
|
|
1078
|
-
config,
|
|
1079
|
-
`/api/following/feed${qs ? `?${qs}` : ""}`,
|
|
1080
|
-
{ credentials: "include", cache: "no-store", ...opts, headers }
|
|
1081
|
-
);
|
|
1082
|
-
} catch {
|
|
1083
|
-
return null;
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
// src/query/fetchers/follow-extras.ts
|
|
1088
|
-
function buildListPath2(prefix, opts) {
|
|
1089
|
-
const params = new URLSearchParams();
|
|
1090
|
-
if (opts.cursor) params.set("cursor", opts.cursor);
|
|
1091
|
-
if (opts.limit) params.set("limit", String(opts.limit));
|
|
1092
|
-
const qs = params.toString();
|
|
1093
|
-
return `${prefix}${qs ? `?${qs}` : ""}`;
|
|
1094
|
-
}
|
|
1095
|
-
async function fetchFollowProfilePage(config, path, opts) {
|
|
1096
|
-
const headers = { ...opts.headers ?? {} };
|
|
1097
|
-
if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
|
|
1098
|
-
try {
|
|
1099
|
-
const res = await apiFetch(
|
|
1100
|
-
config,
|
|
1101
|
-
path,
|
|
1102
|
-
{ credentials: "include", cache: "no-store", ...opts, headers }
|
|
1103
|
-
);
|
|
1104
|
-
return { items: res.items ?? [], cursor: res.cursor ?? null };
|
|
1105
|
-
} catch {
|
|
1106
|
-
return { items: [], cursor: null };
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
async function getMutuals(config, handleOrDid, opts = {}) {
|
|
1110
|
-
return fetchFollowProfilePage(
|
|
1111
|
-
config,
|
|
1112
|
-
buildListPath2(`/api/profile/${encodeIdentifier(handleOrDid)}/mutuals`, opts),
|
|
1113
|
-
opts
|
|
1114
|
-
);
|
|
1115
|
-
}
|
|
1116
|
-
async function getBlueskySuggestions(config, opts = {}) {
|
|
1117
|
-
return fetchFollowProfilePage(config, buildListPath2("/api/me/bluesky-suggestions", opts), opts);
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
// src/query/fetchers/admin-feature-allowlists.ts
|
|
1121
|
-
async function listFeatureAllowlist(config, flag, opts = {}) {
|
|
1122
|
-
const headers = { ...opts.headers ?? {} };
|
|
1123
|
-
if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
|
|
1124
|
-
try {
|
|
1125
|
-
const res = await apiFetch(
|
|
1126
|
-
config,
|
|
1127
|
-
`/api/admin/feature-allowlists/${encodeURIComponent(flag)}`,
|
|
1128
|
-
{ credentials: "include", cache: "no-store", ...opts, headers }
|
|
1129
|
-
);
|
|
1130
|
-
return { items: res.items ?? [] };
|
|
1131
|
-
} catch {
|
|
1132
|
-
return { items: [] };
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
function addFeatureAllowlist(config, flag, did, opts = {}) {
|
|
1136
|
-
const { note, ...rest } = opts;
|
|
1137
|
-
return apiWrite(config, `/api/admin/feature-allowlists/${encodeURIComponent(flag)}`, "POST", {
|
|
1138
|
-
body: note !== void 0 ? { did, note } : { did },
|
|
1139
|
-
...rest
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
|
-
function removeFeatureAllowlist(config, flag, did, opts = {}) {
|
|
1143
|
-
return apiWrite(
|
|
1144
|
-
config,
|
|
1145
|
-
`/api/admin/feature-allowlists/${encodeURIComponent(flag)}/${encodeIdentifier(did)}`,
|
|
1146
|
-
"DELETE",
|
|
1147
|
-
opts
|
|
1148
|
-
);
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
// src/query/fetchers/admin-review-queues.ts
|
|
1152
|
-
async function getAdminReviewQueues(config, opts = {}) {
|
|
1153
|
-
const headers = { ...opts.headers ?? {} };
|
|
1154
|
-
if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
|
|
1155
|
-
const res = await apiFetch(config, "/api/admin/stats/review-queues", {
|
|
1156
|
-
credentials: "include",
|
|
1157
|
-
cache: "no-store",
|
|
1158
|
-
...opts,
|
|
1159
|
-
headers
|
|
1160
|
-
});
|
|
1161
|
-
const ideas = res.ideas ?? 0;
|
|
1162
|
-
const nameCorrections = res.nameCorrections ?? 0;
|
|
1163
|
-
const pendingCompanies = res.pendingCompanies ?? 0;
|
|
1164
|
-
const duplicateOrgs = res.duplicateOrgs ?? 0;
|
|
1165
|
-
return {
|
|
1166
|
-
ideas,
|
|
1167
|
-
nameCorrections,
|
|
1168
|
-
pendingCompanies,
|
|
1169
|
-
duplicateOrgs,
|
|
1170
|
-
// Derived rather than trusted so an API that predates the field still
|
|
1171
|
-
// yields a usable pill count.
|
|
1172
|
-
total: res.total ?? ideas + nameCorrections + pendingCompanies + duplicateOrgs,
|
|
1173
|
-
generatedAt: res.generatedAt ?? ""
|
|
1174
|
-
};
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
// src/query/fetchers/activity.ts
|
|
1178
|
-
async function fetchHeatmapData(config, handleOrDid, days, options = {}) {
|
|
1179
|
-
const path = `/api/activity/${encodeIdentifier(handleOrDid)}/heatmap?days=${days}`;
|
|
1180
|
-
try {
|
|
1181
|
-
return await apiFetch(config, path, {
|
|
1182
|
-
next: { revalidate: 900, tags: [`heatmap-${handleOrDid}`] },
|
|
1183
|
-
...options
|
|
1184
|
-
});
|
|
1185
|
-
} catch {
|
|
1186
|
-
return null;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
async function fetchActivityTeaser(config, handleOrDid, options = {}) {
|
|
1190
|
-
const headers = { ...options.headers ?? {} };
|
|
1191
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
1192
|
-
try {
|
|
1193
|
-
return await apiFetch(
|
|
1194
|
-
config,
|
|
1195
|
-
`/api/activity/${encodeIdentifier(handleOrDid)}/teaser`,
|
|
1196
|
-
{
|
|
1197
|
-
credentials: "include",
|
|
1198
|
-
timeoutMs: 8e3,
|
|
1199
|
-
next: { revalidate: 300, tags: [`activity-teaser-${handleOrDid}`] },
|
|
1200
|
-
...options,
|
|
1201
|
-
headers
|
|
1202
|
-
}
|
|
1203
|
-
);
|
|
1204
|
-
} catch {
|
|
1205
|
-
return null;
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
async function fetchActivityFeed(config, handleOrDid, options = {}) {
|
|
1209
|
-
const params = new URLSearchParams();
|
|
1210
|
-
if (options.category) params.set("category", options.category);
|
|
1211
|
-
if (options.limit) params.set("limit", String(options.limit));
|
|
1212
|
-
if (options.cursor) params.set("cursor", options.cursor);
|
|
1213
|
-
const qs = params.toString();
|
|
1214
|
-
const headers = { ...options.headers ?? {} };
|
|
1215
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
1216
|
-
try {
|
|
1217
|
-
return await apiFetch(
|
|
1218
|
-
config,
|
|
1219
|
-
`/api/activity/${encodeIdentifier(handleOrDid)}${qs ? `?${qs}` : ""}`,
|
|
1220
|
-
{
|
|
1221
|
-
credentials: "include",
|
|
1222
|
-
cache: "no-store",
|
|
1223
|
-
...options,
|
|
1224
|
-
headers
|
|
1225
|
-
}
|
|
1226
|
-
);
|
|
1227
|
-
} catch {
|
|
1228
|
-
return null;
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
var GithubPullRequestSchema = z.object({
|
|
1232
|
-
prNumber: z.number(),
|
|
1233
|
-
repoOwner: z.string(),
|
|
1234
|
-
repoName: z.string(),
|
|
1235
|
-
title: z.string(),
|
|
1236
|
-
url: z.string(),
|
|
1237
|
-
language: z.string().nullable(),
|
|
1238
|
-
additions: z.number(),
|
|
1239
|
-
deletions: z.number(),
|
|
1240
|
-
/** ISO 8601 merge timestamp. */
|
|
1241
|
-
mergedAt: z.string()
|
|
1242
|
-
});
|
|
1243
|
-
var MyGithubPullRequestsResponseSchema = z.object({
|
|
1244
|
-
items: z.array(GithubPullRequestSchema),
|
|
1245
|
-
hasMore: z.boolean()
|
|
1246
|
-
});
|
|
1247
|
-
async function fetchMyGithubPullRequests(config, options = {}) {
|
|
1248
|
-
const { limit, offset, cookieHeader, ...fetchOptions } = options;
|
|
1249
|
-
const params = new URLSearchParams();
|
|
1250
|
-
if (limit !== void 0) params.set("limit", String(limit));
|
|
1251
|
-
if (offset !== void 0) params.set("offset", String(offset));
|
|
1252
|
-
const qs = params.toString();
|
|
1253
|
-
const headers = { ...options.headers ?? {} };
|
|
1254
|
-
if (cookieHeader) headers.cookie = cookieHeader;
|
|
1255
|
-
const data = await apiFetch(
|
|
1256
|
-
config,
|
|
1257
|
-
`/api/me/github/pull-requests${qs ? `?${qs}` : ""}`,
|
|
1258
|
-
{
|
|
1259
|
-
credentials: "include",
|
|
1260
|
-
cache: "no-store",
|
|
1261
|
-
...fetchOptions,
|
|
1262
|
-
headers
|
|
1263
|
-
}
|
|
1264
|
-
);
|
|
1265
|
-
return MyGithubPullRequestsResponseSchema.parse(data);
|
|
1266
|
-
}
|
|
1267
|
-
var RpgItemStatusSchema = z.object({
|
|
1268
|
-
id: z.string(),
|
|
1269
|
-
title: z.string(),
|
|
1270
|
-
description: z.string(),
|
|
1271
|
-
category: z.string(),
|
|
1272
|
-
earned: z.boolean(),
|
|
1273
|
-
state: z.enum(["locked", "earned", "given", "claimed"]),
|
|
1274
|
-
iconUrl: z.string().url().nullable()
|
|
1275
|
-
});
|
|
1276
|
-
var RpgStatusResponseSchema = z.object({
|
|
1277
|
-
hasCharacter: z.boolean(),
|
|
1278
|
-
/** True when the user granted the `repo:equipment.rpg.item` OAuth scope. */
|
|
1279
|
-
canWriteItems: z.boolean(),
|
|
1280
|
-
items: z.array(RpgItemStatusSchema)
|
|
1281
|
-
});
|
|
1282
|
-
async function fetchRpgStatus(config, options = {}) {
|
|
1283
|
-
const { cookieHeader, ...fetchOptions } = options;
|
|
1284
|
-
const headers = { ...options.headers ?? {} };
|
|
1285
|
-
if (cookieHeader) headers.cookie = cookieHeader;
|
|
1286
|
-
const data = await apiFetch(config, "/api/rpg/status", {
|
|
1287
|
-
credentials: "include",
|
|
1288
|
-
cache: "no-store",
|
|
1289
|
-
...fetchOptions,
|
|
1290
|
-
headers
|
|
1291
|
-
});
|
|
1292
|
-
return RpgStatusResponseSchema.parse(data);
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
// src/query/fetchers/endorsement.ts
|
|
1296
|
-
async function fetchEndorsementCount(config, did, options = {}) {
|
|
1297
|
-
const path = `/api/endorsement/${encodeIdentifier(did)}`;
|
|
1298
|
-
try {
|
|
1299
|
-
const data = await apiFetch(config, path, {
|
|
1300
|
-
cache: "no-store",
|
|
1301
|
-
timeoutMs: 5e3,
|
|
1302
|
-
...options
|
|
1303
|
-
});
|
|
1304
|
-
if (typeof data !== "object" || data === null || !("endorsements" in data)) {
|
|
1305
|
-
return 0;
|
|
1306
|
-
}
|
|
1307
|
-
const endorsements = data.endorsements;
|
|
1308
|
-
return Array.isArray(endorsements) ? endorsements.length : 0;
|
|
1309
|
-
} catch {
|
|
1310
|
-
return 0;
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
|
-
// src/query/fetchers/stream.ts
|
|
1315
|
-
async function fetchNetworkStreamCount(config, did, options = {}) {
|
|
1316
|
-
const headers = { ...options.headers ?? {} };
|
|
1317
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
1318
|
-
try {
|
|
1319
|
-
const data = await apiFetch(
|
|
1320
|
-
config,
|
|
1321
|
-
`/api/stream/network?did=${encodeIdentifier(did)}`,
|
|
1322
|
-
{
|
|
1323
|
-
cache: "no-store",
|
|
1324
|
-
timeoutMs: 5e3,
|
|
1325
|
-
...options.cookieHeader ? {} : { credentials: "include" },
|
|
1326
|
-
...options,
|
|
1327
|
-
headers
|
|
1328
|
-
}
|
|
1329
|
-
);
|
|
1330
|
-
if (typeof data !== "object" || data === null || !("items" in data)) {
|
|
1331
|
-
return 0;
|
|
1332
|
-
}
|
|
1333
|
-
const items = data.items;
|
|
1334
|
-
return Array.isArray(items) ? items.length : 0;
|
|
1335
|
-
} catch {
|
|
1336
|
-
return 0;
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
// src/query/fetchers/reactions.ts
|
|
1341
|
-
async function fetchReactionStatus(config, uris, options = {}) {
|
|
1342
|
-
if (uris.length === 0) return {};
|
|
1343
|
-
const headers = { ...options.headers ?? {} };
|
|
1344
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
1345
|
-
try {
|
|
1346
|
-
return await apiFetch(
|
|
1347
|
-
config,
|
|
1348
|
-
`/api/reactions/status?uris=${encodeURIComponent(uris.join(","))}`,
|
|
1349
|
-
{
|
|
1350
|
-
credentials: "include",
|
|
1351
|
-
...options,
|
|
1352
|
-
headers
|
|
1353
|
-
}
|
|
1354
|
-
);
|
|
1355
|
-
} catch {
|
|
1356
|
-
return null;
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
async function checkAppAccount(config, appId, options = {}) {
|
|
1360
|
-
const headers = { ...options.headers ?? {} };
|
|
1361
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
1362
|
-
try {
|
|
1363
|
-
return await apiFetch(
|
|
1364
|
-
config,
|
|
1365
|
-
`/api/reactions/account-check/${encodeURIComponent(appId)}`,
|
|
1366
|
-
{
|
|
1367
|
-
credentials: "include",
|
|
1368
|
-
...options,
|
|
1369
|
-
headers
|
|
1370
|
-
}
|
|
1371
|
-
);
|
|
1372
|
-
} catch {
|
|
1373
|
-
return null;
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
async function createReaction(config, targetUri, appId, targetCid, options = {}) {
|
|
1377
|
-
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
1378
|
-
const url = `${config.baseUrl}/api/reactions`;
|
|
1379
|
-
try {
|
|
1380
|
-
const res = await fetchFn(url, {
|
|
1381
|
-
method: "POST",
|
|
1382
|
-
headers: { "Content-Type": "application/json", ...options.headers ?? {} },
|
|
1383
|
-
credentials: options.credentials ?? "include",
|
|
1384
|
-
body: JSON.stringify({ targetUri, appId, targetCid }),
|
|
1385
|
-
signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 1e4)
|
|
1386
|
-
});
|
|
1387
|
-
if (!res.ok) {
|
|
1388
|
-
if (res.status === 403) {
|
|
1389
|
-
try {
|
|
1390
|
-
const body = await res.json();
|
|
1391
|
-
if (body.error === "ScopeInsufficient") {
|
|
1392
|
-
return {
|
|
1393
|
-
ok: false,
|
|
1394
|
-
error: { type: "scope_insufficient", requiredScope: body.requiredScope }
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
} catch {
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
return { ok: false, error: { type: "error" } };
|
|
1401
|
-
}
|
|
1402
|
-
const data = await res.json();
|
|
1403
|
-
return { ok: true, data };
|
|
1404
|
-
} catch {
|
|
1405
|
-
return { ok: false, error: { type: "error" } };
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
function deleteReaction(config, targetUri, appId, options = {}) {
|
|
1409
|
-
return apiWrite(config, "/api/reactions", "DELETE", {
|
|
1410
|
-
body: { targetUri, appId },
|
|
1411
|
-
...options
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
// src/query/fetchers/quoted-posts.ts
|
|
1416
|
-
var QUOTED_POSTS_BATCH_MAX = 20;
|
|
1417
|
-
async function resolveQuotedPosts(config, uris, options = {}) {
|
|
1418
|
-
if (uris.length === 0) return {};
|
|
1419
|
-
const unique = [...new Set(uris)];
|
|
1420
|
-
const batches = [];
|
|
1421
|
-
for (let i = 0; i < unique.length; i += QUOTED_POSTS_BATCH_MAX) {
|
|
1422
|
-
batches.push(unique.slice(i, i + QUOTED_POSTS_BATCH_MAX));
|
|
1423
|
-
}
|
|
1424
|
-
const headers = { ...options.headers ?? {} };
|
|
1425
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
1426
|
-
const results = {};
|
|
1427
|
-
await Promise.all(
|
|
1428
|
-
batches.map(async (batch) => {
|
|
1429
|
-
try {
|
|
1430
|
-
const data = await apiFetch(
|
|
1431
|
-
config,
|
|
1432
|
-
"/api/quoted-posts/resolve",
|
|
1433
|
-
{
|
|
1434
|
-
method: "POST",
|
|
1435
|
-
body: { uris: batch },
|
|
1436
|
-
credentials: "include",
|
|
1437
|
-
timeoutMs: 8e3,
|
|
1438
|
-
...options,
|
|
1439
|
-
headers
|
|
1440
|
-
}
|
|
1441
|
-
);
|
|
1442
|
-
Object.assign(results, data);
|
|
1443
|
-
} catch {
|
|
1444
|
-
}
|
|
1445
|
-
})
|
|
1446
|
-
);
|
|
1447
|
-
return results;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
// src/query/fetchers/roadmap.ts
|
|
1451
|
-
async function fetchRoadmapVotes(config, options = {}) {
|
|
1452
|
-
try {
|
|
1453
|
-
return await apiFetch(config, "/api/roadmap/votes", {
|
|
1454
|
-
cache: "no-store",
|
|
1455
|
-
...options
|
|
1456
|
-
});
|
|
1457
|
-
} catch {
|
|
1458
|
-
return {};
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
async function fetchMyRoadmapVotes(config, options = {}) {
|
|
1462
|
-
const headers = { ...options.headers ?? {} };
|
|
1463
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
1464
|
-
try {
|
|
1465
|
-
const data = await apiFetch(config, "/api/roadmap/votes/me", {
|
|
1466
|
-
credentials: "include",
|
|
1467
|
-
...options,
|
|
1468
|
-
headers
|
|
1469
|
-
});
|
|
1470
|
-
return data.voted ?? [];
|
|
1471
|
-
} catch {
|
|
1472
|
-
return [];
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
async function castRoadmapVote(config, key, options = {}) {
|
|
1476
|
-
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
1477
|
-
const url = `${config.baseUrl}/api/roadmap/votes/${encodeURIComponent(key)}`;
|
|
1478
|
-
try {
|
|
1479
|
-
const res = await fetchFn(url, {
|
|
1480
|
-
method: "POST",
|
|
1481
|
-
// No body: the item key is in the URL. Do NOT declare a JSON content-type
|
|
1482
|
-
// for an empty body — Fastify rejects that with a 400 before the handler
|
|
1483
|
-
// runs. Only forward caller-provided headers.
|
|
1484
|
-
...options.headers ? { headers: options.headers } : {},
|
|
1485
|
-
credentials: options.credentials ?? "include",
|
|
1486
|
-
signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 1e4)
|
|
1487
|
-
});
|
|
1488
|
-
if (!res.ok) {
|
|
1489
|
-
if (res.status === 403) {
|
|
1490
|
-
try {
|
|
1491
|
-
const body = await res.json();
|
|
1492
|
-
if (body.error === "ScopeInsufficient") {
|
|
1493
|
-
return {
|
|
1494
|
-
ok: false,
|
|
1495
|
-
error: { type: "scope_insufficient", requiredScope: body.requiredScope }
|
|
1496
|
-
};
|
|
1497
|
-
}
|
|
1498
|
-
} catch {
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
return { ok: false, error: { type: "error" } };
|
|
1502
|
-
}
|
|
1503
|
-
const data = await res.json();
|
|
1504
|
-
return { ok: true, data };
|
|
1505
|
-
} catch {
|
|
1506
|
-
return { ok: false, error: { type: "error" } };
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
function retractRoadmapVote(config, key, options = {}) {
|
|
1510
|
-
return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "DELETE", options);
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
// src/query/fetchers/destructive.ts
|
|
1514
|
-
function fetchWipePreview(config, options = {}) {
|
|
1515
|
-
return apiFetch(config, "/api/profile/wipe-preview", {
|
|
1516
|
-
credentials: "include",
|
|
1517
|
-
...options
|
|
1518
|
-
});
|
|
1519
|
-
}
|
|
1520
|
-
function resetProfile(config, deletePdsData, options = {}) {
|
|
1521
|
-
return apiWrite(config, "/api/profile/reset", "DELETE", {
|
|
1522
|
-
body: { deletePdsData },
|
|
1523
|
-
...options
|
|
1524
|
-
});
|
|
1525
|
-
}
|
|
1526
|
-
function deleteAccount(config, deletePdsData, options = {}) {
|
|
1527
|
-
return apiWrite(
|
|
1528
|
-
config,
|
|
1529
|
-
"/api/profile/account",
|
|
1530
|
-
"DELETE",
|
|
1531
|
-
{
|
|
1532
|
-
body: { deletePdsData },
|
|
1533
|
-
...options
|
|
1534
|
-
}
|
|
1535
|
-
);
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
// src/query/fetchers/repo-inventory.ts
|
|
1539
|
-
function fetchRepoInventory(config, options = {}) {
|
|
1540
|
-
return apiFetch(config, "/api/me/repo-inventory", {
|
|
1541
|
-
credentials: "include",
|
|
1542
|
-
...options
|
|
1543
|
-
});
|
|
1544
|
-
}
|
|
1545
|
-
function deleteRepoRecords(config, input, options = {}) {
|
|
1546
|
-
return apiWrite(config, "/api/me/repo-delete", "POST", {
|
|
1547
|
-
body: input,
|
|
1548
|
-
...options
|
|
1549
|
-
});
|
|
1550
|
-
}
|
|
1551
|
-
function repoExportUrl(config) {
|
|
1552
|
-
return `${config.baseUrl}/api/me/repo-export`;
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
// src/query/fetchers/network-map.ts
|
|
1556
|
-
function isNetworkMapResponse(value) {
|
|
1557
|
-
return "graph" in value;
|
|
1558
|
-
}
|
|
1559
|
-
async function initiateNetworkMapGeneration(config, options = {}) {
|
|
1560
|
-
return apiFetch(config, "/api/network-map/generate", {
|
|
1561
|
-
method: "POST",
|
|
1562
|
-
credentials: "include",
|
|
1563
|
-
...options
|
|
1564
|
-
});
|
|
1565
|
-
}
|
|
1566
|
-
async function checkNetworkMapJobStatus(config, jobId, options = {}) {
|
|
1567
|
-
return apiFetch(
|
|
1568
|
-
config,
|
|
1569
|
-
`/api/network-map/status/${encodeURIComponent(jobId)}`,
|
|
1570
|
-
{
|
|
1571
|
-
credentials: "include",
|
|
1572
|
-
...options
|
|
1573
|
-
}
|
|
1574
|
-
);
|
|
1575
|
-
}
|
|
1576
|
-
async function fetchNetworkMap(config, options = {}) {
|
|
1577
|
-
return apiFetchOrNull(config, "/api/network-map", {
|
|
1578
|
-
credentials: "include",
|
|
1579
|
-
cache: "no-store",
|
|
1580
|
-
...options
|
|
1581
|
-
});
|
|
1582
|
-
}
|
|
1583
|
-
var httpUrlNullable = z.string().refine((s) => /^https?:\/\//i.test(s), { message: "must be an http(s) URL" }).nullable();
|
|
1584
|
-
var searchResultCommon = {
|
|
1585
|
-
kind: z.string(),
|
|
1586
|
-
name: z.string(),
|
|
1587
|
-
domain: z.string().nullable(),
|
|
1588
|
-
country: z.string().nullable(),
|
|
1589
|
-
logoUrl: httpUrlNullable,
|
|
1590
|
-
parentName: z.string().nullable()
|
|
1591
|
-
};
|
|
1592
|
-
var EntitySearchResultSchema = z.discriminatedUnion("source", [
|
|
1593
|
-
z.object({
|
|
1594
|
-
source: z.literal("entity"),
|
|
1595
|
-
entityId: z.number().int().positive(),
|
|
1596
|
-
...searchResultCommon
|
|
1597
|
-
}),
|
|
1598
|
-
z.object({
|
|
1599
|
-
source: z.literal("pdl"),
|
|
1600
|
-
pdlId: z.string().min(1),
|
|
1601
|
-
...searchResultCommon
|
|
1602
|
-
})
|
|
1603
|
-
]);
|
|
1604
|
-
var EntitySearchResponseSchema = z.object({
|
|
1605
|
-
results: z.array(EntitySearchResultSchema),
|
|
1606
|
-
hasMore: z.boolean()
|
|
1607
|
-
});
|
|
1608
|
-
z.object({
|
|
1609
|
-
entityId: z.number().int().positive().optional(),
|
|
1610
|
-
pdlId: z.string().min(1).optional()
|
|
1611
|
-
}).refine((v) => v.entityId != null !== (v.pdlId != null), {
|
|
1612
|
-
message: "exactly one of entityId or pdlId is required"
|
|
1613
|
-
});
|
|
1614
|
-
var EntitySelectResponseSchema = z.object({
|
|
1615
|
-
entityId: z.number().int().positive(),
|
|
1616
|
-
slug: z.string(),
|
|
1617
|
-
kind: z.string(),
|
|
1618
|
-
canonicalName: z.string(),
|
|
1619
|
-
domain: z.string().nullable(),
|
|
1620
|
-
/**
|
|
1621
|
-
* The entity's website, gated to sources trustworthy enough to prefill into a
|
|
1622
|
-
* record the user signs. Narrower than `domain`, which is a display value and
|
|
1623
|
-
* may come from a crawl. Null when the entity has no such source.
|
|
1624
|
-
*/
|
|
1625
|
-
website: httpUrlNullable.default(null),
|
|
1626
|
-
/** Which tier `website` came from. Crawled is never an accepted source. */
|
|
1627
|
-
websiteTier: z.enum(["org", "curated"]).nullable().default(null),
|
|
1628
|
-
entityRef: httpUrlNullable
|
|
1629
|
-
});
|
|
1630
|
-
var EntityImportSearchResponseSchema = z.object({
|
|
1631
|
-
results: z.array(EntitySearchResultSchema)
|
|
1632
|
-
});
|
|
1633
|
-
z.object({
|
|
1634
|
-
domain: z.string().min(1).max(253)
|
|
1635
|
-
});
|
|
1636
|
-
z.object({
|
|
1637
|
-
results: z.array(EntitySearchResultSchema),
|
|
1638
|
-
canMint: z.boolean()
|
|
1639
|
-
});
|
|
1640
|
-
z.object({
|
|
1641
|
-
result: EntitySearchResultSchema,
|
|
1642
|
-
pending: z.boolean()
|
|
1643
|
-
});
|
|
1644
|
-
|
|
1645
|
-
// src/query/fetchers/entities.ts
|
|
1646
|
-
var EMPTY_SEARCH2 = { results: [], hasMore: false };
|
|
1647
|
-
async function fetchEntitySearch(config, query, limit, options = {}) {
|
|
1648
|
-
if (!query.trim()) return EMPTY_SEARCH2;
|
|
1649
|
-
const params = new URLSearchParams({ q: query });
|
|
1650
|
-
if (limit !== void 0) params.set("limit", String(limit));
|
|
1651
|
-
const data = await apiFetch(config, `/api/entities/search?${params.toString()}`, {
|
|
1652
|
-
cache: "no-store",
|
|
1653
|
-
...options
|
|
1654
|
-
});
|
|
1655
|
-
return EntitySearchResponseSchema.parse(data);
|
|
1656
|
-
}
|
|
1657
|
-
async function selectEntity(config, body, options = {}) {
|
|
1658
|
-
const data = await apiFetch(config, "/api/entities/select", {
|
|
1659
|
-
method: "POST",
|
|
1660
|
-
body,
|
|
1661
|
-
credentials: "include",
|
|
1662
|
-
...options
|
|
1663
|
-
});
|
|
1664
|
-
return EntitySelectResponseSchema.parse(data);
|
|
1665
|
-
}
|
|
1666
|
-
async function importSearchEntities(config, query, options = {}) {
|
|
1667
|
-
if (!query.trim()) return [];
|
|
1668
|
-
const data = await apiFetch(config, "/api/entities/import-search", {
|
|
1669
|
-
method: "POST",
|
|
1670
|
-
body: { q: query },
|
|
1671
|
-
credentials: "include",
|
|
1672
|
-
...options
|
|
1673
|
-
});
|
|
1674
|
-
return EntityImportSearchResponseSchema.parse(data).results;
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
// src/query/fetchers/org.ts
|
|
1678
|
-
function submitOrgClaim(config, body, options = {}) {
|
|
1679
|
-
return apiWrite(config, "/api/org/claim", "POST", { body, ...options });
|
|
1680
|
-
}
|
|
1681
|
-
function updateOrgProfile(config, body, options = {}) {
|
|
1682
|
-
return apiWrite(config, "/api/org/profile", "PUT", {
|
|
1683
|
-
body,
|
|
1684
|
-
...options
|
|
1685
|
-
});
|
|
1686
|
-
}
|
|
1687
|
-
function requestOrgDomainChallenge(config, body, options = {}) {
|
|
1688
|
-
return apiWrite(config, "/api/org/domains/challenge", "POST", {
|
|
1689
|
-
body,
|
|
1690
|
-
...options
|
|
1691
|
-
});
|
|
1692
|
-
}
|
|
1693
|
-
function verifyOrgDomain(config, body, options = {}) {
|
|
1694
|
-
return apiWrite(config, "/api/org/domains/verify", "POST", {
|
|
1695
|
-
body,
|
|
1696
|
-
...options
|
|
1697
|
-
});
|
|
1698
|
-
}
|
|
1699
|
-
function addOrgNotificationEmail(config, body, options = {}) {
|
|
1700
|
-
return apiWrite(
|
|
1701
|
-
config,
|
|
1702
|
-
"/api/org/notification-emails",
|
|
1703
|
-
"POST",
|
|
1704
|
-
{ body, ...options }
|
|
1705
|
-
);
|
|
1706
|
-
}
|
|
1707
|
-
function removeOrgNotificationEmail(config, body, options = {}) {
|
|
1708
|
-
return apiWrite(
|
|
1709
|
-
config,
|
|
1710
|
-
"/api/org/notification-emails",
|
|
1711
|
-
"DELETE",
|
|
1712
|
-
{ body, ...options }
|
|
1713
|
-
);
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
// src/logic/date-lookahead.ts
|
|
1717
|
-
function isBeyondLookahead(value, months, now = /* @__PURE__ */ new Date()) {
|
|
1718
|
-
const match = /^(\d{4})(?:-(\d{2}))?/.exec(value);
|
|
1719
|
-
if (!match) return false;
|
|
1720
|
-
const index = Number(match[1]) * 12 + (match[2] ? Number(match[2]) : 1);
|
|
1721
|
-
const limit = now.getFullYear() * 12 + now.getMonth() + 1 + months;
|
|
1722
|
-
return index > limit;
|
|
1723
|
-
}
|
|
1724
|
-
function isUpcomingStart(startedAt, now = /* @__PURE__ */ new Date()) {
|
|
1725
|
-
return !!startedAt && isBeyondLookahead(startedAt, 0, now);
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
// src/logic/primary-position.ts
|
|
1729
|
-
function pickPrimaryPosition(positions, now = /* @__PURE__ */ new Date()) {
|
|
1730
|
-
if (!positions || positions.length === 0) return void 0;
|
|
1731
|
-
const active = positions.filter(
|
|
1732
|
-
(p) => !p.endedAt && !p.hidden && !isUpcomingStart(p.startedAt, now)
|
|
1733
|
-
);
|
|
1734
|
-
if (active.length === 0) return void 0;
|
|
1735
|
-
const flagged = active.find((p) => p.primary === true);
|
|
1736
|
-
if (flagged) return flagged;
|
|
1737
|
-
return [...active].sort((a, b) => (b.startedAt ?? "").localeCompare(a.startedAt ?? ""))[0];
|
|
1738
|
-
}
|
|
1739
|
-
|
|
1740
|
-
// src/logic/profile-summary.ts
|
|
1741
|
-
var DEFAULT_MAX_SKILLS = 5;
|
|
1742
|
-
function summarizeProfileView(view, options = {}) {
|
|
1743
|
-
const limit = Math.max(0, options.maxSkills ?? DEFAULT_MAX_SKILLS);
|
|
1744
|
-
const primary = pickPrimaryPosition(view.positions);
|
|
1745
|
-
return {
|
|
1746
|
-
did: view.did,
|
|
1747
|
-
handle: view.handle,
|
|
1748
|
-
displayName: view.displayName,
|
|
1749
|
-
avatar: view.avatar,
|
|
1750
|
-
pronouns: view.pronouns,
|
|
1751
|
-
headline: view.headline,
|
|
1752
|
-
currentTitle: primary?.title,
|
|
1753
|
-
currentCompany: primary ? primary.entityName ?? primary.company : void 0,
|
|
1754
|
-
topSkills: (view.skills ?? []).slice(0, limit).map((s) => s.name),
|
|
1755
|
-
claimed: view.claimed ?? false
|
|
1756
|
-
};
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
|
-
// src/query/fetchers/profile-summary.ts
|
|
1760
|
-
async function fetchProfileSummary(config, actor, options = {}) {
|
|
1761
|
-
const { maxSkills, ...fetchOptions } = options;
|
|
1762
|
-
const view = await fetchGetProfileView(config, actor, fetchOptions);
|
|
1763
|
-
return view ? summarizeProfileView(view, { maxSkills }) : null;
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
// src/query/keys.ts
|
|
1767
|
-
var sifaQueryKeys = {
|
|
1768
|
-
all: () => ["sifa"],
|
|
1769
|
-
profile: {
|
|
1770
|
-
all: () => ["sifa", "profile"],
|
|
1771
|
-
byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid],
|
|
1772
|
-
atFundLink: (did) => ["sifa", "profile", "at-fund-link", did],
|
|
1773
|
-
view: (actor) => ["sifa", "profile", "view", actor],
|
|
1774
|
-
externalAccounts: (handleOrDid) => ["sifa", "profile", "external-accounts", handleOrDid],
|
|
1775
|
-
// Session-scoped: the AppView reads the owner from the session cookie, so
|
|
1776
|
-
// there is only ever one completeness result per client.
|
|
1777
|
-
completeness: () => ["sifa", "profile", "completeness"]
|
|
1778
|
-
},
|
|
1779
|
-
position: {
|
|
1780
|
-
all: () => ["sifa", "position"],
|
|
1781
|
-
byOwner: (did) => ["sifa", "position", "by-owner", did],
|
|
1782
|
-
// Session-scoped: the AppView reads the owner from the session cookie.
|
|
1783
|
-
unlinked: () => ["sifa", "position", "unlinked"]
|
|
1784
|
-
},
|
|
1785
|
-
// Aggregate inbox counts for the header bell badge (session-scoped). The first
|
|
1786
|
-
// aggregate namespace: it fans in across confirmations, endorsements, drift,
|
|
1787
|
-
// unlinked positions and profile completeness on the server.
|
|
1788
|
-
inbox: {
|
|
1789
|
-
all: () => ["sifa", "inbox"],
|
|
1790
|
-
counts: () => ["sifa", "inbox", "counts"]
|
|
1791
|
-
},
|
|
1792
|
-
search: {
|
|
1793
|
-
all: () => ["sifa", "search"],
|
|
1794
|
-
profiles: (filters) => ["sifa", "search", "profiles", filters],
|
|
1795
|
-
companies: (filters) => ["sifa", "search", "companies", filters],
|
|
1796
|
-
skills: (query) => ["sifa", "search", "skills", query],
|
|
1797
|
-
canonicalSkills: (query, limit) => ["sifa", "search", "canonical-skills", query, limit],
|
|
1798
|
-
filters: () => ["sifa", "search", "filters"]
|
|
1799
|
-
},
|
|
1800
|
-
entity: {
|
|
1801
|
-
all: () => ["sifa", "entity"],
|
|
1802
|
-
search: (query, limit) => ["sifa", "entity", "search", query, limit]
|
|
1803
|
-
},
|
|
1804
|
-
discovery: {
|
|
1805
|
-
all: () => ["sifa", "discovery"],
|
|
1806
|
-
similar: (did, limit) => ["sifa", "discovery", "similar", did, limit],
|
|
1807
|
-
suggestions: (opts) => ["sifa", "discovery", "suggestions", opts],
|
|
1808
|
-
suggestionCount: (since) => ["sifa", "discovery", "suggestion-count", since ?? null],
|
|
1809
|
-
featured: () => ["sifa", "discovery", "featured"]
|
|
1810
|
-
},
|
|
1811
|
-
follow: {
|
|
1812
|
-
all: () => ["sifa", "follow"],
|
|
1813
|
-
following: (opts) => ["sifa", "follow", "following", opts],
|
|
1814
|
-
followers: (handle) => ["sifa", "follow", "followers", handle],
|
|
1815
|
-
followingOf: (handle) => ["sifa", "follow", "following-of", handle],
|
|
1816
|
-
feed: (opts) => ["sifa", "follow", "feed", opts],
|
|
1817
|
-
mutuals: (handle) => ["sifa", "follow", "mutuals", handle],
|
|
1818
|
-
blueskySuggestions: () => ["sifa", "follow", "bluesky-suggestions"]
|
|
1819
|
-
},
|
|
1820
|
-
admin: {
|
|
1821
|
-
all: () => ["sifa", "admin"],
|
|
1822
|
-
featureAllowlist: (flag) => ["sifa", "admin", "feature-allowlist", flag],
|
|
1823
|
-
reviewQueues: () => ["sifa", "admin", "review-queues"]
|
|
1824
|
-
},
|
|
1825
|
-
stats: {
|
|
1826
|
-
all: () => ["sifa", "stats"],
|
|
1827
|
-
homepage: () => ["sifa", "stats", "homepage"]
|
|
1828
|
-
},
|
|
1829
|
-
apps: {
|
|
1830
|
-
all: () => ["sifa", "apps"],
|
|
1831
|
-
registry: () => ["sifa", "apps", "registry"],
|
|
1832
|
-
hidden: () => ["sifa", "apps", "hidden"]
|
|
1833
|
-
},
|
|
1834
|
-
auth: {
|
|
1835
|
-
all: () => ["sifa", "auth"],
|
|
1836
|
-
// Session-scoped: the AppView reads the account list from the browser's
|
|
1837
|
-
// cookies, so there is only ever one list per client.
|
|
1838
|
-
accounts: () => ["sifa", "auth", "accounts"]
|
|
1839
|
-
},
|
|
1840
|
-
activity: {
|
|
1841
|
-
all: () => ["sifa", "activity"],
|
|
1842
|
-
heatmap: (handleOrDid, days) => ["sifa", "activity", "heatmap", handleOrDid, days],
|
|
1843
|
-
teaser: (handleOrDid) => ["sifa", "activity", "teaser", handleOrDid],
|
|
1844
|
-
feed: (handleOrDid, opts) => ["sifa", "activity", "feed", handleOrDid, opts],
|
|
1845
|
-
// Session-scoped: the AppView reads the caller's own hides from their
|
|
1846
|
-
// cookie, so there is only ever one list per client.
|
|
1847
|
-
hiddenItems: () => ["sifa", "activity", "hidden-items"]
|
|
1848
|
-
},
|
|
1849
|
-
github: {
|
|
1850
|
-
all: () => ["sifa", "github"],
|
|
1851
|
-
myPullRequests: (opts) => ["sifa", "github", "my-pull-requests", opts]
|
|
1852
|
-
},
|
|
1853
|
-
endorsement: {
|
|
1854
|
-
all: () => ["sifa", "endorsement"],
|
|
1855
|
-
count: (did) => ["sifa", "endorsement", "count", did],
|
|
1856
|
-
// Scoped to the session rather than a DID -- the AppView reads the subject
|
|
1857
|
-
// from the session cookie, so there is only ever one inbox per client.
|
|
1858
|
-
pending: () => ["sifa", "endorsement", "pending"],
|
|
1859
|
-
// Also session-scoped: the AppView picks the candidate from the viewer's
|
|
1860
|
-
// own follows, dismissals and blocks.
|
|
1861
|
-
reciprocity: () => ["sifa", "endorsement", "reciprocity"],
|
|
1862
|
-
received: (did) => ["sifa", "endorsement", "received", did]
|
|
1863
|
-
},
|
|
1864
|
-
confirmation: {
|
|
1865
|
-
all: () => ["sifa", "confirmation"],
|
|
1866
|
-
// Scoped to the session for the same reason as the endorsement inbox: the
|
|
1867
|
-
// AppView reads the subject from the session cookie, so there is only ever
|
|
1868
|
-
// one inbox per client.
|
|
1869
|
-
pending: () => ["sifa", "confirmation", "pending"],
|
|
1870
|
-
/** Confirmations this session has given, for the withdraw surface. */
|
|
1871
|
-
given: () => ["sifa", "confirmation", "given"]
|
|
1872
|
-
},
|
|
1873
|
-
stream: {
|
|
1874
|
-
all: () => ["sifa", "stream"],
|
|
1875
|
-
networkCount: (did) => ["sifa", "stream", "network-count", did]
|
|
1876
|
-
},
|
|
1877
|
-
reactions: {
|
|
1878
|
-
all: () => ["sifa", "reactions"],
|
|
1879
|
-
status: (uris) => ["sifa", "reactions", "status", uris],
|
|
1880
|
-
accountCheck: (appId) => ["sifa", "reactions", "account-check", appId]
|
|
1881
|
-
},
|
|
1882
|
-
roadmap: {
|
|
1883
|
-
all: () => ["sifa", "roadmap"],
|
|
1884
|
-
votes: () => ["sifa", "roadmap", "votes"],
|
|
1885
|
-
myVotes: () => ["sifa", "roadmap", "my-votes"]
|
|
1886
|
-
},
|
|
1887
|
-
bskyPreferences: {
|
|
1888
|
-
all: () => ["sifa", "bsky-preferences"],
|
|
1889
|
-
contentLabels: () => ["sifa", "bsky-preferences", "content-labels"]
|
|
1890
|
-
},
|
|
1891
|
-
repoInventory: {
|
|
1892
|
-
all: () => ["sifa", "repo-inventory"],
|
|
1893
|
-
list: () => ["sifa", "repo-inventory", "list"]
|
|
1894
|
-
},
|
|
1895
|
-
destructive: {
|
|
1896
|
-
all: () => ["sifa", "destructive"],
|
|
1897
|
-
wipePreview: () => ["sifa", "destructive", "wipe-preview"]
|
|
1898
|
-
}
|
|
1899
|
-
};
|
|
1900
|
-
function maxGraphemes(max) {
|
|
1901
|
-
return (value) => {
|
|
1902
|
-
const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
1903
|
-
let count = 0;
|
|
1904
|
-
for (const _ of segmenter.segment(value)) {
|
|
1905
|
-
count++;
|
|
1906
|
-
if (count > max) return false;
|
|
1907
|
-
}
|
|
1908
|
-
return true;
|
|
1909
|
-
};
|
|
1910
|
-
}
|
|
1911
|
-
var didSchema = z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, "Invalid DID");
|
|
1912
|
-
var datetimeSchema = z.string().datetime({ offset: true });
|
|
1913
|
-
var partialDateSchema = z.string().regex(/^\d{4}(-\d{2}(-\d{2}(T.+)?)?)?$/, "Expected YYYY, YYYY-MM, YYYY-MM-DD, or a datetime");
|
|
1914
|
-
var atUriSchema = z.string().regex(/^at:\/\/[^\s]+$/, "Invalid AT-URI");
|
|
1915
|
-
var cidSchema = z.string().regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, "Invalid CID");
|
|
1916
|
-
z.string().regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, "Invalid BCP 47 language tag");
|
|
1917
|
-
var uriSchema = z.string().url();
|
|
1918
|
-
var strongRefSchema = z.object({
|
|
1919
|
-
uri: atUriSchema,
|
|
1920
|
-
cid: cidSchema
|
|
1921
|
-
});
|
|
1922
|
-
z.object({
|
|
1923
|
-
uri: atUriSchema
|
|
1924
|
-
});
|
|
1925
|
-
var externalRecordRefSchema = z.object({
|
|
1926
|
-
uri: atUriSchema,
|
|
1927
|
-
cid: cidSchema.optional()
|
|
1928
|
-
});
|
|
1929
|
-
z.object({
|
|
1930
|
-
name: z.string().min(1).refine(maxGraphemes(256)).max(2560),
|
|
1931
|
-
did: didSchema.optional(),
|
|
1932
|
-
entityRef: uriSchema.optional()
|
|
1933
|
-
}).passthrough();
|
|
1934
|
-
var selfLabelsSchema = z.object({
|
|
1935
|
-
$type: z.literal("com.atproto.label.defs#selfLabels").optional(),
|
|
1936
|
-
values: z.array(z.object({ val: z.string() }))
|
|
1937
|
-
});
|
|
1938
|
-
var projectMemberRefSchema = z.object({
|
|
1939
|
-
did: didSchema,
|
|
1940
|
-
role: z.string().optional(),
|
|
1941
|
-
title: z.string().refine(maxGraphemes(128)).max(1280).optional()
|
|
1942
|
-
});
|
|
1943
|
-
z.object({
|
|
1944
|
-
name: z.string().min(1).refine(maxGraphemes(256)).max(2560),
|
|
1945
|
-
// The user's own role on the project (#596), e.g. Maintainer.
|
|
1946
|
-
role: z.string().refine(maxGraphemes(256)).max(2560).optional(),
|
|
1947
|
-
description: z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
1948
|
-
url: uriSchema.optional(),
|
|
1949
|
-
members: z.array(projectMemberRefSchema).max(50).optional(),
|
|
1950
|
-
/**
|
|
1951
|
-
* The canonical `id.sifa.project.self` this personal entry corresponds to.
|
|
1952
|
-
* A composition link. For the same project recorded on someone else's
|
|
1953
|
-
* profile, see `sameAs`.
|
|
1954
|
-
*/
|
|
1955
|
-
projectRef: strongRefSchema.optional(),
|
|
1956
|
-
/**
|
|
1957
|
-
* The same project as recorded on another person's profile. Each side stays
|
|
1958
|
-
* its own record; this only says the two describe one thing. Resolves by
|
|
1959
|
-
* AT-URI, since they will keep editing their copy.
|
|
1960
|
-
*/
|
|
1961
|
-
sameAs: externalRecordRefSchema.optional(),
|
|
1962
|
-
position: strongRefSchema.optional(),
|
|
1963
|
-
startedAt: partialDateSchema.optional(),
|
|
1964
|
-
endedAt: partialDateSchema.optional(),
|
|
1965
|
-
labels: selfLabelsSchema.optional(),
|
|
1966
|
-
isPrimary: z.boolean().optional(),
|
|
1967
|
-
createdAt: datetimeSchema
|
|
1968
|
-
});
|
|
1969
|
-
|
|
1970
|
-
// src/schemas/profile-involvement.ts
|
|
1971
|
-
var ArtifactLinkSchema = z.object({
|
|
1972
|
-
url: uriSchema,
|
|
1973
|
-
kind: z.string().optional(),
|
|
1974
|
-
label: z.string().refine(maxGraphemes(200)).max(2e3).optional()
|
|
1975
|
-
}).passthrough();
|
|
1976
|
-
z.object({
|
|
1977
|
-
kind: z.string(),
|
|
1978
|
-
upstream: z.string().refine(maxGraphemes(256)).max(2560).optional(),
|
|
1979
|
-
upstreamDid: didSchema.optional(),
|
|
1980
|
-
upstreamUrl: uriSchema.optional(),
|
|
1981
|
-
role: z.string().refine(maxGraphemes(256)).max(2560).optional(),
|
|
1982
|
-
description: z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
1983
|
-
startedAt: partialDateSchema.optional(),
|
|
1984
|
-
endedAt: partialDateSchema.optional(),
|
|
1985
|
-
links: z.array(ArtifactLinkSchema).max(50).optional(),
|
|
1986
|
-
// Portable org entity identifier (Wikidata/ROR/LEI URI) from the resolver
|
|
1987
|
-
// typeahead, constrained to http(s) so a script scheme is never a valid ref.
|
|
1988
|
-
entityRef: z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional(),
|
|
1989
|
-
// community.lexicon.location.address — validated at the app layer.
|
|
1990
|
-
location: z.unknown().optional(),
|
|
1991
|
-
// id.sifa.defs#skillRef references (at-uri to a skill record in the same repo).
|
|
1992
|
-
skills: z.array(z.object({ uri: z.string() })).max(50).optional(),
|
|
1993
|
-
labels: selfLabelsSchema.optional(),
|
|
1994
|
-
collaborators: z.array(projectMemberRefSchema).max(50).optional(),
|
|
1995
|
-
sameAs: externalRecordRefSchema.optional(),
|
|
1996
|
-
isPrimary: z.boolean().optional(),
|
|
1997
|
-
createdAt: datetimeSchema
|
|
1998
|
-
}).passthrough();
|
|
1999
|
-
|
|
2000
|
-
// src/schemas/profile-investment.ts
|
|
2001
|
-
var entityRefField = z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional();
|
|
2002
|
-
var InvestmentAmountSchema = z.object({
|
|
2003
|
-
/** Whole major currency units (euros, not cents). Cheque sizes are round numbers. */
|
|
2004
|
-
value: z.number().int().min(0),
|
|
2005
|
-
/** ISO 4217 three-letter code, uppercase. */
|
|
2006
|
-
currency: z.string().length(3)
|
|
2007
|
-
});
|
|
2008
|
-
var PROFILE_INVESTMENT_NSID = "id.sifa.profile.investment";
|
|
2009
|
-
z.object({
|
|
2010
|
-
/** For a limited-partner entry this names the fund, not a portfolio company. */
|
|
2011
|
-
company: z.string().min(1).refine(maxGraphemes(256)).max(2560),
|
|
2012
|
-
companyDid: didSchema.optional(),
|
|
2013
|
-
entityRef: entityRefField,
|
|
2014
|
-
role: z.string().optional(),
|
|
2015
|
-
stage: z.string().optional(),
|
|
2016
|
-
status: z.string().optional(),
|
|
2017
|
-
/** The vehicle the capital went through. Absent for a cheque in the person's own name. */
|
|
2018
|
-
via: z.string().refine(maxGraphemes(256)).max(2560).optional(),
|
|
2019
|
-
viaDid: didSchema.optional(),
|
|
2020
|
-
viaEntityRef: entityRefField,
|
|
2021
|
-
/**
|
|
2022
|
-
* Optional and empty by default. Cheque size is a personal financial disclosure,
|
|
2023
|
-
* and clients must not prompt for it.
|
|
2024
|
-
*/
|
|
2025
|
-
amount: InvestmentAmountSchema.optional(),
|
|
2026
|
-
startedAt: partialDateSchema.optional(),
|
|
2027
|
-
endedAt: partialDateSchema.optional(),
|
|
2028
|
-
description: z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
2029
|
-
links: z.array(ArtifactLinkSchema).max(50).optional(),
|
|
2030
|
-
labels: selfLabelsSchema.optional(),
|
|
2031
|
-
createdAt: datetimeSchema
|
|
2032
|
-
}).passthrough();
|
|
2033
|
-
|
|
2034
|
-
// src/query/fetchers/investments.ts
|
|
2035
|
-
function createInvestment(config, data, options = {}) {
|
|
2036
|
-
return createRecord(config, PROFILE_INVESTMENT_NSID, data, options);
|
|
2037
|
-
}
|
|
2038
|
-
function updateInvestment(config, rkey, data, options = {}) {
|
|
2039
|
-
return updateRecord(config, PROFILE_INVESTMENT_NSID, rkey, data, options);
|
|
2040
|
-
}
|
|
2041
|
-
function deleteInvestment(config, rkey, options = {}) {
|
|
2042
|
-
return deleteRecord(config, PROFILE_INVESTMENT_NSID, rkey, options);
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
|
-
export { ApiError, HIDDEN_ITEM_SOURCES, HIDDEN_ITEM_TYPES, PROFILE_COMPLETENESS_SIGNALS, QUOTED_POSTS_BATCH_MAX, RpgItemStatusSchema, RpgStatusResponseSchema, addFeatureAllowlist, addOrgNotificationEmail, apiFetch, apiFetchOrNull, apiWrite, apiWriteCreate, bulkHideProfileItems, bulkHideStandardPublications, bulkUnhideProfileItems, bulkUnhideStandardPublications, castRoadmapVote, checkAppAccount, checkNetworkMapJobStatus, confirmEndorsement, createConfirmation, createEducation, createEndorsement, createExternalAccount, createInvestment, createPosition, createProfileLocation, createReaction, createRecord, createSkill, deleteAccount, deleteAvatarOverride, deleteEducation, deleteExternalAccount, deleteInvestment, deleteNamePronunciationAudio, deletePosition, deleteProfileLocation, deleteReaction, deleteRecord, deleteRepoRecords, deleteSkill, dismissConfirmation, dismissEndorsement, dismissUnlinkedPosition, fetchAccounts, fetchActivityFeed, fetchActivityTeaser, fetchAppsRegistry, fetchAtFundLink, fetchEndorsementCount, fetchEntitySearch, fetchExternalAccounts, fetchFeaturedProfile, fetchFollowing, fetchFollowingFeed, fetchGetProfileView, fetchGivenConfirmations, fetchHeatmapData, fetchHiddenActivityItems, fetchHiddenApps, fetchInboxCounts, fetchMyGithubPullRequests, fetchMyRoadmapVotes, fetchNetworkMap, fetchNetworkStreamCount, fetchPendingConfirmations, fetchPendingEndorsements, fetchProfile, fetchProfileCompleteness, fetchProfileSummary, fetchReactionStatus, fetchReceivedEndorsements, fetchReciprocityCandidate, fetchRepoInventory, fetchRoadmapVotes, fetchRpgStatus, fetchSearchCompanies, fetchSearchFilters, fetchSearchProfiles, fetchSimilarProfiles, fetchSkillSuggestions, fetchSpeakers, fetchStats, fetchSuggestionCount, fetchSuggestions, fetchTalks, fetchUnlinkedPositions, fetchWipePreview, followUser, getAdminReviewQueues, getBlueskySuggestions, getFollowers, getFollowing, getMutuals, hideActivityItem, hideKeytraceClaim, hideOrcidPublication, hideProfileItem, hideSifaPublication, hideStandardPublication, importSearchEntities, initiateNetworkMapGeneration, isNetworkMapResponse, linkSkillToPosition, listFeatureAllowlist, refreshOrcidPublications, refreshPds, removeFeatureAllowlist, removeOrgNotificationEmail, repoExportUrl, requestOrgDomainChallenge, resetProfile, resolveQuotedPosts, retractRoadmapVote, revealMarqueDomain, revokeConfirmation, searchSkills, selectEntity, setExternalAccountPrimary, setPositionPrimary, setSectionPrimary, sifaQueryKeys, submitOrgClaim, switchAccount, unfollowUser, unhideActivityItem, unhideKeytraceClaim, unhideOrcidPublication, unhideProfileItem, unhideSifaPublication, unhideStandardPublication, unlinkSkillFromPosition, unrevealMarqueDomain, unsetExternalAccountPrimary, unsetPositionPrimary, unsetSectionPrimary, updateEducation, updateExternalAccount, updateInvestment, updateOrgProfile, updatePosition, updateProfileLocation, updateProfileOverride, updateProfileSelf, updateRecord, updateSkill, uploadAvatar, uploadNamePronunciationAudio, verifyExternalAccount, verifyOrgDomain };
|
|
2046
|
-
//# sourceMappingURL=index.js.map
|
|
2047
362
|
//# sourceMappingURL=index.js.map
|