@singi-labs/sifa-sdk 0.18.5 → 0.18.7

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 (37) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/{network-map-Ds3OR7eJ.d.cts → network-map-3jIMzuUY.d.cts} +1 -1
  4. package/dist/{network-map-DZjcO7tM.d.ts → network-map-CqgdF6Gr.d.ts} +1 -1
  5. package/dist/{org-DmtI6C4A.d.cts → org-ANztvuTe.d.cts} +56 -3
  6. package/dist/{org-h8nhEeAJ.d.ts → org-DS183N90.d.ts} +56 -3
  7. package/dist/{org-settings-CZ_tmAYl.d.cts → org-settings-B8e01iZx.d.cts} +1 -1
  8. package/dist/{org-settings-CZ_tmAYl.d.ts → org-settings-B8e01iZx.d.ts} +1 -1
  9. package/dist/query/fetchers/index.cjs +29 -1
  10. package/dist/query/fetchers/index.cjs.map +1 -1
  11. package/dist/query/fetchers/index.d.cts +4 -4
  12. package/dist/query/fetchers/index.d.ts +4 -4
  13. package/dist/query/fetchers/index.js +27 -2
  14. package/dist/query/fetchers/index.js.map +1 -1
  15. package/dist/query/hooks/index.cjs +61 -1
  16. package/dist/query/hooks/index.cjs.map +1 -1
  17. package/dist/query/hooks/index.d.cts +4 -4
  18. package/dist/query/hooks/index.d.ts +4 -4
  19. package/dist/query/hooks/index.js +59 -2
  20. package/dist/query/hooks/index.js.map +1 -1
  21. package/dist/query/index.cjs +62 -1
  22. package/dist/query/index.cjs.map +1 -1
  23. package/dist/query/index.d.cts +6 -6
  24. package/dist/query/index.d.ts +6 -6
  25. package/dist/query/index.js +57 -2
  26. package/dist/query/index.js.map +1 -1
  27. package/dist/resume/index.cjs +4 -4
  28. package/dist/resume/index.cjs.map +1 -1
  29. package/dist/resume/index.d.cts +8 -3
  30. package/dist/resume/index.d.ts +8 -3
  31. package/dist/resume/index.js +4 -4
  32. package/dist/resume/index.js.map +1 -1
  33. package/dist/schemas/write/index.d.cts +1 -1
  34. package/dist/schemas/write/index.d.ts +1 -1
  35. package/dist/{use-org-notification-emails-Cz4cuTyg.d.ts → use-org-notification-emails-CNDrIUcS.d.ts} +16 -3
  36. package/dist/{use-org-notification-emails-CkCQJhy8.d.cts → use-org-notification-emails-D4JRlCX2.d.cts} +16 -3
  37. package/package.json +1 -1
@@ -706,6 +706,28 @@ function bulkUnhideProfileItems(config, input, options = {}) {
706
706
  return apiWrite(config, "/api/profile/items/bulk-hide", "DELETE", { ...options, body: input });
707
707
  }
708
708
 
709
+ // src/query/fetchers/activity-items-hide.ts
710
+ function hideActivityItem(config, input, options = {}) {
711
+ return apiWrite(config, "/api/activity/items/hide", "POST", { ...options, body: input });
712
+ }
713
+ function unhideActivityItem(config, input, options = {}) {
714
+ return apiWrite(config, "/api/activity/items/hide", "DELETE", { ...options, body: input });
715
+ }
716
+ async function fetchHiddenActivityItems(config, options = {}) {
717
+ const headers = { ...options.headers ?? {} };
718
+ if (options.cookieHeader) headers.cookie = options.cookieHeader;
719
+ try {
720
+ const data = await apiFetch(
721
+ config,
722
+ "/api/activity/hidden-items",
723
+ { credentials: "include", ...options, headers }
724
+ );
725
+ return data.items;
726
+ } catch {
727
+ return [];
728
+ }
729
+ }
730
+
709
731
  // src/query/fetchers/stats.ts
