@singi-labs/sifa-sdk 0.19.74 → 0.19.75

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.
Files changed (48) hide show
  1. package/dist/index.cjs +63 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +3 -3
  4. package/dist/index.d.ts +3 -3
  5. package/dist/index.js +25 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/logic/index.js +26 -0
  8. package/dist/logic/index.js.map +1 -1
  9. package/dist/logic/site-activity-preset.js +68 -0
  10. package/dist/logic/site-activity-preset.js.map +1 -0
  11. package/dist/{network-map-DIUQSB0r.d.ts → network-map-73EK_ow8.d.ts} +2 -2
  12. package/dist/{network-map-BRBzAHrT.d.cts → network-map-DPt0o-vA.d.cts} +2 -2
  13. package/dist/{org-A9Tz-Uv9.d.cts → org-Bb1cRhJu.d.cts} +63 -3
  14. package/dist/{org-Spq8yU-B.d.ts → org-aUopODEW.d.ts} +63 -3
  15. package/dist/{profile-summary-6GySSJvO.d.ts → profile-summary-8TYJWh1y.d.ts} +1 -1
  16. package/dist/{profile-summary-X4MGExfS.d.cts → profile-summary-CaPVQo_x.d.cts} +1 -1
  17. package/dist/query/fetchers/activity-preferences.js +43 -0
  18. package/dist/query/fetchers/activity-preferences.js.map +1 -0
  19. package/dist/query/fetchers/activity.js +3 -0
  20. package/dist/query/fetchers/activity.js.map +1 -1
  21. package/dist/query/fetchers/index.cjs +43 -1
  22. package/dist/query/fetchers/index.cjs.map +1 -1
  23. package/dist/query/fetchers/index.d.cts +5 -5
  24. package/dist/query/fetchers/index.d.ts +5 -5
  25. package/dist/query/fetchers/index.js +8 -0
  26. package/dist/query/fetchers/index.js.map +1 -1
  27. package/dist/query/hooks/index.cjs +76 -1
  28. package/dist/query/hooks/index.cjs.map +1 -1
  29. package/dist/query/hooks/index.d.cts +3 -3
  30. package/dist/query/hooks/index.d.ts +3 -3
  31. package/dist/query/hooks/index.js +8 -0
  32. package/dist/query/hooks/index.js.map +1 -1
  33. package/dist/query/hooks/use-activity-preferences.js +53 -0
  34. package/dist/query/hooks/use-activity-preferences.js.map +1 -0
  35. package/dist/query/hooks/use-activity.js.map +1 -1
  36. package/dist/query/index.cjs +77 -1
  37. package/dist/query/index.cjs.map +1 -1
  38. package/dist/query/index.d.cts +8 -8
  39. package/dist/query/index.d.ts +8 -8
  40. package/dist/query/index.js +16 -0
  41. package/dist/query/index.js.map +1 -1
  42. package/dist/query/keys.js +4 -1
  43. package/dist/query/keys.js.map +1 -1
  44. package/dist/{types-DXep6553.d.cts → types-BY3qFPDf.d.cts} +67 -1
  45. package/dist/{types-DxMMqOJo.d.ts → types-Dl-uk0Ds.d.ts} +67 -1
  46. package/dist/{use-org-notification-emails-CfDfHwBl.d.ts → use-org-notification-emails-ObFoUWP3.d.ts} +11 -4
  47. package/dist/{use-org-notification-emails-5V3ZAlRd.d.cts → use-org-notification-emails-u0AQu9Ez.d.cts} +11 -4
  48. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { W as WriteResult, K as SifaApiConfig, M as ApiFetchOptions, N as CreateResult, b as ActivityLabel, t as RepoDeleteResult, w as RepoInventory } from './types-DxMMqOJo.js';
1
+ import { a3 as WriteResult, a0 as SifaApiConfig, a1 as ApiFetchOptions, a2 as CreateResult, K as SiteActivityPreset, b as ActivityLabel, u as RepoDeleteResult, x as RepoInventory } from './types-Dl-uk0Ds.js';
2
2
  import { p as ExternalAccount, y as PositionViewerConfirmation } from './index-BFdNI6jA.js';
3
3
  import { a as AccountVerification } from './verification-providers-7il3kPQS.js';
4
4
  import { s as FollowProfileItem, p as FeatureAllowlistEntry, r as FeatureFlag } from './follow-profile-ceqefXAw.js';
