@singi-labs/sifa-sdk 0.12.91 → 0.12.92
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/{network-map-y6U7m-hX.d.cts → network-map-BcugllI5.d.cts} +1 -1
- package/dist/{network-map-GfIVEYpr.d.ts → network-map-C3KyOHRU.d.ts} +1 -1
- 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 +32 -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 +31 -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 +41 -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 +39 -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
package/dist/query/index.cjs
CHANGED
|
@@ -744,6 +744,30 @@ async function fetchHiddenApps(config, options = {}) {
|
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
+
// src/query/fetchers/accounts.ts
|
|
748
|
+
async function fetchAccounts(config, options = {}) {
|
|
749
|
+
const headers = { ...options.headers ?? {} };
|
|
750
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
751
|
+
try {
|
|
752
|
+
const data = await apiFetch(config, "/api/auth/accounts", {
|
|
753
|
+
credentials: "include",
|
|
754
|
+
...options,
|
|
755
|
+
headers
|
|
756
|
+
});
|
|
757
|
+
return data.accounts;
|
|
758
|
+
} catch {
|
|
759
|
+
return [];
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
async function switchAccount(config, did, options = {}) {
|
|
763
|
+
await apiFetch(config, "/oauth/switch", {
|
|
764
|
+
method: "POST",
|
|
765
|
+
body: { did },
|
|
766
|
+
credentials: "include",
|
|
767
|
+
...options
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
|
|
747
771
|
// src/query/fetchers/search.ts
|
|
748
772
|
var EMPTY_SEARCH = { profiles: [], total: 0, limit: 20, offset: 0 };
|
|
749
773
|
var EMPTY_FILTERS = { countries: [], industries: [], apps: [], openTo: [] };
|
|
@@ -1585,6 +1609,12 @@ var sifaQueryKeys = {
|
|
|
1585
1609
|
registry: () => ["sifa", "apps", "registry"],
|
|
1586
1610
|
hidden: () => ["sifa", "apps", "hidden"]
|
|
1587
1611
|
},
|
|
1612
|
+
auth: {
|
|
1613
|
+
all: () => ["sifa", "auth"],
|
|
1614
|
+
// Session-scoped: the AppView reads the account list from the browser's
|
|
1615
|
+
// cookies, so there is only ever one list per client.
|
|
1616
|
+
accounts: () => ["sifa", "auth", "accounts"]
|
|
1617
|
+
},
|
|
1588
1618
|
activity: {
|
|
1589
1619
|
all: () => ["sifa", "activity"],
|
|
1590
1620
|
heatmap: (handleOrDid, days) => ["sifa", "activity", "heatmap", handleOrDid, days],
|
|
@@ -2617,6 +2647,14 @@ function useHiddenApps(options) {
|
|
|
2617
2647
|
...options
|
|
2618
2648
|
});
|
|
2619
2649
|
}
|
|
2650
|
+
function useAccounts(options) {
|
|
2651
|
+
const config = useSifaConfig();
|
|
2652
|
+
return reactQuery.useQuery({
|
|
2653
|
+
queryKey: sifaQueryKeys.auth.accounts(),
|
|
2654
|
+
queryFn: () => fetchAccounts(config),
|
|
2655
|
+
...options
|
|
2656
|
+
});
|
|
2657
|
+
}
|
|
2620
2658
|
function useSearchProfiles(filters, options) {
|
|
2621
2659
|
const config = useSifaConfig();
|
|
2622
2660
|
return reactQuery.useQuery({
|
|
@@ -3381,6 +3419,7 @@ exports.deleteSkill = deleteSkill;
|
|
|
3381
3419
|
exports.dismissConfirmation = dismissConfirmation;
|
|
3382
3420
|
exports.dismissEndorsement = dismissEndorsement;
|
|
3383
3421
|
exports.effectiveContentVisibility = effectiveContentVisibility;
|
|
3422
|
+
exports.fetchAccounts = fetchAccounts;
|
|
3384
3423
|
exports.fetchActivityFeed = fetchActivityFeed;
|
|
3385
3424
|
exports.fetchActivityTeaser = fetchActivityTeaser;
|
|
3386
3425
|
exports.fetchAppsRegistry = fetchAppsRegistry;
|
|
@@ -3455,6 +3494,7 @@ exports.setPositionPrimary = setPositionPrimary;
|
|
|
3455
3494
|
exports.shouldGateAdultMedia = shouldGateAdultMedia;
|
|
3456
3495
|
exports.sifaQueryKeys = sifaQueryKeys;
|
|
3457
3496
|
exports.submitOrgClaim = submitOrgClaim;
|
|
3497
|
+
exports.switchAccount = switchAccount;
|
|
3458
3498
|
exports.unfollowUser = unfollowUser;
|
|
3459
3499
|
exports.unhideKeytraceClaim = unhideKeytraceClaim;
|
|
3460
3500
|
exports.unhideOrcidPublication = unhideOrcidPublication;
|
|
@@ -3478,6 +3518,7 @@ exports.updateSkill = updateSkill;
|
|
|
3478
3518
|
exports.updateSkillSubCategories = updateSkillSubCategories;
|
|
3479
3519
|
exports.uploadAvatar = uploadAvatar;
|
|
3480
3520
|
exports.uploadNamePronunciationAudio = uploadNamePronunciationAudio;
|
|
3521
|
+
exports.useAccounts = useAccounts;
|
|
3481
3522
|
exports.useActivityFeed = useActivityFeed;
|
|
3482
3523
|
exports.useActivityTeaser = useActivityTeaser;
|
|
3483
3524
|
exports.useAddFeatureAllowlist = useAddFeatureAllowlist;
|