@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,5 +1,5 @@
|
|
|
1
|
-
export { A as AddFeatureAllowlistVariables, e as CreateReactionVariables, f as CreateRecordVariables, D as DeleteReactionVariables, g as DeleteRecordVariables, j as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, r as SifaProviderProps, U as UnfollowVariables, s as UpdateEducationVariables, t as UpdateExternalAccountVariables, u as UpdatePositionVariables, v as UpdateProfileLocationVariables, w as UpdateRecordVariables, x as UpdateSkillSubCategoriesVariables, y as UpdateSkillVariables, z as UseEntitySearchOptions, B as UseMyGithubPullRequestsParams, a0 as useAccounts, a1 as useActivityFeed, a2 as useActivityPreferences, a3 as useActivityTeaser, a4 as useAddFeatureAllowlist, a5 as useAddOrgNotificationEmail, a6 as useAddProfileEmail, a7 as useAdminReviewQueues, a8 as useAppAccountCheck, a9 as useAppsRegistry, aa as useAtFundLink, ab as useAttestationRequests, ac as useBlueskySuggestions, ad as useBulkHideProfileItems, ae as useBulkHideStandardPublications, af as useBulkUnhideProfileItems, ag as useBulkUnhideStandardPublications, ah as useCanonicalSkillSearch, ai as
|
|
2
|
-
export {
|
|
1
|
+
export { A as AddFeatureAllowlistVariables, e as CreateReactionVariables, f as CreateRecordVariables, D as DeleteReactionVariables, g as DeleteRecordVariables, j as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, r as SifaProviderProps, U as UnfollowVariables, s as UpdateEducationVariables, t as UpdateExternalAccountVariables, u as UpdatePositionVariables, v as UpdateProfileLocationVariables, w as UpdateRecordVariables, x as UpdateSkillSubCategoriesVariables, y as UpdateSkillVariables, z as UseEntitySearchOptions, B as UseMyGithubPullRequestsParams, a0 as useAccounts, a1 as useActivityFeed, a2 as useActivityPreferences, a3 as useActivityTeaser, a4 as useAddFeatureAllowlist, a5 as useAddOrgNotificationEmail, a6 as useAddProfileEmail, a7 as useAdminReviewQueues, a8 as useAppAccountCheck, a9 as useAppsRegistry, aa as useAtFundLink, ab as useAttestationRequests, ac as useBlueskySuggestions, ad as useBulkHideProfileItems, ae as useBulkHideStandardPublications, af as useBulkUnhideProfileItems, ag as useBulkUnhideStandardPublications, ah as useCanonicalSkillSearch, ai as useCastRoadmapItemVote, aj as useCastRoadmapVote, ak as useClearCompletenessDismissals, al as useCreateConfirmation, am as useCreateEducation, an as useCreateEndorsement, ao as useCreateExternalAccount, ap as useCreateOrgAttestation, aq as useCreatePosition, ar as useCreateProfileLocation, as as useCreateReaction, at as useCreateRecord, au as useCreateSkill, av as useDebouncedValue, aw as useDeleteAccount, ax as useDeleteAvatarOverride, ay as useDeleteEducation, az as useDeleteExternalAccount, aA as useDeleteNamePronunciationAudio, aB as useDeletePosition, aC as useDeleteProfileLocation, aD as useDeleteReaction, aE as useDeleteRecord, aF as useDeleteRepoRecords, aG as useDeleteSkill, aH as useDismissCompletenessSignal, aI as useDismissConfirmation, aJ as useDismissUnlinkedPosition, aK as useEndorsementCount, aL as useEntitySearch, aM as useExternalAccounts, aN as useFeatureAllowlist, aO as useFeaturedProfile, aP as useFollow, aQ as useFollowers, aR as useFollowing, aS as useFollowingFeed, aT as useFollowingFeedVersion, aU as useFollowingList, aV as useGetProfileView, aW as useGivenConfirmations, aX as useHeatmapData, aY as useHiddenActivityItems, aZ as useHiddenApps, a_ as useHideActivityItem, a$ as useHideKeytraceClaim, b0 as useHideOrcidPublication, b1 as useHideProfileItem, b2 as useHideSifaPublication, b3 as useHideStandardPublication, b4 as useImportSearchEntities, b5 as useInboxCounts, b6 as useLinkSkillToPosition, b8 as useMutuals, b9 as useMyGithubPullRequests, ba as useMyRoadmapVotes, bb as useNetworkStreamCount, bc as useOffboardOrgAttestation, bd as useOrgAttestations, be as useOrgClaim, bf as useOrgDomainChallenge, bg as useOrgDomainVerify, bh as useOrgProfile, bi as usePendingConfirmations, bj as useProfile, bk as useProfileCompleteness, bl as useProfileEmails, bm as useReactionStatus, bn as useRefreshOrcidPublications, bo as useRefreshPds, bp as useRejectAttestationRequest, bq as useRemoveFeatureAllowlist, br as useRemoveOrgNotificationEmail, bs as useRemoveProfileEmail, bt as useRepoInventory, bu as useRequestEmploymentConfirmation, bv as useResendProfileEmailVerification, bw as useResetProfile, by as useRetractRoadmapItemVote, bz as useRetractRoadmapVote, bA as useRevealMarqueDomain, bB as useRevokeConfirmation, bC as useRevokeOrgAttestation, bD as useRoadmapVotes, bE as useRpgClaimable, bF as useRpgStatus, cm as useSearchCompanies, bG as useSearchFilters, bH as useSearchProfiles, bI as useSelectEntity, bJ as useSetExternalAccountPrimary, bK as useSetPositionPrimary, bL as useSetSectionPrimary, bM as useSifaConfig, bN as useSimilarProfiles, bO as useSiteActivityPreset, bP as useSkillSuggestions, bQ as useStats, bR as useSuggestionCount, bS as useSuggestions, bT as useUnfollow, bU as useUnhideActivityItem, bV as useUnhideKeytraceClaim, bW as useUnhideOrcidPublication, bX as useUnhideProfileItem, bY as useUnhideSifaPublication, bZ as useUnhideStandardPublication, b_ as useUnlinkSkillFromPosition, b$ as useUnlinkedPositions, c0 as useUnrevealMarqueDomain, c1 as useUnsetExternalAccountPrimary, c2 as useUnsetPositionPrimary, c3 as useUnsetSectionPrimary, c4 as useUpdateActivityPreferences, c5 as useUpdateEducation, c6 as useUpdateExternalAccount, c7 as useUpdateOrgProfile, c8 as useUpdatePosition, c9 as useUpdateProfileLocation, ca as useUpdateProfileOverride, cb as useUpdateProfileSelf, cc as useUpdateRecord, cd as useUpdateSkill, ce as useUpdateSkillSubCategories, cf as useUpdateUserSettings, cg as useUploadAvatar, ch as useUploadNamePronunciationAudio, ci as useUserSettings, cj as useVerificationLog, ck as useVerifyExternalAccount, cl as useWipePreview } from '../../use-user-settings-Cq_AHkkM.cjs';
|
|
2
|
+
export { b0 as SifaQueryKey, s as sifaQueryKeys } from '../../user-settings-DDP76dZH.cjs';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
5
5
|
import { a3 as CreateResult, a2 as WriteResult } from '../../types-JydVIhN5.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AddFeatureAllowlistVariables, e as CreateReactionVariables, f as CreateRecordVariables, D as DeleteReactionVariables, g as DeleteRecordVariables, j as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, r as SifaProviderProps, U as UnfollowVariables, s as UpdateEducationVariables, t as UpdateExternalAccountVariables, u as UpdatePositionVariables, v as UpdateProfileLocationVariables, w as UpdateRecordVariables, x as UpdateSkillSubCategoriesVariables, y as UpdateSkillVariables, z as UseEntitySearchOptions, B as UseMyGithubPullRequestsParams, a0 as useAccounts, a1 as useActivityFeed, a2 as useActivityPreferences, a3 as useActivityTeaser, a4 as useAddFeatureAllowlist, a5 as useAddOrgNotificationEmail, a6 as useAddProfileEmail, a7 as useAdminReviewQueues, a8 as useAppAccountCheck, a9 as useAppsRegistry, aa as useAtFundLink, ab as useAttestationRequests, ac as useBlueskySuggestions, ad as useBulkHideProfileItems, ae as useBulkHideStandardPublications, af as useBulkUnhideProfileItems, ag as useBulkUnhideStandardPublications, ah as useCanonicalSkillSearch, ai as
|
|
2
|
-
export {
|
|
1
|
+
export { A as AddFeatureAllowlistVariables, e as CreateReactionVariables, f as CreateRecordVariables, D as DeleteReactionVariables, g as DeleteRecordVariables, j as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, r as SifaProviderProps, U as UnfollowVariables, s as UpdateEducationVariables, t as UpdateExternalAccountVariables, u as UpdatePositionVariables, v as UpdateProfileLocationVariables, w as UpdateRecordVariables, x as UpdateSkillSubCategoriesVariables, y as UpdateSkillVariables, z as UseEntitySearchOptions, B as UseMyGithubPullRequestsParams, a0 as useAccounts, a1 as useActivityFeed, a2 as useActivityPreferences, a3 as useActivityTeaser, a4 as useAddFeatureAllowlist, a5 as useAddOrgNotificationEmail, a6 as useAddProfileEmail, a7 as useAdminReviewQueues, a8 as useAppAccountCheck, a9 as useAppsRegistry, aa as useAtFundLink, ab as useAttestationRequests, ac as useBlueskySuggestions, ad as useBulkHideProfileItems, ae as useBulkHideStandardPublications, af as useBulkUnhideProfileItems, ag as useBulkUnhideStandardPublications, ah as useCanonicalSkillSearch, ai as useCastRoadmapItemVote, aj as useCastRoadmapVote, ak as useClearCompletenessDismissals, al as useCreateConfirmation, am as useCreateEducation, an as useCreateEndorsement, ao as useCreateExternalAccount, ap as useCreateOrgAttestation, aq as useCreatePosition, ar as useCreateProfileLocation, as as useCreateReaction, at as useCreateRecord, au as useCreateSkill, av as useDebouncedValue, aw as useDeleteAccount, ax as useDeleteAvatarOverride, ay as useDeleteEducation, az as useDeleteExternalAccount, aA as useDeleteNamePronunciationAudio, aB as useDeletePosition, aC as useDeleteProfileLocation, aD as useDeleteReaction, aE as useDeleteRecord, aF as useDeleteRepoRecords, aG as useDeleteSkill, aH as useDismissCompletenessSignal, aI as useDismissConfirmation, aJ as useDismissUnlinkedPosition, aK as useEndorsementCount, aL as useEntitySearch, aM as useExternalAccounts, aN as useFeatureAllowlist, aO as useFeaturedProfile, aP as useFollow, aQ as useFollowers, aR as useFollowing, aS as useFollowingFeed, aT as useFollowingFeedVersion, aU as useFollowingList, aV as useGetProfileView, aW as useGivenConfirmations, aX as useHeatmapData, aY as useHiddenActivityItems, aZ as useHiddenApps, a_ as useHideActivityItem, a$ as useHideKeytraceClaim, b0 as useHideOrcidPublication, b1 as useHideProfileItem, b2 as useHideSifaPublication, b3 as useHideStandardPublication, b4 as useImportSearchEntities, b5 as useInboxCounts, b6 as useLinkSkillToPosition, b8 as useMutuals, b9 as useMyGithubPullRequests, ba as useMyRoadmapVotes, bb as useNetworkStreamCount, bc as useOffboardOrgAttestation, bd as useOrgAttestations, be as useOrgClaim, bf as useOrgDomainChallenge, bg as useOrgDomainVerify, bh as useOrgProfile, bi as usePendingConfirmations, bj as useProfile, bk as useProfileCompleteness, bl as useProfileEmails, bm as useReactionStatus, bn as useRefreshOrcidPublications, bo as useRefreshPds, bp as useRejectAttestationRequest, bq as useRemoveFeatureAllowlist, br as useRemoveOrgNotificationEmail, bs as useRemoveProfileEmail, bt as useRepoInventory, bu as useRequestEmploymentConfirmation, bv as useResendProfileEmailVerification, bw as useResetProfile, by as useRetractRoadmapItemVote, bz as useRetractRoadmapVote, bA as useRevealMarqueDomain, bB as useRevokeConfirmation, bC as useRevokeOrgAttestation, bD as useRoadmapVotes, bE as useRpgClaimable, bF as useRpgStatus, cm as useSearchCompanies, bG as useSearchFilters, bH as useSearchProfiles, bI as useSelectEntity, bJ as useSetExternalAccountPrimary, bK as useSetPositionPrimary, bL as useSetSectionPrimary, bM as useSifaConfig, bN as useSimilarProfiles, bO as useSiteActivityPreset, bP as useSkillSuggestions, bQ as useStats, bR as useSuggestionCount, bS as useSuggestions, bT as useUnfollow, bU as useUnhideActivityItem, bV as useUnhideKeytraceClaim, bW as useUnhideOrcidPublication, bX as useUnhideProfileItem, bY as useUnhideSifaPublication, bZ as useUnhideStandardPublication, b_ as useUnlinkSkillFromPosition, b$ as useUnlinkedPositions, c0 as useUnrevealMarqueDomain, c1 as useUnsetExternalAccountPrimary, c2 as useUnsetPositionPrimary, c3 as useUnsetSectionPrimary, c4 as useUpdateActivityPreferences, c5 as useUpdateEducation, c6 as useUpdateExternalAccount, c7 as useUpdateOrgProfile, c8 as useUpdatePosition, c9 as useUpdateProfileLocation, ca as useUpdateProfileOverride, cb as useUpdateProfileSelf, cc as useUpdateRecord, cd as useUpdateSkill, ce as useUpdateSkillSubCategories, cf as useUpdateUserSettings, cg as useUploadAvatar, ch as useUploadNamePronunciationAudio, ci as useUserSettings, cj as useVerificationLog, ck as useVerifyExternalAccount, cl as useWipePreview } from '../../use-user-settings-DoNP3tNl.js';
|
|
2
|
+
export { b0 as SifaQueryKey, s as sifaQueryKeys } from '../../user-settings-CBtacio1.js';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
5
5
|
import { a3 as CreateResult, a2 as WriteResult } from '../../types-CkomzDlY.js';
|
|
@@ -155,7 +155,12 @@ import {
|
|
|
155
155
|
useDeleteReaction
|
|
156
156
|
} from "./use-reaction-mutations.js";
|
|
157
157
|
import { useMyRoadmapVotes, useRoadmapVotes } from "./use-roadmap.js";
|
|
158
|
-
import {
|
|
158
|
+
import {
|
|
159
|
+
useCastRoadmapItemVote,
|
|
160
|
+
useCastRoadmapVote,
|
|
161
|
+
useRetractRoadmapItemVote,
|
|
162
|
+
useRetractRoadmapVote
|
|
163
|
+
} from "./use-roadmap-mutations.js";
|
|
159
164
|
import { useDeleteAccount, useResetProfile, useWipePreview } from "./use-destructive.js";
|
|
160
165
|
import { useDeleteRepoRecords, useRepoInventory } from "./use-repo-inventory.js";
|
|
161
166
|
import {
|
|
@@ -200,6 +205,7 @@ export {
|
|
|
200
205
|
useBulkUnhideProfileItems,
|
|
201
206
|
useBulkUnhideStandardPublications,
|
|
202
207
|
useCanonicalSkillSearch,
|
|
208
|
+
useCastRoadmapItemVote,
|
|
203
209
|
useCastRoadmapVote,
|
|
204
210
|
useClearCompletenessDismissals,
|
|
205
211
|
useCreateConfirmation,
|
|
@@ -279,6 +285,7 @@ export {
|
|
|
279
285
|
useRequestEmploymentConfirmation,
|
|
280
286
|
useResendProfileEmailVerification,
|
|
281
287
|
useResetProfile,
|
|
288
|
+
useRetractRoadmapItemVote,
|
|
282
289
|
useRetractRoadmapVote,
|
|
283
290
|
useRevealMarqueDomain,
|
|
284
291
|
useRevokeConfirmation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/query/hooks/index.ts"],"sourcesContent":["/**\n * Hook-only barrel for `@singi-labs/sifa-sdk/query/hooks`.\n *\n * Re-exports every hook plus the Provider so consumers can do\n * `import { useFollow, SifaProvider } from '@singi-labs/sifa-sdk/query/hooks'`.\n * The full `/query` barrel re-exports these plus the fetcher layer; this\n * subpath is for callers who want the hook surface only.\n *\n * Keep in sync with `../index.ts` — every hook exported there should\n * also be exported here.\n */\n\nexport { SifaProvider, useSifaConfig, type SifaProviderProps } from '../config.js';\n\nexport { useAtFundLink, useProfile } from './use-profile.js';\nexport { useGetProfileView } from './use-get-profile-view.js';\nexport {\n useDeleteAvatarOverride,\n useDeleteNamePronunciationAudio,\n useRefreshPds,\n useUpdateProfileOverride,\n useUpdateProfileSelf,\n useUploadAvatar,\n useUploadNamePronunciationAudio,\n} from './use-profile-mutations.js';\nexport { useCreatePosition } from './use-create-position.js';\nexport {\n useDeletePosition,\n useLinkSkillToPosition,\n useSetPositionPrimary,\n useUnlinkSkillFromPosition,\n useUnsetPositionPrimary,\n useUpdatePosition,\n type PositionSkillLinkVariables,\n type UpdatePositionVariables,\n} from './use-position-mutations.js';\nexport {\n useCreateEducation,\n useDeleteEducation,\n useUpdateEducation,\n type UpdateEducationVariables,\n} from './use-education-mutations.js';\nexport { useSetSectionPrimary, useUnsetSectionPrimary } from './use-section-primary-mutations.js';\nexport {\n useCreateSkill,\n useDeleteSkill,\n useUpdateSkill,\n useUpdateSkillSubCategories,\n type UpdateSkillVariables,\n type UpdateSkillSubCategoriesVariables,\n} from './use-skill-mutations.js';\nexport {\n useCreateRecord,\n useDeleteRecord,\n useUpdateRecord,\n type CreateRecordVariables,\n type DeleteRecordVariables,\n type UpdateRecordVariables,\n} from './use-record-mutations.js';\nexport {\n useCreateProfileLocation,\n useDeleteProfileLocation,\n useUpdateProfileLocation,\n type UpdateProfileLocationVariables,\n} from './use-location-mutations.js';\nexport {\n useCreateExternalAccount,\n useDeleteExternalAccount,\n useExternalAccounts,\n useSetExternalAccountPrimary,\n useUnsetExternalAccountPrimary,\n useUpdateExternalAccount,\n useVerifyExternalAccount,\n type UpdateExternalAccountVariables,\n} from './use-external-accounts.js';\nexport { useCreateEndorsement } from './use-endorsement-mutations.js';\nexport {\n usePendingConfirmations,\n useGivenConfirmations,\n useCreateConfirmation,\n useDismissConfirmation,\n useRevokeConfirmation,\n} from './use-confirmations.js';\nexport { useInboxCounts } from './use-inbox.js';\nexport { useVerificationLog } from './use-verification.js';\nexport {\n useProfileEmails,\n useAddProfileEmail,\n useResendProfileEmailVerification,\n useRemoveProfileEmail,\n} from './use-profile-emails.js';\nexport {\n useOrgAttestations,\n useAttestationRequests,\n useCreateOrgAttestation,\n useOffboardOrgAttestation,\n useRevokeOrgAttestation,\n useRejectAttestationRequest,\n useRequestEmploymentConfirmation,\n} from './use-org-attestations.js';\nexport { useUnlinkedPositions, useDismissUnlinkedPosition } from './use-unlinked-positions.js';\nexport {\n useProfileCompleteness,\n useDismissCompletenessSignal,\n useClearCompletenessDismissals,\n} from './use-profile-completeness.js';\nexport { useRpgClaimable } from './use-rpg-claimable.js';\nexport { useRpgStatus } from './use-rpg-status.js';\nexport { useHideKeytraceClaim, useUnhideKeytraceClaim } from './use-keytrace-claims.js';\nexport { useRevealMarqueDomain, useUnrevealMarqueDomain } from './use-marque-domains.js';\nexport {\n useBulkHideStandardPublications,\n useBulkUnhideStandardPublications,\n useHideOrcidPublication,\n useHideSifaPublication,\n useHideStandardPublication,\n useRefreshOrcidPublications,\n useUnhideOrcidPublication,\n useUnhideSifaPublication,\n useUnhideStandardPublication,\n} from './use-publication-mutations.js';\nexport {\n useBulkHideProfileItems,\n useBulkUnhideProfileItems,\n useHideProfileItem,\n useUnhideProfileItem,\n} from './use-profile-items-hide.js';\nexport {\n useHiddenActivityItems,\n useHideActivityItem,\n useUnhideActivityItem,\n} from './use-activity-items-hide.js';\nexport {\n useActivityPreferences,\n useSiteActivityPreset,\n useUpdateActivityPreferences,\n} from './use-activity-preferences.js';\nexport { useStats } from './use-stats.js';\nexport { useAppsRegistry, useHiddenApps } from './use-apps.js';\nexport { useAccounts } from './use-accounts.js';\nexport {\n useCanonicalSkillSearch,\n useSearchCompanies,\n useSearchFilters,\n useSearchProfiles,\n useSkillSuggestions,\n} from './use-search.js';\nexport {\n useFeaturedProfile,\n useSimilarProfiles,\n useSuggestionCount,\n useSuggestions,\n} from './use-discovery.js';\nexport {\n useFollow,\n useFollowers,\n useFollowing,\n useFollowingFeed,\n useFollowingFeedVersion,\n useFollowingList,\n useUnfollow,\n type FollowVariables,\n type UnfollowVariables,\n} from './use-follow.js';\nexport { useBlueskySuggestions, useMutuals } from './use-follow-extras.js';\nexport {\n useAddFeatureAllowlist,\n useFeatureAllowlist,\n useRemoveFeatureAllowlist,\n type AddFeatureAllowlistVariables,\n type RemoveFeatureAllowlistVariables,\n} from './use-feature-allowlist.js';\nexport { useAdminReviewQueues } from './use-admin-review-queues.js';\nexport { useActivityFeed, useActivityTeaser, useHeatmapData } from './use-activity.js';\nexport { useMyGithubPullRequests, type UseMyGithubPullRequestsParams } from './use-github-prs.js';\nexport { useEndorsementCount } from './use-endorsement.js';\nexport { useNetworkStreamCount } from './use-stream.js';\nexport { useAppAccountCheck, useReactionStatus } from './use-reactions.js';\nexport {\n useCreateReaction,\n useDeleteReaction,\n type CreateReactionVariables,\n type DeleteReactionVariables,\n} from './use-reaction-mutations.js';\nexport { useMyRoadmapVotes, useRoadmapVotes } from './use-roadmap.js';\nexport {
|
|
1
|
+
{"version":3,"sources":["../../../src/query/hooks/index.ts"],"sourcesContent":["/**\n * Hook-only barrel for `@singi-labs/sifa-sdk/query/hooks`.\n *\n * Re-exports every hook plus the Provider so consumers can do\n * `import { useFollow, SifaProvider } from '@singi-labs/sifa-sdk/query/hooks'`.\n * The full `/query` barrel re-exports these plus the fetcher layer; this\n * subpath is for callers who want the hook surface only.\n *\n * Keep in sync with `../index.ts` — every hook exported there should\n * also be exported here.\n */\n\nexport { SifaProvider, useSifaConfig, type SifaProviderProps } from '../config.js';\n\nexport { useAtFundLink, useProfile } from './use-profile.js';\nexport { useGetProfileView } from './use-get-profile-view.js';\nexport {\n useDeleteAvatarOverride,\n useDeleteNamePronunciationAudio,\n useRefreshPds,\n useUpdateProfileOverride,\n useUpdateProfileSelf,\n useUploadAvatar,\n useUploadNamePronunciationAudio,\n} from './use-profile-mutations.js';\nexport { useCreatePosition } from './use-create-position.js';\nexport {\n useDeletePosition,\n useLinkSkillToPosition,\n useSetPositionPrimary,\n useUnlinkSkillFromPosition,\n useUnsetPositionPrimary,\n useUpdatePosition,\n type PositionSkillLinkVariables,\n type UpdatePositionVariables,\n} from './use-position-mutations.js';\nexport {\n useCreateEducation,\n useDeleteEducation,\n useUpdateEducation,\n type UpdateEducationVariables,\n} from './use-education-mutations.js';\nexport { useSetSectionPrimary, useUnsetSectionPrimary } from './use-section-primary-mutations.js';\nexport {\n useCreateSkill,\n useDeleteSkill,\n useUpdateSkill,\n useUpdateSkillSubCategories,\n type UpdateSkillVariables,\n type UpdateSkillSubCategoriesVariables,\n} from './use-skill-mutations.js';\nexport {\n useCreateRecord,\n useDeleteRecord,\n useUpdateRecord,\n type CreateRecordVariables,\n type DeleteRecordVariables,\n type UpdateRecordVariables,\n} from './use-record-mutations.js';\nexport {\n useCreateProfileLocation,\n useDeleteProfileLocation,\n useUpdateProfileLocation,\n type UpdateProfileLocationVariables,\n} from './use-location-mutations.js';\nexport {\n useCreateExternalAccount,\n useDeleteExternalAccount,\n useExternalAccounts,\n useSetExternalAccountPrimary,\n useUnsetExternalAccountPrimary,\n useUpdateExternalAccount,\n useVerifyExternalAccount,\n type UpdateExternalAccountVariables,\n} from './use-external-accounts.js';\nexport { useCreateEndorsement } from './use-endorsement-mutations.js';\nexport {\n usePendingConfirmations,\n useGivenConfirmations,\n useCreateConfirmation,\n useDismissConfirmation,\n useRevokeConfirmation,\n} from './use-confirmations.js';\nexport { useInboxCounts } from './use-inbox.js';\nexport { useVerificationLog } from './use-verification.js';\nexport {\n useProfileEmails,\n useAddProfileEmail,\n useResendProfileEmailVerification,\n useRemoveProfileEmail,\n} from './use-profile-emails.js';\nexport {\n useOrgAttestations,\n useAttestationRequests,\n useCreateOrgAttestation,\n useOffboardOrgAttestation,\n useRevokeOrgAttestation,\n useRejectAttestationRequest,\n useRequestEmploymentConfirmation,\n} from './use-org-attestations.js';\nexport { useUnlinkedPositions, useDismissUnlinkedPosition } from './use-unlinked-positions.js';\nexport {\n useProfileCompleteness,\n useDismissCompletenessSignal,\n useClearCompletenessDismissals,\n} from './use-profile-completeness.js';\nexport { useRpgClaimable } from './use-rpg-claimable.js';\nexport { useRpgStatus } from './use-rpg-status.js';\nexport { useHideKeytraceClaim, useUnhideKeytraceClaim } from './use-keytrace-claims.js';\nexport { useRevealMarqueDomain, useUnrevealMarqueDomain } from './use-marque-domains.js';\nexport {\n useBulkHideStandardPublications,\n useBulkUnhideStandardPublications,\n useHideOrcidPublication,\n useHideSifaPublication,\n useHideStandardPublication,\n useRefreshOrcidPublications,\n useUnhideOrcidPublication,\n useUnhideSifaPublication,\n useUnhideStandardPublication,\n} from './use-publication-mutations.js';\nexport {\n useBulkHideProfileItems,\n useBulkUnhideProfileItems,\n useHideProfileItem,\n useUnhideProfileItem,\n} from './use-profile-items-hide.js';\nexport {\n useHiddenActivityItems,\n useHideActivityItem,\n useUnhideActivityItem,\n} from './use-activity-items-hide.js';\nexport {\n useActivityPreferences,\n useSiteActivityPreset,\n useUpdateActivityPreferences,\n} from './use-activity-preferences.js';\nexport { useStats } from './use-stats.js';\nexport { useAppsRegistry, useHiddenApps } from './use-apps.js';\nexport { useAccounts } from './use-accounts.js';\nexport {\n useCanonicalSkillSearch,\n useSearchCompanies,\n useSearchFilters,\n useSearchProfiles,\n useSkillSuggestions,\n} from './use-search.js';\nexport {\n useFeaturedProfile,\n useSimilarProfiles,\n useSuggestionCount,\n useSuggestions,\n} from './use-discovery.js';\nexport {\n useFollow,\n useFollowers,\n useFollowing,\n useFollowingFeed,\n useFollowingFeedVersion,\n useFollowingList,\n useUnfollow,\n type FollowVariables,\n type UnfollowVariables,\n} from './use-follow.js';\nexport { useBlueskySuggestions, useMutuals } from './use-follow-extras.js';\nexport {\n useAddFeatureAllowlist,\n useFeatureAllowlist,\n useRemoveFeatureAllowlist,\n type AddFeatureAllowlistVariables,\n type RemoveFeatureAllowlistVariables,\n} from './use-feature-allowlist.js';\nexport { useAdminReviewQueues } from './use-admin-review-queues.js';\nexport { useActivityFeed, useActivityTeaser, useHeatmapData } from './use-activity.js';\nexport { useMyGithubPullRequests, type UseMyGithubPullRequestsParams } from './use-github-prs.js';\nexport { useEndorsementCount } from './use-endorsement.js';\nexport { useNetworkStreamCount } from './use-stream.js';\nexport { useAppAccountCheck, useReactionStatus } from './use-reactions.js';\nexport {\n useCreateReaction,\n useDeleteReaction,\n type CreateReactionVariables,\n type DeleteReactionVariables,\n} from './use-reaction-mutations.js';\nexport { useMyRoadmapVotes, useRoadmapVotes } from './use-roadmap.js';\nexport {\n useCastRoadmapItemVote,\n useCastRoadmapVote,\n useRetractRoadmapItemVote,\n useRetractRoadmapVote,\n} from './use-roadmap-mutations.js';\nexport { useDeleteAccount, useResetProfile, useWipePreview } from './use-destructive.js';\nexport { useDeleteRepoRecords, useRepoInventory } from './use-repo-inventory.js';\n\nexport {\n useEntitySearch,\n useSelectEntity,\n useImportSearchEntities,\n useDebouncedValue,\n type UseEntitySearchOptions,\n} from './use-entity-search.js';\n\nexport { useOrgProfile } from './use-org-profile.js';\nexport { useOrgClaim } from './use-org-claim.js';\nexport { useUpdateOrgProfile } from './use-org-profile-settings.js';\nexport { useOrgDomainChallenge, useOrgDomainVerify } from './use-org-domains.js';\nexport {\n useAddOrgNotificationEmail,\n useRemoveOrgNotificationEmail,\n} from './use-org-notification-emails.js';\n\nexport { sifaQueryKeys, type SifaQueryKey } from '../keys.js';\nexport {\n useCreateInvestment,\n useUpdateInvestment,\n useDeleteInvestment,\n} from './use-investment-mutations.js';\nexport { useUpdateUserSettings, useUserSettings } from './use-user-settings.js';\n"],"mappings":"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","names":[]}
|
|
@@ -5,7 +5,9 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
|
5
5
|
import "../client.js";
|
|
6
6
|
import { useSifaConfig } from "../config.js";
|
|
7
7
|
import {
|
|
8
|
+
castRoadmapItemVote,
|
|
8
9
|
castRoadmapVote,
|
|
10
|
+
retractRoadmapItemVote,
|
|
9
11
|
retractRoadmapVote
|
|
10
12
|
} from "../fetchers/roadmap.js";
|
|
11
13
|
import { sifaQueryKeys } from "../keys.js";
|
|
@@ -44,8 +46,42 @@ function useRetractRoadmapVote(options) {
|
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
}
|
|
49
|
+
function useCastRoadmapItemVote(options) {
|
|
50
|
+
const config = useSifaConfig();
|
|
51
|
+
const queryClient = useQueryClient();
|
|
52
|
+
return useMutation({
|
|
53
|
+
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
54
|
+
// handler below and silently drop cache invalidation (#453).
|
|
55
|
+
...options,
|
|
56
|
+
mutationFn: (item) => castRoadmapItemVote(config, item),
|
|
57
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
58
|
+
if (result.ok) {
|
|
59
|
+
await invalidateRoadmap(queryClient);
|
|
60
|
+
}
|
|
61
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function useRetractRoadmapItemVote(options) {
|
|
66
|
+
const config = useSifaConfig();
|
|
67
|
+
const queryClient = useQueryClient();
|
|
68
|
+
return useMutation({
|
|
69
|
+
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
70
|
+
// handler below and silently drop cache invalidation (#453).
|
|
71
|
+
...options,
|
|
72
|
+
mutationFn: (item) => retractRoadmapItemVote(config, item),
|
|
73
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
74
|
+
if (result.success) {
|
|
75
|
+
await invalidateRoadmap(queryClient);
|
|
76
|
+
}
|
|
77
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
47
81
|
export {
|
|
82
|
+
useCastRoadmapItemVote,
|
|
48
83
|
useCastRoadmapVote,
|
|
84
|
+
useRetractRoadmapItemVote,
|
|
49
85
|
useRetractRoadmapVote
|
|
50
86
|
};
|
|
51
87
|
//# sourceMappingURL=use-roadmap-mutations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/query/hooks/use-roadmap-mutations.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient, type UseMutationOptions } from '@tanstack/react-query';\n\nimport { type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n castRoadmapVote,\n retractRoadmapVote,\n type CastRoadmapVoteResult,\n} from '../fetchers/roadmap.js';\nimport { sifaQueryKeys } from '../keys.js';\n\nasync function invalidateRoadmap(queryClient: ReturnType<typeof useQueryClient>): Promise<void> {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.roadmap.all() });\n}\n\n/**\n * React hook for casting a roadmap vote. Variable: the item key.\n *\n * Returns the discriminated-union result so callers can detect\n * `scope_insufficient` and trigger an OAuth scope-upgrade flow\n * (see {@link castRoadmapVote}).\n */\nexport function useCastRoadmapVote(\n options?: Omit<UseMutationOptions<CastRoadmapVoteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (key: string) => castRoadmapVote(config, key),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.ok) {\n await invalidateRoadmap(queryClient);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\n/** React hook for retracting a previously-cast roadmap vote. */\nexport function useRetractRoadmapVote(\n options?: Omit<UseMutationOptions<WriteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (key: string) => retractRoadmapVote(config, key),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateRoadmap(queryClient);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,sBAA+C;AAErE,OAAiC;AACjC,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/query/hooks/use-roadmap-mutations.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient, type UseMutationOptions } from '@tanstack/react-query';\n\nimport { type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n castRoadmapItemVote,\n castRoadmapVote,\n retractRoadmapItemVote,\n retractRoadmapVote,\n type CastRoadmapVoteResult,\n type RoadmapItemRef,\n} from '../fetchers/roadmap.js';\nimport { sifaQueryKeys } from '../keys.js';\n\nasync function invalidateRoadmap(queryClient: ReturnType<typeof useQueryClient>): Promise<void> {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.roadmap.all() });\n}\n\n/**\n * React hook for casting a roadmap vote. Variable: the item key.\n *\n * Returns the discriminated-union result so callers can detect\n * `scope_insufficient` and trigger an OAuth scope-upgrade flow\n * (see {@link castRoadmapVote}).\n */\nexport function useCastRoadmapVote(\n options?: Omit<UseMutationOptions<CastRoadmapVoteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (key: string) => castRoadmapVote(config, key),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.ok) {\n await invalidateRoadmap(queryClient);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\n/** React hook for retracting a previously-cast roadmap vote. */\nexport function useRetractRoadmapVote(\n options?: Omit<UseMutationOptions<WriteResult, Error, string>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (key: string) => retractRoadmapVote(config, key),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateRoadmap(queryClient);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\n/**\n * React hook for voting on a roadmap board item. Variable: the item's\n * `{ did, rkey }`. Returns the same discriminated-union result as\n * {@link useCastRoadmapVote}.\n *\n * Board data from `fetchRoadmap` is usually server-rendered, so the\n * invalidation here does not refresh it: keep optimistic local state or call\n * `router.refresh()`. Voting twice is safe; the API answers 200.\n */\nexport function useCastRoadmapItemVote(\n options?: Omit<UseMutationOptions<CastRoadmapVoteResult, Error, RoadmapItemRef>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (item: RoadmapItemRef) => castRoadmapItemVote(config, item),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.ok) {\n await invalidateRoadmap(queryClient);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n\n/** React hook for retracting a vote on a roadmap board item. */\nexport function useRetractRoadmapItemVote(\n options?: Omit<UseMutationOptions<WriteResult, Error, RoadmapItemRef>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied onSuccess would otherwise replace the\n // handler below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: (item: RoadmapItemRef) => retractRoadmapItemVote(config, item),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await invalidateRoadmap(queryClient);\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n });\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,sBAA+C;AAErE,OAAiC;AACjC,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,qBAAqB;AAE9B,eAAe,kBAAkB,aAA+D;AAC9F,QAAM,YAAY,kBAAkB,EAAE,UAAU,cAAc,QAAQ,IAAI,EAAE,CAAC;AAC/E;AASO,SAAS,mBACd,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,QAAgB,gBAAgB,QAAQ,GAAG;AAAA,IACxD,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,IAAI;AACb,cAAM,kBAAkB,WAAW;AAAA,MACrC;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AAGO,SAAS,sBACd,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,QAAgB,mBAAmB,QAAQ,GAAG;AAAA,IAC3D,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,WAAW;AAAA,MACrC;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AAWO,SAAS,uBACd,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAyB,oBAAoB,QAAQ,IAAI;AAAA,IACtE,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,IAAI;AACb,cAAM,kBAAkB,WAAW;AAAA,MACrC;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AAGO,SAAS,0BACd,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,QAAM,cAAc,eAAe;AACnC,SAAO,YAAY;AAAA;AAAA;AAAA,IAGjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAyB,uBAAuB,QAAQ,IAAI;AAAA,IACzE,WAAW,OAAO,QAAQ,WAAW,gBAAgB,YAAY;AAC/D,UAAI,OAAO,SAAS;AAClB,cAAM,kBAAkB,WAAW;AAAA,MACrC;AACA,YAAM,SAAS,YAAY,QAAQ,WAAW,gBAAgB,OAAO;AAAA,IACvE;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/query/index.cjs
CHANGED
|
@@ -2084,8 +2084,6 @@ async function resolveQuotedPosts(config, uris, options = {}) {
|
|
|
2084
2084
|
);
|
|
2085
2085
|
return results;
|
|
2086
2086
|
}
|
|
2087
|
-
|
|
2088
|
-
// src/query/fetchers/roadmap.ts
|
|
2089
2087
|
async function fetchRoadmapVotes(config, options = {}) {
|
|
2090
2088
|
try {
|
|
2091
2089
|
return await apiFetch(config, "/api/roadmap/votes", {
|
|
@@ -2110,13 +2108,16 @@ async function fetchMyRoadmapVotes(config, options = {}) {
|
|
|
2110
2108
|
return [];
|
|
2111
2109
|
}
|
|
2112
2110
|
}
|
|
2113
|
-
|
|
2111
|
+
function castRoadmapVote(config, key, options = {}) {
|
|
2112
|
+
return castUpvote(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, options);
|
|
2113
|
+
}
|
|
2114
|
+
async function castUpvote(config, path, options) {
|
|
2114
2115
|
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
2115
|
-
const url = `${config.baseUrl}
|
|
2116
|
+
const url = `${config.baseUrl}${path}`;
|
|
2116
2117
|
try {
|
|
2117
2118
|
const res = await fetchFn(url, {
|
|
2118
2119
|
method: "POST",
|
|
2119
|
-
// No body: the item
|
|
2120
|
+
// No body: the item is in the URL. Do NOT declare a JSON content-type
|
|
2120
2121
|
// for an empty body — Fastify rejects that with a 400 before the handler
|
|
2121
2122
|
// runs. Only forward caller-provided headers.
|
|
2122
2123
|
...options.headers ? { headers: options.headers } : {},
|
|
@@ -2147,6 +2148,52 @@ async function castRoadmapVote(config, key, options = {}) {
|
|
|
2147
2148
|
function retractRoadmapVote(config, key, options = {}) {
|
|
2148
2149
|
return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "DELETE", options);
|
|
2149
2150
|
}
|
|
2151
|
+
var roadmapBoardItemSchema = zod.z.object({
|
|
2152
|
+
uri: zod.z.string(),
|
|
2153
|
+
did: zod.z.string(),
|
|
2154
|
+
rkey: zod.z.string(),
|
|
2155
|
+
title: zod.z.string(),
|
|
2156
|
+
body: zod.z.string().nullable(),
|
|
2157
|
+
tags: zod.z.array(zod.z.string()),
|
|
2158
|
+
size: zod.z.enum(["small", "medium", "epic"]).nullable(),
|
|
2159
|
+
status: zod.z.enum(["done", "in-progress", "planned", "later", "under-review"]),
|
|
2160
|
+
votable: zod.z.boolean(),
|
|
2161
|
+
votes: zod.z.object({
|
|
2162
|
+
count: zod.z.number(),
|
|
2163
|
+
voters: zod.z.array(zod.z.object({ did: zod.z.string(), avatarUrl: zod.z.string().optional() }))
|
|
2164
|
+
}),
|
|
2165
|
+
createdAt: zod.z.string(),
|
|
2166
|
+
viewerVoted: zod.z.boolean()
|
|
2167
|
+
});
|
|
2168
|
+
async function fetchRoadmap(config, options = {}) {
|
|
2169
|
+
const { cookieHeader, ...rest } = options;
|
|
2170
|
+
const headers = { ...rest.headers ?? {} };
|
|
2171
|
+
if (cookieHeader) headers.cookie = cookieHeader;
|
|
2172
|
+
try {
|
|
2173
|
+
const data = await apiFetch(config, "/api/roadmap", {
|
|
2174
|
+
cache: "no-store",
|
|
2175
|
+
credentials: "include",
|
|
2176
|
+
...rest,
|
|
2177
|
+
headers
|
|
2178
|
+
});
|
|
2179
|
+
if (!Array.isArray(data.items)) return null;
|
|
2180
|
+
return data.items.flatMap((raw) => {
|
|
2181
|
+
const parsed = roadmapBoardItemSchema.safeParse(raw);
|
|
2182
|
+
return parsed.success ? [parsed.data] : [];
|
|
2183
|
+
});
|
|
2184
|
+
} catch {
|
|
2185
|
+
return null;
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
function itemVotePath(item) {
|
|
2189
|
+
return `/api/roadmap/items/${encodeURIComponent(item.did)}/${encodeURIComponent(item.rkey)}/vote`;
|
|
2190
|
+
}
|
|
2191
|
+
function castRoadmapItemVote(config, item, options = {}) {
|
|
2192
|
+
return castUpvote(config, itemVotePath(item), options);
|
|
2193
|
+
}
|
|
2194
|
+
function retractRoadmapItemVote(config, item, options = {}) {
|
|
2195
|
+
return apiWrite(config, itemVotePath(item), "DELETE", options);
|
|
2196
|
+
}
|
|
2150
2197
|
|
|
2151
2198
|
// src/query/fetchers/destructive.ts
|
|
2152
2199
|
function fetchWipePreview(config, options = {}) {
|
|
@@ -4191,6 +4238,38 @@ function useRetractRoadmapVote(options) {
|
|
|
4191
4238
|
}
|
|
4192
4239
|
});
|
|
4193
4240
|
}
|
|
4241
|
+
function useCastRoadmapItemVote(options) {
|
|
4242
|
+
const config = useSifaConfig();
|
|
4243
|
+
const queryClient = reactQuery.useQueryClient();
|
|
4244
|
+
return reactQuery.useMutation({
|
|
4245
|
+
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
4246
|
+
// handler below and silently drop cache invalidation (#453).
|
|
4247
|
+
...options,
|
|
4248
|
+
mutationFn: (item) => castRoadmapItemVote(config, item),
|
|
4249
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
4250
|
+
if (result.ok) {
|
|
4251
|
+
await invalidateRoadmap(queryClient);
|
|
4252
|
+
}
|
|
4253
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
4254
|
+
}
|
|
4255
|
+
});
|
|
4256
|
+
}
|
|
4257
|
+
function useRetractRoadmapItemVote(options) {
|
|
4258
|
+
const config = useSifaConfig();
|
|
4259
|
+
const queryClient = reactQuery.useQueryClient();
|
|
4260
|
+
return reactQuery.useMutation({
|
|
4261
|
+
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
4262
|
+
// handler below and silently drop cache invalidation (#453).
|
|
4263
|
+
...options,
|
|
4264
|
+
mutationFn: (item) => retractRoadmapItemVote(config, item),
|
|
4265
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
4266
|
+
if (result.success) {
|
|
4267
|
+
await invalidateRoadmap(queryClient);
|
|
4268
|
+
}
|
|
4269
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
4270
|
+
}
|
|
4271
|
+
});
|
|
4272
|
+
}
|
|
4194
4273
|
function useWipePreview(options) {
|
|
4195
4274
|
const config = useSifaConfig();
|
|
4196
4275
|
return reactQuery.useQuery({
|
|
@@ -4534,6 +4613,7 @@ exports.bulkHideProfileItems = bulkHideProfileItems;
|
|
|
4534
4613
|
exports.bulkHideStandardPublications = bulkHideStandardPublications;
|
|
4535
4614
|
exports.bulkUnhideProfileItems = bulkUnhideProfileItems;
|
|
4536
4615
|
exports.bulkUnhideStandardPublications = bulkUnhideStandardPublications;
|
|
4616
|
+
exports.castRoadmapItemVote = castRoadmapItemVote;
|
|
4537
4617
|
exports.castRoadmapVote = castRoadmapVote;
|
|
4538
4618
|
exports.checkAppAccount = checkAppAccount;
|
|
4539
4619
|
exports.checkNetworkMapJobStatus = checkNetworkMapJobStatus;
|
|
@@ -4604,6 +4684,7 @@ exports.fetchReceivedEndorsements = fetchReceivedEndorsements;
|
|
|
4604
4684
|
exports.fetchReciprocityCandidate = fetchReciprocityCandidate;
|
|
4605
4685
|
exports.fetchRepoInventory = fetchRepoInventory;
|
|
4606
4686
|
exports.fetchResolveActor = fetchResolveActor;
|
|
4687
|
+
exports.fetchRoadmap = fetchRoadmap;
|
|
4607
4688
|
exports.fetchRoadmapVotes = fetchRoadmapVotes;
|
|
4608
4689
|
exports.fetchRpgClaimable = fetchRpgClaimable;
|
|
4609
4690
|
exports.fetchRpgStatus = fetchRpgStatus;
|
|
@@ -4659,6 +4740,7 @@ exports.resendProfileEmailVerification = resendProfileEmailVerification;
|
|
|
4659
4740
|
exports.resetProfile = resetProfile;
|
|
4660
4741
|
exports.resolveEntityDomain = resolveEntityDomain;
|
|
4661
4742
|
exports.resolveQuotedPosts = resolveQuotedPosts;
|
|
4743
|
+
exports.retractRoadmapItemVote = retractRoadmapItemVote;
|
|
4662
4744
|
exports.retractRoadmapVote = retractRoadmapVote;
|
|
4663
4745
|
exports.revealMarqueDomain = revealMarqueDomain;
|
|
4664
4746
|
exports.revokeConfirmation = revokeConfirmation;
|
|
@@ -4719,6 +4801,7 @@ exports.useBulkHideStandardPublications = useBulkHideStandardPublications;
|
|
|
4719
4801
|
exports.useBulkUnhideProfileItems = useBulkUnhideProfileItems;
|
|
4720
4802
|
exports.useBulkUnhideStandardPublications = useBulkUnhideStandardPublications;
|
|
4721
4803
|
exports.useCanonicalSkillSearch = useCanonicalSkillSearch;
|
|
4804
|
+
exports.useCastRoadmapItemVote = useCastRoadmapItemVote;
|
|
4722
4805
|
exports.useCastRoadmapVote = useCastRoadmapVote;
|
|
4723
4806
|
exports.useClearCompletenessDismissals = useClearCompletenessDismissals;
|
|
4724
4807
|
exports.useConfirmEndorsement = useConfirmEndorsement;
|
|
@@ -4803,6 +4886,7 @@ exports.useRequestEmploymentConfirmation = useRequestEmploymentConfirmation;
|
|
|
4803
4886
|
exports.useResendProfileEmailVerification = useResendProfileEmailVerification;
|
|
4804
4887
|
exports.useResetProfile = useResetProfile;
|
|
4805
4888
|
exports.useResolveEntityDomain = useResolveEntityDomain;
|
|
4889
|
+
exports.useRetractRoadmapItemVote = useRetractRoadmapItemVote;
|
|
4806
4890
|
exports.useRetractRoadmapVote = useRetractRoadmapVote;
|
|
4807
4891
|
exports.useRevealMarqueDomain = useRevealMarqueDomain;
|
|
4808
4892
|
exports.useRevokeConfirmation = useRevokeConfirmation;
|