@singi-labs/sifa-sdk 0.12.48 → 0.12.49

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.
@@ -1035,6 +1035,30 @@ function removeFeatureAllowlist(config, flag, did, opts = {}) {
1035
1035
  );
1036
1036
  }
1037
1037
 
1038
+ // src/query/fetchers/admin-review-queues.ts
1039
+ async function getAdminReviewQueues(config, opts = {}) {
1040
+ const headers = { ...opts.headers ?? {} };
1041
+ if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
1042
+ const res = await apiFetch(config, "/api/admin/stats/review-queues", {
1043
+ credentials: "include",
1044
+ cache: "no-store",
1045
+ ...opts,
1046
+ headers
1047
+ });
1048
+ const ideas = res.ideas ?? 0;
1049
+ const nameCorrections = res.nameCorrections ?? 0;
1050
+ const pendingCompanies = res.pendingCompanies ?? 0;
1051
+ return {
1052
+ ideas,
1053
+ nameCorrections,
1054
+ pendingCompanies,
1055
+ // Derived rather than trusted so an API that predates the field still
1056
+ // yields a usable pill count.
1057
+ total: res.total ?? ideas + nameCorrections + pendingCompanies,
1058
+ generatedAt: res.generatedAt ?? ""
1059
+ };
1060
+ }
1061
+
1038
1062
  // src/query/fetchers/activity.ts
1039
1063
  async function fetchHeatmapData(config, handleOrDid, days, options = {}) {
1040
1064
  const path = `/api/activity/${encodeIdentifier(handleOrDid)}/heatmap?days=${days}`;
@@ -1441,7 +1465,8 @@ var sifaQueryKeys = {
1441
1465
  },
1442
1466
  admin: {
1443
1467
  all: () => ["sifa", "admin"],
1444
- featureAllowlist: (flag) => ["sifa", "admin", "feature-allowlist", flag]
1468
+ featureAllowlist: (flag) => ["sifa", "admin", "feature-allowlist", flag],
1469
+ reviewQueues: () => ["sifa", "admin", "review-queues"]
1445
1470
  },
1446
1471
  stats: {
1447
1472
  all: () => ["sifa", "stats"],
@@ -2630,6 +2655,16 @@ function useRemoveFeatureAllowlist(flag, options) {
2630
2655
  }
2631
2656
  );
2632
2657
  }
2658
+ var REVIEW_QUEUES_STALE_TIME_MS = 6e4;
2659
+ function useAdminReviewQueues(options) {
2660
+ const config = useSifaConfig();
2661
+ return reactQuery.useQuery({
2662
+ queryKey: sifaQueryKeys.admin.reviewQueues(),
2663
+ queryFn: () => getAdminReviewQueues(config),
2664
+ staleTime: REVIEW_QUEUES_STALE_TIME_MS,
2665
+ ...options
2666
+ });
2667
+ }
2633
2668
  function useHeatmapData(handleOrDid, days, options) {
2634
2669
  const config = useSifaConfig();
2635
2670
  return reactQuery.useQuery({
@@ -3073,6 +3108,7 @@ exports.fetchSuggestionCount = fetchSuggestionCount;
3073
3108
  exports.fetchSuggestions = fetchSuggestions;
3074
3109
  exports.fetchWipePreview = fetchWipePreview;
3075
3110
  exports.followUser = followUser;
3111
+ exports.getAdminReviewQueues = getAdminReviewQueues;
3076
3112
  exports.getBlueskySuggestions = getBlueskySuggestions;
3077
3113
  exports.getFollowers = getFollowers;
3078
3114
  exports.getFollowing = getFollowing;
@@ -3133,6 +3169,7 @@ exports.useActivityFeed = useActivityFeed;
3133
3169
  exports.useActivityTeaser = useActivityTeaser;
3134
3170
  exports.useAddFeatureAllowlist = useAddFeatureAllowlist;
3135
3171
  exports.useAddOrgNotificationEmail = useAddOrgNotificationEmail;
3172
+ exports.useAdminReviewQueues = useAdminReviewQueues;
3136
3173
  exports.useAppAccountCheck = useAppAccountCheck;
3137
3174
  exports.useAppsRegistry = useAppsRegistry;
3138
3175
  exports.useAtFundLink = useAtFundLink;