710
732
  async function fetchStats(config, options = {}) {
711
733
  try {
@@ -1656,7 +1678,10 @@ var sifaQueryKeys = {
1656
1678
  all: () => ["sifa", "activity"],
1657
1679
  heatmap: (handleOrDid, days) => ["sifa", "activity", "heatmap", handleOrDid, days],
1658
1680
  teaser: (handleOrDid) => ["sifa", "activity", "teaser", handleOrDid],
1659
- feed: (handleOrDid, opts) => ["sifa", "activity", "feed", handleOrDid, opts]
1681
+ feed: (handleOrDid, opts) => ["sifa", "activity", "feed", handleOrDid, opts],
1682
+ // Session-scoped: the AppView reads the caller's own hides from their
1683
+ // cookie, so there is only ever one list per client.
1684
+ hiddenItems: () => ["sifa", "activity", "hidden-items"]
1660
1685
  },
1661
1686
  github: {
1662
1687
  all: () => ["sifa", "github"],
@@ -2660,6 +2685,36 @@ var useBulkHideProfileItems = makeWriteHook2(
2660
2685
  var useBulkUnhideProfileItems = makeWriteHook2(
2661
2686
  (config, input) => bulkUnhideProfileItems(config, input)
2662
2687
  );
2688
+ function useHiddenActivityItems(options) {
2689
+ const config = useSifaConfig();
2690
+ return reactQuery.useQuery({
2691
+ queryKey: sifaQueryKeys.activity.hiddenItems(),
2692
+ queryFn: () => fetchHiddenActivityItems(config),
2693
+ ...options
2694
+ });
2695
+ }
2696
+ function makeHideHook(fetcher) {
2697
+ return function useHook(options) {
2698
+ const config = useSifaConfig();
2699
+ const queryClient = reactQuery.useQueryClient();
2700
+ return reactQuery.useMutation({
2701
+ mutationFn: (v) => fetcher(config, v),
2702
+ onSuccess: async (result, variables, onMutateResult, context) => {
2703
+ if (result.success) {
2704
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.activity.all() });
2705
+ }
2706
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2707
+ },
2708
+ ...options
2709
+ });
2710
+ };
2711
+ }
2712
+ var useHideActivityItem = makeHideHook(
2713
+ (config, input) => hideActivityItem(config, input)
2714
+ );
2715
+ var useUnhideActivityItem = makeHideHook(
2716
+ (config, input) => unhideActivityItem(config, input)
2717
+ );
2663
2718
  function useStats(options) {
2664
2719
  const config = useSifaConfig();
2665
2720
  return reactQuery.useQuery({
@@ -3470,6 +3525,7 @@ exports.fetchFollowing = fetchFollowing;
3470
3525
  exports.fetchGetProfileView = fetchGetProfileView;
3471
3526
  exports.fetchGivenConfirmations = fetchGivenConfirmations;
3472
3527
  exports.fetchHeatmapData = fetchHeatmapData;
3528
+ exports.fetchHiddenActivityItems = fetchHiddenActivityItems;
3473
3529
  exports.fetchHiddenApps = fetchHiddenApps;
3474
3530
  exports.fetchMyGithubPullRequests = fetchMyGithubPullRequests;
3475
3531
  exports.fetchMyRoadmapVotes = fetchMyRoadmapVotes;
@@ -3503,6 +3559,7 @@ exports.getFollowers = getFollowers;
3503
3559
  exports.getFollowing = getFollowing;
3504
3560
  exports.getFollowingFeed = getFollowingFeed;
3505
3561
  exports.getMutuals = getMutuals;
3562
+ exports.hideActivityItem = hideActivityItem;
3506
3563
  exports.hideKeytraceClaim = hideKeytraceClaim;
3507
3564
  exports.hideOrcidPublication = hideOrcidPublication;
3508
3565
  exports.hideProfileItem = hideProfileItem;
@@ -3535,6 +3592,7 @@ exports.sifaQueryKeys = sifaQueryKeys;
3535
3592
  exports.submitOrgClaim = submitOrgClaim;
3536
3593
  exports.switchAccount = switchAccount;
3537
3594
  exports.unfollowUser = unfollowUser;
3595
+ exports.unhideActivityItem = unhideActivityItem;
3538
3596
  exports.unhideKeytraceClaim = unhideKeytraceClaim;
3539
3597
  exports.unhideOrcidPublication = unhideOrcidPublication;
3540
3598
  exports.unhideProfileItem = unhideProfileItem;
@@ -3611,7 +3669,9 @@ exports.useFollowingList = useFollowingList;
3611
3669
  exports.useGetProfileView = useGetProfileView;
3612
3670
  exports.useGivenConfirmations = useGivenConfirmations;
3613
3671
  exports.useHeatmapData = useHeatmapData;
3672
+ exports.useHiddenActivityItems = useHiddenActivityItems;
3614
3673
  exports.useHiddenApps = useHiddenApps;
3674
+ exports.useHideActivityItem = useHideActivityItem;
3615
3675
  exports.useHideKeytraceClaim = useHideKeytraceClaim;
3616
3676
  exports.useHideOrcidPublication = useHideOrcidPublication;
3617
3677
  exports.useHideProfileItem = useHideProfileItem;
@@ -3657,6 +3717,7 @@ exports.useStats = useStats;
3657
3717
  exports.useSuggestionCount = useSuggestionCount;
3658
3718
  exports.useSuggestions = useSuggestions;
3659
3719
  exports.useUnfollow = useUnfollow;
3720
+ exports.useUnhideActivityItem = useUnhideActivityItem;
3660
3721
  exports.useUnhideKeytraceClaim = useUnhideKeytraceClaim;
3661
3722
  exports.useUnhideOrcidPublication = useUnhideOrcidPublication;
3662
3723
  exports.useUnhideProfileItem = useUnhideProfileItem;