@singi-labs/sifa-sdk 0.10.17 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -986,8 +986,46 @@ interface FetchMyRoadmapVotesOptions extends ApiFetchOptions {
986
986
  * error or when the response payload is shaped unexpectedly.
987
987
  */
988
988
  declare function fetchMyRoadmapVotes(config: SifaApiConfig, options?: FetchMyRoadmapVotesOptions): Promise<string[]>;
989
- /** Cast a vote on a roadmap item by its key. */
990
- declare function castRoadmapVote(config: SifaApiConfig, key: string, options?: ApiFetchOptions): Promise<WriteResult>;
989
+ /** Result of a successful {@link castRoadmapVote} -- the created upvote record. */
990
+ interface RoadmapVoteResult {
991
+ uri: string;
992
+ rkey: string;
993
+ }
994
+ /** Structured error returned by {@link castRoadmapVote} on failure. */
995
+ interface RoadmapVoteError {
996
+ type: 'scope_insufficient' | 'error';
997
+ /**
998
+ * When `type === 'scope_insufficient'`, the lexicon collection the user must
999
+ * re-authorize for (e.g. `app.userinput.upvote`). sifa-web maps this to an
1000
+ * OAuth scope-upgrade flow (`/oauth/reauth?scope=repo:<collection>`).
1001
+ */
1002
+ requiredScope?: string;
1003
+ }
1004
+ /**
1005
+ * Discriminated-union result of {@link castRoadmapVote}. Exported so the
1006
+ * `useCastRoadmapVote` hook and SDK consumers can type mutation handlers
1007
+ * against a single source of truth.
1008
+ */
1009
+ type CastRoadmapVoteResult = {
1010
+ ok: true;
1011
+ data: RoadmapVoteResult;
1012
+ } | {
1013
+ ok: false;
1014
+ error: RoadmapVoteError;
1015
+ };
1016
+ /**
1017
+ * Cast a vote on a roadmap item by its key.
1018
+ *
1019
+ * Writes an `app.userinput.upvote` record into the viewer's PDS (server-side,
1020
+ * via their OAuth session). Returns a discriminated-union result rather than
1021
+ * the generic {@link WriteResult} because a first-time voter's PDS grant may
1022
+ * not yet include the `app.userinput.upvote` collection: the AppView responds
1023
+ * 403 `ScopeInsufficient`, which the caller handles by triggering an OAuth
1024
+ * scope upgrade rather than showing an error. Mirrors {@link createReaction}.
1025
+ *
1026
+ * Never throws.
1027
+ */
1028
+ declare function castRoadmapVote(config: SifaApiConfig, key: string, options?: ApiFetchOptions): Promise<CastRoadmapVoteResult>;
991
1029
  /** Retract a previously-cast roadmap vote. */
992
1030
  declare function retractRoadmapVote(config: SifaApiConfig, key: string, options?: ApiFetchOptions): Promise<WriteResult>;
993
1031
 
@@ -1110,4 +1148,4 @@ declare const sifaQueryKeys: {
1110
1148
  };
1111
1149
  type SifaQueryKey = ReturnType<typeof sifaQueryKeys.all> | ReturnType<typeof sifaQueryKeys.profile.all> | ReturnType<typeof sifaQueryKeys.profile.byHandle> | ReturnType<typeof sifaQueryKeys.profile.atFundLink> | ReturnType<typeof sifaQueryKeys.profile.externalAccounts> | ReturnType<typeof sifaQueryKeys.position.all> | ReturnType<typeof sifaQueryKeys.position.byOwner> | ReturnType<typeof sifaQueryKeys.search.all> | ReturnType<typeof sifaQueryKeys.search.profiles> | ReturnType<typeof sifaQueryKeys.search.canonicalSkills> | ReturnType<typeof sifaQueryKeys.search.skills> | ReturnType<typeof sifaQueryKeys.search.filters> | ReturnType<typeof sifaQueryKeys.discovery.all> | ReturnType<typeof sifaQueryKeys.discovery.similar> | ReturnType<typeof sifaQueryKeys.discovery.suggestions> | ReturnType<typeof sifaQueryKeys.discovery.suggestionCount> | ReturnType<typeof sifaQueryKeys.discovery.featured> | ReturnType<typeof sifaQueryKeys.follow.all> | ReturnType<typeof sifaQueryKeys.follow.following> | ReturnType<typeof sifaQueryKeys.follow.followers> | ReturnType<typeof sifaQueryKeys.follow.followingOf> | ReturnType<typeof sifaQueryKeys.follow.feed> | ReturnType<typeof sifaQueryKeys.follow.mutuals> | ReturnType<typeof sifaQueryKeys.follow.blueskySuggestions> | ReturnType<typeof sifaQueryKeys.admin.all> | ReturnType<typeof sifaQueryKeys.admin.featureAllowlist> | ReturnType<typeof sifaQueryKeys.stats.all> | ReturnType<typeof sifaQueryKeys.stats.homepage> | ReturnType<typeof sifaQueryKeys.apps.all> | ReturnType<typeof sifaQueryKeys.apps.registry> | ReturnType<typeof sifaQueryKeys.apps.hidden> | ReturnType<typeof sifaQueryKeys.activity.all> | ReturnType<typeof sifaQueryKeys.activity.heatmap> | ReturnType<typeof sifaQueryKeys.activity.teaser> | ReturnType<typeof sifaQueryKeys.activity.feed> | ReturnType<typeof sifaQueryKeys.endorsement.all> | ReturnType<typeof sifaQueryKeys.endorsement.count> | ReturnType<typeof sifaQueryKeys.stream.all> | ReturnType<typeof sifaQueryKeys.stream.networkCount> | ReturnType<typeof sifaQueryKeys.reactions.all> | ReturnType<typeof sifaQueryKeys.reactions.status> | ReturnType<typeof sifaQueryKeys.reactions.accountCheck> | ReturnType<typeof sifaQueryKeys.roadmap.all> | ReturnType<typeof sifaQueryKeys.roadmap.votes> | ReturnType<typeof sifaQueryKeys.roadmap.myVotes> | ReturnType<typeof sifaQueryKeys.bskyPreferences.all> | ReturnType<typeof sifaQueryKeys.bskyPreferences.contentLabels>;
1112
1150
 
1113
- export { type QuotedPostView as $, type ApiFetchOptions as A, type BulkHideProfileItemInput as B, type CheckAppAccountOptions as C, type DeleteAccountResult as D, type EndorsementInput as E, type FeatureAllowlistResponse as F, type FollowingResponse as G, HIDDEN_ITEM_SOURCES as H, HIDDEN_ITEM_TYPES as I, type HeatmapDay as J, type HeatmapResponse as K, type HiddenApp as L, type HiddenItemSource as M, type HiddenItemType as N, type HideProfileItemInput as O, type ListFeatureAllowlistOptions as P, type ProfileIndustryInput as Q, type ProfileLocationAddress as R, type SifaApiConfig as S, type ProfileLocationInput as T, type ProfileSearchResult as U, type ProfileSelfLocation as V, type WriteResult as W, QUOTED_POSTS_BATCH_MAX as X, type QuotedPostAuthor as Y, type QuotedPostImage as Z, type QuotedPostResult as _, type AccountCheckResult as a, getMutuals as a$, type ReactionError as a0, type ReactionResult as a1, type ReactionStatus as a2, type RefreshOrcidPublicationsResult as a3, type RefreshPdsResult as a4, type ResolveQuotedPostsOptions as a5, type RoadmapVoter as a6, type RoadmapVotesResponse as a7, type SearchFilters as a8, type SearchResponse as a9, deleteAvatarOverride as aA, deleteExternalAccount as aB, deleteProfileLocation as aC, deleteReaction as aD, fetchActivityFeed as aE, fetchActivityTeaser as aF, fetchAppsRegistry as aG, fetchExternalAccounts as aH, fetchFeaturedProfile as aI, fetchFollowing as aJ, fetchHeatmapData as aK, fetchHiddenApps as aL, fetchMyRoadmapVotes as aM, fetchReactionStatus as aN, fetchRoadmapVotes as aO, fetchSearchFilters as aP, fetchSearchProfiles as aQ, fetchSimilarProfiles as aR, fetchSkillSuggestions as aS, fetchStats as aT, fetchSuggestionCount as aU, fetchSuggestions as aV, followUser as aW, getBlueskySuggestions as aX, getFollowers as aY, getFollowing as aZ, getFollowingFeed as a_, type SifaQueryKey as aa, type SimilarProfile as ab, type SkillSearchResult as ac, type StatsResponse as ad, type SuggestionProfile as ae, type SuggestionsResponse as af, type UpdateProfileOverrideInput as ag, type UpdateProfileSelfInput as ah, type UploadAvatarResult as ai, type VerifyExternalAccountResult as aj, addFeatureAllowlist as ak, apiFetch as al, apiFetchOrNull as am, apiWrite as an, apiWriteCreate as ao, bulkHideProfileItems as ap, bulkHideStandardPublications as aq, bulkUnhideProfileItems as ar, bulkUnhideStandardPublications as as, castRoadmapVote as at, checkAppAccount as au, createEndorsement as av, createExternalAccount as aw, createProfileLocation as ax, createReaction as ay, deleteAccount as az, type ActivityFeedResponse as b, hideOrcidPublication as b0, hideProfileItem as b1, hideSifaPublication as b2, hideStandardPublication as b3, listFeatureAllowlist as b4, refreshOrcidPublications as b5, refreshPds as b6, removeFeatureAllowlist as b7, resetProfile as b8, resolveQuotedPosts as b9, retractRoadmapVote as ba, searchSkills as bb, setExternalAccountPrimary as bc, unfollowUser as bd, unhideOrcidPublication as be, unhideProfileItem as bf, unhideSifaPublication as bg, unhideStandardPublication as bh, unsetExternalAccountPrimary as bi, updateExternalAccount as bj, updateProfileLocation as bk, updateProfileOverride as bl, updateProfileSelf as bm, uploadAvatar as bn, verifyExternalAccount as bo, type ActivityItem as c, type ActivityItemLinkHealth as d, type ActivityTeaserResponse as e, ApiError as f, type AppRegistryEntry as g, type CreateExternalAccountResult as h, type CreateResult as i, type ExternalAccountInput as j, type FeaturedProfile as k, type FetchActivityFeedOptions as l, type FetchActivityTeaserOptions as m, type FetchFollowListOptions as n, type FetchFollowProfilePageOptions as o, type FetchFollowingFeedOptions as p, type FetchHiddenAppsOptions as q, type FetchMyRoadmapVotesOptions as r, sifaQueryKeys as s, type FetchReactionStatusOptions as t, type FetchSuggestionsOptions as u, type FilterOptions as v, type FollowListPage as w, type FollowProfile as x, type FollowProfilePageResponse as y, type FollowUserResult as z };
1151
+ export { type QuotedPostResult as $, type ApiFetchOptions as A, type BulkHideProfileItemInput as B, type CastRoadmapVoteResult as C, type DeleteAccountResult as D, type EndorsementInput as E, type FeatureAllowlistResponse as F, type FollowUserResult as G, type FollowingResponse as H, HIDDEN_ITEM_SOURCES as I, HIDDEN_ITEM_TYPES as J, type HeatmapDay as K, type HeatmapResponse as L, type HiddenApp as M, type HiddenItemSource as N, type HiddenItemType as O, type HideProfileItemInput as P, type ListFeatureAllowlistOptions as Q, type ProfileIndustryInput as R, type SifaApiConfig as S, type ProfileLocationAddress as T, type ProfileLocationInput as U, type ProfileSearchResult as V, type WriteResult as W, type ProfileSelfLocation as X, QUOTED_POSTS_BATCH_MAX as Y, type QuotedPostAuthor as Z, type QuotedPostImage as _, type AccountCheckResult as a, getFollowers as a$, type QuotedPostView as a0, type ReactionError as a1, type ReactionResult as a2, type ReactionStatus as a3, type RefreshOrcidPublicationsResult as a4, type RefreshPdsResult as a5, type ResolveQuotedPostsOptions as a6, type RoadmapVoteError as a7, type RoadmapVoteResult as a8, type RoadmapVoter as a9, createProfileLocation as aA, createReaction as aB, deleteAccount as aC, deleteAvatarOverride as aD, deleteExternalAccount as aE, deleteProfileLocation as aF, deleteReaction as aG, fetchActivityFeed as aH, fetchActivityTeaser as aI, fetchAppsRegistry as aJ, fetchExternalAccounts as aK, fetchFeaturedProfile as aL, fetchFollowing as aM, fetchHeatmapData as aN, fetchHiddenApps as aO, fetchMyRoadmapVotes as aP, fetchReactionStatus as aQ, fetchRoadmapVotes as aR, fetchSearchFilters as aS, fetchSearchProfiles as aT, fetchSimilarProfiles as aU, fetchSkillSuggestions as aV, fetchStats as aW, fetchSuggestionCount as aX, fetchSuggestions as aY, followUser as aZ, getBlueskySuggestions as a_, type RoadmapVotesResponse as aa, type SearchFilters as ab, type SearchResponse as ac, type SifaQueryKey as ad, type SimilarProfile as ae, type SkillSearchResult as af, type StatsResponse as ag, type SuggestionProfile as ah, type SuggestionsResponse as ai, type UpdateProfileOverrideInput as aj, type UpdateProfileSelfInput as ak, type UploadAvatarResult as al, type VerifyExternalAccountResult as am, addFeatureAllowlist as an, apiFetch as ao, apiFetchOrNull as ap, apiWrite as aq, apiWriteCreate as ar, bulkHideProfileItems as as, bulkHideStandardPublications as at, bulkUnhideProfileItems as au, bulkUnhideStandardPublications as av, castRoadmapVote as aw, checkAppAccount as ax, createEndorsement as ay, createExternalAccount as az, type ActivityFeedResponse as b, getFollowing as b0, getFollowingFeed as b1, getMutuals as b2, hideOrcidPublication as b3, hideProfileItem as b4, hideSifaPublication as b5, hideStandardPublication as b6, listFeatureAllowlist as b7, refreshOrcidPublications as b8, refreshPds as b9, removeFeatureAllowlist as ba, resetProfile as bb, resolveQuotedPosts as bc, retractRoadmapVote as bd, searchSkills as be, setExternalAccountPrimary as bf, unfollowUser as bg, unhideOrcidPublication as bh, unhideProfileItem as bi, unhideSifaPublication as bj, unhideStandardPublication as bk, unsetExternalAccountPrimary as bl, updateExternalAccount as bm, updateProfileLocation as bn, updateProfileOverride as bo, updateProfileSelf as bp, uploadAvatar as bq, verifyExternalAccount as br, type ActivityItem as c, type ActivityItemLinkHealth as d, type ActivityTeaserResponse as e, ApiError as f, type AppRegistryEntry as g, type CheckAppAccountOptions as h, type CreateExternalAccountResult as i, type CreateResult as j, type ExternalAccountInput as k, type FeaturedProfile as l, type FetchActivityFeedOptions as m, type FetchActivityTeaserOptions as n, type FetchFollowListOptions as o, type FetchFollowProfilePageOptions as p, type FetchFollowingFeedOptions as q, type FetchHiddenAppsOptions as r, sifaQueryKeys as s, type FetchMyRoadmapVotesOptions as t, type FetchReactionStatusOptions as u, type FetchSuggestionsOptions as v, type FilterOptions as w, type FollowListPage as x, type FollowProfile as y, type FollowProfilePageResponse as z };
@@ -986,8 +986,46 @@ interface FetchMyRoadmapVotesOptions extends ApiFetchOptions {
986
986
  * error or when the response payload is shaped unexpectedly.
987
987
  */
988
988
  declare function fetchMyRoadmapVotes(config: SifaApiConfig, options?: FetchMyRoadmapVotesOptions): Promise<string[]>;
989
- /** Cast a vote on a roadmap item by its key. */
990
- declare function castRoadmapVote(config: SifaApiConfig, key: string, options?: ApiFetchOptions): Promise<WriteResult>;
989
+ /** Result of a successful {@link castRoadmapVote} -- the created upvote record. */
990
+ interface RoadmapVoteResult {
991
+ uri: string;
992
+ rkey: string;
993
+ }
994
+ /** Structured error returned by {@link castRoadmapVote} on failure. */
995
+ interface RoadmapVoteError {
996
+ type: 'scope_insufficient' | 'error';
997
+ /**
998
+ * When `type === 'scope_insufficient'`, the lexicon collection the user must
999
+ * re-authorize for (e.g. `app.userinput.upvote`). sifa-web maps this to an
1000
+ * OAuth scope-upgrade flow (`/oauth/reauth?scope=repo:<collection>`).
1001
+ */
1002
+ requiredScope?: string;
1003
+ }
1004
+ /**
1005
+ * Discriminated-union result of {@link castRoadmapVote}. Exported so the
1006
+ * `useCastRoadmapVote` hook and SDK consumers can type mutation handlers
1007
+ * against a single source of truth.
1008
+ */
1009
+ type CastRoadmapVoteResult = {
1010
+ ok: true;
1011
+ data: RoadmapVoteResult;
1012
+ } | {
1013
+ ok: false;
1014
+ error: RoadmapVoteError;
1015
+ };
1016
+ /**
1017
+ * Cast a vote on a roadmap item by its key.
1018
+ *
1019
+ * Writes an `app.userinput.upvote` record into the viewer's PDS (server-side,
1020
+ * via their OAuth session). Returns a discriminated-union result rather than
1021
+ * the generic {@link WriteResult} because a first-time voter's PDS grant may
1022
+ * not yet include the `app.userinput.upvote` collection: the AppView responds
1023
+ * 403 `ScopeInsufficient`, which the caller handles by triggering an OAuth
1024
+ * scope upgrade rather than showing an error. Mirrors {@link createReaction}.
1025
+ *
1026
+ * Never throws.
1027
+ */
1028
+ declare function castRoadmapVote(config: SifaApiConfig, key: string, options?: ApiFetchOptions): Promise<CastRoadmapVoteResult>;
991
1029
  /** Retract a previously-cast roadmap vote. */
992
1030
  declare function retractRoadmapVote(config: SifaApiConfig, key: string, options?: ApiFetchOptions): Promise<WriteResult>;
993
1031
 
@@ -1110,4 +1148,4 @@ declare const sifaQueryKeys: {
1110
1148
  };
1111
1149
  type SifaQueryKey = ReturnType<typeof sifaQueryKeys.all> | ReturnType<typeof sifaQueryKeys.profile.all> | ReturnType<typeof sifaQueryKeys.profile.byHandle> | ReturnType<typeof sifaQueryKeys.profile.atFundLink> | ReturnType<typeof sifaQueryKeys.profile.externalAccounts> | ReturnType<typeof sifaQueryKeys.position.all> | ReturnType<typeof sifaQueryKeys.position.byOwner> | ReturnType<typeof sifaQueryKeys.search.all> | ReturnType<typeof sifaQueryKeys.search.profiles> | ReturnType<typeof sifaQueryKeys.search.canonicalSkills> | ReturnType<typeof sifaQueryKeys.search.skills> | ReturnType<typeof sifaQueryKeys.search.filters> | ReturnType<typeof sifaQueryKeys.discovery.all> | ReturnType<typeof sifaQueryKeys.discovery.similar> | ReturnType<typeof sifaQueryKeys.discovery.suggestions> | ReturnType<typeof sifaQueryKeys.discovery.suggestionCount> | ReturnType<typeof sifaQueryKeys.discovery.featured> | ReturnType<typeof sifaQueryKeys.follow.all> | ReturnType<typeof sifaQueryKeys.follow.following> | ReturnType<typeof sifaQueryKeys.follow.followers> | ReturnType<typeof sifaQueryKeys.follow.followingOf> | ReturnType<typeof sifaQueryKeys.follow.feed> | ReturnType<typeof sifaQueryKeys.follow.mutuals> | ReturnType<typeof sifaQueryKeys.follow.blueskySuggestions> | ReturnType<typeof sifaQueryKeys.admin.all> | ReturnType<typeof sifaQueryKeys.admin.featureAllowlist> | ReturnType<typeof sifaQueryKeys.stats.all> | ReturnType<typeof sifaQueryKeys.stats.homepage> | ReturnType<typeof sifaQueryKeys.apps.all> | ReturnType<typeof sifaQueryKeys.apps.registry> | ReturnType<typeof sifaQueryKeys.apps.hidden> | ReturnType<typeof sifaQueryKeys.activity.all> | ReturnType<typeof sifaQueryKeys.activity.heatmap> | ReturnType<typeof sifaQueryKeys.activity.teaser> | ReturnType<typeof sifaQueryKeys.activity.feed> | ReturnType<typeof sifaQueryKeys.endorsement.all> | ReturnType<typeof sifaQueryKeys.endorsement.count> | ReturnType<typeof sifaQueryKeys.stream.all> | ReturnType<typeof sifaQueryKeys.stream.networkCount> | ReturnType<typeof sifaQueryKeys.reactions.all> | ReturnType<typeof sifaQueryKeys.reactions.status> | ReturnType<typeof sifaQueryKeys.reactions.accountCheck> | ReturnType<typeof sifaQueryKeys.roadmap.all> | ReturnType<typeof sifaQueryKeys.roadmap.votes> | ReturnType<typeof sifaQueryKeys.roadmap.myVotes> | ReturnType<typeof sifaQueryKeys.bskyPreferences.all> | ReturnType<typeof sifaQueryKeys.bskyPreferences.contentLabels>;
1112
1150
 
1113
- export { type QuotedPostView as $, type ApiFetchOptions as A, type BulkHideProfileItemInput as B, type CheckAppAccountOptions as C, type DeleteAccountResult as D, type EndorsementInput as E, type FeatureAllowlistResponse as F, type FollowingResponse as G, HIDDEN_ITEM_SOURCES as H, HIDDEN_ITEM_TYPES as I, type HeatmapDay as J, type HeatmapResponse as K, type HiddenApp as L, type HiddenItemSource as M, type HiddenItemType as N, type HideProfileItemInput as O, type ListFeatureAllowlistOptions as P, type ProfileIndustryInput as Q, type ProfileLocationAddress as R, type SifaApiConfig as S, type ProfileLocationInput as T, type ProfileSearchResult as U, type ProfileSelfLocation as V, type WriteResult as W, QUOTED_POSTS_BATCH_MAX as X, type QuotedPostAuthor as Y, type QuotedPostImage as Z, type QuotedPostResult as _, type AccountCheckResult as a, getMutuals as a$, type ReactionError as a0, type ReactionResult as a1, type ReactionStatus as a2, type RefreshOrcidPublicationsResult as a3, type RefreshPdsResult as a4, type ResolveQuotedPostsOptions as a5, type RoadmapVoter as a6, type RoadmapVotesResponse as a7, type SearchFilters as a8, type SearchResponse as a9, deleteAvatarOverride as aA, deleteExternalAccount as aB, deleteProfileLocation as aC, deleteReaction as aD, fetchActivityFeed as aE, fetchActivityTeaser as aF, fetchAppsRegistry as aG, fetchExternalAccounts as aH, fetchFeaturedProfile as aI, fetchFollowing as aJ, fetchHeatmapData as aK, fetchHiddenApps as aL, fetchMyRoadmapVotes as aM, fetchReactionStatus as aN, fetchRoadmapVotes as aO, fetchSearchFilters as aP, fetchSearchProfiles as aQ, fetchSimilarProfiles as aR, fetchSkillSuggestions as aS, fetchStats as aT, fetchSuggestionCount as aU, fetchSuggestions as aV, followUser as aW, getBlueskySuggestions as aX, getFollowers as aY, getFollowing as aZ, getFollowingFeed as a_, type SifaQueryKey as aa, type SimilarProfile as ab, type SkillSearchResult as ac, type StatsResponse as ad, type SuggestionProfile as ae, type SuggestionsResponse as af, type UpdateProfileOverrideInput as ag, type UpdateProfileSelfInput as ah, type UploadAvatarResult as ai, type VerifyExternalAccountResult as aj, addFeatureAllowlist as ak, apiFetch as al, apiFetchOrNull as am, apiWrite as an, apiWriteCreate as ao, bulkHideProfileItems as ap, bulkHideStandardPublications as aq, bulkUnhideProfileItems as ar, bulkUnhideStandardPublications as as, castRoadmapVote as at, checkAppAccount as au, createEndorsement as av, createExternalAccount as aw, createProfileLocation as ax, createReaction as ay, deleteAccount as az, type ActivityFeedResponse as b, hideOrcidPublication as b0, hideProfileItem as b1, hideSifaPublication as b2, hideStandardPublication as b3, listFeatureAllowlist as b4, refreshOrcidPublications as b5, refreshPds as b6, removeFeatureAllowlist as b7, resetProfile as b8, resolveQuotedPosts as b9, retractRoadmapVote as ba, searchSkills as bb, setExternalAccountPrimary as bc, unfollowUser as bd, unhideOrcidPublication as be, unhideProfileItem as bf, unhideSifaPublication as bg, unhideStandardPublication as bh, unsetExternalAccountPrimary as bi, updateExternalAccount as bj, updateProfileLocation as bk, updateProfileOverride as bl, updateProfileSelf as bm, uploadAvatar as bn, verifyExternalAccount as bo, type ActivityItem as c, type ActivityItemLinkHealth as d, type ActivityTeaserResponse as e, ApiError as f, type AppRegistryEntry as g, type CreateExternalAccountResult as h, type CreateResult as i, type ExternalAccountInput as j, type FeaturedProfile as k, type FetchActivityFeedOptions as l, type FetchActivityTeaserOptions as m, type FetchFollowListOptions as n, type FetchFollowProfilePageOptions as o, type FetchFollowingFeedOptions as p, type FetchHiddenAppsOptions as q, type FetchMyRoadmapVotesOptions as r, sifaQueryKeys as s, type FetchReactionStatusOptions as t, type FetchSuggestionsOptions as u, type FilterOptions as v, type FollowListPage as w, type FollowProfile as x, type FollowProfilePageResponse as y, type FollowUserResult as z };
1151
+ export { type QuotedPostResult as $, type ApiFetchOptions as A, type BulkHideProfileItemInput as B, type CastRoadmapVoteResult as C, type DeleteAccountResult as D, type EndorsementInput as E, type FeatureAllowlistResponse as F, type FollowUserResult as G, type FollowingResponse as H, HIDDEN_ITEM_SOURCES as I, HIDDEN_ITEM_TYPES as J, type HeatmapDay as K, type HeatmapResponse as L, type HiddenApp as M, type HiddenItemSource as N, type HiddenItemType as O, type HideProfileItemInput as P, type ListFeatureAllowlistOptions as Q, type ProfileIndustryInput as R, type SifaApiConfig as S, type ProfileLocationAddress as T, type ProfileLocationInput as U, type ProfileSearchResult as V, type WriteResult as W, type ProfileSelfLocation as X, QUOTED_POSTS_BATCH_MAX as Y, type QuotedPostAuthor as Z, type QuotedPostImage as _, type AccountCheckResult as a, getFollowers as a$, type QuotedPostView as a0, type ReactionError as a1, type ReactionResult as a2, type ReactionStatus as a3, type RefreshOrcidPublicationsResult as a4, type RefreshPdsResult as a5, type ResolveQuotedPostsOptions as a6, type RoadmapVoteError as a7, type RoadmapVoteResult as a8, type RoadmapVoter as a9, createProfileLocation as aA, createReaction as aB, deleteAccount as aC, deleteAvatarOverride as aD, deleteExternalAccount as aE, deleteProfileLocation as aF, deleteReaction as aG, fetchActivityFeed as aH, fetchActivityTeaser as aI, fetchAppsRegistry as aJ, fetchExternalAccounts as aK, fetchFeaturedProfile as aL, fetchFollowing as aM, fetchHeatmapData as aN, fetchHiddenApps as aO, fetchMyRoadmapVotes as aP, fetchReactionStatus as aQ, fetchRoadmapVotes as aR, fetchSearchFilters as aS, fetchSearchProfiles as aT, fetchSimilarProfiles as aU, fetchSkillSuggestions as aV, fetchStats as aW, fetchSuggestionCount as aX, fetchSuggestions as aY, followUser as aZ, getBlueskySuggestions as a_, type RoadmapVotesResponse as aa, type SearchFilters as ab, type SearchResponse as ac, type SifaQueryKey as ad, type SimilarProfile as ae, type SkillSearchResult as af, type StatsResponse as ag, type SuggestionProfile as ah, type SuggestionsResponse as ai, type UpdateProfileOverrideInput as aj, type UpdateProfileSelfInput as ak, type UploadAvatarResult as al, type VerifyExternalAccountResult as am, addFeatureAllowlist as an, apiFetch as ao, apiFetchOrNull as ap, apiWrite as aq, apiWriteCreate as ar, bulkHideProfileItems as as, bulkHideStandardPublications as at, bulkUnhideProfileItems as au, bulkUnhideStandardPublications as av, castRoadmapVote as aw, checkAppAccount as ax, createEndorsement as ay, createExternalAccount as az, type ActivityFeedResponse as b, getFollowing as b0, getFollowingFeed as b1, getMutuals as b2, hideOrcidPublication as b3, hideProfileItem as b4, hideSifaPublication as b5, hideStandardPublication as b6, listFeatureAllowlist as b7, refreshOrcidPublications as b8, refreshPds as b9, removeFeatureAllowlist as ba, resetProfile as bb, resolveQuotedPosts as bc, retractRoadmapVote as bd, searchSkills as be, setExternalAccountPrimary as bf, unfollowUser as bg, unhideOrcidPublication as bh, unhideProfileItem as bi, unhideSifaPublication as bj, unhideStandardPublication as bk, unsetExternalAccountPrimary as bl, updateExternalAccount as bm, updateProfileLocation as bn, updateProfileOverride as bo, updateProfileSelf as bp, uploadAvatar as bq, verifyExternalAccount as br, type ActivityItem as c, type ActivityItemLinkHealth as d, type ActivityTeaserResponse as e, ApiError as f, type AppRegistryEntry as g, type CheckAppAccountOptions as h, type CreateExternalAccountResult as i, type CreateResult as j, type ExternalAccountInput as k, type FeaturedProfile as l, type FetchActivityFeedOptions as m, type FetchActivityTeaserOptions as n, type FetchFollowListOptions as o, type FetchFollowProfilePageOptions as p, type FetchFollowingFeedOptions as q, type FetchHiddenAppsOptions as r, sifaQueryKeys as s, type FetchMyRoadmapVotesOptions as t, type FetchReactionStatusOptions as u, type FetchSuggestionsOptions as v, type FilterOptions as w, type FollowListPage as x, type FollowProfile as y, type FollowProfilePageResponse as z };
@@ -1016,8 +1016,36 @@ async function fetchMyRoadmapVotes(config, options = {}) {
1016
1016
  return [];
1017
1017
  }
1018
1018
  }
1019
- function castRoadmapVote(config, key, options = {}) {
1020
- return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "POST", options);
1019
+ async function castRoadmapVote(config, key, options = {}) {
1020
+ const fetchFn = config.fetch ?? globalThis.fetch;
1021
+ const url = `${config.baseUrl}/api/roadmap/votes/${encodeURIComponent(key)}`;
1022
+ try {
1023
+ const res = await fetchFn(url, {
1024
+ method: "POST",
1025
+ headers: { "Content-Type": "application/json", ...options.headers ?? {} },
1026
+ credentials: options.credentials ?? "include",
1027
+ signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 1e4)
1028
+ });
1029
+ if (!res.ok) {
1030
+ if (res.status === 403) {
1031
+ try {
1032
+ const body = await res.json();
1033
+ if (body.error === "ScopeInsufficient") {
1034
+ return {
1035
+ ok: false,
1036
+ error: { type: "scope_insufficient", requiredScope: body.requiredScope }
1037
+ };
1038
+ }
1039
+ } catch {
1040
+ }
1041
+ }
1042
+ return { ok: false, error: { type: "error" } };
1043
+ }
1044
+ const data = await res.json();
1045
+ return { ok: true, data };
1046
+ } catch {
1047
+ return { ok: false, error: { type: "error" } };
1048
+ }
1021
1049
  }
1022
1050
  function retractRoadmapVote(config, key, options = {}) {
1023
1051
  return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "DELETE", options);