@singi-labs/sifa-sdk 0.19.49 → 0.19.50
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 -1
- package/dist/index.js +1 -1
- package/dist/{org-CxTEjjrm.d.ts → org-Bp4mNT8K.d.ts} +26 -2
- package/dist/{org-DC_FpoTY.d.cts → org-CFzRg61Q.d.cts} +26 -2
- package/dist/query/fetchers/follow.js +30 -6
- package/dist/query/fetchers/follow.js.map +1 -1
- package/dist/query/fetchers/index.cjs +31 -6
- 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 +4 -0
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +45 -7
- 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 +2 -0
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/hooks/use-follow.js +21 -1
- package/dist/query/hooks/use-follow.js.map +1 -1
- package/dist/query/index.cjs +51 -7
- 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 +6 -0
- package/dist/query/index.js.map +1 -1
- package/dist/query/keys.js +1 -0
- package/dist/query/keys.js.map +1 -1
- package/dist/{use-org-notification-emails-CWWi1D8t.d.ts → use-org-notification-emails-CJ0hKqco.d.ts} +9 -3
- package/dist/{use-org-notification-emails-DOyAF0C_.d.cts → use-org-notification-emails-Dk084Rrw.d.cts} +9 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AddFeatureAllowlistVariables, C as CreateReactionVariables, a as CreateRecordVariables, D as DeleteReactionVariables, b as DeleteRecordVariables, F as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, c as SifaProviderProps, U as UnfollowVariables, d as UpdateEducationVariables, e as UpdateExternalAccountVariables, f as UpdatePositionVariables, g as UpdateProfileLocationVariables, h as UpdateRecordVariables, i as UpdateSkillSubCategoriesVariables, j as UpdateSkillVariables, k as UseEntitySearchOptions, l as UseMyGithubPullRequestsParams, u as useAccounts, m as useActivityFeed, n as useActivityTeaser, o as useAddFeatureAllowlist, p as useAddOrgNotificationEmail, q as useAdminReviewQueues, r as useAppAccountCheck, s as useAppsRegistry, t as useAtFundLink, v as useBlueskySuggestions, w as useBulkHideProfileItems, x as useBulkHideStandardPublications, y as useBulkUnhideProfileItems, z as useBulkUnhideStandardPublications, B as useCanonicalSkillSearch, E as useCastRoadmapVote, G as useCreateConfirmation, H as useCreateEducation, I as useCreateEndorsement, J as useCreateExternalAccount, K as useCreatePosition, L as useCreateProfileLocation, M as useCreateReaction, N as useCreateRecord, O as useCreateSkill, Q as useDebouncedValue, T as useDeleteAccount, V as useDeleteAvatarOverride, W as useDeleteEducation, X as useDeleteExternalAccount, Y as useDeleteNamePronunciationAudio, Z as useDeletePosition, _ as useDeleteProfileLocation, $ as useDeleteReaction, a0 as useDeleteRecord, a1 as useDeleteRepoRecords, a2 as useDeleteSkill, a3 as useDismissConfirmation, a4 as useDismissUnlinkedPosition, a5 as useEndorsementCount, a6 as useEntitySearch, a7 as useExternalAccounts, a8 as useFeatureAllowlist, a9 as useFeaturedProfile, aa as useFollow, ab as useFollowers, ac as useFollowing, ad as useFollowingFeed, ae as
|
|
2
|
-
export {
|
|
1
|
+
export { A as AddFeatureAllowlistVariables, C as CreateReactionVariables, a as CreateRecordVariables, D as DeleteReactionVariables, b as DeleteRecordVariables, F as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, c as SifaProviderProps, U as UnfollowVariables, d as UpdateEducationVariables, e as UpdateExternalAccountVariables, f as UpdatePositionVariables, g as UpdateProfileLocationVariables, h as UpdateRecordVariables, i as UpdateSkillSubCategoriesVariables, j as UpdateSkillVariables, k as UseEntitySearchOptions, l as UseMyGithubPullRequestsParams, u as useAccounts, m as useActivityFeed, n as useActivityTeaser, o as useAddFeatureAllowlist, p as useAddOrgNotificationEmail, q as useAdminReviewQueues, r as useAppAccountCheck, s as useAppsRegistry, t as useAtFundLink, v as useBlueskySuggestions, w as useBulkHideProfileItems, x as useBulkHideStandardPublications, y as useBulkUnhideProfileItems, z as useBulkUnhideStandardPublications, B as useCanonicalSkillSearch, E as useCastRoadmapVote, G as useCreateConfirmation, H as useCreateEducation, I as useCreateEndorsement, J as useCreateExternalAccount, K as useCreatePosition, L as useCreateProfileLocation, M as useCreateReaction, N as useCreateRecord, O as useCreateSkill, Q as useDebouncedValue, T as useDeleteAccount, V as useDeleteAvatarOverride, W as useDeleteEducation, X as useDeleteExternalAccount, Y as useDeleteNamePronunciationAudio, Z as useDeletePosition, _ as useDeleteProfileLocation, $ as useDeleteReaction, a0 as useDeleteRecord, a1 as useDeleteRepoRecords, a2 as useDeleteSkill, a3 as useDismissConfirmation, a4 as useDismissUnlinkedPosition, a5 as useEndorsementCount, a6 as useEntitySearch, a7 as useExternalAccounts, a8 as useFeatureAllowlist, a9 as useFeaturedProfile, aa as useFollow, ab as useFollowers, ac as useFollowing, ad as useFollowingFeed, ae as useFollowingFeedVersion, af as useFollowingList, ag as useGetProfileView, ah as useGivenConfirmations, ai as useHeatmapData, aj as useHiddenActivityItems, ak as useHiddenApps, al as useHideActivityItem, am as useHideKeytraceClaim, an as useHideOrcidPublication, ao as useHideProfileItem, ap as useHideSifaPublication, aq as useHideStandardPublication, ar as useImportSearchEntities, as as useInboxCounts, at as useLinkSkillToPosition, av as useMutuals, aw as useMyGithubPullRequests, ax as useMyRoadmapVotes, ay as useNetworkStreamCount, az as useOrgClaim, aA as useOrgDomainChallenge, aB as useOrgDomainVerify, aC as useOrgProfile, aD as usePendingConfirmations, aE as useProfile, aF as useProfileCompleteness, aG as useReactionStatus, aH as useRefreshOrcidPublications, aI as useRefreshPds, aJ as useRemoveFeatureAllowlist, aK as useRemoveOrgNotificationEmail, aL as useRepoInventory, aM as useResetProfile, aO as useRetractRoadmapVote, aP as useRevealMarqueDomain, aQ as useRevokeConfirmation, aR as useRoadmapVotes, bt as useSearchCompanies, aS as useSearchFilters, aT as useSearchProfiles, aU as useSelectEntity, aV as useSetExternalAccountPrimary, aW as useSetPositionPrimary, aX as useSetSectionPrimary, aY as useSifaConfig, aZ as useSimilarProfiles, a_ as useSkillSuggestions, a$ as useStats, b0 as useSuggestionCount, b1 as useSuggestions, b2 as useUnfollow, b3 as useUnhideActivityItem, b4 as useUnhideKeytraceClaim, b5 as useUnhideOrcidPublication, b6 as useUnhideProfileItem, b7 as useUnhideSifaPublication, b8 as useUnhideStandardPublication, b9 as useUnlinkSkillFromPosition, ba as useUnlinkedPositions, bb as useUnrevealMarqueDomain, bc as useUnsetExternalAccountPrimary, bd as useUnsetPositionPrimary, be as useUnsetSectionPrimary, bf as useUpdateEducation, bg as useUpdateExternalAccount, bh as useUpdateOrgProfile, bi as useUpdatePosition, bj as useUpdateProfileLocation, bk as useUpdateProfileOverride, bl as useUpdateProfileSelf, bm as useUpdateRecord, bn as useUpdateSkill, bo as useUpdateSkillSubCategories, bp as useUploadAvatar, bq as useUploadNamePronunciationAudio, br as useVerifyExternalAccount, bs as useWipePreview } from '../../use-org-notification-emails-Dk084Rrw.cjs';
|
|
2
|
+
export { aK as SifaQueryKey, s as sifaQueryKeys } from '../../org-CFzRg61Q.cjs';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
5
5
|
import { N as CreateResult, W as WriteResult } from '../../types-DAGqE0b9.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AddFeatureAllowlistVariables, C as CreateReactionVariables, a as CreateRecordVariables, D as DeleteReactionVariables, b as DeleteRecordVariables, F as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, c as SifaProviderProps, U as UnfollowVariables, d as UpdateEducationVariables, e as UpdateExternalAccountVariables, f as UpdatePositionVariables, g as UpdateProfileLocationVariables, h as UpdateRecordVariables, i as UpdateSkillSubCategoriesVariables, j as UpdateSkillVariables, k as UseEntitySearchOptions, l as UseMyGithubPullRequestsParams, u as useAccounts, m as useActivityFeed, n as useActivityTeaser, o as useAddFeatureAllowlist, p as useAddOrgNotificationEmail, q as useAdminReviewQueues, r as useAppAccountCheck, s as useAppsRegistry, t as useAtFundLink, v as useBlueskySuggestions, w as useBulkHideProfileItems, x as useBulkHideStandardPublications, y as useBulkUnhideProfileItems, z as useBulkUnhideStandardPublications, B as useCanonicalSkillSearch, E as useCastRoadmapVote, G as useCreateConfirmation, H as useCreateEducation, I as useCreateEndorsement, J as useCreateExternalAccount, K as useCreatePosition, L as useCreateProfileLocation, M as useCreateReaction, N as useCreateRecord, O as useCreateSkill, Q as useDebouncedValue, T as useDeleteAccount, V as useDeleteAvatarOverride, W as useDeleteEducation, X as useDeleteExternalAccount, Y as useDeleteNamePronunciationAudio, Z as useDeletePosition, _ as useDeleteProfileLocation, $ as useDeleteReaction, a0 as useDeleteRecord, a1 as useDeleteRepoRecords, a2 as useDeleteSkill, a3 as useDismissConfirmation, a4 as useDismissUnlinkedPosition, a5 as useEndorsementCount, a6 as useEntitySearch, a7 as useExternalAccounts, a8 as useFeatureAllowlist, a9 as useFeaturedProfile, aa as useFollow, ab as useFollowers, ac as useFollowing, ad as useFollowingFeed, ae as
|
|
2
|
-
export {
|
|
1
|
+
export { A as AddFeatureAllowlistVariables, C as CreateReactionVariables, a as CreateRecordVariables, D as DeleteReactionVariables, b as DeleteRecordVariables, F as FollowVariables, P as PositionSkillLinkVariables, R as RemoveFeatureAllowlistVariables, S as SifaProvider, c as SifaProviderProps, U as UnfollowVariables, d as UpdateEducationVariables, e as UpdateExternalAccountVariables, f as UpdatePositionVariables, g as UpdateProfileLocationVariables, h as UpdateRecordVariables, i as UpdateSkillSubCategoriesVariables, j as UpdateSkillVariables, k as UseEntitySearchOptions, l as UseMyGithubPullRequestsParams, u as useAccounts, m as useActivityFeed, n as useActivityTeaser, o as useAddFeatureAllowlist, p as useAddOrgNotificationEmail, q as useAdminReviewQueues, r as useAppAccountCheck, s as useAppsRegistry, t as useAtFundLink, v as useBlueskySuggestions, w as useBulkHideProfileItems, x as useBulkHideStandardPublications, y as useBulkUnhideProfileItems, z as useBulkUnhideStandardPublications, B as useCanonicalSkillSearch, E as useCastRoadmapVote, G as useCreateConfirmation, H as useCreateEducation, I as useCreateEndorsement, J as useCreateExternalAccount, K as useCreatePosition, L as useCreateProfileLocation, M as useCreateReaction, N as useCreateRecord, O as useCreateSkill, Q as useDebouncedValue, T as useDeleteAccount, V as useDeleteAvatarOverride, W as useDeleteEducation, X as useDeleteExternalAccount, Y as useDeleteNamePronunciationAudio, Z as useDeletePosition, _ as useDeleteProfileLocation, $ as useDeleteReaction, a0 as useDeleteRecord, a1 as useDeleteRepoRecords, a2 as useDeleteSkill, a3 as useDismissConfirmation, a4 as useDismissUnlinkedPosition, a5 as useEndorsementCount, a6 as useEntitySearch, a7 as useExternalAccounts, a8 as useFeatureAllowlist, a9 as useFeaturedProfile, aa as useFollow, ab as useFollowers, ac as useFollowing, ad as useFollowingFeed, ae as useFollowingFeedVersion, af as useFollowingList, ag as useGetProfileView, ah as useGivenConfirmations, ai as useHeatmapData, aj as useHiddenActivityItems, ak as useHiddenApps, al as useHideActivityItem, am as useHideKeytraceClaim, an as useHideOrcidPublication, ao as useHideProfileItem, ap as useHideSifaPublication, aq as useHideStandardPublication, ar as useImportSearchEntities, as as useInboxCounts, at as useLinkSkillToPosition, av as useMutuals, aw as useMyGithubPullRequests, ax as useMyRoadmapVotes, ay as useNetworkStreamCount, az as useOrgClaim, aA as useOrgDomainChallenge, aB as useOrgDomainVerify, aC as useOrgProfile, aD as usePendingConfirmations, aE as useProfile, aF as useProfileCompleteness, aG as useReactionStatus, aH as useRefreshOrcidPublications, aI as useRefreshPds, aJ as useRemoveFeatureAllowlist, aK as useRemoveOrgNotificationEmail, aL as useRepoInventory, aM as useResetProfile, aO as useRetractRoadmapVote, aP as useRevealMarqueDomain, aQ as useRevokeConfirmation, aR as useRoadmapVotes, bt as useSearchCompanies, aS as useSearchFilters, aT as useSearchProfiles, aU as useSelectEntity, aV as useSetExternalAccountPrimary, aW as useSetPositionPrimary, aX as useSetSectionPrimary, aY as useSifaConfig, aZ as useSimilarProfiles, a_ as useSkillSuggestions, a$ as useStats, b0 as useSuggestionCount, b1 as useSuggestions, b2 as useUnfollow, b3 as useUnhideActivityItem, b4 as useUnhideKeytraceClaim, b5 as useUnhideOrcidPublication, b6 as useUnhideProfileItem, b7 as useUnhideSifaPublication, b8 as useUnhideStandardPublication, b9 as useUnlinkSkillFromPosition, ba as useUnlinkedPositions, bb as useUnrevealMarqueDomain, bc as useUnsetExternalAccountPrimary, bd as useUnsetPositionPrimary, be as useUnsetSectionPrimary, bf as useUpdateEducation, bg as useUpdateExternalAccount, bh as useUpdateOrgProfile, bi as useUpdatePosition, bj as useUpdateProfileLocation, bk as useUpdateProfileOverride, bl as useUpdateProfileSelf, bm as useUpdateRecord, bn as useUpdateSkill, bo as useUpdateSkillSubCategories, bp as useUploadAvatar, bq as useUploadNamePronunciationAudio, br as useVerifyExternalAccount, bs as useWipePreview } from '../../use-org-notification-emails-CJ0hKqco.js';
|
|
2
|
+
export { aK as SifaQueryKey, s as sifaQueryKeys } from '../../org-Bp4mNT8K.js';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
5
5
|
import { N as CreateResult, W as WriteResult } from '../../types-CK8KgdqA.js';
|
|
@@ -107,6 +107,7 @@ import {
|
|
|
107
107
|
useFollowers,
|
|
108
108
|
useFollowing,
|
|
109
109
|
useFollowingFeed,
|
|
110
|
+
useFollowingFeedVersion,
|
|
110
111
|
useFollowingList,
|
|
111
112
|
useUnfollow
|
|
112
113
|
} from "./use-follow.js";
|
|
@@ -203,6 +204,7 @@ export {
|
|
|
203
204
|
useFollowers,
|
|
204
205
|
useFollowing,
|
|
205
206
|
useFollowingFeed,
|
|
207
|
+
useFollowingFeedVersion,
|
|
206
208
|
useFollowingList,
|
|
207
209
|
useGetProfileView,
|
|
208
210
|
useGivenConfirmations,
|
|
@@ -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 { useUnlinkedPositions, useDismissUnlinkedPosition } from './use-unlinked-positions.js';\nexport { useProfileCompleteness } from './use-profile-completeness.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 { 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 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 { useCastRoadmapVote, useRetractRoadmapVote } 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';\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,sBAAsB,kCAAkC;AACjE,SAAS,8BAA8B;AACvC,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,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,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,mBAAmB,uBAAuB;AACnD,SAAS,oBAAoB,6BAA6B;AAC1D,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;","names":[]}
|
|
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 { useUnlinkedPositions, useDismissUnlinkedPosition } from './use-unlinked-positions.js';\nexport { useProfileCompleteness } from './use-profile-completeness.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 { 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 { useCastRoadmapVote, useRetractRoadmapVote } 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';\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,sBAAsB,kCAAkC;AACjE,SAAS,8BAA8B;AACvC,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,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,mBAAmB,uBAAuB;AACnD,SAAS,oBAAoB,6BAA6B;AAC1D,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;","names":[]}
|
|
@@ -12,6 +12,7 @@ import { useSifaConfig } from "../config.js";
|
|
|
12
12
|
import {
|
|
13
13
|
fetchFollowing,
|
|
14
14
|
fetchFollowingFeed,
|
|
15
|
+
fetchFollowingFeedVersion,
|
|
15
16
|
followUser,
|
|
16
17
|
getFollowers,
|
|
17
18
|
getFollowing,
|
|
@@ -98,7 +99,25 @@ function useFollowingFeed(opts = {}, options) {
|
|
|
98
99
|
includeBluesky: opts.includeBluesky,
|
|
99
100
|
app: opts.app
|
|
100
101
|
}),
|
|
101
|
-
|
|
102
|
+
// A failed request is an error, not an empty feed: React Query retries it,
|
|
103
|
+
// and the client can tell "could not load" from "nothing yet".
|
|
104
|
+
queryFn: async () => {
|
|
105
|
+
const feed = await fetchFollowingFeed(config, opts);
|
|
106
|
+
if (!feed) throw new Error("Following feed unavailable");
|
|
107
|
+
return feed;
|
|
108
|
+
},
|
|
109
|
+
...options
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function useFollowingFeedVersion(opts = {}, options) {
|
|
113
|
+
const config = useSifaConfig();
|
|
114
|
+
return useQuery({
|
|
115
|
+
queryKey: sifaQueryKeys.follow.feedVersion({
|
|
116
|
+
limit: opts.limit,
|
|
117
|
+
includeBluesky: opts.includeBluesky,
|
|
118
|
+
app: opts.app
|
|
119
|
+
}),
|
|
120
|
+
queryFn: async () => (await fetchFollowingFeedVersion(config, opts))?.builtAt ?? null,
|
|
102
121
|
...options
|
|
103
122
|
});
|
|
104
123
|
}
|
|
@@ -107,6 +126,7 @@ export {
|
|
|
107
126
|
useFollowers,
|
|
108
127
|
useFollowing,
|
|
109
128
|
useFollowingFeed,
|
|
129
|
+
useFollowingFeedVersion,
|
|
110
130
|
useFollowingList,
|
|
111
131
|
useUnfollow
|
|
112
132
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/query/hooks/use-follow.ts"],"sourcesContent":["'use client';\n\nimport {\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n type InfiniteData,\n type UseInfiniteQueryOptions,\n type UseMutationOptions,\n type UseQueryOptions,\n} from '@tanstack/react-query';\n\nimport { type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n fetchFollowing,\n fetchFollowingFeed,\n followUser,\n getFollowers,\n getFollowing,\n unfollowUser,\n type FetchFollowListOptions,\n type FetchFollowingFeedOptions,\n type FollowListPage,\n type FollowProfile,\n type FollowUserResult,\n type FollowingResponse,\n} from '../fetchers/follow.js';\nimport type { FollowingFeedResponse } from '../fetchers/follow.js';\nimport { sifaQueryKeys } from '../keys.js';\n\n/**\n * Legacy \"people I follow\" query. Kept as-is for back-compat with sifa-web\n * call sites that pre-date the V5 feed work. New code should use\n * {@link useFollowingList} (paginated per-profile) or\n * {@link useFollowingFeed} (V5 feed).\n */\nexport function useFollowing(\n opts: { source?: string; cursor?: string; limit?: number } = {},\n options?: Omit<\n UseQueryOptions<\n FollowingResponse,\n Error,\n FollowingResponse,\n ReturnType<typeof sifaQueryKeys.follow.following>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n queryKey: sifaQueryKeys.follow.following(opts as Record<string, unknown>),\n queryFn: () => fetchFollowing(config, opts),\n ...options,\n });\n}\n\n/** Variables for {@link useFollow}. */\nexport interface FollowVariables {\n handle: string;\n /** Server-resolved DID of the subject, when known. Used for optimistic cache writes. */\n subjectDid?: string;\n /** Optional Sifa-only \"why I followed\" note (max 200 graphemes). */\n note?: string;\n}\n\n/** Variables for {@link useUnfollow}. */\nexport interface UnfollowVariables {\n handle: string;\n}\n\n/**\n * Mutation hook for following a handle. Optimistically marks the\n * follow-state cache as `true` and rolls back on failure (per\n * sifa-api#673 TR8 / iter-1 plan TR8). Invalidates the followers /\n * following lists and the V5 feed on success so they refetch.\n *\n * Optimistic cache entry: `sifaQueryKeys.follow.followers(handle)`\n * receives the viewer prepended to the list shape; the optimistic update\n * is intentionally conservative — it only flips per-handle state and\n * doesn't try to invent rich `FollowProfile` fields.\n */\nexport function useFollow(\n options?: Omit<UseMutationOptions<FollowUserResult, Error, FollowVariables>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied handler would otherwise replace the\n // one below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: ({ handle, note }: FollowVariables) => followUser(config, handle, { note }),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n onError: async (error, variables, onMutateResult, context) => {\n // Rollback: refetch the affected lists so stale optimistic state is reset.\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n await options?.onError?.(error, variables, onMutateResult, context);\n },\n });\n}\n\n/**\n * Mutation hook for unfollowing a handle. Optimistic + rollback mirror\n * of {@link useFollow}.\n */\nexport function useUnfollow(\n options?: Omit<UseMutationOptions<WriteResult, Error, UnfollowVariables>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied handler would otherwise replace the\n // one below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: ({ handle }: UnfollowVariables) => unfollowUser(config, handle),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n onError: async (error, variables, onMutateResult, context) => {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n await options?.onError?.(error, variables, onMutateResult, context);\n },\n });\n}\n\n/** Infinite-query hook for `handle`'s followers list. */\nexport function useFollowers(\n handle: string,\n opts: Omit<FetchFollowListOptions, 'cursor'> = {},\n options?: Omit<\n UseInfiniteQueryOptions<\n FollowListPage,\n Error,\n InfiniteData<FollowListPage>,\n ReturnType<typeof sifaQueryKeys.follow.followers>,\n string | undefined\n >,\n 'queryKey' | 'queryFn' | 'initialPageParam' | 'getNextPageParam'\n >,\n) {\n const config = useSifaConfig();\n return useInfiniteQuery({\n queryKey: sifaQueryKeys.follow.followers(handle),\n queryFn: ({ pageParam }) => getFollowers(config, handle, { ...opts, cursor: pageParam }),\n initialPageParam: undefined as string | undefined,\n getNextPageParam: (lastPage: FollowListPage) => lastPage.cursor ?? undefined,\n enabled: handle.length > 0,\n ...options,\n });\n}\n\n/** Infinite-query hook for who `handle` follows. */\nexport function useFollowingList(\n handle: string,\n opts: Omit<FetchFollowListOptions, 'cursor'> = {},\n options?: Omit<\n UseInfiniteQueryOptions<\n FollowListPage,\n Error,\n InfiniteData<FollowListPage>,\n ReturnType<typeof sifaQueryKeys.follow.followingOf>,\n string | undefined\n >,\n 'queryKey' | 'queryFn' | 'initialPageParam' | 'getNextPageParam'\n >,\n) {\n const config = useSifaConfig();\n return useInfiniteQuery({\n queryKey: sifaQueryKeys.follow.followingOf(handle),\n queryFn: ({ pageParam }) => getFollowing(config, handle, { ...opts, cursor: pageParam }),\n initialPageParam: undefined as string | undefined,\n getNextPageParam: (lastPage: FollowListPage) => lastPage.cursor ?? undefined,\n enabled: handle.length > 0,\n ...options,\n });\n}\n\n/**\n * Infinite-query hook for the V5 home feed (authenticated viewer).\n *\n * The viewer's cross-app following feed: what OTHER apps their connections use.\n * See {@link fetchFollowingFeed}. v1 is a finite first page (no infinite scroll\n * yet). The native app must set `config.getAuthToken`; web uses its cookie.\n */\nexport function useFollowingFeed(\n opts: FetchFollowingFeedOptions = {},\n options?: Omit<\n UseQueryOptions<\n FollowingFeedResponse | null,\n Error,\n FollowingFeedResponse | null,\n ReturnType<typeof sifaQueryKeys.follow.feed>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n // `app` is part of the key: each source tab is its own cache entry, so\n // switching tabs does not serve the previous tab's items.\n queryKey: sifaQueryKeys.follow.feed({\n limit: opts.limit,\n includeBluesky: opts.includeBluesky,\n app: opts.app,\n }),\n queryFn: () => fetchFollowingFeed(config, opts),\n ...options,\n });\n}\n\n// Re-export for convenience so consumers only need one import path for the type.\nexport type { FollowProfile };\n"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/query/hooks/use-follow.ts"],"sourcesContent":["'use client';\n\nimport {\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n type InfiniteData,\n type UseInfiniteQueryOptions,\n type UseMutationOptions,\n type UseQueryOptions,\n} from '@tanstack/react-query';\n\nimport { type WriteResult } from '../client.js';\nimport { useSifaConfig } from '../config.js';\nimport {\n fetchFollowing,\n fetchFollowingFeed,\n fetchFollowingFeedVersion,\n followUser,\n getFollowers,\n getFollowing,\n unfollowUser,\n type FetchFollowListOptions,\n type FetchFollowingFeedOptions,\n type FollowListPage,\n type FollowProfile,\n type FollowUserResult,\n type FollowingResponse,\n} from '../fetchers/follow.js';\nimport type { FollowingFeedResponse } from '../fetchers/follow.js';\nimport { sifaQueryKeys } from '../keys.js';\n\n/**\n * Legacy \"people I follow\" query. Kept as-is for back-compat with sifa-web\n * call sites that pre-date the V5 feed work. New code should use\n * {@link useFollowingList} (paginated per-profile) or\n * {@link useFollowingFeed} (V5 feed).\n */\nexport function useFollowing(\n opts: { source?: string; cursor?: string; limit?: number } = {},\n options?: Omit<\n UseQueryOptions<\n FollowingResponse,\n Error,\n FollowingResponse,\n ReturnType<typeof sifaQueryKeys.follow.following>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n queryKey: sifaQueryKeys.follow.following(opts as Record<string, unknown>),\n queryFn: () => fetchFollowing(config, opts),\n ...options,\n });\n}\n\n/** Variables for {@link useFollow}. */\nexport interface FollowVariables {\n handle: string;\n /** Server-resolved DID of the subject, when known. Used for optimistic cache writes. */\n subjectDid?: string;\n /** Optional Sifa-only \"why I followed\" note (max 200 graphemes). */\n note?: string;\n}\n\n/** Variables for {@link useUnfollow}. */\nexport interface UnfollowVariables {\n handle: string;\n}\n\n/**\n * Mutation hook for following a handle. Optimistically marks the\n * follow-state cache as `true` and rolls back on failure (per\n * sifa-api#673 TR8 / iter-1 plan TR8). Invalidates the followers /\n * following lists and the V5 feed on success so they refetch.\n *\n * Optimistic cache entry: `sifaQueryKeys.follow.followers(handle)`\n * receives the viewer prepended to the list shape; the optimistic update\n * is intentionally conservative — it only flips per-handle state and\n * doesn't try to invent rich `FollowProfile` fields.\n */\nexport function useFollow(\n options?: Omit<UseMutationOptions<FollowUserResult, Error, FollowVariables>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied handler would otherwise replace the\n // one below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: ({ handle, note }: FollowVariables) => followUser(config, handle, { note }),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n onError: async (error, variables, onMutateResult, context) => {\n // Rollback: refetch the affected lists so stale optimistic state is reset.\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n await options?.onError?.(error, variables, onMutateResult, context);\n },\n });\n}\n\n/**\n * Mutation hook for unfollowing a handle. Optimistic + rollback mirror\n * of {@link useFollow}.\n */\nexport function useUnfollow(\n options?: Omit<UseMutationOptions<WriteResult, Error, UnfollowVariables>, 'mutationFn'>,\n) {\n const config = useSifaConfig();\n const queryClient = useQueryClient();\n return useMutation({\n // Spread first: a consumer-supplied handler would otherwise replace the\n // one below and silently drop cache invalidation (#453).\n ...options,\n mutationFn: ({ handle }: UnfollowVariables) => unfollowUser(config, handle),\n onSuccess: async (result, variables, onMutateResult, context) => {\n if (result.success) {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n }\n await options?.onSuccess?.(result, variables, onMutateResult, context);\n },\n onError: async (error, variables, onMutateResult, context) => {\n await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.follow.all() });\n await options?.onError?.(error, variables, onMutateResult, context);\n },\n });\n}\n\n/** Infinite-query hook for `handle`'s followers list. */\nexport function useFollowers(\n handle: string,\n opts: Omit<FetchFollowListOptions, 'cursor'> = {},\n options?: Omit<\n UseInfiniteQueryOptions<\n FollowListPage,\n Error,\n InfiniteData<FollowListPage>,\n ReturnType<typeof sifaQueryKeys.follow.followers>,\n string | undefined\n >,\n 'queryKey' | 'queryFn' | 'initialPageParam' | 'getNextPageParam'\n >,\n) {\n const config = useSifaConfig();\n return useInfiniteQuery({\n queryKey: sifaQueryKeys.follow.followers(handle),\n queryFn: ({ pageParam }) => getFollowers(config, handle, { ...opts, cursor: pageParam }),\n initialPageParam: undefined as string | undefined,\n getNextPageParam: (lastPage: FollowListPage) => lastPage.cursor ?? undefined,\n enabled: handle.length > 0,\n ...options,\n });\n}\n\n/** Infinite-query hook for who `handle` follows. */\nexport function useFollowingList(\n handle: string,\n opts: Omit<FetchFollowListOptions, 'cursor'> = {},\n options?: Omit<\n UseInfiniteQueryOptions<\n FollowListPage,\n Error,\n InfiniteData<FollowListPage>,\n ReturnType<typeof sifaQueryKeys.follow.followingOf>,\n string | undefined\n >,\n 'queryKey' | 'queryFn' | 'initialPageParam' | 'getNextPageParam'\n >,\n) {\n const config = useSifaConfig();\n return useInfiniteQuery({\n queryKey: sifaQueryKeys.follow.followingOf(handle),\n queryFn: ({ pageParam }) => getFollowing(config, handle, { ...opts, cursor: pageParam }),\n initialPageParam: undefined as string | undefined,\n getNextPageParam: (lastPage: FollowListPage) => lastPage.cursor ?? undefined,\n enabled: handle.length > 0,\n ...options,\n });\n}\n\n/**\n * Infinite-query hook for the V5 home feed (authenticated viewer).\n *\n * The viewer's cross-app following feed: what OTHER apps their connections use.\n * See {@link fetchFollowingFeed}. v1 is a finite first page (no infinite scroll\n * yet). The native app must set `config.getAuthToken`; web uses its cookie.\n */\nexport function useFollowingFeed(\n opts: FetchFollowingFeedOptions = {},\n options?: Omit<\n UseQueryOptions<\n FollowingFeedResponse,\n Error,\n FollowingFeedResponse,\n ReturnType<typeof sifaQueryKeys.follow.feed>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n // `app` is part of the key: each source tab is its own cache entry, so\n // switching tabs does not serve the previous tab's items.\n queryKey: sifaQueryKeys.follow.feed({\n limit: opts.limit,\n includeBluesky: opts.includeBluesky,\n app: opts.app,\n }),\n // A failed request is an error, not an empty feed: React Query retries it,\n // and the client can tell \"could not load\" from \"nothing yet\".\n queryFn: async () => {\n const feed = await fetchFollowingFeed(config, opts);\n if (!feed) throw new Error('Following feed unavailable');\n return feed;\n },\n ...options,\n });\n}\n\n/**\n * When the cached following feed for the same query was built (ISO 8601, or\n * null). Poll it while a `stale` feed is shown, e.g. with `refetchInterval`,\n * and offer the newer feed once {@link isNewerFollowingFeed} is true.\n */\nexport function useFollowingFeedVersion(\n opts: FetchFollowingFeedOptions = {},\n options?: Omit<\n UseQueryOptions<\n string | null,\n Error,\n string | null,\n ReturnType<typeof sifaQueryKeys.follow.feedVersion>\n >,\n 'queryKey' | 'queryFn'\n >,\n) {\n const config = useSifaConfig();\n return useQuery({\n queryKey: sifaQueryKeys.follow.feedVersion({\n limit: opts.limit,\n includeBluesky: opts.includeBluesky,\n app: opts.app,\n }),\n queryFn: async () => (await fetchFollowingFeedVersion(config, opts))?.builtAt ?? null,\n ...options,\n });\n}\n\n// Re-export for convenience so consumers only need one import path for the type.\nexport type { FollowProfile };\n"],"mappings":"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","names":[]}
|
package/dist/query/index.cjs
CHANGED
|
@@ -1258,7 +1258,7 @@ async function getFollowing(config, handle, opts = {}) {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
1260
|
var FOLLOWING_FEED_LXM = "id.sifa.feed.getFollowingFeed";
|
|
1261
|
-
async function
|
|
1261
|
+
async function followingFeedRequest(config, opts) {
|
|
1262
1262
|
const params = new URLSearchParams();
|
|
1263
1263
|
if (opts.limit) params.set("limit", String(opts.limit));
|
|
1264
1264
|
if (opts.app) params.set("app", opts.app);
|
|
@@ -1270,16 +1270,38 @@ async function fetchFollowingFeed(config, opts = {}) {
|
|
|
1270
1270
|
const token = await config.getAuthToken(FOLLOWING_FEED_LXM);
|
|
1271
1271
|
if (token) headers.Authorization = `Bearer ${token}`;
|
|
1272
1272
|
}
|
|
1273
|
+
return { query: qs ? `?${qs}` : "", headers };
|
|
1274
|
+
}
|
|
1275
|
+
async function fetchFollowingFeed(config, opts = {}) {
|
|
1276
|
+
const { query, headers } = await followingFeedRequest(config, opts);
|
|
1273
1277
|
try {
|
|
1274
|
-
return await apiFetch(
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1278
|
+
return await apiFetch(config, `/api/following/feed${query}`, {
|
|
1279
|
+
credentials: "include",
|
|
1280
|
+
cache: "no-store",
|
|
1281
|
+
...opts,
|
|
1282
|
+
headers
|
|
1283
|
+
});
|
|
1279
1284
|
} catch {
|
|
1280
1285
|
return null;
|
|
1281
1286
|
}
|
|
1282
1287
|
}
|
|
1288
|
+
async function fetchFollowingFeedVersion(config, opts = {}) {
|
|
1289
|
+
const { query, headers } = await followingFeedRequest(config, opts);
|
|
1290
|
+
try {
|
|
1291
|
+
return await apiFetch(config, `/api/following/feed/version${query}`, {
|
|
1292
|
+
credentials: "include",
|
|
1293
|
+
cache: "no-store",
|
|
1294
|
+
...opts,
|
|
1295
|
+
headers
|
|
1296
|
+
});
|
|
1297
|
+
} catch {
|
|
1298
|
+
return null;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
function isNewerFollowingFeed(shownBuiltAt, latestBuiltAt) {
|
|
1302
|
+
if (!shownBuiltAt || !latestBuiltAt) return false;
|
|
1303
|
+
return Date.parse(latestBuiltAt) > Date.parse(shownBuiltAt);
|
|
1304
|
+
}
|
|
1283
1305
|
|
|
1284
1306
|
// src/query/fetchers/follow-extras.ts
|
|
1285
1307
|
function buildListPath2(prefix, opts) {
|
|
@@ -1829,6 +1851,7 @@ var sifaQueryKeys = {
|
|
|
1829
1851
|
followers: (handle) => ["sifa", "follow", "followers", handle],
|
|
1830
1852
|
followingOf: (handle) => ["sifa", "follow", "following-of", handle],
|
|
1831
1853
|
feed: (opts) => ["sifa", "follow", "feed", opts],
|
|
1854
|
+
feedVersion: (opts) => ["sifa", "follow", "feed-version", opts],
|
|
1832
1855
|
mutuals: (handle) => ["sifa", "follow", "mutuals", handle],
|
|
1833
1856
|
blueskySuggestions: () => ["sifa", "follow", "bluesky-suggestions"]
|
|
1834
1857
|
},
|
|
@@ -3216,7 +3239,25 @@ function useFollowingFeed(opts = {}, options) {
|
|
|
3216
3239
|
includeBluesky: opts.includeBluesky,
|
|
3217
3240
|
app: opts.app
|
|
3218
3241
|
}),
|
|
3219
|
-
|
|
3242
|
+
// A failed request is an error, not an empty feed: React Query retries it,
|
|
3243
|
+
// and the client can tell "could not load" from "nothing yet".
|
|
3244
|
+
queryFn: async () => {
|
|
3245
|
+
const feed = await fetchFollowingFeed(config, opts);
|
|
3246
|
+
if (!feed) throw new Error("Following feed unavailable");
|
|
3247
|
+
return feed;
|
|
3248
|
+
},
|
|
3249
|
+
...options
|
|
3250
|
+
});
|
|
3251
|
+
}
|
|
3252
|
+
function useFollowingFeedVersion(opts = {}, options) {
|
|
3253
|
+
const config = useSifaConfig();
|
|
3254
|
+
return reactQuery.useQuery({
|
|
3255
|
+
queryKey: sifaQueryKeys.follow.feedVersion({
|
|
3256
|
+
limit: opts.limit,
|
|
3257
|
+
includeBluesky: opts.includeBluesky,
|
|
3258
|
+
app: opts.app
|
|
3259
|
+
}),
|
|
3260
|
+
queryFn: async () => (await fetchFollowingFeedVersion(config, opts))?.builtAt ?? null,
|
|
3220
3261
|
...options
|
|
3221
3262
|
});
|
|
3222
3263
|
}
|
|
@@ -3801,6 +3842,7 @@ exports.fetchExternalAccounts = fetchExternalAccounts;
|
|
|
3801
3842
|
exports.fetchFeaturedProfile = fetchFeaturedProfile;
|
|
3802
3843
|
exports.fetchFollowing = fetchFollowing;
|
|
3803
3844
|
exports.fetchFollowingFeed = fetchFollowingFeed;
|
|
3845
|
+
exports.fetchFollowingFeedVersion = fetchFollowingFeedVersion;
|
|
3804
3846
|
exports.fetchGetProfileView = fetchGetProfileView;
|
|
3805
3847
|
exports.fetchGivenConfirmations = fetchGivenConfirmations;
|
|
3806
3848
|
exports.fetchHeatmapData = fetchHeatmapData;
|
|
@@ -3850,6 +3892,7 @@ exports.hideStandardPublication = hideStandardPublication;
|
|
|
3850
3892
|
exports.importSearchEntities = importSearchEntities;
|
|
3851
3893
|
exports.initiateNetworkMapGeneration = initiateNetworkMapGeneration;
|
|
3852
3894
|
exports.isNetworkMapResponse = isNetworkMapResponse;
|
|
3895
|
+
exports.isNewerFollowingFeed = isNewerFollowingFeed;
|
|
3853
3896
|
exports.linkSkillToPosition = linkSkillToPosition;
|
|
3854
3897
|
exports.listFeatureAllowlist = listFeatureAllowlist;
|
|
3855
3898
|
exports.mintEntityDomain = mintEntityDomain;
|
|
@@ -3950,6 +3993,7 @@ exports.useFollow = useFollow;
|
|
|
3950
3993
|
exports.useFollowers = useFollowers;
|
|
3951
3994
|
exports.useFollowing = useFollowing;
|
|
3952
3995
|
exports.useFollowingFeed = useFollowingFeed;
|
|
3996
|
+
exports.useFollowingFeedVersion = useFollowingFeedVersion;
|
|
3953
3997
|
exports.useFollowingList = useFollowingList;
|
|
3954
3998
|
exports.useGetProfileView = useGetProfileView;
|
|
3955
3999
|
exports.useGivenConfirmations = useGivenConfirmations;
|