@singi-labs/sifa-sdk 0.18.22 → 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.
- package/dist/badge/index.cjs.map +1 -1
- package/dist/badge/index.js.map +1 -1
- package/dist/{feed-BMm9Pkew.d.cts → follow-profile-D1l6pulB.d.cts} +1 -190
- package/dist/{feed-BMm9Pkew.d.ts → follow-profile-D1l6pulB.d.ts} +1 -190
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/{network-map-Dupds9nG.d.cts → network-map-C8VCE7HI.d.cts} +2 -2
- package/dist/{network-map-Cwef6yhK.d.ts → network-map-DNE9jp_r.d.ts} +2 -2
- package/dist/{org-DgC4pecF.d.cts → org-8RWC0qSH.d.cts} +198 -191
- package/dist/{org-DC_71Ojb.d.ts → org-BwK-97S0.d.ts} +198 -191
- package/dist/{profile-investment-Bvulg_jG.d.cts → profile-investment-D-nKT3ZK.d.cts} +190 -1
- package/dist/{profile-investment-Bvulg_jG.d.ts → profile-investment-D-nKT3ZK.d.ts} +190 -1
- package/dist/query/fetchers/index.cjs +9 -9
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +4 -4
- package/dist/query/fetchers/index.d.ts +4 -4
- package/dist/query/fetchers/index.js +9 -9
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +11 -17
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +4 -4
- package/dist/query/hooks/index.d.ts +4 -4
- package/dist/query/hooks/index.js +11 -17
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +12 -18
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +6 -6
- package/dist/query/index.d.ts +6 -6
- package/dist/query/index.js +12 -18
- package/dist/query/index.js.map +1 -1
- package/dist/schemas/index.d.cts +2 -2
- package/dist/schemas/index.d.ts +2 -2
- package/dist/{use-org-notification-emails-ZmOjvMh0.d.cts → use-org-notification-emails-CeDxRlis.d.cts} +7 -40
- package/dist/{use-org-notification-emails-CHU0JhlL.d.ts → use-org-notification-emails-LIoQtBgD.d.ts} +7 -40
- 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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
2349
|
-
limit: opts.limit,
|
|
2350
|
-
|
|
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
|
}
|