@singi-labs/sifa-sdk 0.9.9 → 0.9.11
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-De8hX7ZH.d.cts → index-SmYL2LUp.d.cts} +8 -0
- package/dist/{index-De8hX7ZH.d.ts → index-SmYL2LUp.d.ts} +8 -0
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/query/fetchers/index.cjs +33 -0
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +31 -2
- package/dist/query/fetchers/index.d.ts +31 -2
- package/dist/query/fetchers/index.js +28 -1
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/index.cjs +70 -0
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +17 -4
- package/dist/query/index.d.ts +17 -4
- package/dist/query/index.js +61 -1
- package/dist/query/index.js.map +1 -1
- package/package.json +1 -1
package/dist/query/index.cjs
CHANGED
|
@@ -437,6 +437,33 @@ async function refreshOrcidPublications(config, options = {}) {
|
|
|
437
437
|
return result;
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
+
// src/query/fetchers/profile-items-hide.ts
|
|
441
|
+
var HIDDEN_ITEM_TYPES = [
|
|
442
|
+
"position",
|
|
443
|
+
"education",
|
|
444
|
+
"certification",
|
|
445
|
+
"project",
|
|
446
|
+
"volunteering",
|
|
447
|
+
"publication",
|
|
448
|
+
"course",
|
|
449
|
+
"honor",
|
|
450
|
+
"language",
|
|
451
|
+
"externalAccount"
|
|
452
|
+
];
|
|
453
|
+
var HIDDEN_ITEM_SOURCES = ["pds", "standard", "orcid"];
|
|
454
|
+
function hideProfileItem(config, input, options = {}) {
|
|
455
|
+
return apiWrite(config, "/api/profile/items/hide", "POST", { ...options, body: input });
|
|
456
|
+
}
|
|
457
|
+
function unhideProfileItem(config, input, options = {}) {
|
|
458
|
+
return apiWrite(config, "/api/profile/items/hide", "DELETE", { ...options, body: input });
|
|
459
|
+
}
|
|
460
|
+
function bulkHideProfileItems(config, input, options = {}) {
|
|
461
|
+
return apiWrite(config, "/api/profile/items/bulk-hide", "POST", { ...options, body: input });
|
|
462
|
+
}
|
|
463
|
+
function bulkUnhideProfileItems(config, input, options = {}) {
|
|
464
|
+
return apiWrite(config, "/api/profile/items/bulk-hide", "DELETE", { ...options, body: input });
|
|
465
|
+
}
|
|
466
|
+
|
|
440
467
|
// src/query/fetchers/stats.ts
|
|
441
468
|
async function fetchStats(config, options = {}) {
|
|
442
469
|
try {
|
|
@@ -1557,6 +1584,39 @@ function useRefreshOrcidPublications(ownerHandleOrDid, options) {
|
|
|
1557
1584
|
...options
|
|
1558
1585
|
});
|
|
1559
1586
|
}
|
|
1587
|
+
async function invalidateProfile8(queryClient, ownerHandleOrDid) {
|
|
1588
|
+
await queryClient.invalidateQueries({
|
|
1589
|
+
queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1592
|
+
function makeWriteHook2(fetcher) {
|
|
1593
|
+
return function useHook(ownerHandleOrDid, options) {
|
|
1594
|
+
const config = useSifaConfig();
|
|
1595
|
+
const queryClient = reactQuery.useQueryClient();
|
|
1596
|
+
return reactQuery.useMutation({
|
|
1597
|
+
mutationFn: (v) => fetcher(config, v),
|
|
1598
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
1599
|
+
if (result.success) {
|
|
1600
|
+
await invalidateProfile8(queryClient, ownerHandleOrDid);
|
|
1601
|
+
}
|
|
1602
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
1603
|
+
},
|
|
1604
|
+
...options
|
|
1605
|
+
});
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
var useHideProfileItem = makeWriteHook2(
|
|
1609
|
+
(config, input) => hideProfileItem(config, input)
|
|
1610
|
+
);
|
|
1611
|
+
var useUnhideProfileItem = makeWriteHook2(
|
|
1612
|
+
(config, input) => unhideProfileItem(config, input)
|
|
1613
|
+
);
|
|
1614
|
+
var useBulkHideProfileItems = makeWriteHook2(
|
|
1615
|
+
(config, input) => bulkHideProfileItems(config, input)
|
|
1616
|
+
);
|
|
1617
|
+
var useBulkUnhideProfileItems = makeWriteHook2(
|
|
1618
|
+
(config, input) => bulkUnhideProfileItems(config, input)
|
|
1619
|
+
);
|
|
1560
1620
|
function useStats(options) {
|
|
1561
1621
|
const config = useSifaConfig();
|
|
1562
1622
|
return reactQuery.useQuery({
|
|
@@ -1824,13 +1884,17 @@ function useDeleteAccount(options) {
|
|
|
1824
1884
|
}
|
|
1825
1885
|
|
|
1826
1886
|
exports.ApiError = ApiError;
|
|
1887
|
+
exports.HIDDEN_ITEM_SOURCES = HIDDEN_ITEM_SOURCES;
|
|
1888
|
+
exports.HIDDEN_ITEM_TYPES = HIDDEN_ITEM_TYPES;
|
|
1827
1889
|
exports.QUOTED_POSTS_BATCH_MAX = QUOTED_POSTS_BATCH_MAX;
|
|
1828
1890
|
exports.SifaProvider = SifaProvider;
|
|
1829
1891
|
exports.apiFetch = apiFetch;
|
|
1830
1892
|
exports.apiFetchOrNull = apiFetchOrNull;
|
|
1831
1893
|
exports.apiWrite = apiWrite;
|
|
1832
1894
|
exports.apiWriteCreate = apiWriteCreate;
|
|
1895
|
+
exports.bulkHideProfileItems = bulkHideProfileItems;
|
|
1833
1896
|
exports.bulkHideStandardPublications = bulkHideStandardPublications;
|
|
1897
|
+
exports.bulkUnhideProfileItems = bulkUnhideProfileItems;
|
|
1834
1898
|
exports.bulkUnhideStandardPublications = bulkUnhideStandardPublications;
|
|
1835
1899
|
exports.castRoadmapVote = castRoadmapVote;
|
|
1836
1900
|
exports.checkAppAccount = checkAppAccount;
|
|
@@ -1877,6 +1941,7 @@ exports.fetchSuggestionCount = fetchSuggestionCount;
|
|
|
1877
1941
|
exports.fetchSuggestions = fetchSuggestions;
|
|
1878
1942
|
exports.hideKeytraceClaim = hideKeytraceClaim;
|
|
1879
1943
|
exports.hideOrcidPublication = hideOrcidPublication;
|
|
1944
|
+
exports.hideProfileItem = hideProfileItem;
|
|
1880
1945
|
exports.hideSifaPublication = hideSifaPublication;
|
|
1881
1946
|
exports.hideStandardPublication = hideStandardPublication;
|
|
1882
1947
|
exports.initiateNetworkMapGeneration = initiateNetworkMapGeneration;
|
|
@@ -1893,6 +1958,7 @@ exports.setPositionPrimary = setPositionPrimary;
|
|
|
1893
1958
|
exports.sifaQueryKeys = sifaQueryKeys;
|
|
1894
1959
|
exports.unhideKeytraceClaim = unhideKeytraceClaim;
|
|
1895
1960
|
exports.unhideOrcidPublication = unhideOrcidPublication;
|
|
1961
|
+
exports.unhideProfileItem = unhideProfileItem;
|
|
1896
1962
|
exports.unhideSifaPublication = unhideSifaPublication;
|
|
1897
1963
|
exports.unhideStandardPublication = unhideStandardPublication;
|
|
1898
1964
|
exports.unlinkSkillFromPosition = unlinkSkillFromPosition;
|
|
@@ -1912,7 +1978,9 @@ exports.useActivityTeaser = useActivityTeaser;
|
|
|
1912
1978
|
exports.useAppAccountCheck = useAppAccountCheck;
|
|
1913
1979
|
exports.useAppsRegistry = useAppsRegistry;
|
|
1914
1980
|
exports.useAtFundLink = useAtFundLink;
|
|
1981
|
+
exports.useBulkHideProfileItems = useBulkHideProfileItems;
|
|
1915
1982
|
exports.useBulkHideStandardPublications = useBulkHideStandardPublications;
|
|
1983
|
+
exports.useBulkUnhideProfileItems = useBulkUnhideProfileItems;
|
|
1916
1984
|
exports.useBulkUnhideStandardPublications = useBulkUnhideStandardPublications;
|
|
1917
1985
|
exports.useCanonicalSkillSearch = useCanonicalSkillSearch;
|
|
1918
1986
|
exports.useCastRoadmapVote = useCastRoadmapVote;
|
|
@@ -1941,6 +2009,7 @@ exports.useHeatmapData = useHeatmapData;
|
|
|
1941
2009
|
exports.useHiddenApps = useHiddenApps;
|
|
1942
2010
|
exports.useHideKeytraceClaim = useHideKeytraceClaim;
|
|
1943
2011
|
exports.useHideOrcidPublication = useHideOrcidPublication;
|
|
2012
|
+
exports.useHideProfileItem = useHideProfileItem;
|
|
1944
2013
|
exports.useHideSifaPublication = useHideSifaPublication;
|
|
1945
2014
|
exports.useHideStandardPublication = useHideStandardPublication;
|
|
1946
2015
|
exports.useLinkSkillToPosition = useLinkSkillToPosition;
|
|
@@ -1965,6 +2034,7 @@ exports.useSuggestionCount = useSuggestionCount;
|
|
|
1965
2034
|
exports.useSuggestions = useSuggestions;
|
|
1966
2035
|
exports.useUnhideKeytraceClaim = useUnhideKeytraceClaim;
|
|
1967
2036
|
exports.useUnhideOrcidPublication = useUnhideOrcidPublication;
|
|
2037
|
+
exports.useUnhideProfileItem = useUnhideProfileItem;
|
|
1968
2038
|
exports.useUnhideSifaPublication = useUnhideSifaPublication;
|
|
1969
2039
|
exports.useUnhideStandardPublication = useUnhideStandardPublication;
|
|
1970
2040
|
exports.useUnlinkSkillFromPosition = useUnlinkSkillFromPosition;
|