@singi-labs/sifa-sdk 0.10.17 → 0.11.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 +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/{keys-CMaEcp0g.d.cts → keys-BDzlCEo1.d.cts} +41 -3
- package/dist/{keys-B_Z735bY.d.ts → keys-D1qvOp5Q.d.ts} +41 -3
- package/dist/query/fetchers/index.cjs +30 -2
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +2 -2
- package/dist/query/fetchers/index.d.ts +2 -2
- package/dist/query/fetchers/index.js +30 -2
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +31 -3
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +10 -4
- package/dist/query/hooks/index.d.ts +10 -4
- package/dist/query/hooks/index.js +31 -3
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +31 -3
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +2 -2
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +31 -3
- package/dist/query/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions,
|
|
2
|
-
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as
|
|
1
|
+
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from '../../keys-BDzlCEo1.cjs';
|
|
2
|
+
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, s as sifaQueryKeys, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../../keys-BDzlCEo1.cjs';
|
|
3
3
|
import { c as Profile, r as ProfilePosition, w as SkillRef } from '../../adult-content-o0BxhFzc.cjs';
|
|
4
4
|
import '../../feed-DHTy7fUN.cjs';
|
|
5
5
|
import 'zod';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions,
|
|
2
|
-
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as
|
|
1
|
+
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from '../../keys-D1qvOp5Q.js';
|
|
2
|
+
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, s as sifaQueryKeys, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../../keys-D1qvOp5Q.js';
|
|
3
3
|
import { c as Profile, r as ProfilePosition, w as SkillRef } from '../../adult-content-o0BxhFzc.js';
|
|
4
4
|
import '../../feed-DHTy7fUN.js';
|
|
5
5
|
import 'zod';
|
|
@@ -1014,8 +1014,36 @@ async function fetchMyRoadmapVotes(config, options = {}) {
|
|
|
1014
1014
|
return [];
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
function castRoadmapVote(config, key, options = {}) {
|
|
1018
|
-
|
|
1017
|
+
async function castRoadmapVote(config, key, options = {}) {
|
|
1018
|
+
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
1019
|
+
const url = `${config.baseUrl}/api/roadmap/votes/${encodeURIComponent(key)}`;
|
|
1020
|
+
try {
|
|
1021
|
+
const res = await fetchFn(url, {
|
|
1022
|
+
method: "POST",
|
|
1023
|
+
headers: { "Content-Type": "application/json", ...options.headers ?? {} },
|
|
1024
|
+
credentials: options.credentials ?? "include",
|
|
1025
|
+
signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 1e4)
|
|
1026
|
+
});
|
|
1027
|
+
if (!res.ok) {
|
|
1028
|
+
if (res.status === 403) {
|
|
1029
|
+
try {
|
|
1030
|
+
const body = await res.json();
|
|
1031
|
+
if (body.error === "ScopeInsufficient") {
|
|
1032
|
+
return {
|
|
1033
|
+
ok: false,
|
|
1034
|
+
error: { type: "scope_insufficient", requiredScope: body.requiredScope }
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1037
|
+
} catch {
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
return { ok: false, error: { type: "error" } };
|
|
1041
|
+
}
|
|
1042
|
+
const data = await res.json();
|
|
1043
|
+
return { ok: true, data };
|
|
1044
|
+
} catch {
|
|
1045
|
+
return { ok: false, error: { type: "error" } };
|
|
1046
|
+
}
|
|
1019
1047
|
}
|
|
1020
1048
|
function retractRoadmapVote(config, key, options = {}) {
|
|
1021
1049
|
return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "DELETE", options);
|