@singi-labs/sifa-sdk 0.18.21 → 0.19.0

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 (43) hide show
  1. package/dist/atproto/index.cjs +8 -0
  2. package/dist/atproto/index.cjs.map +1 -1
  3. package/dist/atproto/index.d.cts +10 -1
  4. package/dist/atproto/index.d.ts +10 -1
  5. package/dist/atproto/index.js +7 -1
  6. package/dist/atproto/index.js.map +1 -1
  7. package/dist/badge/index.cjs.map +1 -1
  8. package/dist/badge/index.js.map +1 -1
  9. package/dist/{feed-BMm9Pkew.d.cts → follow-profile-D1l6pulB.d.cts} +1 -190
  10. package/dist/{feed-BMm9Pkew.d.ts → follow-profile-D1l6pulB.d.ts} +1 -190
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.d.cts +4 -4
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js +1 -1
  15. package/dist/{network-map-Dupds9nG.d.cts → network-map-C8VCE7HI.d.cts} +2 -2
  16. package/dist/{network-map-Cwef6yhK.d.ts → network-map-DNE9jp_r.d.ts} +2 -2
  17. package/dist/{org-DgC4pecF.d.cts → org-8RWC0qSH.d.cts} +198 -191
  18. package/dist/{org-DC_71Ojb.d.ts → org-BwK-97S0.d.ts} +198 -191
  19. package/dist/{profile-investment-Bvulg_jG.d.cts → profile-investment-D-nKT3ZK.d.cts} +190 -1
  20. package/dist/{profile-investment-Bvulg_jG.d.ts → profile-investment-D-nKT3ZK.d.ts} +190 -1
  21. package/dist/query/fetchers/index.cjs +9 -9
  22. package/dist/query/fetchers/index.cjs.map +1 -1
  23. package/dist/query/fetchers/index.d.cts +4 -4
  24. package/dist/query/fetchers/index.d.ts +4 -4
  25. package/dist/query/fetchers/index.js +9 -9
  26. package/dist/query/fetchers/index.js.map +1 -1
  27. package/dist/query/hooks/index.cjs +11 -17
  28. package/dist/query/hooks/index.cjs.map +1 -1
  29. package/dist/query/hooks/index.d.cts +4 -4
  30. package/dist/query/hooks/index.d.ts +4 -4
  31. package/dist/query/hooks/index.js +11 -17
  32. package/dist/query/hooks/index.js.map +1 -1
  33. package/dist/query/index.cjs +12 -18
  34. package/dist/query/index.cjs.map +1 -1
  35. package/dist/query/index.d.cts +6 -6
  36. package/dist/query/index.d.ts +6 -6
  37. package/dist/query/index.js +12 -18
  38. package/dist/query/index.js.map +1 -1
  39. package/dist/schemas/index.d.cts +2 -2
  40. package/dist/schemas/index.d.ts +2 -2
  41. package/dist/{use-org-notification-emails-ZmOjvMh0.d.cts → use-org-notification-emails-CeDxRlis.d.cts} +7 -40
  42. package/dist/{use-org-notification-emails-CHU0JhlL.d.ts → use-org-notification-emails-LIoQtBgD.d.ts} +7 -40
  43. package/package.json +1 -1
@@ -2250,25 +2250,25 @@ async function getFollowing(config, handle, opts = {}) {
2250
2250
  return { follows: [], cursor: null };
2251
2251
  }
2252
2252
  }
2253
- async function getFollowingFeed(config, opts = {}) {
2253
+ var FOLLOWING_FEED_LXM = "id.sifa.feed.getFollowingFeed";
2254
+ async function fetchFollowingFeed(config, opts = {}) {
2254
2255
  const params = new URLSearchParams();
2255
- if (opts.cursor) params.set("cursor", opts.cursor);
2256
2256
  if (opts.limit) params.set("limit", String(opts.limit));
2257
- if (opts.categories && opts.categories.length > 0) {
2258
- params.set("categories", opts.categories.join(","));
2259
- }
2260
2257
  const qs = params.toString();
2261
2258
  const headers = { ...opts.headers ?? {} };
2262
2259
  if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
2260
+ if (config.getAuthToken) {
2261
+ const token = await config.getAuthToken(FOLLOWING_FEED_LXM);
2262
+ if (token) headers.Authorization = `Bearer ${token}`;
2263
+ }
2263
2264
  try {
2264
- const res = await apiFetch(
2265
+ return await apiFetch(
2265
2266
  config,
2266
2267
  `/api/following/feed${qs ? `?${qs}` : ""}`,
2267
2268
  { credentials: "include", cache: "no-store", ...opts, headers }
2268
2269
  );
2269
- return { items: res.items ?? [], cursor: res.cursor ?? null };
2270
2270
  } catch {
2271
- return { items: [], cursor: null };
2271
+ return null;
2272
2272
  }
2273
2273
  }
2274
2274
 
@@ -2345,15 +2345,9 @@ function useFollowingList(handle, opts = {}, options) {
2345
2345
  }
2346
2346
  function useFollowingFeed(opts = {}, options) {
2347
2347
  const config = useSifaConfig();
2348
- const keyOpts = {
2349
- limit: opts.limit,
2350
- categories: opts.categories
2351
- };
2352
- return reactQuery.useInfiniteQuery({
2353
- queryKey: sifaQueryKeys.follow.feed(keyOpts),
2354
- queryFn: ({ pageParam }) => getFollowingFeed(config, { ...opts, cursor: pageParam }),
2355
- initialPageParam: void 0,
2356
- getNextPageParam: (lastPage) => lastPage.cursor ?? void 0,
2348
+ return reactQuery.useQuery({
2349
+ queryKey: sifaQueryKeys.follow.feed({ limit: opts.limit }),
2350
+ queryFn: () => fetchFollowingFeed(config, opts),
2357
2351
  ...options
2358
2352
  });
2359
2353
  }