@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.
@@ -196,7 +196,8 @@ var sifaQueryKeys = {
196
196
  },
197
197
  admin: {
198
198
  all: () => ["sifa", "admin"],
199
- featureAllowlist: (flag) => ["sifa", "admin", "feature-allowlist", flag]
199
+ featureAllowlist: (flag) => ["sifa", "admin", "feature-allowlist", flag],
200
+ reviewQueues: () => ["sifa", "admin", "review-queues"]
200
201
  },
201
202
  stats: {
202
203
  all: () => ["sifa", "stats"],
@@ -2021,6 +2022,42 @@ function useRemoveFeatureAllowlist(flag, options) {
2021
2022
  );
2022
2023
  }
2023
2024
 
2025
+ // src/query/fetchers/admin-review-queues.ts
2026
+ async function getAdminReviewQueues(config, opts = {}) {
2027
+ const headers = { ...opts.headers ?? {} };
2028
+ if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
2029
+ const res = await apiFetch(config, "/api/admin/stats/review-queues", {
2030
+ credentials: "include",
2031
+ cache: "no-store",
2032
+ ...opts,
2033
+ headers
2034
+ });
2035
+ const ideas = res.ideas ?? 0;
2036
+ const nameCorrections = res.nameCorrections ?? 0;
2037
+ const pendingCompanies = res.pendingCompanies ?? 0;
2038
+ return {
2039
+ ideas,
2040
+ nameCorrections,
2041
+ pendingCompanies,
2042
+ // Derived rather than trusted so an API that predates the field still
2043
+ // yields a usable pill count.
2044
+ total: res.total ?? ideas + nameCorrections + pendingCompanies,
2045
+ generatedAt: res.generatedAt ?? ""
2046
+ };
2047
+ }
2048
+
2049
+ // src/query/hooks/use-admin-review-queues.ts
2050
+ var REVIEW_QUEUES_STALE_TIME_MS = 6e4;
2051
+ function useAdminReviewQueues(options) {
2052
+ const config = useSifaConfig();
2053
+ return reactQuery.useQuery({
2054
+ queryKey: sifaQueryKeys.admin.reviewQueues(),
2055
+ queryFn: () => getAdminReviewQueues(config),
2056
+ staleTime: REVIEW_QUEUES_STALE_TIME_MS,
2057
+ ...options
2058
+ });
2059
+ }
2060
+
2024
2061
  // src/query/fetchers/activity.ts
2025
2062
  async function fetchHeatmapData(config, handleOrDid, days, options = {}) {
2026
2063
  const path = `/api/activity/${encodeIdentifier(handleOrDid)}/heatmap?days=${days}`;
@@ -2762,6 +2799,7 @@ exports.useActivityFeed = useActivityFeed;
2762
2799
  exports.useActivityTeaser = useActivityTeaser;
2763
2800
  exports.useAddFeatureAllowlist = useAddFeatureAllowlist;
2764
2801
  exports.useAddOrgNotificationEmail = useAddOrgNotificationEmail;
2802
+ exports.useAdminReviewQueues = useAdminReviewQueues;
2765
2803
  exports.useAppAccountCheck = useAppAccountCheck;
2766
2804
  exports.useAppsRegistry = useAppsRegistry;
2767
2805
  exports.useAtFundLink = useAtFundLink;