@singi-labs/sifa-sdk 0.20.1 → 0.20.2
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/index.cjs +53 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/query/fetchers/index.cjs +55 -5
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +1 -1
- package/dist/query/fetchers/index.d.ts +1 -1
- package/dist/query/fetchers/index.js +6 -0
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/fetchers/roadmap.js +56 -3
- package/dist/query/fetchers/roadmap.js.map +1 -1
- package/dist/query/hooks/index.cjs +66 -5
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +2 -2
- package/dist/query/hooks/index.d.ts +2 -2
- package/dist/query/hooks/index.js +8 -1
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/hooks/use-roadmap-mutations.js +36 -0
- package/dist/query/hooks/use-roadmap-mutations.js.map +1 -1
- package/dist/query/index.cjs +89 -5
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +14 -1
- package/dist/query/index.js.map +1 -1
- package/dist/roadmap/board-body.js +55 -0
- package/dist/roadmap/board-body.js.map +1 -0
- package/dist/{use-user-settings-YIv1C3qN.d.cts → use-user-settings-Cq_AHkkM.d.cts} +14 -2
- package/dist/{use-user-settings-CrS3ZXoW.d.ts → use-user-settings-DoNP3tNl.d.ts} +14 -2
- package/dist/{user-settings-Bvafly0r.d.ts → user-settings-CBtacio1.d.ts} +52 -1
- package/dist/{user-settings-DWq91Gj-.d.cts → user-settings-DDP76dZH.d.cts} +52 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a1 as SifaApiConfig, a0 as ApiFetchOptions, a3 as CreateResult, a2 as WriteResult } from '../../types-JydVIhN5.cjs';
|
|
2
2
|
export { a4 as ApiError, ai as CompanySearchFilters, aj as CompanySearchResponse, ak as CompanySearchResult, a5 as FilterOptions, a6 as ProfileSearchResult, a7 as ProfileSearchSuggestion, S as SearchFilters, a8 as SearchResponse, a9 as SkillSearchResult, aa as apiFetch, ab as apiFetchOrNull, ac as apiWrite, ad as apiWriteCreate, al as fetchSearchCompanies, ae as fetchSearchFilters, af as fetchSearchProfiles, ag as fetchSkillSuggestions, ah as searchSkills } from '../../types-JydVIhN5.cjs';
|
|
3
3
|
export { D as DismissEndorsementInput, F as FetchGermMessageLinkOptions, b as FetchNetworkStreamCountOptions, c as FetchPendingEndorsementsOptions, G as GermMessageLink, N as NetworkMapEdge, d as NetworkMapGenerationJob, e as NetworkMapGraphData, f as NetworkMapNode, g as NetworkMapPendingJob, h as NetworkMapResponse, i as PendingEndorsement, P as PendingEndorsementsPage, j as ReceivedEndorsement, R as ReceivedEndorsementsPage, a as ReciprocityCandidate, k as ReciprocitySkill, S as SpeakerCard, l as SpeakerDirectoryFilters, m as SpeakerGroup, n as SpeakersResponse, T as TalkEvent, o as TalkRow, p as TalkSpeaker, q as TalksResponse, r as checkNetworkMapJobStatus, s as createEducation, t as createPosition, u as createRecord, v as deleteEducation, w as deletePosition, x as deleteRecord, y as dismissEndorsement, z as fetchAtFundLink, A as fetchEndorsementCount, B as fetchEntitySearch, C as fetchGermMessageLink, E as fetchGetProfileView, H as fetchNetworkMap, I as fetchNetworkStreamCount, J as fetchPendingEndorsements, K as fetchProfile, L as fetchProfileSummary, M as fetchReceivedEndorsements, O as fetchReciprocityCandidate, Q as fetchSpeakers, U as fetchTalks, V as germRedirectPath, W as hideKeytraceClaim, X as importSearchEntities, Y as initiateNetworkMapGeneration, Z as isNetworkMapResponse, _ as linkSkillToPosition, a1 as revealMarqueDomain, a2 as selectEntity, a3 as setPositionPrimary, a4 as unhideKeytraceClaim, a5 as unlinkSkillFromPosition, a6 as unrevealMarqueDomain, a7 as unsetPositionPrimary, a8 as updateEducation, a9 as updatePosition, aa as updateRecord } from '../../network-map-DJonNOl0.cjs';
|
|
4
|
-
export { A as AccountCheckResult, b as AccountSummary, c as ActivityFeedResponse, d as ActivityItem, e as ActivityItemLinkHealth, f as ActivityPreferences, g as ActivityTeaserResponse, h as AdminReviewQueues, i as AppRegistryEntry, B as BulkHideProfileItemInput, j as CastRoadmapVoteResult, k as CheckAppAccountOptions, C as ConfirmEndorsementInput, l as ConfirmationInput, m as ConfirmationSubjectInput, n as CreateExternalAccountResult, D as DeleteAccountResult, o as DismissCompletenessSignalInput, p as DismissUnlinkedPositionInput, E as EndorsementInput, q as ExternalAccountInput, F as FeatureAllowlistResponse, r as FeaturedProfile, t as FetchAccountsOptions, u as FetchActivityFeedOptions, v as FetchActivityPreferencesOptions, w as FetchActivityTeaserOptions, x as FetchConfirmationsOptions, y as FetchFollowListOptions, z as FetchFollowProfilePageOptions, G as FetchFollowingFeedOptions, H as FetchHiddenActivityItemsOptions, I as FetchHiddenAppsOptions, J as FetchInboxCountsOptions, K as FetchMyGithubPullRequestsOptions, L as FetchMyRoadmapVotesOptions, M as FetchProfileCompletenessOptions, N as FetchReactionStatusOptions, O as
|
|
4
|
+
export { A as AccountCheckResult, b as AccountSummary, c as ActivityFeedResponse, d as ActivityItem, e as ActivityItemLinkHealth, f as ActivityPreferences, g as ActivityTeaserResponse, h as AdminReviewQueues, i as AppRegistryEntry, B as BulkHideProfileItemInput, j as CastRoadmapVoteResult, k as CheckAppAccountOptions, C as ConfirmEndorsementInput, l as ConfirmationInput, m as ConfirmationSubjectInput, n as CreateExternalAccountResult, D as DeleteAccountResult, o as DismissCompletenessSignalInput, p as DismissUnlinkedPositionInput, E as EndorsementInput, q as ExternalAccountInput, F as FeatureAllowlistResponse, r as FeaturedProfile, t as FetchAccountsOptions, u as FetchActivityFeedOptions, v as FetchActivityPreferencesOptions, w as FetchActivityTeaserOptions, x as FetchConfirmationsOptions, y as FetchFollowListOptions, z as FetchFollowProfilePageOptions, G as FetchFollowingFeedOptions, H as FetchHiddenActivityItemsOptions, I as FetchHiddenAppsOptions, J as FetchInboxCountsOptions, K as FetchMyGithubPullRequestsOptions, L as FetchMyRoadmapVotesOptions, M as FetchProfileCompletenessOptions, N as FetchReactionStatusOptions, O as FetchRoadmapOptions, P as FetchRpgClaimableOptions, Q as FetchRpgStatusOptions, R as FetchSuggestionsOptions, S as FetchUnlinkedPositionsOptions, T as FetchUserSettingsOptions, U as FollowListPage, V as FollowProfile, W as FollowProfilePageResponse, X as FollowUserResult, Y as FollowingFeedApp, Z as FollowingFeedBuild, _ as FollowingFeedEmptyReason, $ as FollowingFeedResponse, a0 as FollowingFeedVersion, a1 as FollowingResponse, a2 as GetAdminReviewQueuesOptions, a3 as GithubPullRequest, a4 as GivenConfirmation, a5 as HIDDEN_ITEM_SOURCES, a6 as HIDDEN_ITEM_TYPES, a7 as HeatmapDay, a8 as HeatmapResponse, a9 as HiddenActivityItem, aa as HiddenApp, ab as HiddenItemSource, ac as HiddenItemType, ad as HideActivityItemInput, ae as HideProfileItemInput, af as InboxCounts, ag as ListFeatureAllowlistOptions, ah as MyGithubPullRequestsResponse, ai as OrgClaimBinding, aj as OrgClaimResult, ak as OrgDomainChallengeResult, al as OrgDomainVerifyResult, am as OrgNotificationEmailAddResult, an as OrgNotificationEmailRemoveResult, ao as OrgProfileEcho, ap as OrgProfileUpdateResult, aq as PROFILE_COMPLETENESS_SIGNALS, ar as PdsWipeOutcome, as as PendingConfirmation, at as PendingConfirmationsPage, au as PrimarySection, av as ProfileCompleteness, aw as ProfileCompletenessSignal, ax as ProfileIndustryInput, ay as ProfileLocationAddress, az as ProfileLocationInput, aA as ProfileSelfLocation, aB as QUOTED_POSTS_BATCH_MAX, aC as QuotedPostAuthor, aD as QuotedPostImage, aE as QuotedPostResult, aF as QuotedPostView, aG as ReactionError, aH as ReactionResult, aI as ReactionStatus, aJ as RefreshOrcidPublicationsResult, aK as RefreshPdsResult, aL as RepoDeleteInput, aM as ResetProfileResult, aN as ResolveQuotedPostsOptions, aO as RoadmapBoardItem, aP as RoadmapBoardSize, aQ as RoadmapBoardStatus, aR as RoadmapItemRef, aS as RoadmapVoteError, aT as RoadmapVoteResult, aU as RoadmapVoter, aV as RoadmapVotesResponse, aW as RpgClaimableResponse, aX as RpgClaimableResponseSchema, aY as RpgItemStatus, aZ as RpgItemStatusSchema, a_ as RpgStatusResponse, a$ as RpgStatusResponseSchema, b0 as SifaQueryKey, b1 as SimilarProfile, b2 as SiteActivityPresetResponse, b3 as StatsResponse, b5 as SuggestionProfile, b6 as SuggestionsResponse, b7 as UnhideActivityItemInput, b8 as UnlinkedPosition, b9 as UnlinkedPositionsResult, ba as UpdateActivityPreferencesInput, bb as UpdateProfileOverrideInput, bc as UpdateProfileSelfInput, bd as UploadAvatarResult, be as UploadPronunciationAudioResult, bf as UserSettings, bg as UserSettingsPatch, bh as UserSettingsSchema, bi as VerifyExternalAccountResult, bj as WipePreview, bk as addFeatureAllowlist, bl as addOrgNotificationEmail, bm as bulkHideProfileItems, bn as bulkHideStandardPublications, bo as bulkUnhideProfileItems, bp as bulkUnhideStandardPublications, bq as castRoadmapItemVote, br as castRoadmapVote, bs as checkAppAccount, bt as clearCompletenessDismissals, bu as confirmEndorsement, bv as createConfirmation, bw as createEndorsement, bx as createExternalAccount, by as createProfileLocation, bz as createReaction, bA as createSkill, bB as deleteAccount, bC as deleteAvatarOverride, bD as deleteExternalAccount, bE as deleteNamePronunciationAudio, bF as deleteProfileLocation, bG as deleteReaction, bH as deleteRepoRecords, bI as deleteSkill, bJ as dismissCompletenessSignal, bK as dismissConfirmation, bL as dismissUnlinkedPosition, bM as fetchAccounts, bN as fetchActivityFeed, bO as fetchActivityPreferences, bP as fetchActivityTeaser, bQ as fetchAppsRegistry, bR as fetchExternalAccounts, bS as fetchFeaturedProfile, bT as fetchFollowing, bU as fetchFollowingFeed, bV as fetchFollowingFeedVersion, bW as fetchGivenConfirmations, bX as fetchHeatmapData, bY as fetchHiddenActivityItems, bZ as fetchHiddenApps, b_ as fetchInboxCounts, b$ as fetchMyGithubPullRequests, c0 as fetchMyRoadmapVotes, c1 as fetchPendingConfirmations, c2 as fetchProfileCompleteness, c3 as fetchReactionStatus, c4 as fetchRepoInventory, c5 as fetchRoadmap, c6 as fetchRoadmapVotes, c7 as fetchRpgClaimable, c8 as fetchRpgStatus, c9 as fetchSimilarProfiles, ca as fetchSiteActivityPreset, cb as fetchStats, cc as fetchSuggestionCount, cd as fetchSuggestions, ce as fetchUnlinkedPositions, cf as fetchUserSettings, cg as fetchViewerPositionConfirmations, ch as fetchWipePreview, ci as followUser, cj as getAdminReviewQueues, ck as getBlueskySuggestions, cl as getFollowers, cm as getFollowing, cn as getMutuals, co as hideActivityItem, cp as hideOrcidPublication, cq as hideProfileItem, cr as hideSifaPublication, cs as hideStandardPublication, ct as isNewerFollowingFeed, cu as listFeatureAllowlist, cv as refreshOrcidPublications, cw as refreshPds, cx as removeFeatureAllowlist, cy as removeOrgNotificationEmail, cz as repoExportUrl, cA as requestOrgDomainChallenge, cB as resetProfile, cC as resolveQuotedPosts, cD as retractRoadmapItemVote, cE as retractRoadmapVote, cF as revokeConfirmation, cG as setExternalAccountPrimary, cH as setSectionPrimary, s as sifaQueryKeys, cI as submitOrgClaim, cJ as switchAccount, cK as unfollowUser, cL as unhideActivityItem, cM as unhideOrcidPublication, cN as unhideProfileItem, cO as unhideSifaPublication, cP as unhideStandardPublication, cQ as unsetExternalAccountPrimary, cR as unsetSectionPrimary, cS as updateActivityPreferences, cT as updateExternalAccount, cU as updateOrgProfile, cV as updateProfileLocation, cW as updateProfileOverride, cX as updateProfileSelf, cY as updateSkill, c_ as updateUserSettings, c$ as uploadAvatar, d0 as uploadNamePronunciationAudio, d1 as verifyExternalAccount, d2 as verifyOrgDomain } from '../../user-settings-DDP76dZH.cjs';
|
|
5
5
|
import '../../index-BQAKeEoj.cjs';
|
|
6
6
|
import '../../verification-providers-DeyGqaoC.cjs';
|
|
7
7
|
import 'zod';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a1 as SifaApiConfig, a0 as ApiFetchOptions, a3 as CreateResult, a2 as WriteResult } from '../../types-CkomzDlY.js';
|
|
2
2
|
export { a4 as ApiError, ai as CompanySearchFilters, aj as CompanySearchResponse, ak as CompanySearchResult, a5 as FilterOptions, a6 as ProfileSearchResult, a7 as ProfileSearchSuggestion, S as SearchFilters, a8 as SearchResponse, a9 as SkillSearchResult, aa as apiFetch, ab as apiFetchOrNull, ac as apiWrite, ad as apiWriteCreate, al as fetchSearchCompanies, ae as fetchSearchFilters, af as fetchSearchProfiles, ag as fetchSkillSuggestions, ah as searchSkills } from '../../types-CkomzDlY.js';
|
|
3
3
|
export { D as DismissEndorsementInput, F as FetchGermMessageLinkOptions, b as FetchNetworkStreamCountOptions, c as FetchPendingEndorsementsOptions, G as GermMessageLink, N as NetworkMapEdge, d as NetworkMapGenerationJob, e as NetworkMapGraphData, f as NetworkMapNode, g as NetworkMapPendingJob, h as NetworkMapResponse, i as PendingEndorsement, P as PendingEndorsementsPage, j as ReceivedEndorsement, R as ReceivedEndorsementsPage, a as ReciprocityCandidate, k as ReciprocitySkill, S as SpeakerCard, l as SpeakerDirectoryFilters, m as SpeakerGroup, n as SpeakersResponse, T as TalkEvent, o as TalkRow, p as TalkSpeaker, q as TalksResponse, r as checkNetworkMapJobStatus, s as createEducation, t as createPosition, u as createRecord, v as deleteEducation, w as deletePosition, x as deleteRecord, y as dismissEndorsement, z as fetchAtFundLink, A as fetchEndorsementCount, B as fetchEntitySearch, C as fetchGermMessageLink, E as fetchGetProfileView, H as fetchNetworkMap, I as fetchNetworkStreamCount, J as fetchPendingEndorsements, K as fetchProfile, L as fetchProfileSummary, M as fetchReceivedEndorsements, O as fetchReciprocityCandidate, Q as fetchSpeakers, U as fetchTalks, V as germRedirectPath, W as hideKeytraceClaim, X as importSearchEntities, Y as initiateNetworkMapGeneration, Z as isNetworkMapResponse, _ as linkSkillToPosition, a1 as revealMarqueDomain, a2 as selectEntity, a3 as setPositionPrimary, a4 as unhideKeytraceClaim, a5 as unlinkSkillFromPosition, a6 as unrevealMarqueDomain, a7 as unsetPositionPrimary, a8 as updateEducation, a9 as updatePosition, aa as updateRecord } from '../../network-map-2OKh3wSB.js';
|
|
4
|
-
export { A as AccountCheckResult, b as AccountSummary, c as ActivityFeedResponse, d as ActivityItem, e as ActivityItemLinkHealth, f as ActivityPreferences, g as ActivityTeaserResponse, h as AdminReviewQueues, i as AppRegistryEntry, B as BulkHideProfileItemInput, j as CastRoadmapVoteResult, k as CheckAppAccountOptions, C as ConfirmEndorsementInput, l as ConfirmationInput, m as ConfirmationSubjectInput, n as CreateExternalAccountResult, D as DeleteAccountResult, o as DismissCompletenessSignalInput, p as DismissUnlinkedPositionInput, E as EndorsementInput, q as ExternalAccountInput, F as FeatureAllowlistResponse, r as FeaturedProfile, t as FetchAccountsOptions, u as FetchActivityFeedOptions, v as FetchActivityPreferencesOptions, w as FetchActivityTeaserOptions, x as FetchConfirmationsOptions, y as FetchFollowListOptions, z as FetchFollowProfilePageOptions, G as FetchFollowingFeedOptions, H as FetchHiddenActivityItemsOptions, I as FetchHiddenAppsOptions, J as FetchInboxCountsOptions, K as FetchMyGithubPullRequestsOptions, L as FetchMyRoadmapVotesOptions, M as FetchProfileCompletenessOptions, N as FetchReactionStatusOptions, O as
|
|
4
|
+
export { A as AccountCheckResult, b as AccountSummary, c as ActivityFeedResponse, d as ActivityItem, e as ActivityItemLinkHealth, f as ActivityPreferences, g as ActivityTeaserResponse, h as AdminReviewQueues, i as AppRegistryEntry, B as BulkHideProfileItemInput, j as CastRoadmapVoteResult, k as CheckAppAccountOptions, C as ConfirmEndorsementInput, l as ConfirmationInput, m as ConfirmationSubjectInput, n as CreateExternalAccountResult, D as DeleteAccountResult, o as DismissCompletenessSignalInput, p as DismissUnlinkedPositionInput, E as EndorsementInput, q as ExternalAccountInput, F as FeatureAllowlistResponse, r as FeaturedProfile, t as FetchAccountsOptions, u as FetchActivityFeedOptions, v as FetchActivityPreferencesOptions, w as FetchActivityTeaserOptions, x as FetchConfirmationsOptions, y as FetchFollowListOptions, z as FetchFollowProfilePageOptions, G as FetchFollowingFeedOptions, H as FetchHiddenActivityItemsOptions, I as FetchHiddenAppsOptions, J as FetchInboxCountsOptions, K as FetchMyGithubPullRequestsOptions, L as FetchMyRoadmapVotesOptions, M as FetchProfileCompletenessOptions, N as FetchReactionStatusOptions, O as FetchRoadmapOptions, P as FetchRpgClaimableOptions, Q as FetchRpgStatusOptions, R as FetchSuggestionsOptions, S as FetchUnlinkedPositionsOptions, T as FetchUserSettingsOptions, U as FollowListPage, V as FollowProfile, W as FollowProfilePageResponse, X as FollowUserResult, Y as FollowingFeedApp, Z as FollowingFeedBuild, _ as FollowingFeedEmptyReason, $ as FollowingFeedResponse, a0 as FollowingFeedVersion, a1 as FollowingResponse, a2 as GetAdminReviewQueuesOptions, a3 as GithubPullRequest, a4 as GivenConfirmation, a5 as HIDDEN_ITEM_SOURCES, a6 as HIDDEN_ITEM_TYPES, a7 as HeatmapDay, a8 as HeatmapResponse, a9 as HiddenActivityItem, aa as HiddenApp, ab as HiddenItemSource, ac as HiddenItemType, ad as HideActivityItemInput, ae as HideProfileItemInput, af as InboxCounts, ag as ListFeatureAllowlistOptions, ah as MyGithubPullRequestsResponse, ai as OrgClaimBinding, aj as OrgClaimResult, ak as OrgDomainChallengeResult, al as OrgDomainVerifyResult, am as OrgNotificationEmailAddResult, an as OrgNotificationEmailRemoveResult, ao as OrgProfileEcho, ap as OrgProfileUpdateResult, aq as PROFILE_COMPLETENESS_SIGNALS, ar as PdsWipeOutcome, as as PendingConfirmation, at as PendingConfirmationsPage, au as PrimarySection, av as ProfileCompleteness, aw as ProfileCompletenessSignal, ax as ProfileIndustryInput, ay as ProfileLocationAddress, az as ProfileLocationInput, aA as ProfileSelfLocation, aB as QUOTED_POSTS_BATCH_MAX, aC as QuotedPostAuthor, aD as QuotedPostImage, aE as QuotedPostResult, aF as QuotedPostView, aG as ReactionError, aH as ReactionResult, aI as ReactionStatus, aJ as RefreshOrcidPublicationsResult, aK as RefreshPdsResult, aL as RepoDeleteInput, aM as ResetProfileResult, aN as ResolveQuotedPostsOptions, aO as RoadmapBoardItem, aP as RoadmapBoardSize, aQ as RoadmapBoardStatus, aR as RoadmapItemRef, aS as RoadmapVoteError, aT as RoadmapVoteResult, aU as RoadmapVoter, aV as RoadmapVotesResponse, aW as RpgClaimableResponse, aX as RpgClaimableResponseSchema, aY as RpgItemStatus, aZ as RpgItemStatusSchema, a_ as RpgStatusResponse, a$ as RpgStatusResponseSchema, b0 as SifaQueryKey, b1 as SimilarProfile, b2 as SiteActivityPresetResponse, b3 as StatsResponse, b5 as SuggestionProfile, b6 as SuggestionsResponse, b7 as UnhideActivityItemInput, b8 as UnlinkedPosition, b9 as UnlinkedPositionsResult, ba as UpdateActivityPreferencesInput, bb as UpdateProfileOverrideInput, bc as UpdateProfileSelfInput, bd as UploadAvatarResult, be as UploadPronunciationAudioResult, bf as UserSettings, bg as UserSettingsPatch, bh as UserSettingsSchema, bi as VerifyExternalAccountResult, bj as WipePreview, bk as addFeatureAllowlist, bl as addOrgNotificationEmail, bm as bulkHideProfileItems, bn as bulkHideStandardPublications, bo as bulkUnhideProfileItems, bp as bulkUnhideStandardPublications, bq as castRoadmapItemVote, br as castRoadmapVote, bs as checkAppAccount, bt as clearCompletenessDismissals, bu as confirmEndorsement, bv as createConfirmation, bw as createEndorsement, bx as createExternalAccount, by as createProfileLocation, bz as createReaction, bA as createSkill, bB as deleteAccount, bC as deleteAvatarOverride, bD as deleteExternalAccount, bE as deleteNamePronunciationAudio, bF as deleteProfileLocation, bG as deleteReaction, bH as deleteRepoRecords, bI as deleteSkill, bJ as dismissCompletenessSignal, bK as dismissConfirmation, bL as dismissUnlinkedPosition, bM as fetchAccounts, bN as fetchActivityFeed, bO as fetchActivityPreferences, bP as fetchActivityTeaser, bQ as fetchAppsRegistry, bR as fetchExternalAccounts, bS as fetchFeaturedProfile, bT as fetchFollowing, bU as fetchFollowingFeed, bV as fetchFollowingFeedVersion, bW as fetchGivenConfirmations, bX as fetchHeatmapData, bY as fetchHiddenActivityItems, bZ as fetchHiddenApps, b_ as fetchInboxCounts, b$ as fetchMyGithubPullRequests, c0 as fetchMyRoadmapVotes, c1 as fetchPendingConfirmations, c2 as fetchProfileCompleteness, c3 as fetchReactionStatus, c4 as fetchRepoInventory, c5 as fetchRoadmap, c6 as fetchRoadmapVotes, c7 as fetchRpgClaimable, c8 as fetchRpgStatus, c9 as fetchSimilarProfiles, ca as fetchSiteActivityPreset, cb as fetchStats, cc as fetchSuggestionCount, cd as fetchSuggestions, ce as fetchUnlinkedPositions, cf as fetchUserSettings, cg as fetchViewerPositionConfirmations, ch as fetchWipePreview, ci as followUser, cj as getAdminReviewQueues, ck as getBlueskySuggestions, cl as getFollowers, cm as getFollowing, cn as getMutuals, co as hideActivityItem, cp as hideOrcidPublication, cq as hideProfileItem, cr as hideSifaPublication, cs as hideStandardPublication, ct as isNewerFollowingFeed, cu as listFeatureAllowlist, cv as refreshOrcidPublications, cw as refreshPds, cx as removeFeatureAllowlist, cy as removeOrgNotificationEmail, cz as repoExportUrl, cA as requestOrgDomainChallenge, cB as resetProfile, cC as resolveQuotedPosts, cD as retractRoadmapItemVote, cE as retractRoadmapVote, cF as revokeConfirmation, cG as setExternalAccountPrimary, cH as setSectionPrimary, s as sifaQueryKeys, cI as submitOrgClaim, cJ as switchAccount, cK as unfollowUser, cL as unhideActivityItem, cM as unhideOrcidPublication, cN as unhideProfileItem, cO as unhideSifaPublication, cP as unhideStandardPublication, cQ as unsetExternalAccountPrimary, cR as unsetSectionPrimary, cS as updateActivityPreferences, cT as updateExternalAccount, cU as updateOrgProfile, cV as updateProfileLocation, cW as updateProfileOverride, cX as updateProfileSelf, cY as updateSkill, c_ as updateUserSettings, c$ as uploadAvatar, d0 as uploadNamePronunciationAudio, d1 as verifyExternalAccount, d2 as verifyOrgDomain } from '../../user-settings-CBtacio1.js';
|
|
5
5
|
import '../../index-DDh2RLvx.js';
|
|
6
6
|
import '../../verification-providers-DeyGqaoC.js';
|
|
7
7
|
import 'zod';
|
|
@@ -188,9 +188,12 @@ import {
|
|
|
188
188
|
resolveQuotedPosts
|
|
189
189
|
} from "./quoted-posts.js";
|
|
190
190
|
import {
|
|
191
|
+
castRoadmapItemVote,
|
|
191
192
|
castRoadmapVote,
|
|
192
193
|
fetchMyRoadmapVotes,
|
|
194
|
+
fetchRoadmap,
|
|
193
195
|
fetchRoadmapVotes,
|
|
196
|
+
retractRoadmapItemVote,
|
|
194
197
|
retractRoadmapVote
|
|
195
198
|
} from "./roadmap.js";
|
|
196
199
|
import {
|
|
@@ -246,6 +249,7 @@ export {
|
|
|
246
249
|
bulkHideStandardPublications,
|
|
247
250
|
bulkUnhideProfileItems,
|
|
248
251
|
bulkUnhideStandardPublications,
|
|
252
|
+
castRoadmapItemVote,
|
|
249
253
|
castRoadmapVote,
|
|
250
254
|
checkAppAccount,
|
|
251
255
|
checkNetworkMapJobStatus,
|
|
@@ -310,6 +314,7 @@ export {
|
|
|
310
314
|
fetchReceivedEndorsements,
|
|
311
315
|
fetchReciprocityCandidate,
|
|
312
316
|
fetchRepoInventory,
|
|
317
|
+
fetchRoadmap,
|
|
313
318
|
fetchRoadmapVotes,
|
|
314
319
|
fetchRpgClaimable,
|
|
315
320
|
fetchRpgStatus,
|
|
@@ -355,6 +360,7 @@ export {
|
|
|
355
360
|
requestOrgDomainChallenge,
|
|
356
361
|
resetProfile,
|
|
357
362
|
resolveQuotedPosts,
|
|
363
|
+
retractRoadmapItemVote,
|
|
358
364
|
retractRoadmapVote,
|
|
359
365
|
revealMarqueDomain,
|
|
360
366
|
revokeConfirmation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/query/fetchers/index.ts"],"sourcesContent":["/**\n * Fetcher-only barrel for `@singi-labs/sifa-sdk/query/fetchers`.\n *\n * Pure, no React imports. Safe to import from Next.js React Server\n * Components, edge runtimes, and any other context where React hooks\n * are unavailable. Client components should import from\n * `@singi-labs/sifa-sdk/query` to get hooks + Provider too.\n *\n * Keep in sync with `../index.ts`: every fetcher exported there should\n * also be exported here. Hooks and the Provider live only in the\n * `/query` barrel.\n */\n\nexport {\n ApiError,\n apiFetch,\n apiFetchOrNull,\n apiWrite,\n apiWriteCreate,\n type ApiFetchOptions,\n type CreateResult,\n type SifaApiConfig,\n type WriteResult,\n} from '../client.js';\n\nexport { fetchAtFundLink, fetchProfile } from './profile.js';\nexport {\n fetchGermMessageLink,\n germRedirectPath,\n type FetchGermMessageLinkOptions,\n type GermMessageLink,\n} from './germ.js';\nexport { fetchGetProfileView } from './get-profile-view.js';\nexport {\n deleteAvatarOverride,\n deleteNamePronunciationAudio,\n refreshPds,\n updateProfileOverride,\n updateProfileSelf,\n uploadAvatar,\n uploadNamePronunciationAudio,\n type ProfileIndustryInput,\n type ProfileSelfLocation,\n type RefreshPdsResult,\n type UpdateProfileOverrideInput,\n type UpdateProfileSelfInput,\n type UploadAvatarResult,\n type UploadPronunciationAudioResult,\n} from './profile-mutations.js';\nexport {\n createPosition,\n deletePosition,\n linkSkillToPosition,\n setPositionPrimary,\n unlinkSkillFromPosition,\n unsetPositionPrimary,\n updatePosition,\n} from './positions.js';\nexport { createEducation, deleteEducation, updateEducation } from './education.js';\nexport { setSectionPrimary, unsetSectionPrimary, type PrimarySection } from './section-primary.js';\nexport { createSkill, deleteSkill, updateSkill } from './skills.js';\nexport { createRecord, deleteRecord, updateRecord } from './records.js';\nexport {\n createProfileLocation,\n deleteProfileLocation,\n updateProfileLocation,\n type ProfileLocationAddress,\n type ProfileLocationInput,\n} from './profile-locations.js';\nexport {\n createExternalAccount,\n deleteExternalAccount,\n fetchExternalAccounts,\n setExternalAccountPrimary,\n unsetExternalAccountPrimary,\n updateExternalAccount,\n verifyExternalAccount,\n type CreateExternalAccountResult,\n type ExternalAccountInput,\n type VerifyExternalAccountResult,\n} from './external-accounts.js';\nexport {\n createEndorsement,\n confirmEndorsement,\n type EndorsementInput,\n type ConfirmEndorsementInput,\n} from './endorsements.js';\nexport {\n fetchReceivedEndorsements,\n type ReceivedEndorsement,\n type ReceivedEndorsementsPage,\n} from './received-endorsements.js';\nexport {\n fetchReciprocityCandidate,\n type ReciprocityCandidate,\n type ReciprocitySkill,\n} from './reciprocity.js';\nexport {\n fetchPendingEndorsements,\n dismissEndorsement,\n type PendingEndorsement,\n type PendingEndorsementsPage,\n type DismissEndorsementInput,\n type FetchPendingEndorsementsOptions,\n} from './endorsement-inbox.js';\nexport {\n fetchPendingConfirmations,\n fetchGivenConfirmations,\n fetchViewerPositionConfirmations,\n createConfirmation,\n dismissConfirmation,\n revokeConfirmation,\n type PendingConfirmation,\n type PendingConfirmationsPage,\n type GivenConfirmation,\n type ConfirmationInput,\n type ConfirmationSubjectInput,\n type FetchConfirmationsOptions,\n} from './confirmations.js';\nexport { fetchInboxCounts, type InboxCounts, type FetchInboxCountsOptions } from './inbox.js';\nexport {\n fetchUnlinkedPositions,\n dismissUnlinkedPosition,\n type UnlinkedPosition,\n type UnlinkedPositionsResult,\n type FetchUnlinkedPositionsOptions,\n type DismissUnlinkedPositionInput,\n} from './unlinked-positions.js';\nexport {\n fetchProfileCompleteness,\n dismissCompletenessSignal,\n clearCompletenessDismissals,\n PROFILE_COMPLETENESS_SIGNALS,\n type ProfileCompleteness,\n type ProfileCompletenessSignal,\n type FetchProfileCompletenessOptions,\n type DismissCompletenessSignalInput,\n} from './profile-completeness.js';\nexport { hideKeytraceClaim, unhideKeytraceClaim } from './keytrace-claims.js';\nexport { revealMarqueDomain, unrevealMarqueDomain } from './marque-domains.js';\nexport {\n bulkHideStandardPublications,\n bulkUnhideStandardPublications,\n hideOrcidPublication,\n hideSifaPublication,\n hideStandardPublication,\n refreshOrcidPublications,\n unhideOrcidPublication,\n unhideSifaPublication,\n unhideStandardPublication,\n type RefreshOrcidPublicationsResult,\n} from './publications.js';\nexport {\n bulkHideProfileItems,\n bulkUnhideProfileItems,\n hideProfileItem,\n unhideProfileItem,\n HIDDEN_ITEM_SOURCES,\n HIDDEN_ITEM_TYPES,\n type BulkHideProfileItemInput,\n type HiddenItemSource,\n type HiddenItemType,\n type HideProfileItemInput,\n} from './profile-items-hide.js';\nexport {\n fetchHiddenActivityItems,\n hideActivityItem,\n unhideActivityItem,\n type FetchHiddenActivityItemsOptions,\n type HiddenActivityItem,\n type HideActivityItemInput,\n type UnhideActivityItemInput,\n} from './activity-items-hide.js';\nexport {\n fetchActivityPreferences,\n fetchSiteActivityPreset,\n updateActivityPreferences,\n type ActivityPreferences,\n type FetchActivityPreferencesOptions,\n type SiteActivityPresetResponse,\n type UpdateActivityPreferencesInput,\n} from './activity-preferences.js';\nexport { fetchStats, type StatsResponse } from './stats.js';\nexport {\n fetchAppsRegistry,\n fetchHiddenApps,\n type AppRegistryEntry,\n type FetchHiddenAppsOptions,\n type HiddenApp,\n} from './apps.js';\nexport {\n fetchAccounts,\n switchAccount,\n type AccountSummary,\n type FetchAccountsOptions,\n} from './accounts.js';\nexport {\n fetchSearchCompanies,\n fetchSearchFilters,\n fetchSearchProfiles,\n fetchSkillSuggestions,\n searchSkills,\n type CompanySearchFilters,\n type CompanySearchResponse,\n type CompanySearchResult,\n type FilterOptions,\n type ProfileSearchResult,\n type ProfileSearchSuggestion,\n type SearchFilters,\n type SearchResponse,\n type SkillSearchResult,\n} from './search.js';\nexport {\n fetchSpeakers,\n fetchTalks,\n type SpeakerCard,\n type SpeakerGroup,\n type SpeakerDirectoryFilters,\n type SpeakersResponse,\n type TalkEvent,\n type TalkRow,\n type TalkSpeaker,\n type TalksResponse,\n} from './speakers.js';\nexport {\n fetchFeaturedProfile,\n fetchSimilarProfiles,\n fetchSuggestionCount,\n fetchSuggestions,\n type FeaturedProfile,\n type FetchSuggestionsOptions,\n type SimilarProfile,\n type SuggestionProfile,\n type SuggestionsResponse,\n} from './discovery.js';\nexport {\n fetchFollowing,\n followUser,\n getFollowers,\n getFollowing,\n fetchFollowingFeed,\n fetchFollowingFeedVersion,\n isNewerFollowingFeed,\n type FollowingFeedVersion,\n type FollowingFeedBuild,\n unfollowUser,\n type FetchFollowListOptions,\n type FetchFollowingFeedOptions,\n type FollowingFeedApp,\n type FollowingFeedEmptyReason,\n type FollowingFeedResponse,\n type FollowListPage,\n type FollowProfile,\n type FollowUserResult,\n type FollowingResponse,\n} from './follow.js';\nexport {\n getBlueskySuggestions,\n getMutuals,\n type FetchFollowProfilePageOptions,\n type FollowProfilePageResponse,\n} from './follow-extras.js';\nexport {\n addFeatureAllowlist,\n listFeatureAllowlist,\n removeFeatureAllowlist,\n type FeatureAllowlistResponse,\n type ListFeatureAllowlistOptions,\n} from './admin-feature-allowlists.js';\nexport {\n getAdminReviewQueues,\n type AdminReviewQueues,\n type GetAdminReviewQueuesOptions,\n} from './admin-review-queues.js';\nexport {\n fetchActivityFeed,\n fetchActivityTeaser,\n fetchHeatmapData,\n type ActivityFeedResponse,\n type ActivityItem,\n type ActivityItemLinkHealth,\n type ActivityTeaserResponse,\n type FetchActivityFeedOptions,\n type FetchActivityTeaserOptions,\n type HeatmapDay,\n type HeatmapResponse,\n} from './activity.js';\nexport {\n fetchMyGithubPullRequests,\n type GithubPullRequest,\n type MyGithubPullRequestsResponse,\n type FetchMyGithubPullRequestsOptions,\n} from './github-prs.js';\nexport {\n fetchRpgStatus,\n fetchRpgClaimable,\n RpgItemStatusSchema,\n RpgStatusResponseSchema,\n RpgClaimableResponseSchema,\n type RpgItemStatus,\n type RpgStatusResponse,\n type FetchRpgStatusOptions,\n type RpgClaimableResponse,\n type FetchRpgClaimableOptions,\n} from './rpg.js';\nexport { fetchEndorsementCount } from './endorsement.js';\nexport { fetchNetworkStreamCount, type FetchNetworkStreamCountOptions } from './stream.js';\nexport {\n checkAppAccount,\n createReaction,\n deleteReaction,\n fetchReactionStatus,\n type AccountCheckResult,\n type CheckAppAccountOptions,\n type FetchReactionStatusOptions,\n type ReactionError,\n type ReactionResult,\n type ReactionStatus,\n} from './reactions.js';\nexport {\n QUOTED_POSTS_BATCH_MAX,\n resolveQuotedPosts,\n type QuotedPostAuthor,\n type QuotedPostImage,\n type QuotedPostResult,\n type QuotedPostView,\n type ResolveQuotedPostsOptions,\n} from './quoted-posts.js';\nexport {\n castRoadmapVote,\n fetchMyRoadmapVotes,\n fetchRoadmapVotes,\n retractRoadmapVote,\n type CastRoadmapVoteResult,\n type FetchMyRoadmapVotesOptions,\n type RoadmapVoteError,\n type RoadmapVoteResult,\n type RoadmapVoter,\n type RoadmapVotesResponse,\n} from './roadmap.js';\nexport {\n deleteAccount,\n fetchWipePreview,\n resetProfile,\n type DeleteAccountResult,\n type ResetProfileResult,\n type PdsWipeOutcome,\n type WipePreview,\n} from './destructive.js';\nexport {\n deleteRepoRecords,\n fetchRepoInventory,\n repoExportUrl,\n type RepoDeleteInput,\n} from './repo-inventory.js';\nexport {\n checkNetworkMapJobStatus,\n fetchNetworkMap,\n initiateNetworkMapGeneration,\n isNetworkMapResponse,\n type NetworkMapEdge,\n type NetworkMapGenerationJob,\n type NetworkMapGraphData,\n type NetworkMapNode,\n type NetworkMapPendingJob,\n type NetworkMapResponse,\n} from './network-map.js';\n\nexport { fetchEntitySearch, selectEntity, importSearchEntities } from './entities.js';\n\nexport {\n submitOrgClaim,\n updateOrgProfile,\n requestOrgDomainChallenge,\n verifyOrgDomain,\n addOrgNotificationEmail,\n removeOrgNotificationEmail,\n type OrgClaimBinding,\n type OrgProfileEcho,\n type OrgClaimResult,\n type OrgProfileUpdateResult,\n type OrgDomainChallengeResult,\n type OrgDomainVerifyResult,\n type OrgNotificationEmailAddResult,\n type OrgNotificationEmailRemoveResult,\n} from './org.js';\n\nexport { fetchProfileSummary } from './profile-summary.js';\n\nexport {\n fetchUserSettings,\n updateUserSettings,\n UserSettingsSchema,\n type FetchUserSettingsOptions,\n type UserSettings,\n type UserSettingsPatch,\n} from './user-settings.js';\n\nexport { sifaQueryKeys, type SifaQueryKey } from '../keys.js';\nexport { createInvestment, updateInvestment, deleteInvestment } from './investments.js';\n"],"mappings":";AAaA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAEP,SAAS,iBAAiB,oBAAoB;AAC9C;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB,iBAAiB,uBAAuB;AAClE,SAAS,mBAAmB,2BAAgD;AAC5E,SAAS,aAAa,aAAa,mBAAmB;AACtD,SAAS,cAAc,cAAc,oBAAoB;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP,SAAS,wBAAwE;AACjF;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP,SAAS,mBAAmB,2BAA2B;AACvD,SAAS,oBAAoB,4BAA4B;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAA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AA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAEP,SAAS,2BAA2B;AAEpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,qBAAwC;AACjD,SAAS,kBAAkB,kBAAkB,wBAAwB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/query/fetchers/index.ts"],"sourcesContent":["/**\n * Fetcher-only barrel for `@singi-labs/sifa-sdk/query/fetchers`.\n *\n * Pure, no React imports. Safe to import from Next.js React Server\n * Components, edge runtimes, and any other context where React hooks\n * are unavailable. Client components should import from\n * `@singi-labs/sifa-sdk/query` to get hooks + Provider too.\n *\n * Keep in sync with `../index.ts`: every fetcher exported there should\n * also be exported here. Hooks and the Provider live only in the\n * `/query` barrel.\n */\n\nexport {\n ApiError,\n apiFetch,\n apiFetchOrNull,\n apiWrite,\n apiWriteCreate,\n type ApiFetchOptions,\n type CreateResult,\n type SifaApiConfig,\n type WriteResult,\n} from '../client.js';\n\nexport { fetchAtFundLink, fetchProfile } from './profile.js';\nexport {\n fetchGermMessageLink,\n germRedirectPath,\n type FetchGermMessageLinkOptions,\n type GermMessageLink,\n} from './germ.js';\nexport { fetchGetProfileView } from './get-profile-view.js';\nexport {\n deleteAvatarOverride,\n deleteNamePronunciationAudio,\n refreshPds,\n updateProfileOverride,\n updateProfileSelf,\n uploadAvatar,\n uploadNamePronunciationAudio,\n type ProfileIndustryInput,\n type ProfileSelfLocation,\n type RefreshPdsResult,\n type UpdateProfileOverrideInput,\n type UpdateProfileSelfInput,\n type UploadAvatarResult,\n type UploadPronunciationAudioResult,\n} from './profile-mutations.js';\nexport {\n createPosition,\n deletePosition,\n linkSkillToPosition,\n setPositionPrimary,\n unlinkSkillFromPosition,\n unsetPositionPrimary,\n updatePosition,\n} from './positions.js';\nexport { createEducation, deleteEducation, updateEducation } from './education.js';\nexport { setSectionPrimary, unsetSectionPrimary, type PrimarySection } from './section-primary.js';\nexport { createSkill, deleteSkill, updateSkill } from './skills.js';\nexport { createRecord, deleteRecord, updateRecord } from './records.js';\nexport {\n createProfileLocation,\n deleteProfileLocation,\n updateProfileLocation,\n type ProfileLocationAddress,\n type ProfileLocationInput,\n} from './profile-locations.js';\nexport {\n createExternalAccount,\n deleteExternalAccount,\n fetchExternalAccounts,\n setExternalAccountPrimary,\n unsetExternalAccountPrimary,\n updateExternalAccount,\n verifyExternalAccount,\n type CreateExternalAccountResult,\n type ExternalAccountInput,\n type VerifyExternalAccountResult,\n} from './external-accounts.js';\nexport {\n createEndorsement,\n confirmEndorsement,\n type EndorsementInput,\n type ConfirmEndorsementInput,\n} from './endorsements.js';\nexport {\n fetchReceivedEndorsements,\n type ReceivedEndorsement,\n type ReceivedEndorsementsPage,\n} from './received-endorsements.js';\nexport {\n fetchReciprocityCandidate,\n type ReciprocityCandidate,\n type ReciprocitySkill,\n} from './reciprocity.js';\nexport {\n fetchPendingEndorsements,\n dismissEndorsement,\n type PendingEndorsement,\n type PendingEndorsementsPage,\n type DismissEndorsementInput,\n type FetchPendingEndorsementsOptions,\n} from './endorsement-inbox.js';\nexport {\n fetchPendingConfirmations,\n fetchGivenConfirmations,\n fetchViewerPositionConfirmations,\n createConfirmation,\n dismissConfirmation,\n revokeConfirmation,\n type PendingConfirmation,\n type PendingConfirmationsPage,\n type GivenConfirmation,\n type ConfirmationInput,\n type ConfirmationSubjectInput,\n type FetchConfirmationsOptions,\n} from './confirmations.js';\nexport { fetchInboxCounts, type InboxCounts, type FetchInboxCountsOptions } from './inbox.js';\nexport {\n fetchUnlinkedPositions,\n dismissUnlinkedPosition,\n type UnlinkedPosition,\n type UnlinkedPositionsResult,\n type FetchUnlinkedPositionsOptions,\n type DismissUnlinkedPositionInput,\n} from './unlinked-positions.js';\nexport {\n fetchProfileCompleteness,\n dismissCompletenessSignal,\n clearCompletenessDismissals,\n PROFILE_COMPLETENESS_SIGNALS,\n type ProfileCompleteness,\n type ProfileCompletenessSignal,\n type FetchProfileCompletenessOptions,\n type DismissCompletenessSignalInput,\n} from './profile-completeness.js';\nexport { hideKeytraceClaim, unhideKeytraceClaim } from './keytrace-claims.js';\nexport { revealMarqueDomain, unrevealMarqueDomain } from './marque-domains.js';\nexport {\n bulkHideStandardPublications,\n bulkUnhideStandardPublications,\n hideOrcidPublication,\n hideSifaPublication,\n hideStandardPublication,\n refreshOrcidPublications,\n unhideOrcidPublication,\n unhideSifaPublication,\n unhideStandardPublication,\n type RefreshOrcidPublicationsResult,\n} from './publications.js';\nexport {\n bulkHideProfileItems,\n bulkUnhideProfileItems,\n hideProfileItem,\n unhideProfileItem,\n HIDDEN_ITEM_SOURCES,\n HIDDEN_ITEM_TYPES,\n type BulkHideProfileItemInput,\n type HiddenItemSource,\n type HiddenItemType,\n type HideProfileItemInput,\n} from './profile-items-hide.js';\nexport {\n fetchHiddenActivityItems,\n hideActivityItem,\n unhideActivityItem,\n type FetchHiddenActivityItemsOptions,\n type HiddenActivityItem,\n type HideActivityItemInput,\n type UnhideActivityItemInput,\n} from './activity-items-hide.js';\nexport {\n fetchActivityPreferences,\n fetchSiteActivityPreset,\n updateActivityPreferences,\n type ActivityPreferences,\n type FetchActivityPreferencesOptions,\n type SiteActivityPresetResponse,\n type UpdateActivityPreferencesInput,\n} from './activity-preferences.js';\nexport { fetchStats, type StatsResponse } from './stats.js';\nexport {\n fetchAppsRegistry,\n fetchHiddenApps,\n type AppRegistryEntry,\n type FetchHiddenAppsOptions,\n type HiddenApp,\n} from './apps.js';\nexport {\n fetchAccounts,\n switchAccount,\n type AccountSummary,\n type FetchAccountsOptions,\n} from './accounts.js';\nexport {\n fetchSearchCompanies,\n fetchSearchFilters,\n fetchSearchProfiles,\n fetchSkillSuggestions,\n searchSkills,\n type CompanySearchFilters,\n type CompanySearchResponse,\n type CompanySearchResult,\n type FilterOptions,\n type ProfileSearchResult,\n type ProfileSearchSuggestion,\n type SearchFilters,\n type SearchResponse,\n type SkillSearchResult,\n} from './search.js';\nexport {\n fetchSpeakers,\n fetchTalks,\n type SpeakerCard,\n type SpeakerGroup,\n type SpeakerDirectoryFilters,\n type SpeakersResponse,\n type TalkEvent,\n type TalkRow,\n type TalkSpeaker,\n type TalksResponse,\n} from './speakers.js';\nexport {\n fetchFeaturedProfile,\n fetchSimilarProfiles,\n fetchSuggestionCount,\n fetchSuggestions,\n type FeaturedProfile,\n type FetchSuggestionsOptions,\n type SimilarProfile,\n type SuggestionProfile,\n type SuggestionsResponse,\n} from './discovery.js';\nexport {\n fetchFollowing,\n followUser,\n getFollowers,\n getFollowing,\n fetchFollowingFeed,\n fetchFollowingFeedVersion,\n isNewerFollowingFeed,\n type FollowingFeedVersion,\n type FollowingFeedBuild,\n unfollowUser,\n type FetchFollowListOptions,\n type FetchFollowingFeedOptions,\n type FollowingFeedApp,\n type FollowingFeedEmptyReason,\n type FollowingFeedResponse,\n type FollowListPage,\n type FollowProfile,\n type FollowUserResult,\n type FollowingResponse,\n} from './follow.js';\nexport {\n getBlueskySuggestions,\n getMutuals,\n type FetchFollowProfilePageOptions,\n type FollowProfilePageResponse,\n} from './follow-extras.js';\nexport {\n addFeatureAllowlist,\n listFeatureAllowlist,\n removeFeatureAllowlist,\n type FeatureAllowlistResponse,\n type ListFeatureAllowlistOptions,\n} from './admin-feature-allowlists.js';\nexport {\n getAdminReviewQueues,\n type AdminReviewQueues,\n type GetAdminReviewQueuesOptions,\n} from './admin-review-queues.js';\nexport {\n fetchActivityFeed,\n fetchActivityTeaser,\n fetchHeatmapData,\n type ActivityFeedResponse,\n type ActivityItem,\n type ActivityItemLinkHealth,\n type ActivityTeaserResponse,\n type FetchActivityFeedOptions,\n type FetchActivityTeaserOptions,\n type HeatmapDay,\n type HeatmapResponse,\n} from './activity.js';\nexport {\n fetchMyGithubPullRequests,\n type GithubPullRequest,\n type MyGithubPullRequestsResponse,\n type FetchMyGithubPullRequestsOptions,\n} from './github-prs.js';\nexport {\n fetchRpgStatus,\n fetchRpgClaimable,\n RpgItemStatusSchema,\n RpgStatusResponseSchema,\n RpgClaimableResponseSchema,\n type RpgItemStatus,\n type RpgStatusResponse,\n type FetchRpgStatusOptions,\n type RpgClaimableResponse,\n type FetchRpgClaimableOptions,\n} from './rpg.js';\nexport { fetchEndorsementCount } from './endorsement.js';\nexport { fetchNetworkStreamCount, type FetchNetworkStreamCountOptions } from './stream.js';\nexport {\n checkAppAccount,\n createReaction,\n deleteReaction,\n fetchReactionStatus,\n type AccountCheckResult,\n type CheckAppAccountOptions,\n type FetchReactionStatusOptions,\n type ReactionError,\n type ReactionResult,\n type ReactionStatus,\n} from './reactions.js';\nexport {\n QUOTED_POSTS_BATCH_MAX,\n resolveQuotedPosts,\n type QuotedPostAuthor,\n type QuotedPostImage,\n type QuotedPostResult,\n type QuotedPostView,\n type ResolveQuotedPostsOptions,\n} from './quoted-posts.js';\nexport {\n castRoadmapItemVote,\n castRoadmapVote,\n fetchMyRoadmapVotes,\n fetchRoadmap,\n fetchRoadmapVotes,\n retractRoadmapItemVote,\n retractRoadmapVote,\n type CastRoadmapVoteResult,\n type FetchMyRoadmapVotesOptions,\n type FetchRoadmapOptions,\n type RoadmapBoardItem,\n type RoadmapBoardSize,\n type RoadmapBoardStatus,\n type RoadmapItemRef,\n type RoadmapVoteError,\n type RoadmapVoteResult,\n type RoadmapVoter,\n type RoadmapVotesResponse,\n} from './roadmap.js';\nexport {\n deleteAccount,\n fetchWipePreview,\n resetProfile,\n type DeleteAccountResult,\n type ResetProfileResult,\n type PdsWipeOutcome,\n type WipePreview,\n} from './destructive.js';\nexport {\n deleteRepoRecords,\n fetchRepoInventory,\n repoExportUrl,\n type RepoDeleteInput,\n} from './repo-inventory.js';\nexport {\n checkNetworkMapJobStatus,\n fetchNetworkMap,\n initiateNetworkMapGeneration,\n isNetworkMapResponse,\n type NetworkMapEdge,\n type NetworkMapGenerationJob,\n type NetworkMapGraphData,\n type NetworkMapNode,\n type NetworkMapPendingJob,\n type NetworkMapResponse,\n} from './network-map.js';\n\nexport { fetchEntitySearch, selectEntity, importSearchEntities } from './entities.js';\n\nexport {\n submitOrgClaim,\n updateOrgProfile,\n requestOrgDomainChallenge,\n verifyOrgDomain,\n addOrgNotificationEmail,\n removeOrgNotificationEmail,\n type OrgClaimBinding,\n type OrgProfileEcho,\n type OrgClaimResult,\n type OrgProfileUpdateResult,\n type OrgDomainChallengeResult,\n type OrgDomainVerifyResult,\n type OrgNotificationEmailAddResult,\n type OrgNotificationEmailRemoveResult,\n} from './org.js';\n\nexport { fetchProfileSummary } from './profile-summary.js';\n\nexport {\n fetchUserSettings,\n updateUserSettings,\n UserSettingsSchema,\n type FetchUserSettingsOptions,\n type UserSettings,\n type UserSettingsPatch,\n} from './user-settings.js';\n\nexport { sifaQueryKeys, type SifaQueryKey } from '../keys.js';\nexport { createInvestment, updateInvestment, deleteInvestment } from './investments.js';\n"],"mappings":";AAaA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAEP,SAAS,iBAAiB,oBAAoB;AAC9C;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAQK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB,iBAAiB,uBAAuB;AAClE,SAAS,mBAAmB,2BAAgD;AAC5E,SAAS,aAAa,aAAa,mBAAmB;AACtD,SAAS,cAAc,cAAc,oBAAoB;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,OAGK;AACP;AAAA,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B;AACtC,SAAS,+BAAoE;AAC7E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAYK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AAEP,SAAS,mBAAmB,cAAc,4BAA4B;AAEtE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAEP,SAAS,2BAA2B;AAEpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,qBAAwC;AACjD,SAAS,kBAAkB,kBAAkB,wBAAwB;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/query/fetchers/roadmap.ts
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
import {
|
|
3
4
|
apiFetch,
|
|
4
5
|
apiWrite
|
|
@@ -27,13 +28,16 @@ async function fetchMyRoadmapVotes(config, options = {}) {
|
|
|
27
28
|
return [];
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
function castRoadmapVote(config, key, options = {}) {
|
|
32
|
+
return castUpvote(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, options);
|
|
33
|
+
}
|
|
34
|
+
async function castUpvote(config, path, options) {
|
|
31
35
|
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
32
|
-
const url = `${config.baseUrl}
|
|
36
|
+
const url = `${config.baseUrl}${path}`;
|
|
33
37
|
try {
|
|
34
38
|
const res = await fetchFn(url, {
|
|
35
39
|
method: "POST",
|
|
36
|
-
// No body: the item
|
|
40
|
+
// No body: the item is in the URL. Do NOT declare a JSON content-type
|
|
37
41
|
// for an empty body — Fastify rejects that with a 400 before the handler
|
|
38
42
|
// runs. Only forward caller-provided headers.
|
|
39
43
|
...options.headers ? { headers: options.headers } : {},
|
|
@@ -64,10 +68,59 @@ async function castRoadmapVote(config, key, options = {}) {
|
|
|
64
68
|
function retractRoadmapVote(config, key, options = {}) {
|
|
65
69
|
return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "DELETE", options);
|
|
66
70
|
}
|
|
71
|
+
var roadmapBoardItemSchema = z.object({
|
|
72
|
+
uri: z.string(),
|
|
73
|
+
did: z.string(),
|
|
74
|
+
rkey: z.string(),
|
|
75
|
+
title: z.string(),
|
|
76
|
+
body: z.string().nullable(),
|
|
77
|
+
tags: z.array(z.string()),
|
|
78
|
+
size: z.enum(["small", "medium", "epic"]).nullable(),
|
|
79
|
+
status: z.enum(["done", "in-progress", "planned", "later", "under-review"]),
|
|
80
|
+
votable: z.boolean(),
|
|
81
|
+
votes: z.object({
|
|
82
|
+
count: z.number(),
|
|
83
|
+
voters: z.array(z.object({ did: z.string(), avatarUrl: z.string().optional() }))
|
|
84
|
+
}),
|
|
85
|
+
createdAt: z.string(),
|
|
86
|
+
viewerVoted: z.boolean()
|
|
87
|
+
});
|
|
88
|
+
async function fetchRoadmap(config, options = {}) {
|
|
89
|
+
const { cookieHeader, ...rest } = options;
|
|
90
|
+
const headers = { ...rest.headers ?? {} };
|
|
91
|
+
if (cookieHeader) headers.cookie = cookieHeader;
|
|
92
|
+
try {
|
|
93
|
+
const data = await apiFetch(config, "/api/roadmap", {
|
|
94
|
+
cache: "no-store",
|
|
95
|
+
credentials: "include",
|
|
96
|
+
...rest,
|
|
97
|
+
headers
|
|
98
|
+
});
|
|
99
|
+
if (!Array.isArray(data.items)) return null;
|
|
100
|
+
return data.items.flatMap((raw) => {
|
|
101
|
+
const parsed = roadmapBoardItemSchema.safeParse(raw);
|
|
102
|
+
return parsed.success ? [parsed.data] : [];
|
|
103
|
+
});
|
|
104
|
+
} catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function itemVotePath(item) {
|
|
109
|
+
return `/api/roadmap/items/${encodeURIComponent(item.did)}/${encodeURIComponent(item.rkey)}/vote`;
|
|
110
|
+
}
|
|
111
|
+
function castRoadmapItemVote(config, item, options = {}) {
|
|
112
|
+
return castUpvote(config, itemVotePath(item), options);
|
|
113
|
+
}
|
|
114
|
+
function retractRoadmapItemVote(config, item, options = {}) {
|
|
115
|
+
return apiWrite(config, itemVotePath(item), "DELETE", options);
|
|
116
|
+
}
|
|
67
117
|
export {
|
|
118
|
+
castRoadmapItemVote,
|
|
68
119
|
castRoadmapVote,
|
|
69
120
|
fetchMyRoadmapVotes,
|
|
121
|
+
fetchRoadmap,
|
|
70
122
|
fetchRoadmapVotes,
|
|
123
|
+
retractRoadmapItemVote,
|
|
71
124
|
retractRoadmapVote
|
|
72
125
|
};
|
|
73
126
|
//# sourceMappingURL=roadmap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/query/fetchers/roadmap.ts"],"sourcesContent":["import {\n apiFetch,\n apiWrite,\n type ApiFetchOptions,\n type SifaApiConfig,\n type WriteResult,\n} from '../client.js';\n\n/** Voter on a roadmap item. */\nexport interface RoadmapVoter {\n did: string;\n avatarUrl?: string;\n}\n\n/** Map of item key -> vote tally and voter list. */\nexport type RoadmapVotesResponse = Record<string, { count: number; voters: RoadmapVoter[] }>;\n\n/**\n * Public roadmap vote tallies, keyed by item. Returns `{}` on any error.\n */\nexport async function fetchRoadmapVotes(\n config: SifaApiConfig,\n options: ApiFetchOptions = {},\n): Promise<RoadmapVotesResponse> {\n try {\n return await apiFetch<RoadmapVotesResponse>(config, '/api/roadmap/votes', {\n cache: 'no-store',\n ...options,\n });\n } catch {\n return {};\n }\n}\n\nexport interface FetchMyRoadmapVotesOptions extends ApiFetchOptions {\n /**\n * Pass the caller's `Cookie` header on Next.js RSC server-side calls.\n * Required for authenticated server fetches because `credentials: 'include'`\n * does not propagate browser cookies in RSC.\n */\n cookieHeader?: string;\n}\n\n/**\n * Roadmap items the authenticated user has voted on. Returns `[]` on any\n * error or when the response payload is shaped unexpectedly.\n */\nexport async function fetchMyRoadmapVotes(\n config: SifaApiConfig,\n options: FetchMyRoadmapVotesOptions = {},\n): Promise<string[]> {\n const headers: Record<string, string> = { ...(options.headers ?? {}) };\n if (options.cookieHeader) headers.cookie = options.cookieHeader;\n\n try {\n const data = await apiFetch<{ voted?: string[] }>(config, '/api/roadmap/votes/me', {\n credentials: 'include',\n ...options,\n headers,\n });\n return data.voted ?? [];\n } catch {\n return [];\n }\n}\n\n/** Result of a successful {@link castRoadmapVote} -- the created upvote record. */\nexport interface RoadmapVoteResult {\n uri: string;\n rkey: string;\n}\n\n/** Structured error returned by {@link castRoadmapVote} on failure. */\nexport interface RoadmapVoteError {\n type: 'scope_insufficient' | 'error';\n /**\n * When `type === 'scope_insufficient'`, the lexicon collection the user must\n * re-authorize for (e.g. `app.userinput.upvote`). sifa-web maps this to an\n * OAuth scope-upgrade flow (`/oauth/reauth?scope=repo:<collection>`).\n */\n requiredScope?: string;\n}\n\n/**\n * Discriminated-union result of {@link castRoadmapVote}. Exported so the\n * `useCastRoadmapVote` hook and SDK consumers can type mutation handlers\n * against a single source of truth.\n */\nexport type CastRoadmapVoteResult =\n { ok: true; data: RoadmapVoteResult } | { ok: false; error: RoadmapVoteError };\n\n/**\n * Cast a vote on a roadmap item by its key.\n *\n * Writes an `app.userinput.upvote` record into the viewer's PDS (server-side,\n * via their OAuth session). Returns a discriminated-union result rather than\n * the generic {@link WriteResult} because a first-time voter's PDS grant may\n * not yet include the `app.userinput.upvote` collection: the AppView responds\n * 403 `ScopeInsufficient`, which the caller handles by triggering an OAuth\n * scope upgrade rather than showing an error. Mirrors {@link createReaction}.\n *\n * Never throws.\n */\nexport async function castRoadmapVote(\n config: SifaApiConfig,\n key: string,\n options: ApiFetchOptions = {},\n): Promise<CastRoadmapVoteResult> {\n const fetchFn = config.fetch ?? globalThis.fetch;\n const url = `${config.baseUrl}/api/roadmap/votes/${encodeURIComponent(key)}`;\n\n try {\n const res = await fetchFn(url, {\n method: 'POST',\n // No body: the item key is in the URL. Do NOT declare a JSON content-type\n // for an empty body — Fastify rejects that with a 400 before the handler\n // runs. Only forward caller-provided headers.\n ...(options.headers ? { headers: options.headers } : {}),\n credentials: options.credentials ?? 'include',\n signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 10_000),\n });\n\n if (!res.ok) {\n if (res.status === 403) {\n try {\n const body = (await res.json()) as { error?: string; requiredScope?: string };\n if (body.error === 'ScopeInsufficient') {\n return {\n ok: false,\n error: { type: 'scope_insufficient', requiredScope: body.requiredScope },\n };\n }\n } catch {\n // Fall through to generic error.\n }\n }\n return { ok: false, error: { type: 'error' } };\n }\n\n const data = (await res.json()) as RoadmapVoteResult;\n return { ok: true, data };\n } catch {\n return { ok: false, error: { type: 'error' } };\n }\n}\n\n/** Retract a previously-cast roadmap vote. */\nexport function retractRoadmapVote(\n config: SifaApiConfig,\n key: string,\n options: ApiFetchOptions = {},\n): Promise<WriteResult> {\n return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, 'DELETE', options);\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AAcP,eAAsB,kBACpB,QACA,UAA2B,CAAC,GACG;AAC/B,MAAI;AACF,WAAO,MAAM,SAA+B,QAAQ,sBAAsB;AAAA,MACxE,OAAO;AAAA,MACP,GAAG;AAAA,IACL,CAAC;AAAA,EACH,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;AAeA,eAAsB,oBACpB,QACA,UAAsC,CAAC,GACpB;AACnB,QAAM,UAAkC,EAAE,GAAI,QAAQ,WAAW,CAAC,EAAG;AACrE,MAAI,QAAQ,aAAc,SAAQ,SAAS,QAAQ;AAEnD,MAAI;AACF,UAAM,OAAO,MAAM,SAA+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U,OAAO;AAC5F;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/query/fetchers/roadmap.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport {\n apiFetch,\n apiWrite,\n type ApiFetchOptions,\n type SifaApiConfig,\n type WriteResult,\n} from '../client.js';\n\n/** Voter on a roadmap item. */\nexport interface RoadmapVoter {\n did: string;\n avatarUrl?: string;\n}\n\n/** Map of item key -> vote tally and voter list. */\nexport type RoadmapVotesResponse = Record<string, { count: number; voters: RoadmapVoter[] }>;\n\n/**\n * Public roadmap vote tallies, keyed by item. Returns `{}` on any error.\n */\nexport async function fetchRoadmapVotes(\n config: SifaApiConfig,\n options: ApiFetchOptions = {},\n): Promise<RoadmapVotesResponse> {\n try {\n return await apiFetch<RoadmapVotesResponse>(config, '/api/roadmap/votes', {\n cache: 'no-store',\n ...options,\n });\n } catch {\n return {};\n }\n}\n\nexport interface FetchMyRoadmapVotesOptions extends ApiFetchOptions {\n /**\n * Pass the caller's `Cookie` header on Next.js RSC server-side calls.\n * Required for authenticated server fetches because `credentials: 'include'`\n * does not propagate browser cookies in RSC.\n */\n cookieHeader?: string;\n}\n\n/**\n * Roadmap items the authenticated user has voted on. Returns `[]` on any\n * error or when the response payload is shaped unexpectedly.\n */\nexport async function fetchMyRoadmapVotes(\n config: SifaApiConfig,\n options: FetchMyRoadmapVotesOptions = {},\n): Promise<string[]> {\n const headers: Record<string, string> = { ...(options.headers ?? {}) };\n if (options.cookieHeader) headers.cookie = options.cookieHeader;\n\n try {\n const data = await apiFetch<{ voted?: string[] }>(config, '/api/roadmap/votes/me', {\n credentials: 'include',\n ...options,\n headers,\n });\n return data.voted ?? [];\n } catch {\n return [];\n }\n}\n\n/** Result of a successful {@link castRoadmapVote} -- the created upvote record. */\nexport interface RoadmapVoteResult {\n uri: string;\n rkey: string;\n}\n\n/** Structured error returned by {@link castRoadmapVote} on failure. */\nexport interface RoadmapVoteError {\n type: 'scope_insufficient' | 'error';\n /**\n * When `type === 'scope_insufficient'`, the lexicon collection the user must\n * re-authorize for (e.g. `app.userinput.upvote`). sifa-web maps this to an\n * OAuth scope-upgrade flow (`/oauth/reauth?scope=repo:<collection>`).\n */\n requiredScope?: string;\n}\n\n/**\n * Discriminated-union result of {@link castRoadmapVote}. Exported so the\n * `useCastRoadmapVote` hook and SDK consumers can type mutation handlers\n * against a single source of truth.\n */\nexport type CastRoadmapVoteResult =\n { ok: true; data: RoadmapVoteResult } | { ok: false; error: RoadmapVoteError };\n\n/**\n * Cast a vote on a roadmap item by its key.\n *\n * Writes an `app.userinput.upvote` record into the viewer's PDS (server-side,\n * via their OAuth session). Returns a discriminated-union result rather than\n * the generic {@link WriteResult} because a first-time voter's PDS grant may\n * not yet include the `app.userinput.upvote` collection: the AppView responds\n * 403 `ScopeInsufficient`, which the caller handles by triggering an OAuth\n * scope upgrade rather than showing an error. Mirrors {@link createReaction}.\n *\n * Never throws.\n */\nexport function castRoadmapVote(\n config: SifaApiConfig,\n key: string,\n options: ApiFetchOptions = {},\n): Promise<CastRoadmapVoteResult> {\n return castUpvote(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, options);\n}\n\nasync function castUpvote(\n config: SifaApiConfig,\n path: string,\n options: ApiFetchOptions,\n): Promise<CastRoadmapVoteResult> {\n const fetchFn = config.fetch ?? globalThis.fetch;\n const url = `${config.baseUrl}${path}`;\n\n try {\n const res = await fetchFn(url, {\n method: 'POST',\n // No body: the item is in the URL. Do NOT declare a JSON content-type\n // for an empty body — Fastify rejects that with a 400 before the handler\n // runs. Only forward caller-provided headers.\n ...(options.headers ? { headers: options.headers } : {}),\n credentials: options.credentials ?? 'include',\n signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 10_000),\n });\n\n if (!res.ok) {\n if (res.status === 403) {\n try {\n const body = (await res.json()) as { error?: string; requiredScope?: string };\n if (body.error === 'ScopeInsufficient') {\n return {\n ok: false,\n error: { type: 'scope_insufficient', requiredScope: body.requiredScope },\n };\n }\n } catch {\n // Fall through to generic error.\n }\n }\n return { ok: false, error: { type: 'error' } };\n }\n\n const data = (await res.json()) as RoadmapVoteResult;\n return { ok: true, data };\n } catch {\n return { ok: false, error: { type: 'error' } };\n }\n}\n\n/** Retract a previously-cast roadmap vote. */\nexport function retractRoadmapVote(\n config: SifaApiConfig,\n key: string,\n options: ApiFetchOptions = {},\n): Promise<WriteResult> {\n return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, 'DELETE', options);\n}\n\n/** Roadmap group of a board item (sifa-api `GET /api/roadmap`). */\nexport type RoadmapBoardStatus = 'done' | 'in-progress' | 'planned' | 'later' | 'under-review';\n\nexport type RoadmapBoardSize = 'small' | 'medium' | 'epic';\n\n/** One item on the roadmap, read from Sifa's userinput.app board. */\nexport interface RoadmapBoardItem {\n /** The `app.userinput.discussion` record URI. */\n uri: string;\n /** Author of the discussion (sifa.id or anyone who posted an idea). */\n did: string;\n rkey: string;\n title: string;\n /** Free text from the record. Render as plain text. */\n body: string | null;\n /** Tags without the size tag. */\n tags: string[];\n size: RoadmapBoardSize | null;\n status: RoadmapBoardStatus;\n votable: boolean;\n votes: { count: number; voters: RoadmapVoter[] };\n createdAt: string;\n /** Whether the signed-in viewer voted. False without a session. */\n viewerVoted: boolean;\n}\n\n/** Identifies a board item for voting. */\nexport interface RoadmapItemRef {\n did: string;\n rkey: string;\n}\n\nconst roadmapBoardItemSchema: z.ZodType<RoadmapBoardItem> = z.object({\n uri: z.string(),\n did: z.string(),\n rkey: z.string(),\n title: z.string(),\n body: z.string().nullable(),\n tags: z.array(z.string()),\n size: z.enum(['small', 'medium', 'epic']).nullable(),\n status: z.enum(['done', 'in-progress', 'planned', 'later', 'under-review']),\n votable: z.boolean(),\n votes: z.object({\n count: z.number(),\n voters: z.array(z.object({ did: z.string(), avatarUrl: z.string().optional() })),\n }),\n createdAt: z.string(),\n viewerVoted: z.boolean(),\n});\n\nexport interface FetchRoadmapOptions extends ApiFetchOptions {\n /**\n * Pass the caller's `Cookie` header on Next.js RSC server-side calls so\n * `viewerVoted` reflects the viewer.\n */\n cookieHeader?: string;\n}\n\n/**\n * The roadmap as built from Sifa's userinput.app board, grouped and ordered\n * by the API. Returns `null` on any error, so callers can tell an outage from\n * an empty roadmap.\n */\nexport async function fetchRoadmap(\n config: SifaApiConfig,\n options: FetchRoadmapOptions = {},\n): Promise<RoadmapBoardItem[] | null> {\n const { cookieHeader, ...rest } = options;\n const headers: Record<string, string> = { ...(rest.headers ?? {}) };\n if (cookieHeader) headers.cookie = cookieHeader;\n\n try {\n const data = await apiFetch<{ items?: unknown }>(config, '/api/roadmap', {\n cache: 'no-store',\n credentials: 'include',\n ...rest,\n headers,\n });\n if (!Array.isArray(data.items)) return null;\n // Drop items with an unexpected shape rather than failing the whole roadmap.\n return data.items.flatMap((raw) => {\n const parsed = roadmapBoardItemSchema.safeParse(raw);\n return parsed.success ? [parsed.data] : [];\n });\n } catch {\n return null;\n }\n}\n\nfunction itemVotePath(item: RoadmapItemRef): string {\n return `/api/roadmap/items/${encodeURIComponent(item.did)}/${encodeURIComponent(item.rkey)}/vote`;\n}\n\n/**\n * Vote on a roadmap board item. Same result shape and scope handling as\n * {@link castRoadmapVote}. Never throws.\n */\nexport function castRoadmapItemVote(\n config: SifaApiConfig,\n item: RoadmapItemRef,\n options: ApiFetchOptions = {},\n): Promise<CastRoadmapVoteResult> {\n return castUpvote(config, itemVotePath(item), options);\n}\n\n/** Retract a vote on a roadmap board item. */\nexport function retractRoadmapItemVote(\n config: SifaApiConfig,\n item: RoadmapItemRef,\n options: ApiFetchOptions = {},\n): Promise<WriteResult> {\n return apiWrite(config, itemVotePath(item), 'DELETE', options);\n}\n"],"mappings":";AAAA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AAcP,eAAsB,kBACpB,QACA,UAA2B,CAAC,GACG;AAC/B,MAAI;AACF,WAAO,MAAM,SAA+B,QAAQ,sBAAsB;AAAA,MACxE,OAAO;AAAA,MACP,GAAG;AAAA,IACL,CAA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O,MAAM,SAA8B,QAAQ,gBAAgB;AAAA,MACvE,OAAO;AAAA,MACP,aAAa;AAAA,MACb,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AACD,QAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,EAAG,QAAO;AAEvC,WAAO,KAAK,MAAM,QAAQ,CAAC,QAAQ;AACjC,YAAM,SAAS,uBAAuB,UAAU,GAAG;AACnD,aAAO,OAAO,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC;AAAA,IAC3C,CAAC;AAAA,EACH,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,aAAa,MAA8B;AAClD,SAAO,sBAAsB,mBAAmB,KAAK,GAAG,CAAC,IAAI,mBAAmB,KAAK,IAAI,CAAC;AAC5F;AAMO,SAAS,oBACd,QACA,MACA,UAA2B,CAAC,GACI;AAChC,SAAO,WAAW,QAAQ,aAAa,IAAI,GAAG,OAAO;AACvD;AAGO,SAAS,uBACd,QACA,MACA,UAA2B,CAAC,GACN;AACtB,SAAO,SAAS,QAAQ,aAAa,IAAI,GAAG,UAAU,OAAO;AAC/D;","names":[]}
|
|
@@ -3504,8 +3504,6 @@ function useDeleteReaction(options) {
|
|
|
3504
3504
|
}
|
|
3505
3505
|
});
|
|
3506
3506
|
}
|
|
3507
|
-
|
|
3508
|
-
// src/query/fetchers/roadmap.ts
|
|
3509
3507
|
async function fetchRoadmapVotes(config, options = {}) {
|
|
3510
3508
|
try {
|
|
3511
3509
|
return await apiFetch(config, "/api/roadmap/votes", {
|
|
@@ -3530,13 +3528,16 @@ async function fetchMyRoadmapVotes(config, options = {}) {
|
|
|
3530
3528
|
return [];
|
|
3531
3529
|
}
|
|
3532
3530
|
}
|
|
3533
|
-
|
|
3531
|
+
function castRoadmapVote(config, key, options = {}) {
|
|
3532
|
+
return castUpvote(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, options);
|
|
3533
|
+
}
|
|
3534
|
+
async function castUpvote(config, path, options) {
|
|
3534
3535
|
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
3535
|
-
const url = `${config.baseUrl}
|
|
3536
|
+
const url = `${config.baseUrl}${path}`;
|
|
3536
3537
|
try {
|
|
3537
3538
|
const res = await fetchFn(url, {
|
|
3538
3539
|
method: "POST",
|
|
3539
|
-
// No body: the item
|
|
3540
|
+
// No body: the item is in the URL. Do NOT declare a JSON content-type
|
|
3540
3541
|
// for an empty body — Fastify rejects that with a 400 before the handler
|
|
3541
3542
|
// runs. Only forward caller-provided headers.
|
|
3542
3543
|
...options.headers ? { headers: options.headers } : {},
|
|
@@ -3567,6 +3568,32 @@ async function castRoadmapVote(config, key, options = {}) {
|
|
|
3567
3568
|
function retractRoadmapVote(config, key, options = {}) {
|
|
3568
3569
|
return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "DELETE", options);
|
|
3569
3570
|
}
|
|
3571
|
+
zod.z.object({
|
|
3572
|
+
uri: zod.z.string(),
|
|
3573
|
+
did: zod.z.string(),
|
|
3574
|
+
rkey: zod.z.string(),
|
|
3575
|
+
title: zod.z.string(),
|
|
3576
|
+
body: zod.z.string().nullable(),
|
|
3577
|
+
tags: zod.z.array(zod.z.string()),
|
|
3578
|
+
size: zod.z.enum(["small", "medium", "epic"]).nullable(),
|
|
3579
|
+
status: zod.z.enum(["done", "in-progress", "planned", "later", "under-review"]),
|
|
3580
|
+
votable: zod.z.boolean(),
|
|
3581
|
+
votes: zod.z.object({
|
|
3582
|
+
count: zod.z.number(),
|
|
3583
|
+
voters: zod.z.array(zod.z.object({ did: zod.z.string(), avatarUrl: zod.z.string().optional() }))
|
|
3584
|
+
}),
|
|
3585
|
+
createdAt: zod.z.string(),
|
|
3586
|
+
viewerVoted: zod.z.boolean()
|
|
3587
|
+
});
|
|
3588
|
+
function itemVotePath(item) {
|
|
3589
|
+
return `/api/roadmap/items/${encodeURIComponent(item.did)}/${encodeURIComponent(item.rkey)}/vote`;
|
|
3590
|
+
}
|
|
3591
|
+
function castRoadmapItemVote(config, item, options = {}) {
|
|
3592
|
+
return castUpvote(config, itemVotePath(item), options);
|
|
3593
|
+
}
|
|
3594
|
+
function retractRoadmapItemVote(config, item, options = {}) {
|
|
3595
|
+
return apiWrite(config, itemVotePath(item), "DELETE", options);
|
|
3596
|
+
}
|
|
3570
3597
|
|
|
3571
3598
|
// src/query/hooks/use-roadmap.ts
|
|
3572
3599
|
function useRoadmapVotes(options) {
|
|
@@ -3620,6 +3647,38 @@ function useRetractRoadmapVote(options) {
|
|
|
3620
3647
|
}
|
|
3621
3648
|
});
|
|
3622
3649
|
}
|
|
3650
|
+
function useCastRoadmapItemVote(options) {
|
|
3651
|
+
const config = useSifaConfig();
|
|
3652
|
+
const queryClient = reactQuery.useQueryClient();
|
|
3653
|
+
return reactQuery.useMutation({
|
|
3654
|
+
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
3655
|
+
// handler below and silently drop cache invalidation (#453).
|
|
3656
|
+
...options,
|
|
3657
|
+
mutationFn: (item) => castRoadmapItemVote(config, item),
|
|
3658
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
3659
|
+
if (result.ok) {
|
|
3660
|
+
await invalidateRoadmap(queryClient);
|
|
3661
|
+
}
|
|
3662
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
3663
|
+
}
|
|
3664
|
+
});
|
|
3665
|
+
}
|
|
3666
|
+
function useRetractRoadmapItemVote(options) {
|
|
3667
|
+
const config = useSifaConfig();
|
|
3668
|
+
const queryClient = reactQuery.useQueryClient();
|
|
3669
|
+
return reactQuery.useMutation({
|
|
3670
|
+
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
3671
|
+
// handler below and silently drop cache invalidation (#453).
|
|
3672
|
+
...options,
|
|
3673
|
+
mutationFn: (item) => retractRoadmapItemVote(config, item),
|
|
3674
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
3675
|
+
if (result.success) {
|
|
3676
|
+
await invalidateRoadmap(queryClient);
|
|
3677
|
+
}
|
|
3678
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
3679
|
+
}
|
|
3680
|
+
});
|
|
3681
|
+
}
|
|
3623
3682
|
|
|
3624
3683
|
// src/query/fetchers/destructive.ts
|
|
3625
3684
|
function fetchWipePreview(config, options = {}) {
|
|
@@ -4247,6 +4306,7 @@ exports.useBulkHideStandardPublications = useBulkHideStandardPublications;
|
|
|
4247
4306
|
exports.useBulkUnhideProfileItems = useBulkUnhideProfileItems;
|
|
4248
4307
|
exports.useBulkUnhideStandardPublications = useBulkUnhideStandardPublications;
|
|
4249
4308
|
exports.useCanonicalSkillSearch = useCanonicalSkillSearch;
|
|
4309
|
+
exports.useCastRoadmapItemVote = useCastRoadmapItemVote;
|
|
4250
4310
|
exports.useCastRoadmapVote = useCastRoadmapVote;
|
|
4251
4311
|
exports.useClearCompletenessDismissals = useClearCompletenessDismissals;
|
|
4252
4312
|
exports.useCreateConfirmation = useCreateConfirmation;
|
|
@@ -4326,6 +4386,7 @@ exports.useRepoInventory = useRepoInventory;
|
|
|
4326
4386
|
exports.useRequestEmploymentConfirmation = useRequestEmploymentConfirmation;
|
|
4327
4387
|
exports.useResendProfileEmailVerification = useResendProfileEmailVerification;
|
|
4328
4388
|
exports.useResetProfile = useResetProfile;
|
|
4389
|
+
exports.useRetractRoadmapItemVote = useRetractRoadmapItemVote;
|
|
4329
4390
|
exports.useRetractRoadmapVote = useRetractRoadmapVote;
|
|
4330
4391
|
exports.useRevealMarqueDomain = useRevealMarqueDomain;
|
|
4331
4392
|
exports.useRevokeConfirmation = useRevokeConfirmation;
|