@singi-labs/sifa-sdk 0.20.2 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -92
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -16
- package/dist/index.d.ts +3 -16
- package/dist/index.js +2 -7
- package/dist/index.js.map +1 -1
- package/dist/query/fetchers/index.cjs +33 -75
- 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 +1 -9
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/fetchers/roadmap.js +34 -71
- package/dist/query/fetchers/roadmap.js.map +1 -1
- package/dist/query/hooks/index.cjs +24 -135
- 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 +1 -11
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/hooks/use-roadmap-mutations.js +5 -63
- package/dist/query/hooks/use-roadmap-mutations.js.map +1 -1
- package/dist/query/index.cjs +35 -150
- 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 +2 -17
- package/dist/query/index.js.map +1 -1
- package/dist/query/keys.js +0 -5
- package/dist/query/keys.js.map +1 -1
- package/dist/roadmap/index.js +0 -91
- package/dist/roadmap/index.js.map +1 -1
- package/dist/{use-user-settings-Cq_AHkkM.d.cts → use-user-settings-Bn6g8bgr.d.cts} +7 -22
- package/dist/{use-user-settings-DoNP3tNl.d.ts → use-user-settings-DQ6Dyby7.d.ts} +7 -22
- package/dist/{user-settings-CBtacio1.d.ts → user-settings-BdNrDa9O.d.ts} +16 -50
- package/dist/{user-settings-DDP76dZH.d.cts → user-settings-C8JUD4DM.d.cts} +16 -50
- package/package.json +1 -1
- package/dist/query/hooks/use-roadmap.js +0 -31
- package/dist/query/hooks/use-roadmap.js.map +0 -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 useCastRoadmapItemVote, aj 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 useClearCompletenessDismissals, ak as useCreateConfirmation, al as useCreateEducation, am as useCreateEndorsement, an as useCreateExternalAccount, ao as useCreateOrgAttestation, ap as useCreatePosition, aq as useCreateProfileLocation, ar as useCreateReaction, as as useCreateRecord, at as useCreateSkill, au as useDebouncedValue, av as useDeleteAccount, aw as useDeleteAvatarOverride, ax as useDeleteEducation, ay as useDeleteExternalAccount, az as useDeleteNamePronunciationAudio, aA as useDeletePosition, aB as useDeleteProfileLocation, aC as useDeleteReaction, aD as useDeleteRecord, aE as useDeleteRepoRecords, aF as useDeleteSkill, aG as useDismissCompletenessSignal, aH as useDismissConfirmation, aI as useDismissUnlinkedPosition, aJ as useEndorsementCount, aK as useEntitySearch, aL as useExternalAccounts, aM as useFeatureAllowlist, aN as useFeaturedProfile, aO as useFollow, aP as useFollowers, aQ as useFollowing, aR as useFollowingFeed, aS as useFollowingFeedVersion, aT as useFollowingList, aU as useGetProfileView, aV as useGivenConfirmations, aW as useHeatmapData, aX as useHiddenActivityItems, aY as useHiddenApps, aZ as useHideActivityItem, a_ as useHideKeytraceClaim, a$ as useHideOrcidPublication, b0 as useHideProfileItem, b1 as useHideSifaPublication, b2 as useHideStandardPublication, b3 as useImportSearchEntities, b4 as useInboxCounts, b5 as useLinkSkillToPosition, b7 as useMutuals, b8 as useMyGithubPullRequests, b9 as useNetworkStreamCount, ba as useOffboardOrgAttestation, bb as useOrgAttestations, bc as useOrgClaim, bd as useOrgDomainChallenge, be as useOrgDomainVerify, bf as useOrgProfile, bg as usePendingConfirmations, bh as useProfile, bi as useProfileCompleteness, bj as useProfileEmails, bk as useReactionStatus, bl as useRefreshOrcidPublications, bm as useRefreshPds, bn as useRejectAttestationRequest, bo as useRemoveFeatureAllowlist, bp as useRemoveOrgNotificationEmail, bq as useRemoveProfileEmail, br as useRepoInventory, bs as useRequestEmploymentConfirmation, bt as useResendProfileEmailVerification, bu as useResetProfile, bw as useRetractRoadmapItemVote, bx as useRevealMarqueDomain, by as useRevokeConfirmation, bz as useRevokeOrgAttestation, bA as useRpgClaimable, bB as useRpgStatus, ci as useSearchCompanies, bC as useSearchFilters, bD as useSearchProfiles, bE as useSelectEntity, bF as useSetExternalAccountPrimary, bG as useSetPositionPrimary, bH as useSetSectionPrimary, bI as useSifaConfig, bJ as useSimilarProfiles, bK as useSiteActivityPreset, bL as useSkillSuggestions, bM as useStats, bN as useSuggestionCount, bO as useSuggestions, bP as useUnfollow, bQ as useUnhideActivityItem, bR as useUnhideKeytraceClaim, bS as useUnhideOrcidPublication, bT as useUnhideProfileItem, bU as useUnhideSifaPublication, bV as useUnhideStandardPublication, bW as useUnlinkSkillFromPosition, bX as useUnlinkedPositions, bY as useUnrevealMarqueDomain, bZ as useUnsetExternalAccountPrimary, b_ as useUnsetPositionPrimary, b$ as useUnsetSectionPrimary, c0 as useUpdateActivityPreferences, c1 as useUpdateEducation, c2 as useUpdateExternalAccount, c3 as useUpdateOrgProfile, c4 as useUpdatePosition, c5 as useUpdateProfileLocation, c6 as useUpdateProfileOverride, c7 as useUpdateProfileSelf, c8 as useUpdateRecord, c9 as useUpdateSkill, ca as useUpdateSkillSubCategories, cb as useUpdateUserSettings, cc as useUploadAvatar, cd as useUploadNamePronunciationAudio, ce as useUserSettings, cf as useVerificationLog, cg as useVerifyExternalAccount, ch as useWipePreview } from '../../use-user-settings-Bn6g8bgr.cjs';
|
|
2
|
+
export { a_ as SifaQueryKey, s as sifaQueryKeys } from '../../user-settings-C8JUD4DM.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 useCastRoadmapItemVote, aj 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 useClearCompletenessDismissals, ak as useCreateConfirmation, al as useCreateEducation, am as useCreateEndorsement, an as useCreateExternalAccount, ao as useCreateOrgAttestation, ap as useCreatePosition, aq as useCreateProfileLocation, ar as useCreateReaction, as as useCreateRecord, at as useCreateSkill, au as useDebouncedValue, av as useDeleteAccount, aw as useDeleteAvatarOverride, ax as useDeleteEducation, ay as useDeleteExternalAccount, az as useDeleteNamePronunciationAudio, aA as useDeletePosition, aB as useDeleteProfileLocation, aC as useDeleteReaction, aD as useDeleteRecord, aE as useDeleteRepoRecords, aF as useDeleteSkill, aG as useDismissCompletenessSignal, aH as useDismissConfirmation, aI as useDismissUnlinkedPosition, aJ as useEndorsementCount, aK as useEntitySearch, aL as useExternalAccounts, aM as useFeatureAllowlist, aN as useFeaturedProfile, aO as useFollow, aP as useFollowers, aQ as useFollowing, aR as useFollowingFeed, aS as useFollowingFeedVersion, aT as useFollowingList, aU as useGetProfileView, aV as useGivenConfirmations, aW as useHeatmapData, aX as useHiddenActivityItems, aY as useHiddenApps, aZ as useHideActivityItem, a_ as useHideKeytraceClaim, a$ as useHideOrcidPublication, b0 as useHideProfileItem, b1 as useHideSifaPublication, b2 as useHideStandardPublication, b3 as useImportSearchEntities, b4 as useInboxCounts, b5 as useLinkSkillToPosition, b7 as useMutuals, b8 as useMyGithubPullRequests, b9 as useNetworkStreamCount, ba as useOffboardOrgAttestation, bb as useOrgAttestations, bc as useOrgClaim, bd as useOrgDomainChallenge, be as useOrgDomainVerify, bf as useOrgProfile, bg as usePendingConfirmations, bh as useProfile, bi as useProfileCompleteness, bj as useProfileEmails, bk as useReactionStatus, bl as useRefreshOrcidPublications, bm as useRefreshPds, bn as useRejectAttestationRequest, bo as useRemoveFeatureAllowlist, bp as useRemoveOrgNotificationEmail, bq as useRemoveProfileEmail, br as useRepoInventory, bs as useRequestEmploymentConfirmation, bt as useResendProfileEmailVerification, bu as useResetProfile, bw as useRetractRoadmapItemVote, bx as useRevealMarqueDomain, by as useRevokeConfirmation, bz as useRevokeOrgAttestation, bA as useRpgClaimable, bB as useRpgStatus, ci as useSearchCompanies, bC as useSearchFilters, bD as useSearchProfiles, bE as useSelectEntity, bF as useSetExternalAccountPrimary, bG as useSetPositionPrimary, bH as useSetSectionPrimary, bI as useSifaConfig, bJ as useSimilarProfiles, bK as useSiteActivityPreset, bL as useSkillSuggestions, bM as useStats, bN as useSuggestionCount, bO as useSuggestions, bP as useUnfollow, bQ as useUnhideActivityItem, bR as useUnhideKeytraceClaim, bS as useUnhideOrcidPublication, bT as useUnhideProfileItem, bU as useUnhideSifaPublication, bV as useUnhideStandardPublication, bW as useUnlinkSkillFromPosition, bX as useUnlinkedPositions, bY as useUnrevealMarqueDomain, bZ as useUnsetExternalAccountPrimary, b_ as useUnsetPositionPrimary, b$ as useUnsetSectionPrimary, c0 as useUpdateActivityPreferences, c1 as useUpdateEducation, c2 as useUpdateExternalAccount, c3 as useUpdateOrgProfile, c4 as useUpdatePosition, c5 as useUpdateProfileLocation, c6 as useUpdateProfileOverride, c7 as useUpdateProfileSelf, c8 as useUpdateRecord, c9 as useUpdateSkill, ca as useUpdateSkillSubCategories, cb as useUpdateUserSettings, cc as useUploadAvatar, cd as useUploadNamePronunciationAudio, ce as useUserSettings, cf as useVerificationLog, cg as useVerifyExternalAccount, ch as useWipePreview } from '../../use-user-settings-DQ6Dyby7.js';
|
|
2
|
+
export { a_ as SifaQueryKey, s as sifaQueryKeys } from '../../user-settings-BdNrDa9O.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';
|
|
@@ -154,13 +154,7 @@ import {
|
|
|
154
154
|
useCreateReaction,
|
|
155
155
|
useDeleteReaction
|
|
156
156
|
} from "./use-reaction-mutations.js";
|
|
157
|
-
import {
|
|
158
|
-
import {
|
|
159
|
-
useCastRoadmapItemVote,
|
|
160
|
-
useCastRoadmapVote,
|
|
161
|
-
useRetractRoadmapItemVote,
|
|
162
|
-
useRetractRoadmapVote
|
|
163
|
-
} from "./use-roadmap-mutations.js";
|
|
157
|
+
import { useCastRoadmapItemVote, useRetractRoadmapItemVote } from "./use-roadmap-mutations.js";
|
|
164
158
|
import { useDeleteAccount, useResetProfile, useWipePreview } from "./use-destructive.js";
|
|
165
159
|
import { useDeleteRepoRecords, useRepoInventory } from "./use-repo-inventory.js";
|
|
166
160
|
import {
|
|
@@ -206,7 +200,6 @@ export {
|
|
|
206
200
|
useBulkUnhideStandardPublications,
|
|
207
201
|
useCanonicalSkillSearch,
|
|
208
202
|
useCastRoadmapItemVote,
|
|
209
|
-
useCastRoadmapVote,
|
|
210
203
|
useClearCompletenessDismissals,
|
|
211
204
|
useCreateConfirmation,
|
|
212
205
|
useCreateEducation,
|
|
@@ -262,7 +255,6 @@ export {
|
|
|
262
255
|
useLinkSkillToPosition,
|
|
263
256
|
useMutuals,
|
|
264
257
|
useMyGithubPullRequests,
|
|
265
|
-
useMyRoadmapVotes,
|
|
266
258
|
useNetworkStreamCount,
|
|
267
259
|
useOffboardOrgAttestation,
|
|
268
260
|
useOrgAttestations,
|
|
@@ -286,11 +278,9 @@ export {
|
|
|
286
278
|
useResendProfileEmailVerification,
|
|
287
279
|
useResetProfile,
|
|
288
280
|
useRetractRoadmapItemVote,
|
|
289
|
-
useRetractRoadmapVote,
|
|
290
281
|
useRevealMarqueDomain,
|
|
291
282
|
useRevokeConfirmation,
|
|
292
283
|
useRevokeOrgAttestation,
|
|
293
|
-
useRoadmapVotes,
|
|
294
284
|
useRpgClaimable,
|
|
295
285
|
useRpgStatus,
|
|
296
286
|
useSearchCompanies,
|
|
@@ -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 {
|
|
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 { useCastRoadmapItemVote, useRetractRoadmapItemVote } 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":";AAYA,SAAS,cAAc,qBAA6C;AAEpE,SAAS,eAAe,kBAAkB;AAC1C,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,sBAAsB,8BAA8B;AAC7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB,kCAAkC;AACjE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB,8BAA8B;AAC7D,SAAS,uBAAuB,+BAA+B;AAC/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAAgB;AACzB,SAAS,iBAAiB,qBAAqB;AAC/C,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,uBAAuB,kBAAkB;AAClD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B;AACrC,SAAS,iBAAiB,mBAAmB,sBAAsB;AACnE,SAAS,+BAAmE;AAC5E,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC,SAAS,oBAAoB,yBAAyB;AACtD;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,wBAAwB,iCAAiC;AAClE,SAAS,kBAAkB,iBAAiB,sBAAsB;AAClE,SAAS,sBAAsB,wBAAwB;AAEvD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,uBAAuB,0BAA0B;AAC1D;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,qBAAwC;AACjD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB,uBAAuB;","names":[]}
|
|
@@ -1,87 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/query/hooks/use-roadmap-mutations.ts
|
|
4
|
-
import { useMutation
|
|
4
|
+
import { useMutation } from "@tanstack/react-query";
|
|
5
5
|
import "../client.js";
|
|
6
6
|
import { useSifaConfig } from "../config.js";
|
|
7
7
|
import {
|
|
8
8
|
castRoadmapItemVote,
|
|
9
|
-
|
|
10
|
-
retractRoadmapItemVote,
|
|
11
|
-
retractRoadmapVote
|
|
9
|
+
retractRoadmapItemVote
|
|
12
10
|
} from "../fetchers/roadmap.js";
|
|
13
|
-
import { sifaQueryKeys } from "../keys.js";
|
|
14
|
-
async function invalidateRoadmap(queryClient) {
|
|
15
|
-
await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.roadmap.all() });
|
|
16
|
-
}
|
|
17
|
-
function useCastRoadmapVote(options) {
|
|
18
|
-
const config = useSifaConfig();
|
|
19
|
-
const queryClient = useQueryClient();
|
|
20
|
-
return useMutation({
|
|
21
|
-
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
22
|
-
// handler below and silently drop cache invalidation (#453).
|
|
23
|
-
...options,
|
|
24
|
-
mutationFn: (key) => castRoadmapVote(config, key),
|
|
25
|
-
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
26
|
-
if (result.ok) {
|
|
27
|
-
await invalidateRoadmap(queryClient);
|
|
28
|
-
}
|
|
29
|
-
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function useRetractRoadmapVote(options) {
|
|
34
|
-
const config = useSifaConfig();
|
|
35
|
-
const queryClient = useQueryClient();
|
|
36
|
-
return useMutation({
|
|
37
|
-
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
38
|
-
// handler below and silently drop cache invalidation (#453).
|
|
39
|
-
...options,
|
|
40
|
-
mutationFn: (key) => retractRoadmapVote(config, key),
|
|
41
|
-
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
42
|
-
if (result.success) {
|
|
43
|
-
await invalidateRoadmap(queryClient);
|
|
44
|
-
}
|
|
45
|
-
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
11
|
function useCastRoadmapItemVote(options) {
|
|
50
12
|
const config = useSifaConfig();
|
|
51
|
-
const queryClient = useQueryClient();
|
|
52
13
|
return useMutation({
|
|
53
|
-
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
54
|
-
// handler below and silently drop cache invalidation (#453).
|
|
55
14
|
...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
|
-
}
|
|
15
|
+
mutationFn: (item) => castRoadmapItemVote(config, item)
|
|
63
16
|
});
|
|
64
17
|
}
|
|
65
18
|
function useRetractRoadmapItemVote(options) {
|
|
66
19
|
const config = useSifaConfig();
|
|
67
|
-
const queryClient = useQueryClient();
|
|
68
20
|
return useMutation({
|
|
69
|
-
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
70
|
-
// handler below and silently drop cache invalidation (#453).
|
|
71
21
|
...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
|
-
}
|
|
22
|
+
mutationFn: (item) => retractRoadmapItemVote(config, item)
|
|
79
23
|
});
|
|
80
24
|
}
|
|
81
25
|
export {
|
|
82
26
|
useCastRoadmapItemVote,
|
|
83
|
-
|
|
84
|
-
useRetractRoadmapItemVote,
|
|
85
|
-
useRetractRoadmapVote
|
|
27
|
+
useRetractRoadmapItemVote
|
|
86
28
|
};
|
|
87
29
|
//# 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,
|
|
1
|
+
{"version":3,"sources":["../../../src/query/hooks/use-roadmap-mutations.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, type UseMutationOptions } from '@tanstack/react-query';\n\nimport { type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n castRoadmapItemVote,\n retractRoadmapItemVote,\n type CastRoadmapVoteResult,\n type RoadmapItemRef,\n} from '../fetchers/roadmap.js';\n\n/**\n * React hook for voting on a roadmap board item. Variable: the item's\n * `{ did, rkey }`. Returns the discriminated-union result so callers can\n * detect `scope_insufficient` and trigger an OAuth scope-upgrade flow.\n *\n * Board data from `fetchRoadmap` is not held in the query cache, so nothing is\n * invalidated here: keep optimistic local state or call `router.refresh()`.\n * 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 return useMutation({\n ...options,\n mutationFn: (item: RoadmapItemRef) => castRoadmapItemVote(config, item),\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 return useMutation({\n ...options,\n mutationFn: (item: RoadmapItemRef) => retractRoadmapItemVote(config, item),\n });\n}\n"],"mappings":";;;AAEA,SAAS,mBAA4C;AAErD,OAAiC;AACjC,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAWA,SAAS,uBACd,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,YAAY;AAAA,IACjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAyB,oBAAoB,QAAQ,IAAI;AAAA,EACxE,CAAC;AACH;AAGO,SAAS,0BACd,SACA;AACA,QAAM,SAAS,cAAc;AAC7B,SAAO,YAAY;AAAA,IACjB,GAAG;AAAA,IACH,YAAY,CAAC,SAAyB,uBAAuB,QAAQ,IAAI;AAAA,EAC3E,CAAC;AACH;","names":[]}
|
package/dist/query/index.cjs
CHANGED
|
@@ -2084,70 +2084,6 @@ async function resolveQuotedPosts(config, uris, options = {}) {
|
|
|
2084
2084
|
);
|
|
2085
2085
|
return results;
|
|
2086
2086
|
}
|
|
2087
|
-
async function fetchRoadmapVotes(config, options = {}) {
|
|
2088
|
-
try {
|
|
2089
|
-
return await apiFetch(config, "/api/roadmap/votes", {
|
|
2090
|
-
cache: "no-store",
|
|
2091
|
-
...options
|
|
2092
|
-
});
|
|
2093
|
-
} catch {
|
|
2094
|
-
return {};
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
async function fetchMyRoadmapVotes(config, options = {}) {
|
|
2098
|
-
const headers = { ...options.headers ?? {} };
|
|
2099
|
-
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
2100
|
-
try {
|
|
2101
|
-
const data = await apiFetch(config, "/api/roadmap/votes/me", {
|
|
2102
|
-
credentials: "include",
|
|
2103
|
-
...options,
|
|
2104
|
-
headers
|
|
2105
|
-
});
|
|
2106
|
-
return data.voted ?? [];
|
|
2107
|
-
} catch {
|
|
2108
|
-
return [];
|
|
2109
|
-
}
|
|
2110
|
-
}
|
|
2111
|
-
function castRoadmapVote(config, key, options = {}) {
|
|
2112
|
-
return castUpvote(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, options);
|
|
2113
|
-
}
|
|
2114
|
-
async function castUpvote(config, path, options) {
|
|
2115
|
-
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
2116
|
-
const url = `${config.baseUrl}${path}`;
|
|
2117
|
-
try {
|
|
2118
|
-
const res = await fetchFn(url, {
|
|
2119
|
-
method: "POST",
|
|
2120
|
-
// No body: the item is in the URL. Do NOT declare a JSON content-type
|
|
2121
|
-
// for an empty body — Fastify rejects that with a 400 before the handler
|
|
2122
|
-
// runs. Only forward caller-provided headers.
|
|
2123
|
-
...options.headers ? { headers: options.headers } : {},
|
|
2124
|
-
credentials: options.credentials ?? "include",
|
|
2125
|
-
signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 1e4)
|
|
2126
|
-
});
|
|
2127
|
-
if (!res.ok) {
|
|
2128
|
-
if (res.status === 403) {
|
|
2129
|
-
try {
|
|
2130
|
-
const body = await res.json();
|
|
2131
|
-
if (body.error === "ScopeInsufficient") {
|
|
2132
|
-
return {
|
|
2133
|
-
ok: false,
|
|
2134
|
-
error: { type: "scope_insufficient", requiredScope: body.requiredScope }
|
|
2135
|
-
};
|
|
2136
|
-
}
|
|
2137
|
-
} catch {
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
return { ok: false, error: { type: "error" } };
|
|
2141
|
-
}
|
|
2142
|
-
const data = await res.json();
|
|
2143
|
-
return { ok: true, data };
|
|
2144
|
-
} catch {
|
|
2145
|
-
return { ok: false, error: { type: "error" } };
|
|
2146
|
-
}
|
|
2147
|
-
}
|
|
2148
|
-
function retractRoadmapVote(config, key, options = {}) {
|
|
2149
|
-
return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "DELETE", options);
|
|
2150
|
-
}
|
|
2151
2087
|
var roadmapBoardItemSchema = zod.z.object({
|
|
2152
2088
|
uri: zod.z.string(),
|
|
2153
2089
|
did: zod.z.string(),
|
|
@@ -2188,8 +2124,39 @@ async function fetchRoadmap(config, options = {}) {
|
|
|
2188
2124
|
function itemVotePath(item) {
|
|
2189
2125
|
return `/api/roadmap/items/${encodeURIComponent(item.did)}/${encodeURIComponent(item.rkey)}/vote`;
|
|
2190
2126
|
}
|
|
2191
|
-
function castRoadmapItemVote(config, item, options = {}) {
|
|
2192
|
-
|
|
2127
|
+
async function castRoadmapItemVote(config, item, options = {}) {
|
|
2128
|
+
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
2129
|
+
const url = `${config.baseUrl}${itemVotePath(item)}`;
|
|
2130
|
+
try {
|
|
2131
|
+
const res = await fetchFn(url, {
|
|
2132
|
+
method: "POST",
|
|
2133
|
+
// No body: the item is in the URL. Do NOT declare a JSON content-type
|
|
2134
|
+
// for an empty body — Fastify rejects that with a 400 before the handler
|
|
2135
|
+
// runs. Only forward caller-provided headers.
|
|
2136
|
+
...options.headers ? { headers: options.headers } : {},
|
|
2137
|
+
credentials: options.credentials ?? "include",
|
|
2138
|
+
signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 1e4)
|
|
2139
|
+
});
|
|
2140
|
+
if (!res.ok) {
|
|
2141
|
+
if (res.status === 403) {
|
|
2142
|
+
try {
|
|
2143
|
+
const body = await res.json();
|
|
2144
|
+
if (body.error === "ScopeInsufficient") {
|
|
2145
|
+
return {
|
|
2146
|
+
ok: false,
|
|
2147
|
+
error: { type: "scope_insufficient", requiredScope: body.requiredScope }
|
|
2148
|
+
};
|
|
2149
|
+
}
|
|
2150
|
+
} catch {
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
return { ok: false, error: { type: "error" } };
|
|
2154
|
+
}
|
|
2155
|
+
const data = await res.json();
|
|
2156
|
+
return { ok: true, data };
|
|
2157
|
+
} catch {
|
|
2158
|
+
return { ok: false, error: { type: "error" } };
|
|
2159
|
+
}
|
|
2193
2160
|
}
|
|
2194
2161
|
function retractRoadmapItemVote(config, item, options = {}) {
|
|
2195
2162
|
return apiWrite(config, itemVotePath(item), "DELETE", options);
|
|
@@ -2410,11 +2377,6 @@ var sifaQueryKeys = {
|
|
|
2410
2377
|
status: (uris) => ["sifa", "reactions", "status", uris],
|
|
2411
2378
|
accountCheck: (appId) => ["sifa", "reactions", "account-check", appId]
|
|
2412
2379
|
},
|
|
2413
|
-
roadmap: {
|
|
2414
|
-
all: () => ["sifa", "roadmap"],
|
|
2415
|
-
votes: () => ["sifa", "roadmap", "votes"],
|
|
2416
|
-
myVotes: () => ["sifa", "roadmap", "my-votes"]
|
|
2417
|
-
},
|
|
2418
2380
|
bskyPreferences: {
|
|
2419
2381
|
all: () => ["sifa", "bsky-preferences"],
|
|
2420
2382
|
contentLabels: () => ["sifa", "bsky-preferences", "content-labels"]
|
|
@@ -4187,87 +4149,18 @@ function useDeleteReaction(options) {
|
|
|
4187
4149
|
}
|
|
4188
4150
|
});
|
|
4189
4151
|
}
|
|
4190
|
-
function useRoadmapVotes(options) {
|
|
4191
|
-
const config = useSifaConfig();
|
|
4192
|
-
return reactQuery.useQuery({
|
|
4193
|
-
queryKey: sifaQueryKeys.roadmap.votes(),
|
|
4194
|
-
queryFn: () => fetchRoadmapVotes(config),
|
|
4195
|
-
...options
|
|
4196
|
-
});
|
|
4197
|
-
}
|
|
4198
|
-
function useMyRoadmapVotes(options) {
|
|
4199
|
-
const config = useSifaConfig();
|
|
4200
|
-
return reactQuery.useQuery({
|
|
4201
|
-
queryKey: sifaQueryKeys.roadmap.myVotes(),
|
|
4202
|
-
queryFn: () => fetchMyRoadmapVotes(config),
|
|
4203
|
-
...options
|
|
4204
|
-
});
|
|
4205
|
-
}
|
|
4206
|
-
async function invalidateRoadmap(queryClient) {
|
|
4207
|
-
await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.roadmap.all() });
|
|
4208
|
-
}
|
|
4209
|
-
function useCastRoadmapVote(options) {
|
|
4210
|
-
const config = useSifaConfig();
|
|
4211
|
-
const queryClient = reactQuery.useQueryClient();
|
|
4212
|
-
return reactQuery.useMutation({
|
|
4213
|
-
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
4214
|
-
// handler below and silently drop cache invalidation (#453).
|
|
4215
|
-
...options,
|
|
4216
|
-
mutationFn: (key) => castRoadmapVote(config, key),
|
|
4217
|
-
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
4218
|
-
if (result.ok) {
|
|
4219
|
-
await invalidateRoadmap(queryClient);
|
|
4220
|
-
}
|
|
4221
|
-
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
4222
|
-
}
|
|
4223
|
-
});
|
|
4224
|
-
}
|
|
4225
|
-
function useRetractRoadmapVote(options) {
|
|
4226
|
-
const config = useSifaConfig();
|
|
4227
|
-
const queryClient = reactQuery.useQueryClient();
|
|
4228
|
-
return reactQuery.useMutation({
|
|
4229
|
-
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
4230
|
-
// handler below and silently drop cache invalidation (#453).
|
|
4231
|
-
...options,
|
|
4232
|
-
mutationFn: (key) => retractRoadmapVote(config, key),
|
|
4233
|
-
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
4234
|
-
if (result.success) {
|
|
4235
|
-
await invalidateRoadmap(queryClient);
|
|
4236
|
-
}
|
|
4237
|
-
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
4238
|
-
}
|
|
4239
|
-
});
|
|
4240
|
-
}
|
|
4241
4152
|
function useCastRoadmapItemVote(options) {
|
|
4242
4153
|
const config = useSifaConfig();
|
|
4243
|
-
const queryClient = reactQuery.useQueryClient();
|
|
4244
4154
|
return reactQuery.useMutation({
|
|
4245
|
-
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
4246
|
-
// handler below and silently drop cache invalidation (#453).
|
|
4247
4155
|
...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
|
-
}
|
|
4156
|
+
mutationFn: (item) => castRoadmapItemVote(config, item)
|
|
4255
4157
|
});
|
|
4256
4158
|
}
|
|
4257
4159
|
function useRetractRoadmapItemVote(options) {
|
|
4258
4160
|
const config = useSifaConfig();
|
|
4259
|
-
const queryClient = reactQuery.useQueryClient();
|
|
4260
4161
|
return reactQuery.useMutation({
|
|
4261
|
-
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
4262
|
-
// handler below and silently drop cache invalidation (#453).
|
|
4263
4162
|
...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
|
-
}
|
|
4163
|
+
mutationFn: (item) => retractRoadmapItemVote(config, item)
|
|
4271
4164
|
});
|
|
4272
4165
|
}
|
|
4273
4166
|
function useWipePreview(options) {
|
|
@@ -4614,7 +4507,6 @@ exports.bulkHideStandardPublications = bulkHideStandardPublications;
|
|
|
4614
4507
|
exports.bulkUnhideProfileItems = bulkUnhideProfileItems;
|
|
4615
4508
|
exports.bulkUnhideStandardPublications = bulkUnhideStandardPublications;
|
|
4616
4509
|
exports.castRoadmapItemVote = castRoadmapItemVote;
|
|
4617
|
-
exports.castRoadmapVote = castRoadmapVote;
|
|
4618
4510
|
exports.checkAppAccount = checkAppAccount;
|
|
4619
4511
|
exports.checkNetworkMapJobStatus = checkNetworkMapJobStatus;
|
|
4620
4512
|
exports.clearCompletenessDismissals = clearCompletenessDismissals;
|
|
@@ -4669,7 +4561,6 @@ exports.fetchHiddenActivityItems = fetchHiddenActivityItems;
|
|
|
4669
4561
|
exports.fetchHiddenApps = fetchHiddenApps;
|
|
4670
4562
|
exports.fetchInboxCounts = fetchInboxCounts;
|
|
4671
4563
|
exports.fetchMyGithubPullRequests = fetchMyGithubPullRequests;
|
|
4672
|
-
exports.fetchMyRoadmapVotes = fetchMyRoadmapVotes;
|
|
4673
4564
|
exports.fetchNetworkMap = fetchNetworkMap;
|
|
4674
4565
|
exports.fetchNetworkStreamCount = fetchNetworkStreamCount;
|
|
4675
4566
|
exports.fetchOrgAttestations = fetchOrgAttestations;
|
|
@@ -4685,7 +4576,6 @@ exports.fetchReciprocityCandidate = fetchReciprocityCandidate;
|
|
|
4685
4576
|
exports.fetchRepoInventory = fetchRepoInventory;
|
|
4686
4577
|
exports.fetchResolveActor = fetchResolveActor;
|
|
4687
4578
|
exports.fetchRoadmap = fetchRoadmap;
|
|
4688
|
-
exports.fetchRoadmapVotes = fetchRoadmapVotes;
|
|
4689
4579
|
exports.fetchRpgClaimable = fetchRpgClaimable;
|
|
4690
4580
|
exports.fetchRpgStatus = fetchRpgStatus;
|
|
4691
4581
|
exports.fetchSearchFilters = fetchSearchFilters;
|
|
@@ -4741,7 +4631,6 @@ exports.resetProfile = resetProfile;
|
|
|
4741
4631
|
exports.resolveEntityDomain = resolveEntityDomain;
|
|
4742
4632
|
exports.resolveQuotedPosts = resolveQuotedPosts;
|
|
4743
4633
|
exports.retractRoadmapItemVote = retractRoadmapItemVote;
|
|
4744
|
-
exports.retractRoadmapVote = retractRoadmapVote;
|
|
4745
4634
|
exports.revealMarqueDomain = revealMarqueDomain;
|
|
4746
4635
|
exports.revokeConfirmation = revokeConfirmation;
|
|
4747
4636
|
exports.revokeOrgAttestation = revokeOrgAttestation;
|
|
@@ -4802,7 +4691,6 @@ exports.useBulkUnhideProfileItems = useBulkUnhideProfileItems;
|
|
|
4802
4691
|
exports.useBulkUnhideStandardPublications = useBulkUnhideStandardPublications;
|
|
4803
4692
|
exports.useCanonicalSkillSearch = useCanonicalSkillSearch;
|
|
4804
4693
|
exports.useCastRoadmapItemVote = useCastRoadmapItemVote;
|
|
4805
|
-
exports.useCastRoadmapVote = useCastRoadmapVote;
|
|
4806
4694
|
exports.useClearCompletenessDismissals = useClearCompletenessDismissals;
|
|
4807
4695
|
exports.useConfirmEndorsement = useConfirmEndorsement;
|
|
4808
4696
|
exports.useCreateConfirmation = useCreateConfirmation;
|
|
@@ -4859,7 +4747,6 @@ exports.useLinkSkillToPosition = useLinkSkillToPosition;
|
|
|
4859
4747
|
exports.useMintEntityDomain = useMintEntityDomain;
|
|
4860
4748
|
exports.useMutuals = useMutuals;
|
|
4861
4749
|
exports.useMyGithubPullRequests = useMyGithubPullRequests;
|
|
4862
|
-
exports.useMyRoadmapVotes = useMyRoadmapVotes;
|
|
4863
4750
|
exports.useNetworkStreamCount = useNetworkStreamCount;
|
|
4864
4751
|
exports.useOffboardOrgAttestation = useOffboardOrgAttestation;
|
|
4865
4752
|
exports.useOrgAttestations = useOrgAttestations;
|
|
@@ -4887,11 +4774,9 @@ exports.useResendProfileEmailVerification = useResendProfileEmailVerification;
|
|
|
4887
4774
|
exports.useResetProfile = useResetProfile;
|
|
4888
4775
|
exports.useResolveEntityDomain = useResolveEntityDomain;
|
|
4889
4776
|
exports.useRetractRoadmapItemVote = useRetractRoadmapItemVote;
|
|
4890
|
-
exports.useRetractRoadmapVote = useRetractRoadmapVote;
|
|
4891
4777
|
exports.useRevealMarqueDomain = useRevealMarqueDomain;
|
|
4892
4778
|
exports.useRevokeConfirmation = useRevokeConfirmation;
|
|
4893
4779
|
exports.useRevokeOrgAttestation = useRevokeOrgAttestation;
|
|
4894
|
-
exports.useRoadmapVotes = useRoadmapVotes;
|
|
4895
4780
|
exports.useRpgClaimable = useRpgClaimable;
|
|
4896
4781
|
exports.useRpgStatus = useRpgStatus;
|
|
4897
4782
|
exports.useSearchFilters = useSearchFilters;
|