@singi-labs/sifa-sdk 0.12.91 → 0.13.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/index.cjs +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/{network-map-GfIVEYpr.d.ts → network-map-CC9Dito-.d.ts} +95 -3
- package/dist/{network-map-y6U7m-hX.d.cts → network-map-D223f7DM.d.cts} +95 -3
- package/dist/{org-ClDqS3CM.d.cts → org-DCHb1xhw.d.cts} +36 -1
- package/dist/{org-GlACA06R.d.ts → org-zMZg_r7v.d.ts} +36 -1
- package/dist/query/fetchers/index.cjs +71 -0
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +3 -3
- package/dist/query/fetchers/index.d.ts +3 -3
- package/dist/query/fetchers/index.js +68 -1
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +33 -0
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +3 -3
- package/dist/query/hooks/index.d.ts +3 -3
- package/dist/query/hooks/index.js +33 -1
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +80 -0
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +5 -5
- package/dist/query/index.d.ts +5 -5
- package/dist/query/index.js +76 -1
- package/dist/query/index.js.map +1 -1
- package/dist/{use-org-notification-emails-DGzW9MH6.d.ts → use-org-notification-emails-Bt-h3SAB.d.ts} +9 -2
- package/dist/{use-org-notification-emails-B-oGiDHo.d.cts → use-org-notification-emails-ByAvxb0x.d.cts} +9 -2
- package/package.json +1 -1
|
@@ -209,6 +209,12 @@ var sifaQueryKeys = {
|
|
|
209
209
|
registry: () => ["sifa", "apps", "registry"],
|
|
210
210
|
hidden: () => ["sifa", "apps", "hidden"]
|
|
211
211
|
},
|
|
212
|
+
auth: {
|
|
213
|
+
all: () => ["sifa", "auth"],
|
|
214
|
+
// Session-scoped: the AppView reads the account list from the browser's
|
|
215
|
+
// cookies, so there is only ever one list per client.
|
|
216
|
+
accounts: () => ["sifa", "auth", "accounts"]
|
|
217
|
+
},
|
|
212
218
|
activity: {
|
|
213
219
|
all: () => ["sifa", "activity"],
|
|
214
220
|
heatmap: (handleOrDid, days) => ["sifa", "activity", "heatmap", handleOrDid, days],
|
|
@@ -1662,6 +1668,32 @@ function useHiddenApps(options) {
|
|
|
1662
1668
|
});
|
|
1663
1669
|
}
|
|
1664
1670
|
|
|
1671
|
+
// src/query/fetchers/accounts.ts
|
|
1672
|
+
async function fetchAccounts(config, options = {}) {
|
|
1673
|
+
const headers = { ...options.headers ?? {} };
|
|
1674
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
1675
|
+
try {
|
|
1676
|
+
const data = await apiFetch(config, "/api/auth/accounts", {
|
|
1677
|
+
credentials: "include",
|
|
1678
|
+
...options,
|
|
1679
|
+
headers
|
|
1680
|
+
});
|
|
1681
|
+
return data.accounts;
|
|
1682
|
+
} catch {
|
|
1683
|
+
return [];
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
// src/query/hooks/use-accounts.ts
|
|
1688
|
+
function useAccounts(options) {
|
|
1689
|
+
const config = useSifaConfig();
|
|
1690
|
+
return reactQuery.useQuery({
|
|
1691
|
+
queryKey: sifaQueryKeys.auth.accounts(),
|
|
1692
|
+
queryFn: () => fetchAccounts(config),
|
|
1693
|
+
...options
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1665
1697
|
// src/query/fetchers/search.ts
|
|
1666
1698
|
var EMPTY_SEARCH = { profiles: [], total: 0, limit: 20, offset: 0 };
|
|
1667
1699
|
var EMPTY_FILTERS = { countries: [], industries: [], apps: [], openTo: [] };
|
|
@@ -3232,6 +3264,7 @@ function useDeleteInvestment(ownerDid, options) {
|
|
|
3232
3264
|
|
|
3233
3265
|
exports.SifaProvider = SifaProvider;
|
|
3234
3266
|
exports.sifaQueryKeys = sifaQueryKeys;
|
|
3267
|
+
exports.useAccounts = useAccounts;
|
|
3235
3268
|
exports.useActivityFeed = useActivityFeed;
|
|
3236
3269
|
exports.useActivityTeaser = useActivityTeaser;
|
|
3237
3270
|
exports.useAddFeatureAllowlist = useAddFeatureAllowlist;
|