@singi-labs/sifa-sdk 0.10.18 → 0.11.1

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.
@@ -1,5 +1,5 @@
1
- import { S as SifaApiConfig, A as ApiFetchOptions, i as CreateResult, W as WriteResult } from '../../keys-CMaEcp0g.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 CheckAppAccountOptions, h as CreateExternalAccountResult, D as DeleteAccountResult, E as EndorsementInput, j as ExternalAccountInput, F as FeatureAllowlistResponse, k as FeaturedProfile, l as FetchActivityFeedOptions, m as FetchActivityTeaserOptions, n as FetchFollowListOptions, o as FetchFollowProfilePageOptions, p as FetchFollowingFeedOptions, q as FetchHiddenAppsOptions, r as FetchMyRoadmapVotesOptions, t as FetchReactionStatusOptions, u as FetchSuggestionsOptions, v as FilterOptions, w as FollowListPage, x as FollowProfile, y as FollowProfilePageResponse, z as FollowUserResult, G as FollowingResponse, H as HIDDEN_ITEM_SOURCES, I as HIDDEN_ITEM_TYPES, J as HeatmapDay, K as HeatmapResponse, L as HiddenApp, M as HiddenItemSource, N as HiddenItemType, O as HideProfileItemInput, P as ListFeatureAllowlistOptions, Q as ProfileIndustryInput, R as ProfileLocationAddress, T as ProfileLocationInput, U as ProfileSearchResult, V as ProfileSelfLocation, X as QUOTED_POSTS_BATCH_MAX, Y as QuotedPostAuthor, Z as QuotedPostImage, _ as QuotedPostResult, $ as QuotedPostView, a0 as ReactionError, a1 as ReactionResult, a2 as ReactionStatus, a3 as RefreshOrcidPublicationsResult, a4 as RefreshPdsResult, a5 as ResolveQuotedPostsOptions, a6 as RoadmapVoter, a7 as RoadmapVotesResponse, a8 as SearchFilters, a9 as SearchResponse, aa as SifaQueryKey, ab as SimilarProfile, ac as SkillSearchResult, ad as StatsResponse, ae as SuggestionProfile, af as SuggestionsResponse, ag as UpdateProfileOverrideInput, ah as UpdateProfileSelfInput, ai as UploadAvatarResult, aj as VerifyExternalAccountResult, ak as addFeatureAllowlist, al as apiFetch, am as apiFetchOrNull, an as apiWrite, ao as apiWriteCreate, ap as bulkHideProfileItems, aq as bulkHideStandardPublications, ar as bulkUnhideProfileItems, as as bulkUnhideStandardPublications, at as castRoadmapVote, au as checkAppAccount, av as createEndorsement, aw as createExternalAccount, ax as createProfileLocation, ay as createReaction, az as deleteAccount, aA as deleteAvatarOverride, aB as deleteExternalAccount, aC as deleteProfileLocation, aD as deleteReaction, aE as fetchActivityFeed, aF as fetchActivityTeaser, aG as fetchAppsRegistry, aH as fetchExternalAccounts, aI as fetchFeaturedProfile, aJ as fetchFollowing, aK as fetchHeatmapData, aL as fetchHiddenApps, aM as fetchMyRoadmapVotes, aN as fetchReactionStatus, aO as fetchRoadmapVotes, aP as fetchSearchFilters, aQ as fetchSearchProfiles, aR as fetchSimilarProfiles, aS as fetchSkillSuggestions, aT as fetchStats, aU as fetchSuggestionCount, aV as fetchSuggestions, aW as followUser, aX as getBlueskySuggestions, aY as getFollowers, aZ as getFollowing, a_ as getFollowingFeed, a$ as getMutuals, b0 as hideOrcidPublication, b1 as hideProfileItem, b2 as hideSifaPublication, b3 as hideStandardPublication, b4 as listFeatureAllowlist, b5 as refreshOrcidPublications, b6 as refreshPds, b7 as removeFeatureAllowlist, b8 as resetProfile, b9 as resolveQuotedPosts, ba as retractRoadmapVote, bb as searchSkills, bc as setExternalAccountPrimary, s as sifaQueryKeys, bd as unfollowUser, be as unhideOrcidPublication, bf as unhideProfileItem, bg as unhideSifaPublication, bh as unhideStandardPublication, bi as unsetExternalAccountPrimary, bj as updateExternalAccount, bk as updateProfileLocation, bl as updateProfileOverride, bm as updateProfileSelf, bn as uploadAvatar, bo as verifyExternalAccount } from '../../keys-CMaEcp0g.cjs';
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, i as CreateResult, W as WriteResult } from '../../keys-B_Z735bY.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 CheckAppAccountOptions, h as CreateExternalAccountResult, D as DeleteAccountResult, E as EndorsementInput, j as ExternalAccountInput, F as FeatureAllowlistResponse, k as FeaturedProfile, l as FetchActivityFeedOptions, m as FetchActivityTeaserOptions, n as FetchFollowListOptions, o as FetchFollowProfilePageOptions, p as FetchFollowingFeedOptions, q as FetchHiddenAppsOptions, r as FetchMyRoadmapVotesOptions, t as FetchReactionStatusOptions, u as FetchSuggestionsOptions, v as FilterOptions, w as FollowListPage, x as FollowProfile, y as FollowProfilePageResponse, z as FollowUserResult, G as FollowingResponse, H as HIDDEN_ITEM_SOURCES, I as HIDDEN_ITEM_TYPES, J as HeatmapDay, K as HeatmapResponse, L as HiddenApp, M as HiddenItemSource, N as HiddenItemType, O as HideProfileItemInput, P as ListFeatureAllowlistOptions, Q as ProfileIndustryInput, R as ProfileLocationAddress, T as ProfileLocationInput, U as ProfileSearchResult, V as ProfileSelfLocation, X as QUOTED_POSTS_BATCH_MAX, Y as QuotedPostAuthor, Z as QuotedPostImage, _ as QuotedPostResult, $ as QuotedPostView, a0 as ReactionError, a1 as ReactionResult, a2 as ReactionStatus, a3 as RefreshOrcidPublicationsResult, a4 as RefreshPdsResult, a5 as ResolveQuotedPostsOptions, a6 as RoadmapVoter, a7 as RoadmapVotesResponse, a8 as SearchFilters, a9 as SearchResponse, aa as SifaQueryKey, ab as SimilarProfile, ac as SkillSearchResult, ad as StatsResponse, ae as SuggestionProfile, af as SuggestionsResponse, ag as UpdateProfileOverrideInput, ah as UpdateProfileSelfInput, ai as UploadAvatarResult, aj as VerifyExternalAccountResult, ak as addFeatureAllowlist, al as apiFetch, am as apiFetchOrNull, an as apiWrite, ao as apiWriteCreate, ap as bulkHideProfileItems, aq as bulkHideStandardPublications, ar as bulkUnhideProfileItems, as as bulkUnhideStandardPublications, at as castRoadmapVote, au as checkAppAccount, av as createEndorsement, aw as createExternalAccount, ax as createProfileLocation, ay as createReaction, az as deleteAccount, aA as deleteAvatarOverride, aB as deleteExternalAccount, aC as deleteProfileLocation, aD as deleteReaction, aE as fetchActivityFeed, aF as fetchActivityTeaser, aG as fetchAppsRegistry, aH as fetchExternalAccounts, aI as fetchFeaturedProfile, aJ as fetchFollowing, aK as fetchHeatmapData, aL as fetchHiddenApps, aM as fetchMyRoadmapVotes, aN as fetchReactionStatus, aO as fetchRoadmapVotes, aP as fetchSearchFilters, aQ as fetchSearchProfiles, aR as fetchSimilarProfiles, aS as fetchSkillSuggestions, aT as fetchStats, aU as fetchSuggestionCount, aV as fetchSuggestions, aW as followUser, aX as getBlueskySuggestions, aY as getFollowers, aZ as getFollowing, a_ as getFollowingFeed, a$ as getMutuals, b0 as hideOrcidPublication, b1 as hideProfileItem, b2 as hideSifaPublication, b3 as hideStandardPublication, b4 as listFeatureAllowlist, b5 as refreshOrcidPublications, b6 as refreshPds, b7 as removeFeatureAllowlist, b8 as resetProfile, b9 as resolveQuotedPosts, ba as retractRoadmapVote, bb as searchSkills, bc as setExternalAccountPrimary, s as sifaQueryKeys, bd as unfollowUser, be as unhideOrcidPublication, bf as unhideProfileItem, bg as unhideSifaPublication, bh as unhideStandardPublication, bi as unsetExternalAccountPrimary, bj as updateExternalAccount, bk as updateProfileLocation, bl as updateProfileOverride, bm as updateProfileSelf, bn as uploadAvatar, bo as verifyExternalAccount } from '../../keys-B_Z735bY.js';
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
- return apiWrite(config, `/api/roadmap/votes/${encodeURIComponent(key)}`, "POST", options);
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);