@@ -637,6 +637,49 @@ declare function unhideActivityItem(config: SifaApiConfig, input: UnhideActivity
637
637
  */
638
638
  declare function fetchHiddenActivityItems(config: SifaApiConfig, options?: FetchHiddenActivityItemsOptions): Promise<HiddenActivityItem[]>;
639
639
 
640
+ /**
641
+ * The authenticated user's activity preferences, resolved to an answer for
642
+ * every known key. `sitePreset` is the personal-site "show only" filter; both
643
+ * lists empty means no preset.
644
+ */
645
+ interface ActivityPreferences {
646
+ streamCategories: Record<string, boolean>;
647
+ digestItemTypes: Record<string, boolean>;
648
+ sitePreset: SiteActivityPreset;
649
+ }
650
+ /**
651
+ * Partial update. Only the keys present change. `sitePreset`, when present,
652
+ * replaces the whole stored preset; send empty lists to clear it.
653
+ */
654
+ interface UpdateActivityPreferencesInput {
655
+ streamCategories?: Record<string, boolean>;
656
+ digestItemTypes?: Record<string, boolean>;
657
+ sitePreset?: SiteActivityPreset;
658
+ }
659
+ /** A user's personal-site preset as anyone can read it. */
660
+ interface SiteActivityPresetResponse extends SiteActivityPreset {
661
+ did: string;
662
+ /** False when both lists are empty, i.e. the site shows all activity. */
663
+ active: boolean;
664
+ }
665
+ interface FetchActivityPreferencesOptions extends ApiFetchOptions {
666
+ /**
667
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls.
668
+ * `credentials: 'include'` does NOT propagate browser cookies in RSC.
669
+ */
670
+ cookieHeader?: string;
671
+ }
672
+ /** The caller's own preferences. Returns `null` on any error. */
673
+ declare function fetchActivityPreferences(config: SifaApiConfig, options?: FetchActivityPreferencesOptions): Promise<ActivityPreferences | null>;
674
+ /** Update the caller's own preferences. */
675
+ declare function updateActivityPreferences(config: SifaApiConfig, input: UpdateActivityPreferencesInput, options?: ApiFetchOptions): Promise<WriteResult<Partial<ActivityPreferences>>>;
676
+ /**
677
+ * Public read of a user's personal-site preset, by handle or DID. Site
678
+ * builders use it to show the same activity page.sifa.id shows. Returns
679
+ * `null` on any error.
680
+ */
681
+ declare function fetchSiteActivityPreset(config: SifaApiConfig, handleOrDid: string, options?: ApiFetchOptions): Promise<SiteActivityPresetResponse | null>;
682
+
640
683
  /** Public, aggregate stats shown on the homepage and similar surfaces. */
641
684
  interface StatsResponse {
642
685
  profileCount: number;
@@ -982,6 +1025,21 @@ interface FetchActivityTeaserOptions extends ApiFetchOptions {
982
1025
  declare function fetchActivityTeaser(config: SifaApiConfig, handleOrDid: string, options?: FetchActivityTeaserOptions): Promise<ActivityTeaserResponse | null>;
983
1026
  interface FetchActivityFeedOptions extends ApiFetchOptions {
984
1027
  category?: string;
1028
+ /**
1029
+ * Show only these app categories. Applies when `category` is unset (the
1030
+ * "all" view).
1031
+ */
1032
+ categories?: string[];
1033
+ /**
1034
+ * Show only long-form posts carrying one of these tags. Other activity is
1035
+ * not filtered on tags. See `SiteActivityPreset`.
1036
+ */
1037
+ tags?: string[];
1038
+ /**
1039
+ * Apply the profile owner's saved preset for this surface. Explicit
1040
+ * `categories` / `tags` override the matching half of the preset.
1041
+ */
1042
+ preset?: 'site';
985
1043
  limit?: number;
986
1044
  cursor?: string;
987
1045
  cookieHeader?: string;
@@ -1643,6 +1701,8 @@ declare const sifaQueryKeys: {
1643
1701
  readonly teaser: (handleOrDid: string) => readonly ["sifa", "activity", "teaser", string];
1644
1702
  readonly feed: (handleOrDid: string, opts: Record<string, unknown>) => readonly ["sifa", "activity", "feed", string, Record<string, unknown>];
1645
1703
  readonly hiddenItems: () => readonly ["sifa", "activity", "hidden-items"];
1704
+ readonly preferences: () => readonly ["sifa", "activity", "preferences"];
1705
+ readonly sitePreset: (handleOrDid: string) => readonly ["sifa", "activity", "site-preset", string];
1646
1706
  };
1647
1707
  readonly github: {
1648
1708
  readonly all: () => readonly ["sifa", "github"];
@@ -1706,7 +1766,7 @@ declare const sifaQueryKeys: {
1706
1766
  readonly wipePreview: () => readonly ["sifa", "destructive", "wipe-preview"];
1707
1767
  };
1708
1768
  };
1709
- type SifaQueryKey = ReturnType<typeof sifaQueryKeys.all> | ReturnType<typeof sifaQueryKeys.profile.all> | ReturnType<typeof sifaQueryKeys.profile.byHandle> | ReturnType<typeof sifaQueryKeys.profile.atFundLink> | ReturnType<typeof sifaQueryKeys.profile.externalAccounts> | ReturnType<typeof sifaQueryKeys.profile.completeness> | ReturnType<typeof sifaQueryKeys.position.all> | ReturnType<typeof sifaQueryKeys.position.byOwner> | ReturnType<typeof sifaQueryKeys.position.unlinked> | ReturnType<typeof sifaQueryKeys.inbox.all> | ReturnType<typeof sifaQueryKeys.inbox.counts> | ReturnType<typeof sifaQueryKeys.search.all> | ReturnType<typeof sifaQueryKeys.search.profiles> | ReturnType<typeof sifaQueryKeys.search.canonicalSkills> | ReturnType<typeof sifaQueryKeys.search.skills> | ReturnType<typeof sifaQueryKeys.search.filters> | ReturnType<typeof sifaQueryKeys.entity.all> | ReturnType<typeof sifaQueryKeys.entity.search> | ReturnType<typeof sifaQueryKeys.discovery.all> | ReturnType<typeof sifaQueryKeys.discovery.similar> | ReturnType<typeof sifaQueryKeys.discovery.suggestions> | ReturnType<typeof sifaQueryKeys.discovery.suggestionCount> | ReturnType<typeof sifaQueryKeys.discovery.featured> | ReturnType<typeof sifaQueryKeys.follow.all> | ReturnType<typeof sifaQueryKeys.follow.following> | ReturnType<typeof sifaQueryKeys.follow.followers> | ReturnType<typeof sifaQueryKeys.follow.followingOf> | ReturnType<typeof sifaQueryKeys.follow.feed> | ReturnType<typeof sifaQueryKeys.follow.mutuals> | ReturnType<typeof sifaQueryKeys.follow.blueskySuggestions> | ReturnType<typeof sifaQueryKeys.admin.all> | ReturnType<typeof sifaQueryKeys.admin.featureAllowlist> | ReturnType<typeof sifaQueryKeys.admin.reviewQueues> | ReturnType<typeof sifaQueryKeys.stats.all> | ReturnType<typeof sifaQueryKeys.stats.homepage> | ReturnType<typeof sifaQueryKeys.apps.all> | ReturnType<typeof sifaQueryKeys.apps.registry> | ReturnType<typeof sifaQueryKeys.apps.hidden> | ReturnType<typeof sifaQueryKeys.activity.all> | ReturnType<typeof sifaQueryKeys.activity.heatmap> | ReturnType<typeof sifaQueryKeys.activity.teaser> | ReturnType<typeof sifaQueryKeys.activity.feed> | ReturnType<typeof sifaQueryKeys.activity.hiddenItems> | ReturnType<typeof sifaQueryKeys.endorsement.all> | ReturnType<typeof sifaQueryKeys.endorsement.count> | ReturnType<typeof sifaQueryKeys.endorsement.pending> | ReturnType<typeof sifaQueryKeys.endorsement.reciprocity> | ReturnType<typeof sifaQueryKeys.endorsement.received> | ReturnType<typeof sifaQueryKeys.confirmation.all> | ReturnType<typeof sifaQueryKeys.confirmation.pending> | ReturnType<typeof sifaQueryKeys.confirmation.given> | ReturnType<typeof sifaQueryKeys.stream.all> | ReturnType<typeof sifaQueryKeys.stream.networkCount> | ReturnType<typeof sifaQueryKeys.reactions.all> | ReturnType<typeof sifaQueryKeys.reactions.status> | ReturnType<typeof sifaQueryKeys.reactions.accountCheck> | ReturnType<typeof sifaQueryKeys.roadmap.all> | ReturnType<typeof sifaQueryKeys.roadmap.votes> | ReturnType<typeof sifaQueryKeys.roadmap.myVotes> | ReturnType<typeof sifaQueryKeys.bskyPreferences.all> | ReturnType<typeof sifaQueryKeys.bskyPreferences.contentLabels> | ReturnType<typeof sifaQueryKeys.destructive.all> | ReturnType<typeof sifaQueryKeys.destructive.wipePreview> | ReturnType<typeof sifaQueryKeys.repoInventory.all> | ReturnType<typeof sifaQueryKeys.repoInventory.list>;
1769
+ type SifaQueryKey = ReturnType<typeof sifaQueryKeys.all> | ReturnType<typeof sifaQueryKeys.profile.all> | ReturnType<typeof sifaQueryKeys.profile.byHandle> | ReturnType<typeof sifaQueryKeys.profile.atFundLink> | ReturnType<typeof sifaQueryKeys.profile.externalAccounts> | ReturnType<typeof sifaQueryKeys.profile.completeness> | ReturnType<typeof sifaQueryKeys.position.all> | ReturnType<typeof sifaQueryKeys.position.byOwner> | ReturnType<typeof sifaQueryKeys.position.unlinked> | ReturnType<typeof sifaQueryKeys.inbox.all> | ReturnType<typeof sifaQueryKeys.inbox.counts> | ReturnType<typeof sifaQueryKeys.search.all> | ReturnType<typeof sifaQueryKeys.search.profiles> | ReturnType<typeof sifaQueryKeys.search.canonicalSkills> | ReturnType<typeof sifaQueryKeys.search.skills> | ReturnType<typeof sifaQueryKeys.search.filters> | ReturnType<typeof sifaQueryKeys.entity.all> | ReturnType<typeof sifaQueryKeys.entity.search> | ReturnType<typeof sifaQueryKeys.discovery.all> | ReturnType<typeof sifaQueryKeys.discovery.similar> | ReturnType<typeof sifaQueryKeys.discovery.suggestions> | ReturnType<typeof sifaQueryKeys.discovery.suggestionCount> | ReturnType<typeof sifaQueryKeys.discovery.featured> | ReturnType<typeof sifaQueryKeys.follow.all> | ReturnType<typeof sifaQueryKeys.follow.following> | ReturnType<typeof sifaQueryKeys.follow.followers> | ReturnType<typeof sifaQueryKeys.follow.followingOf> | ReturnType<typeof sifaQueryKeys.follow.feed> | ReturnType<typeof sifaQueryKeys.follow.mutuals> | ReturnType<typeof sifaQueryKeys.follow.blueskySuggestions> | ReturnType<typeof sifaQueryKeys.admin.all> | ReturnType<typeof sifaQueryKeys.admin.featureAllowlist> | ReturnType<typeof sifaQueryKeys.admin.reviewQueues> | ReturnType<typeof sifaQueryKeys.stats.all> | ReturnType<typeof sifaQueryKeys.stats.homepage> | ReturnType<typeof sifaQueryKeys.apps.all> | ReturnType<typeof sifaQueryKeys.apps.registry> | ReturnType<typeof sifaQueryKeys.apps.hidden> | ReturnType<typeof sifaQueryKeys.activity.all> | ReturnType<typeof sifaQueryKeys.activity.heatmap> | ReturnType<typeof sifaQueryKeys.activity.teaser> | ReturnType<typeof sifaQueryKeys.activity.feed> | ReturnType<typeof sifaQueryKeys.activity.hiddenItems> | ReturnType<typeof sifaQueryKeys.activity.preferences> | ReturnType<typeof sifaQueryKeys.activity.sitePreset> | ReturnType<typeof sifaQueryKeys.endorsement.all> | ReturnType<typeof sifaQueryKeys.endorsement.count> | ReturnType<typeof sifaQueryKeys.endorsement.pending> | ReturnType<typeof sifaQueryKeys.endorsement.reciprocity> | ReturnType<typeof sifaQueryKeys.endorsement.received> | ReturnType<typeof sifaQueryKeys.confirmation.all> | ReturnType<typeof sifaQueryKeys.confirmation.pending> | ReturnType<typeof sifaQueryKeys.confirmation.given> | ReturnType<typeof sifaQueryKeys.stream.all> | ReturnType<typeof sifaQueryKeys.stream.networkCount> | ReturnType<typeof sifaQueryKeys.reactions.all> | ReturnType<typeof sifaQueryKeys.reactions.status> | ReturnType<typeof sifaQueryKeys.reactions.accountCheck> | ReturnType<typeof sifaQueryKeys.roadmap.all> | ReturnType<typeof sifaQueryKeys.roadmap.votes> | ReturnType<typeof sifaQueryKeys.roadmap.myVotes> | ReturnType<typeof sifaQueryKeys.bskyPreferences.all> | ReturnType<typeof sifaQueryKeys.bskyPreferences.contentLabels> | ReturnType<typeof sifaQueryKeys.destructive.all> | ReturnType<typeof sifaQueryKeys.destructive.wipePreview> | ReturnType<typeof sifaQueryKeys.repoInventory.all> | ReturnType<typeof sifaQueryKeys.repoInventory.list>;
1710
1770
 
1711
1771
  /** How a single entity binding was resolved during a claim. */
1712
1772
  interface OrgClaimBinding {
@@ -1798,4 +1858,4 @@ declare function addOrgNotificationEmail(config: SifaApiConfig, body: OrgNotific
1798
1858
  */
1799
1859
  declare function removeOrgNotificationEmail(config: SifaApiConfig, body: OrgNotificationEmailRequestInput, options?: Omit<ApiFetchOptions, 'method' | 'body'>): Promise<WriteResult<Partial<OrgNotificationEmailRemoveResult>>>;
1800
1860
 
1801
- export { HIDDEN_ITEM_TYPES as $, type AccountCheckResult as A, type BulkHideProfileItemInput as B, type ConfirmEndorsementInput as C, type DeleteAccountResult as D, type EndorsementInput as E, type FeatureAllowlistResponse as F, type FetchInboxCountsOptions as G, type FetchMyGithubPullRequestsOptions as H, type FetchMyRoadmapVotesOptions as I, type FetchProfileCompletenessOptions as J, type FetchReactionStatusOptions as K, type FetchSuggestionsOptions as L, type FetchUnlinkedPositionsOptions as M, type FollowListPage as N, type FollowProfile as O, type FollowProfilePageResponse as P, type FollowUserResult as Q, type FollowingFeedApp as R, type FollowingFeedBuild as S, type FollowingFeedEmptyReason as T, type FollowingFeedResponse as U, type FollowingFeedVersion as V, type FollowingResponse as W, type GetAdminReviewQueuesOptions as X, type GithubPullRequest as Y, type GivenConfirmation as Z, HIDDEN_ITEM_SOURCES as _, type ConfirmEndorsementResult as a, addOrgNotificationEmail as a$, type HeatmapDay as a0, type HeatmapResponse as a1, type HiddenActivityItem as a2, type HiddenApp as a3, type HiddenItemSource as a4, type HiddenItemType as a5, type HideActivityItemInput as a6, type HideProfileItemInput as a7, type InboxCounts as a8, type ListFeatureAllowlistOptions as a9, type ReactionResult as aA, type ReactionStatus as aB, type RefreshOrcidPublicationsResult as aC, type RefreshPdsResult as aD, type RepoDeleteInput as aE, type ResetProfileResult as aF, type ResolveQuotedPostsOptions as aG, type RoadmapVoteError as aH, type RoadmapVoteResult as aI, type RoadmapVoter as aJ, type RoadmapVotesResponse as aK, type SifaQueryKey as aL, type SimilarProfile as aM, type StatsResponse as aN, type SubCategoryBulkResult as aO, type SuggestionProfile as aP, type SuggestionsResponse as aQ, type UnhideActivityItemInput as aR, type UnlinkedPosition as aS, type UnlinkedPositionsResult as aT, type UpdateProfileOverrideInput as aU, type UpdateProfileSelfInput as aV, type UploadAvatarResult as aW, type UploadPronunciationAudioResult as aX, type VerifyExternalAccountResult as aY, type WipePreview as aZ, addFeatureAllowlist as a_, type MyGithubPullRequestsResponse as aa, type OrgClaimBinding as ab, type OrgClaimResult as ac, type OrgDomainChallengeResult as ad, type OrgDomainVerifyResult as ae, type OrgNotificationEmailAddResult as af, type OrgNotificationEmailRemoveResult as ag, type OrgProfileEcho as ah, type OrgProfileUpdateResult as ai, PROFILE_COMPLETENESS_SIGNALS as aj, type PdsWipeOutcome as ak, type PendingConfirmation as al, type PendingConfirmationsPage as am, type PrimarySection as an, type ProfileCompleteness as ao, type ProfileCompletenessSignal as ap, type ProfileIndustryInput as aq, type ProfileLocationAddress as ar, type ProfileLocationInput as as, type ProfileSelfLocation as at, QUOTED_POSTS_BATCH_MAX as au, type QuotedPostAuthor as av, type QuotedPostImage as aw, type QuotedPostResult as ax, type QuotedPostView as ay, type ReactionError as az, type AccountSummary as b, listFeatureAllowlist as b$, bulkHideProfileItems as b0, bulkHideStandardPublications as b1, bulkUnhideProfileItems as b2, bulkUnhideStandardPublications as b3, castRoadmapVote as b4, checkAppAccount as b5, confirmEndorsement as b6, createConfirmation as b7, createEndorsement as b8, createExternalAccount as b9, fetchInboxCounts as bA, fetchMyGithubPullRequests as bB, fetchMyRoadmapVotes as bC, fetchPendingConfirmations as bD, fetchProfileCompleteness as bE, fetchReactionStatus as bF, fetchRepoInventory as bG, fetchRoadmapVotes as bH, fetchSimilarProfiles as bI, fetchStats as bJ, fetchSuggestionCount as bK, fetchSuggestions as bL, fetchUnlinkedPositions as bM, fetchViewerPositionConfirmations as bN, fetchWipePreview as bO, followUser as bP, getAdminReviewQueues as bQ, getBlueskySuggestions as bR, getFollowers as bS, getFollowing as bT, getMutuals as bU, hideActivityItem as bV, hideOrcidPublication as bW, hideProfileItem as bX, hideSifaPublication as bY, hideStandardPublication as bZ, isNewerFollowingFeed as b_, createProfileLocation as ba, createReaction as bb, createSkill as bc, deleteAccount as bd, deleteAvatarOverride as be, deleteExternalAccount as bf, deleteNamePronunciationAudio as bg, deleteProfileLocation as bh, deleteReaction as bi, deleteRepoRecords as bj, deleteSkill as bk, dismissConfirmation as bl, dismissUnlinkedPosition as bm, fetchAccounts as bn, fetchActivityFeed as bo, fetchActivityTeaser as bp, fetchAppsRegistry as bq, fetchExternalAccounts as br, fetchFeaturedProfile as bs, fetchFollowing as bt, fetchFollowingFeed as bu, fetchFollowingFeedVersion as bv, fetchGivenConfirmations as bw, fetchHeatmapData as bx, fetchHiddenActivityItems as by, fetchHiddenApps as bz, type ActivityFeedResponse as c, refreshOrcidPublications as c0, refreshPds as c1, removeFeatureAllowlist as c2, removeOrgNotificationEmail as c3, repoExportUrl as c4, requestOrgDomainChallenge as c5, resetProfile as c6, resolveQuotedPosts as c7, retractRoadmapVote as c8, revokeConfirmation as c9, setExternalAccountPrimary as ca, setSectionPrimary as cb, submitOrgClaim as cc, switchAccount as cd, unfollowUser as ce, unhideActivityItem as cf, unhideOrcidPublication as cg, unhideProfileItem as ch, unhideSifaPublication as ci, unhideStandardPublication as cj, unsetExternalAccountPrimary as ck, unsetSectionPrimary as cl, updateExternalAccount as cm, updateOrgProfile as cn, updateProfileLocation as co, updateProfileOverride as cp, updateProfileSelf as cq, updateSkill as cr, updateSkillSubCategories as cs, uploadAvatar as ct, uploadNamePronunciationAudio as cu, verifyExternalAccount as cv, verifyOrgDomain as cw, type ActivityItem as d, type ActivityItemLinkHealth as e, type ActivityTeaserResponse as f, type AdminReviewQueues as g, type AppRegistryEntry as h, type CastRoadmapVoteResult as i, type CheckAppAccountOptions as j, type ConfirmationInput as k, type ConfirmationSubjectInput as l, type CreateExternalAccountResult as m, type DismissUnlinkedPositionInput as n, type ExternalAccountInput as o, type FeaturedProfile as p, type FetchAccountsOptions as q, type FetchActivityFeedOptions as r, sifaQueryKeys as s, type FetchActivityTeaserOptions as t, type FetchConfirmationsOptions as u, type FetchFollowListOptions as v, type FetchFollowProfilePageOptions as w, type FetchFollowingFeedOptions as x, type FetchHiddenActivityItemsOptions as y, type FetchHiddenAppsOptions as z };
1861
+ export { type GivenConfirmation as $, type AccountCheckResult as A, type BulkHideProfileItemInput as B, type ConfirmEndorsementInput as C, type DeleteAccountResult as D, type EndorsementInput as E, type FeatureAllowlistResponse as F, type FetchHiddenActivityItemsOptions as G, type FetchHiddenAppsOptions as H, type FetchInboxCountsOptions as I, type FetchMyGithubPullRequestsOptions as J, type FetchMyRoadmapVotesOptions as K, type FetchProfileCompletenessOptions as L, type FetchReactionStatusOptions as M, type FetchSuggestionsOptions as N, type FetchUnlinkedPositionsOptions as O, type FollowListPage as P, type FollowProfile as Q, type FollowProfilePageResponse as R, type FollowUserResult as S, type FollowingFeedApp as T, type FollowingFeedBuild as U, type FollowingFeedEmptyReason as V, type FollowingFeedResponse as W, type FollowingFeedVersion as X, type FollowingResponse as Y, type GetAdminReviewQueuesOptions as Z, type GithubPullRequest as _, type ConfirmEndorsementResult as a, type UploadPronunciationAudioResult as a$, HIDDEN_ITEM_SOURCES as a0, HIDDEN_ITEM_TYPES as a1, type HeatmapDay as a2, type HeatmapResponse as a3, type HiddenActivityItem as a4, type HiddenApp as a5, type HiddenItemSource as a6, type HiddenItemType as a7, type HideActivityItemInput as a8, type HideProfileItemInput as a9, type QuotedPostView as aA, type ReactionError as aB, type ReactionResult as aC, type ReactionStatus as aD, type RefreshOrcidPublicationsResult as aE, type RefreshPdsResult as aF, type RepoDeleteInput as aG, type ResetProfileResult as aH, type ResolveQuotedPostsOptions as aI, type RoadmapVoteError as aJ, type RoadmapVoteResult as aK, type RoadmapVoter as aL, type RoadmapVotesResponse as aM, type SifaQueryKey as aN, type SimilarProfile as aO, type SiteActivityPresetResponse as aP, type StatsResponse as aQ, type SubCategoryBulkResult as aR, type SuggestionProfile as aS, type SuggestionsResponse as aT, type UnhideActivityItemInput as aU, type UnlinkedPosition as aV, type UnlinkedPositionsResult as aW, type UpdateActivityPreferencesInput as aX, type UpdateProfileOverrideInput as aY, type UpdateProfileSelfInput as aZ, type UploadAvatarResult as a_, type InboxCounts as aa, type ListFeatureAllowlistOptions as ab, type MyGithubPullRequestsResponse as ac, type OrgClaimBinding as ad, type OrgClaimResult as ae, type OrgDomainChallengeResult as af, type OrgDomainVerifyResult as ag, type OrgNotificationEmailAddResult as ah, type OrgNotificationEmailRemoveResult as ai, type OrgProfileEcho as aj, type OrgProfileUpdateResult as ak, PROFILE_COMPLETENESS_SIGNALS as al, type PdsWipeOutcome as am, type PendingConfirmation as an, type PendingConfirmationsPage as ao, type PrimarySection as ap, type ProfileCompleteness as aq, type ProfileCompletenessSignal as ar, type ProfileIndustryInput as as, type ProfileLocationAddress as at, type ProfileLocationInput as au, type ProfileSelfLocation as av, QUOTED_POSTS_BATCH_MAX as aw, type QuotedPostAuthor as ax, type QuotedPostImage as ay, type QuotedPostResult as az, type AccountSummary as b, hideActivityItem as b$, type VerifyExternalAccountResult as b0, type WipePreview as b1, addFeatureAllowlist as b2, addOrgNotificationEmail as b3, bulkHideProfileItems as b4, bulkHideStandardPublications as b5, bulkUnhideProfileItems as b6, bulkUnhideStandardPublications as b7, castRoadmapVote as b8, checkAppAccount as b9, fetchFollowingFeedVersion as bA, fetchGivenConfirmations as bB, fetchHeatmapData as bC, fetchHiddenActivityItems as bD, fetchHiddenApps as bE, fetchInboxCounts as bF, fetchMyGithubPullRequests as bG, fetchMyRoadmapVotes as bH, fetchPendingConfirmations as bI, fetchProfileCompleteness as bJ, fetchReactionStatus as bK, fetchRepoInventory as bL, fetchRoadmapVotes as bM, fetchSimilarProfiles as bN, fetchSiteActivityPreset as bO, fetchStats as bP, fetchSuggestionCount as bQ, fetchSuggestions as bR, fetchUnlinkedPositions as bS, fetchViewerPositionConfirmations as bT, fetchWipePreview as bU, followUser as bV, getAdminReviewQueues as bW, getBlueskySuggestions as bX, getFollowers as bY, getFollowing as bZ, getMutuals as b_, confirmEndorsement as ba, createConfirmation as bb, createEndorsement as bc, createExternalAccount as bd, createProfileLocation as be, createReaction as bf, createSkill as bg, deleteAccount as bh, deleteAvatarOverride as bi, deleteExternalAccount as bj, deleteNamePronunciationAudio as bk, deleteProfileLocation as bl, deleteReaction as bm, deleteRepoRecords as bn, deleteSkill as bo, dismissConfirmation as bp, dismissUnlinkedPosition as bq, fetchAccounts as br, fetchActivityFeed as bs, fetchActivityPreferences as bt, fetchActivityTeaser as bu, fetchAppsRegistry as bv, fetchExternalAccounts as bw, fetchFeaturedProfile as bx, fetchFollowing as by, fetchFollowingFeed as bz, type ActivityFeedResponse as c, hideOrcidPublication as c0, hideProfileItem as c1, hideSifaPublication as c2, hideStandardPublication as c3, isNewerFollowingFeed as c4, listFeatureAllowlist as c5, refreshOrcidPublications as c6, refreshPds as c7, removeFeatureAllowlist as c8, removeOrgNotificationEmail as c9, uploadAvatar as cA, uploadNamePronunciationAudio as cB, verifyExternalAccount as cC, verifyOrgDomain as cD, repoExportUrl as ca, requestOrgDomainChallenge as cb, resetProfile as cc, resolveQuotedPosts as cd, retractRoadmapVote as ce, revokeConfirmation as cf, setExternalAccountPrimary as cg, setSectionPrimary as ch, submitOrgClaim as ci, switchAccount as cj, unfollowUser as ck, unhideActivityItem as cl, unhideOrcidPublication as cm, unhideProfileItem as cn, unhideSifaPublication as co, unhideStandardPublication as cp, unsetExternalAccountPrimary as cq, unsetSectionPrimary as cr, updateActivityPreferences as cs, updateExternalAccount as ct, updateOrgProfile as cu, updateProfileLocation as cv, updateProfileOverride as cw, updateProfileSelf as cx, updateSkill as cy, updateSkillSubCategories as cz, type ActivityItem as d, type ActivityItemLinkHealth as e, type ActivityPreferences as f, type ActivityTeaserResponse as g, type AdminReviewQueues as h, type AppRegistryEntry as i, type CastRoadmapVoteResult as j, type CheckAppAccountOptions as k, type ConfirmationInput as l, type ConfirmationSubjectInput as m, type CreateExternalAccountResult as n, type DismissUnlinkedPositionInput as o, type ExternalAccountInput as p, type FeaturedProfile as q, type FetchAccountsOptions as r, sifaQueryKeys as s, type FetchActivityFeedOptions as t, type FetchActivityPreferencesOptions as u, type FetchActivityTeaserOptions as v, type FetchConfirmationsOptions as w, type FetchFollowListOptions as x, type FetchFollowProfilePageOptions as y, type FetchFollowingFeedOptions as z };
@@ -1,4 +1,4 @@
1
- import { n as ProfileView } from './types-DxMMqOJo.js';
1
+ import { o as ProfileView } from './types-Dl-uk0Ds.js';
2
2
 
3
3
  /**
4
4
  * Compact professional summary derived from a {@link ProfileView}.
@@ -1,4 +1,4 @@
1
- import { n as ProfileView } from './types-DXep6553.cjs';
1
+ import { o as ProfileView } from './types-BY3qFPDf.cjs';
2
2
 
3
3
  /**
4
4
  * Compact professional summary derived from a {@link ProfileView}.
@@ -0,0 +1,43 @@
1
+ // src/query/fetchers/activity-preferences.ts
2
+ import {
3
+ apiFetch,
4
+ apiWrite,
5
+ encodeIdentifier
6
+ } from "../client.js";
7
+ async function fetchActivityPreferences(config, options = {}) {
8
+ const headers = { ...options.headers ?? {} };
9
+ if (options.cookieHeader) headers.cookie = options.cookieHeader;
10
+ try {
11
+ return await apiFetch(config, "/api/activity-preferences", {
12
+ credentials: "include",
13
+ cache: "no-store",
14
+ ...options,
15
+ headers
16
+ });
17
+ } catch {
18
+ return null;
19
+ }
20
+ }
21
+ function updateActivityPreferences(config, input, options = {}) {
22
+ return apiWrite(config, "/api/activity-preferences", "PUT", {
23
+ ...options,
24
+ body: input
25
+ });
26
+ }
27
+ async function fetchSiteActivityPreset(config, handleOrDid, options = {}) {
28
+ try {
29
+ return await apiFetch(
30
+ config,
31
+ `/api/activity-preferences/site-preset/${encodeIdentifier(handleOrDid)}`,
32
+ options
33
+ );
34
+ } catch {
35
+ return null;
36
+ }
37
+ }
38
+ export {
39
+ fetchActivityPreferences,
40
+ fetchSiteActivityPreset,
41
+ updateActivityPreferences
42
+ };
43
+ //# sourceMappingURL=activity-preferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/query/fetchers/activity-preferences.ts"],"sourcesContent":["import type { SiteActivityPreset } from '../../logic/site-activity-preset.js';\nimport {\n apiFetch,\n apiWrite,\n encodeIdentifier,\n type ApiFetchOptions,\n type SifaApiConfig,\n type WriteResult,\n} from '../client.js';\n\n/**\n * The authenticated user's activity preferences, resolved to an answer for\n * every known key. `sitePreset` is the personal-site \"show only\" filter; both\n * lists empty means no preset.\n */\nexport interface ActivityPreferences {\n streamCategories: Record<string, boolean>;\n digestItemTypes: Record<string, boolean>;\n sitePreset: SiteActivityPreset;\n}\n\n/**\n * Partial update. Only the keys present change. `sitePreset`, when present,\n * replaces the whole stored preset; send empty lists to clear it.\n */\nexport interface UpdateActivityPreferencesInput {\n streamCategories?: Record<string, boolean>;\n digestItemTypes?: Record<string, boolean>;\n sitePreset?: SiteActivityPreset;\n}\n\n/** A user's personal-site preset as anyone can read it. */\nexport interface SiteActivityPresetResponse extends SiteActivityPreset {\n did: string;\n /** False when both lists are empty, i.e. the site shows all activity. */\n active: boolean;\n}\n\nexport interface FetchActivityPreferencesOptions extends ApiFetchOptions {\n /**\n * Pass the caller's `Cookie` header on Next.js RSC server-side calls.\n * `credentials: 'include'` does NOT propagate browser cookies in RSC.\n */\n cookieHeader?: string;\n}\n\n/** The caller's own preferences. Returns `null` on any error. */\nexport async function fetchActivityPreferences(\n config: SifaApiConfig,\n options: FetchActivityPreferencesOptions = {},\n): Promise<ActivityPreferences | null> {\n const headers: Record<string, string> = { ...(options.headers ?? {}) };\n if (options.cookieHeader) headers.cookie = options.cookieHeader;\n\n try {\n return await apiFetch<ActivityPreferences>(config, '/api/activity-preferences', {\n credentials: 'include',\n cache: 'no-store',\n ...options,\n headers,\n });\n } catch {\n return null;\n }\n}\n\n/** Update the caller's own preferences. */\nexport function updateActivityPreferences(\n config: SifaApiConfig,\n input: UpdateActivityPreferencesInput,\n options: ApiFetchOptions = {},\n): Promise<WriteResult<Partial<ActivityPreferences>>> {\n return apiWrite<Partial<ActivityPreferences>>(config, '/api/activity-preferences', 'PUT', {\n ...options,\n body: input,\n });\n}\n\n/**\n * Public read of a user's personal-site preset, by handle or DID. Site\n * builders use it to show the same activity page.sifa.id shows. Returns\n * `null` on any error.\n */\nexport async function fetchSiteActivityPreset(\n config: SifaApiConfig,\n handleOrDid: string,\n options: ApiFetchOptions = {},\n): Promise<SiteActivityPresetResponse | null> {\n try {\n return await apiFetch<SiteActivityPresetResponse>(\n config,\n `/api/activity-preferences/site-preset/${encodeIdentifier(handleOrDid)}`,\n options,\n );\n } catch {\n return null;\n }\n}\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAuCP,eAAsB,yBACpB,QACA,UAA2C,CAAC,GACP;AACrC,QAAM,UAAkC,EAAE,GAAI,QAAQ,WAAW,CAAC,EAAG;AACrE,MAAI,QAAQ,aAAc,SAAQ,SAAS,QAAQ;AAEnD,MAAI;AACF,WAAO,MAAM,SAA8B,QAAQ,6BAA6B;AAAA,MAC9E,aAAa;AAAA,MACb,OAAO;AAAA,MACP,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,0BACd,QACA,OACA,UAA2B,CAAC,GACwB;AACpD,SAAO,SAAuC,QAAQ,6BAA6B,OAAO;AAAA,IACxF,GAAG;AAAA,IACH,MAAM;AAAA,EACR,CAAC;AACH;AAOA,eAAsB,wBACpB,QACA,aACA,UAA2B,CAAC,GACgB;AAC5C,MAAI;AACF,WAAO,MAAM;AAAA,MACX;AAAA,MACA,yCAAyC,iBAAiB,WAAW,CAAC;AAAA,MACtE;AAAA,IACF;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -33,6 +33,9 @@ async function fetchActivityTeaser(config, handleOrDid, options = {}) {
33
33
  async function fetchActivityFeed(config, handleOrDid, options = {}) {
34
34
  const params = new URLSearchParams();
35
35
  if (options.category) params.set("category", options.category);
36
+ if (options.categories?.length) params.set("categories", options.categories.join(","));
37
+ if (options.tags?.length) params.set("tags", options.tags.join(","));
38
+ if (options.preset) params.set("preset", options.preset);
36
39
  if (options.limit) params.set("limit", String(options.limit));
37
40
  if (options.cursor) params.set("cursor", options.cursor);
38
41
  const qs = params.toString();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/query/fetchers/activity.ts"],"sourcesContent":["import type { ActivityLabel } from '../../cards/adult-content.js';\nimport { encodeIdentifier, apiFetch, type ApiFetchOptions, type SifaApiConfig } from '../client.js';\nimport type { QuotedPostResult } from './quoted-posts.js';\n\n/**\n * Liveness of an activity card's destination, as reported by sifa-api's\n * `/api/activity` enrichment (see sifa-api `url-health-checker`). How liveness\n * is measured depends on the card's health strategy (see `resolveCardHealth`):\n * first-party permalinks (`record`) are checked by record existence on the PDS;\n * foreign/derived targets (`url`) by HTTP reachability (HEAD, then GET).\n *\n * ok -- record exists, or the URL returned 2xx/3xx\n * broken -- confirmed dead (record deleted, or >=2 consecutive 4xx / >=5 consecutive 5xx)\n * unverifiable -- 403/429, PDS unreachable, or network error; NOT dead\n * unknown -- newly seen, not yet checked\n *\n * Consumers should only suppress UI on `'broken'`. All other values\n * (including missing) mean \"render normally\".\n */\nexport type ActivityItemLinkHealth = 'ok' | 'broken' | 'unverifiable' | 'unknown';\n\nexport interface HeatmapDay {\n date: string;\n total: number;\n apps: { appId: string; count: number }[];\n}\n\nexport interface HeatmapResponse {\n days: HeatmapDay[];\n appTotals: { appId: string; appName: string; total: number }[];\n thresholds: [number, number, number, number];\n}\n\nexport interface ActivityItem {\n uri: string;\n cid: string;\n collection: string;\n rkey: string;\n record: Record<string, unknown>;\n appId: string;\n appName: string;\n category: string;\n indexedAt: string;\n /**\n * The record author's handle / display name / avatar, injected by the server\n * on MULTI-author feeds (the following feed) so a card can show whose activity\n * it is. Unset on the per-author activity feed (all one author). Mirrors the\n * stream `ActivityItem`'s author fields the view-model transform reads.\n */\n authorHandle?: string;\n authorDisplayName?: string;\n authorAvatar?: string;\n /**\n * Set by the server when an `app.bsky.embed.record` quote was already\n * resolved upstream (AppView path). Mutually exclusive with `quotedPostUri`.\n */\n quotedPost?: QuotedPostResult;\n /**\n * Set by the server when an `app.bsky.embed.record` quote needs client-side\n * resolution (PDS path). Pass batches to {@link resolveQuotedPosts}.\n * Mutually exclusive with `quotedPost`.\n */\n quotedPostUri?: string;\n /**\n * Reachability of the card's external destination as last checked by\n * sifa-api. Undefined for legacy responses; treat as 'unknown'.\n * See {@link ActivityItemLinkHealth}.\n */\n linkHealth?: ActivityItemLinkHealth;\n /**\n * Content labels from `app.bsky.feed.defs#postView.labels`. Set by\n * sifa-api for Bluesky posts; undefined for other sources and legacy\n * responses. Pass items to {@link hasAdultContent} to decide whether to\n * gate media. See {@link ActivityLabel}.\n */\n labels?: ActivityLabel[];\n /**\n * The owner has hidden this item from their profile. Only ever set on the\n * owner's own view of their feed -- every other surface omits hidden items\n * rather than flagging them -- so a card can offer an unhide in place.\n */\n hidden?: boolean;\n}\n\nexport interface ActivityTeaserResponse {\n items: ActivityItem[];\n blueskyGated?: boolean;\n backfillPending?: boolean;\n failedApps?: string[];\n}\n\nexport interface ActivityFeedResponse {\n items: ActivityItem[];\n cursor: string | null;\n hasMore: boolean;\n availableCategories?: string[];\n blueskyGated?: boolean;\n failedApps?: string[];\n}\n\n/**\n * Per-day activity counts for a profile across all ATproto apps. Returns\n * `null` on any error so callers can render a graceful empty state.\n */\nexport async function fetchHeatmapData(\n config: SifaApiConfig,\n handleOrDid: string,\n days: number,\n options: ApiFetchOptions = {},\n): Promise<HeatmapResponse | null> {\n const path = `/api/activity/${encodeIdentifier(handleOrDid)}/heatmap?days=${days}`;\n try {\n return await apiFetch<HeatmapResponse>(config, path, {\n next: { revalidate: 900, tags: [`heatmap-${handleOrDid}`] },\n ...options,\n });\n } catch {\n return null;\n }\n}\n\nexport interface FetchActivityTeaserOptions extends ApiFetchOptions {\n /**\n * Pass the caller's `Cookie` header on Next.js RSC server-side calls.\n * Required for authenticated server fetches because `credentials: 'include'`\n * does not propagate browser cookies in RSC.\n */\n cookieHeader?: string;\n}\n\n/**\n * Recent activity teaser for a profile (homepage-sized slice). Caps the\n * upstream wait so the SSR path cannot hang. Returns `null` on any error.\n */\nexport async function fetchActivityTeaser(\n config: SifaApiConfig,\n handleOrDid: string,\n options: FetchActivityTeaserOptions = {},\n): Promise<ActivityTeaserResponse | null> {\n const headers: Record<string, string> = { ...(options.headers ?? {}) };\n if (options.cookieHeader) headers.cookie = options.cookieHeader;\n\n try {\n return await apiFetch<ActivityTeaserResponse>(\n config,\n `/api/activity/${encodeIdentifier(handleOrDid)}/teaser`,\n {\n credentials: 'include',\n timeoutMs: 8000,\n next: { revalidate: 300, tags: [`activity-teaser-${handleOrDid}`] },\n ...options,\n headers,\n },\n );\n } catch {\n return null;\n }\n}\n\nexport interface FetchActivityFeedOptions extends ApiFetchOptions {\n category?: string;\n limit?: number;\n cursor?: string;\n cookieHeader?: string;\n}\n\n/**\n * Paginated activity feed for a profile. Always fresh (`cache: 'no-store'`).\n * Returns `null` on any error.\n */\nexport async function fetchActivityFeed(\n config: SifaApiConfig,\n handleOrDid: string,\n options: FetchActivityFeedOptions = {},\n): Promise<ActivityFeedResponse | null> {\n const params = new URLSearchParams();\n if (options.category) params.set('category', options.category);\n if (options.limit) params.set('limit', String(options.limit));\n if (options.cursor) params.set('cursor', options.cursor);\n const qs = params.toString();\n\n const headers: Record<string, string> = { ...(options.headers ?? {}) };\n if (options.cookieHeader) headers.cookie = options.cookieHeader;\n\n try {\n return await apiFetch<ActivityFeedResponse>(\n config,\n `/api/activity/${encodeIdentifier(handleOrDid)}${qs ? `?${qs}` : ''}`,\n {\n credentials: 'include',\n cache: 'no-store',\n ...options,\n headers,\n },\n );\n } catch {\n return null;\n }\n}\n"],"mappings":";AACA,SAAS,kBAAkB,gBAA0D;AAuGrF,eAAsB,iBACpB,QACA,aACA,MACA,UAA2B,CAAC,GACK;AACjC,QAAM,OAAO,iBAAiB,iBAAiB,WAAW,CAAC,iBAAiB,IAAI;AAChF,MAAI;AACF,WAAO,MAAM,SAA0B,QAAQ,MAAM;AAAA,MACnD,MAAM,EAAE,YAAY,KAAK,MAAM,CAAC,WAAW,WAAW,EAAE,EAAE;AAAA,MAC1D,GAAG;AAAA,IACL,CAAC;AAAA,EACH,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAeA,eAAsB,oBACpB,QACA,aACA,UAAsC,CAAC,GACC;AACxC,QAAM,UAAkC,EAAE,GAAI,QAAQ,WAAW,CAAC,EAAG;AACrE,MAAI,QAAQ,aAAc,SAAQ,SAAS,QAAQ;AAEnD,MAAI;AACF,WAAO,MAAM;AAAA,MACX;AAAA,MACA,iBAAiB,iBAAiB,WAAW,CAAC;AAAA,MAC9C;AAAA,QACE,aAAa;AAAA,QACb,WAAW;AAAA,QACX,MAAM,EAAE,YAAY,KAAK,MAAM,CAAC,mBAAmB,WAAW,EAAE,EAAE;AAAA,QAClE,GAAG;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAaA,eAAsB,kBACpB,QACA,aACA,UAAoC,CAAC,GACC;AACtC,QAAM,SAAS,IAAI,gBAAgB;AACnC,MAAI,QAAQ,SAAU,QAAO,IAAI,YAAY,QAAQ,QAAQ;AAC7D,MAAI,QAAQ,MAAO,QAAO,IAAI,SAAS,OAAO,QAAQ,KAAK,CAAC;AAC5D,MAAI,QAAQ,OAAQ,QAAO,IAAI,UAAU,QAAQ,MAAM;AACvD,QAAM,KAAK,OAAO,SAAS;AAE3B,QAAM,UAAkC,EAAE,GAAI,QAAQ,WAAW,CAAC,EAAG;AACrE,MAAI,QAAQ,aAAc,SAAQ,SAAS,QAAQ;AAEnD,MAAI;AACF,WAAO,MAAM;AAAA,MACX;AAAA,MACA,iBAAiB,iBAAiB,WAAW,CAAC,GAAG,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,MACnE;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,QACP,GAAG;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/query/fetchers/activity.ts"],"sourcesContent":["import type { ActivityLabel } from '../../cards/adult-content.js';\nimport { encodeIdentifier, apiFetch, type ApiFetchOptions, type SifaApiConfig } from '../client.js';\nimport type { QuotedPostResult } from './quoted-posts.js';\n\n/**\n * Liveness of an activity card's destination, as reported by sifa-api's\n * `/api/activity` enrichment (see sifa-api `url-health-checker`). How liveness\n * is measured depends on the card's health strategy (see `resolveCardHealth`):\n * first-party permalinks (`record`) are checked by record existence on the PDS;\n * foreign/derived targets (`url`) by HTTP reachability (HEAD, then GET).\n *\n * ok -- record exists, or the URL returned 2xx/3xx\n * broken -- confirmed dead (record deleted, or >=2 consecutive 4xx / >=5 consecutive 5xx)\n * unverifiable -- 403/429, PDS unreachable, or network error; NOT dead\n * unknown -- newly seen, not yet checked\n *\n * Consumers should only suppress UI on `'broken'`. All other values\n * (including missing) mean \"render normally\".\n */\nexport type ActivityItemLinkHealth = 'ok' | 'broken' | 'unverifiable' | 'unknown';\n\nexport interface HeatmapDay {\n date: string;\n total: number;\n apps: { appId: string; count: number }[];\n}\n\nexport interface HeatmapResponse {\n days: HeatmapDay[];\n appTotals: { appId: string; appName: string; total: number }[];\n thresholds: [number, number, number, number];\n}\n\nexport interface ActivityItem {\n uri: string;\n cid: string;\n collection: string;\n rkey: string;\n record: Record<string, unknown>;\n appId: string;\n appName: string;\n category: string;\n indexedAt: string;\n /**\n * The record author's handle / display name / avatar, injected by the server\n * on MULTI-author feeds (the following feed) so a card can show whose activity\n * it is. Unset on the per-author activity feed (all one author). Mirrors the\n * stream `ActivityItem`'s author fields the view-model transform reads.\n */\n authorHandle?: string;\n authorDisplayName?: string;\n authorAvatar?: string;\n /**\n * Set by the server when an `app.bsky.embed.record` quote was already\n * resolved upstream (AppView path). Mutually exclusive with `quotedPostUri`.\n */\n quotedPost?: QuotedPostResult;\n /**\n * Set by the server when an `app.bsky.embed.record` quote needs client-side\n * resolution (PDS path). Pass batches to {@link resolveQuotedPosts}.\n * Mutually exclusive with `quotedPost`.\n */\n quotedPostUri?: string;\n /**\n * Reachability of the card's external destination as last checked by\n * sifa-api. Undefined for legacy responses; treat as 'unknown'.\n * See {@link ActivityItemLinkHealth}.\n */\n linkHealth?: ActivityItemLinkHealth;\n /**\n * Content labels from `app.bsky.feed.defs#postView.labels`. Set by\n * sifa-api for Bluesky posts; undefined for other sources and legacy\n * responses. Pass items to {@link hasAdultContent} to decide whether to\n * gate media. See {@link ActivityLabel}.\n */\n labels?: ActivityLabel[];\n /**\n * The owner has hidden this item from their profile. Only ever set on the\n * owner's own view of their feed -- every other surface omits hidden items\n * rather than flagging them -- so a card can offer an unhide in place.\n */\n hidden?: boolean;\n}\n\nexport interface ActivityTeaserResponse {\n items: ActivityItem[];\n blueskyGated?: boolean;\n backfillPending?: boolean;\n failedApps?: string[];\n}\n\nexport interface ActivityFeedResponse {\n items: ActivityItem[];\n cursor: string | null;\n hasMore: boolean;\n availableCategories?: string[];\n blueskyGated?: boolean;\n failedApps?: string[];\n}\n\n/**\n * Per-day activity counts for a profile across all ATproto apps. Returns\n * `null` on any error so callers can render a graceful empty state.\n */\nexport async function fetchHeatmapData(\n config: SifaApiConfig,\n handleOrDid: string,\n days: number,\n options: ApiFetchOptions = {},\n): Promise<HeatmapResponse | null> {\n const path = `/api/activity/${encodeIdentifier(handleOrDid)}/heatmap?days=${days}`;\n try {\n return await apiFetch<HeatmapResponse>(config, path, {\n next: { revalidate: 900, tags: [`heatmap-${handleOrDid}`] },\n ...options,\n });\n } catch {\n return null;\n }\n}\n\nexport interface FetchActivityTeaserOptions extends ApiFetchOptions {\n /**\n * Pass the caller's `Cookie` header on Next.js RSC server-side calls.\n * Required for authenticated server fetches because `credentials: 'include'`\n * does not propagate browser cookies in RSC.\n */\n cookieHeader?: string;\n}\n\n/**\n * Recent activity teaser for a profile (homepage-sized slice). Caps the\n * upstream wait so the SSR path cannot hang. Returns `null` on any error.\n */\nexport async function fetchActivityTeaser(\n config: SifaApiConfig,\n handleOrDid: string,\n options: FetchActivityTeaserOptions = {},\n): Promise<ActivityTeaserResponse | null> {\n const headers: Record<string, string> = { ...(options.headers ?? {}) };\n if (options.cookieHeader) headers.cookie = options.cookieHeader;\n\n try {\n return await apiFetch<ActivityTeaserResponse>(\n config,\n `/api/activity/${encodeIdentifier(handleOrDid)}/teaser`,\n {\n credentials: 'include',\n timeoutMs: 8000,\n next: { revalidate: 300, tags: [`activity-teaser-${handleOrDid}`] },\n ...options,\n headers,\n },\n );\n } catch {\n return null;\n }\n}\n\nexport interface FetchActivityFeedOptions extends ApiFetchOptions {\n category?: string;\n /**\n * Show only these app categories. Applies when `category` is unset (the\n * \"all\" view).\n */\n categories?: string[];\n /**\n * Show only long-form posts carrying one of these tags. Other activity is\n * not filtered on tags. See `SiteActivityPreset`.\n */\n tags?: string[];\n /**\n * Apply the profile owner's saved preset for this surface. Explicit\n * `categories` / `tags` override the matching half of the preset.\n */\n preset?: 'site';\n limit?: number;\n cursor?: string;\n cookieHeader?: string;\n}\n\n/**\n * Paginated activity feed for a profile. Always fresh (`cache: 'no-store'`).\n * Returns `null` on any error.\n */\nexport async function fetchActivityFeed(\n config: SifaApiConfig,\n handleOrDid: string,\n options: FetchActivityFeedOptions = {},\n): Promise<ActivityFeedResponse | null> {\n const params = new URLSearchParams();\n if (options.category) params.set('category', options.category);\n if (options.categories?.length) params.set('categories', options.categories.join(','));\n if (options.tags?.length) params.set('tags', options.tags.join(','));\n if (options.preset) params.set('preset', options.preset);\n if (options.limit) params.set('limit', String(options.limit));\n if (options.cursor) params.set('cursor', options.cursor);\n const qs = params.toString();\n\n const headers: Record<string, string> = { ...(options.headers ?? {}) };\n if (options.cookieHeader) headers.cookie = options.cookieHeader;\n\n try {\n return await apiFetch<ActivityFeedResponse>(\n config,\n `/api/activity/${encodeIdentifier(handleOrDid)}${qs ? `?${qs}` : ''}`,\n {\n credentials: 'include',\n cache: 'no-store',\n ...options,\n headers,\n },\n );\n } catch {\n return null;\n }\n}\n"],"mappings":";AACA,SAAS,kBAAkB,gBAA0D;AAuGrF,eAAsB,iBACpB,QACA,aACA,MACA,UAA2B,CAAC,GACK;AACjC,QAAM,OAAO,iBAAiB,iBAAiB,WAAW,CAAC,iBAAiB,IAAI;AAChF,MAAI;AACF,WAAO,MAAM,SAA0B,QAAQ,MAAM;AAAA,MACnD,MAAM,EAAE,YAAY,KAAK,MAAM,CAAC,WAAW,WAAW,EAAE,EAAE;AAAA,MAC1D,GAAG;AAAA,IACL,CAAC;AAAA,EACH,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAeA,eAAsB,oBACpB,QACA,aACA,UAAsC,CAAC,GACC;AACxC,QAAM,UAAkC,EAAE,GAAI,QAAQ,WAAW,CAAC,EAAG;AACrE,MAAI,QAAQ,aAAc,SAAQ,SAAS,QAAQ;AAEnD,MAAI;AACF,WAAO,MAAM;AAAA,MACX;AAAA,MACA,iBAAiB,iBAAiB,WAAW,CAAC;AAAA,MAC9C;AAAA,QACE,aAAa;AAAA,QACb,WAAW;AAAA,QACX,MAAM,EAAE,YAAY,KAAK,MAAM,CAAC,mBAAmB,WAAW,EAAE,EAAE;AAAA,QAClE,GAAG;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AA4BA,eAAsB,kBACpB,QACA,aACA,UAAoC,CAAC,GACC;AACtC,QAAM,SAAS,IAAI,gBAAgB;AACnC,MAAI,QAAQ,SAAU,QAAO,IAAI,YAAY,QAAQ,QAAQ;AAC7D,MAAI,QAAQ,YAAY,OAAQ,QAAO,IAAI,cAAc,QAAQ,WAAW,KAAK,GAAG,CAAC;AACrF,MAAI,QAAQ,MAAM,OAAQ,QAAO,IAAI,QAAQ,QAAQ,KAAK,KAAK,GAAG,CAAC;AACnE,MAAI,QAAQ,OAAQ,QAAO,IAAI,UAAU,QAAQ,MAAM;AACvD,MAAI,QAAQ,MAAO,QAAO,IAAI,SAAS,OAAO,QAAQ,KAAK,CAAC;AAC5D,MAAI,QAAQ,OAAQ,QAAO,IAAI,UAAU,QAAQ,MAAM;AACvD,QAAM,KAAK,OAAO,SAAS;AAE3B,QAAM,UAAkC,EAAE,GAAI,QAAQ,WAAW,CAAC,EAAG;AACrE,MAAI,QAAQ,aAAc,SAAQ,SAAS,QAAQ;AAEnD,MAAI;AACF,WAAO,MAAM;AAAA,MACX;AAAA,MACA,iBAAiB,iBAAiB,WAAW,CAAC,GAAG,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,MACnE;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,QACP,GAAG;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -801,6 +801,39 @@ async function fetchHiddenActivityItems(config, options = {}) {
801
801
  }
802
802
  }
803
803
 
804
+ // src/query/fetchers/activity-preferences.ts
805
+ async function fetchActivityPreferences(config, options = {}) {
806
+ const headers = { ...options.headers ?? {} };
807
+ if (options.cookieHeader) headers.cookie = options.cookieHeader;
808
+ try {
809
+ return await apiFetch(config, "/api/activity-preferences", {
810
+ credentials: "include",
811
+ cache: "no-store",
812
+ ...options,
813
+ headers
814
+ });
815
+ } catch {
816
+ return null;
817
+ }
818
+ }
819
+ function updateActivityPreferences(config, input, options = {}) {
820
+ return apiWrite(config, "/api/activity-preferences", "PUT", {
821
+ ...options,
822
+ body: input
823
+ });
824
+ }
825
+ async function fetchSiteActivityPreset(config, handleOrDid, options = {}) {
826
+ try {
827
+ return await apiFetch(
828
+ config,
829
+ `/api/activity-preferences/site-preset/${encodeIdentifier(handleOrDid)}`,
830
+ options
831
+ );
832
+ } catch {
833
+ return null;
834
+ }
835
+ }
836
+
804
837
  // src/query/fetchers/stats.ts
805
838
  async function fetchStats(config, options = {}) {
806
839
  try {
@@ -1282,6 +1315,9 @@ async function fetchActivityTeaser(config, handleOrDid, options = {}) {
1282
1315
  async function fetchActivityFeed(config, handleOrDid, options = {}) {
1283
1316
  const params = new URLSearchParams();
1284
1317
  if (options.category) params.set("category", options.category);
1318
+ if (options.categories?.length) params.set("categories", options.categories.join(","));
1319
+ if (options.tags?.length) params.set("tags", options.tags.join(","));
1320
+ if (options.preset) params.set("preset", options.preset);
1285
1321
  if (options.limit) params.set("limit", String(options.limit));
1286
1322
  if (options.cursor) params.set("cursor", options.cursor);
1287
1323
  const qs = params.toString();
@@ -1926,7 +1962,10 @@ var sifaQueryKeys = {
1926
1962
  feed: (handleOrDid, opts) => ["sifa", "activity", "feed", handleOrDid, opts],
1927
1963
  // Session-scoped: the AppView reads the caller's own hides from their
1928
1964
  // cookie, so there is only ever one list per client.
1929
- hiddenItems: () => ["sifa", "activity", "hidden-items"]
1965
+ hiddenItems: () => ["sifa", "activity", "hidden-items"],
1966
+ // Session-scoped, like hiddenItems: the caller's own preferences.
1967
+ preferences: () => ["sifa", "activity", "preferences"],
1968
+ sitePreset: (handleOrDid) => ["sifa", "activity", "site-preset", handleOrDid]
1930
1969
  },
1931
1970
  github: {
1932
1971
  all: () => ["sifa", "github"],
@@ -2184,6 +2223,7 @@ exports.dismissEndorsement = dismissEndorsement;
2184
2223
  exports.dismissUnlinkedPosition = dismissUnlinkedPosition;
2185
2224
  exports.fetchAccounts = fetchAccounts;
2186
2225
  exports.fetchActivityFeed = fetchActivityFeed;
2226
+ exports.fetchActivityPreferences = fetchActivityPreferences;
2187
2227
  exports.fetchActivityTeaser = fetchActivityTeaser;
2188
2228
  exports.fetchAppsRegistry = fetchAppsRegistry;
2189
2229
  exports.fetchAtFundLink = fetchAtFundLink;
@@ -2219,6 +2259,7 @@ exports.fetchSearchCompanies = fetchSearchCompanies;
2219
2259
  exports.fetchSearchFilters = fetchSearchFilters;
2220
2260
  exports.fetchSearchProfiles = fetchSearchProfiles;
2221
2261
  exports.fetchSimilarProfiles = fetchSimilarProfiles;
2262
+ exports.fetchSiteActivityPreset = fetchSiteActivityPreset;
2222
2263
  exports.fetchSkillSuggestions = fetchSkillSuggestions;
2223
2264
  exports.fetchSpeakers = fetchSpeakers;
2224
2265
  exports.fetchStats = fetchStats;
@@ -2277,6 +2318,7 @@ exports.unrevealMarqueDomain = unrevealMarqueDomain;
2277
2318
  exports.unsetExternalAccountPrimary = unsetExternalAccountPrimary;
2278
2319
  exports.unsetPositionPrimary = unsetPositionPrimary;
2279
2320
  exports.unsetSectionPrimary = unsetSectionPrimary;
2321
+ exports.updateActivityPreferences = updateActivityPreferences;
2280
2322
  exports.updateEducation = updateEducation;
2281
2323
  exports.updateExternalAccount = updateExternalAccount;
2282
2324
  exports.updateInvestment = updateInvestment;