@singi-labs/sifa-sdk 0.10.14 → 0.10.16
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/{adult-content-DxasJdot.d.cts → adult-content-o0BxhFzc.d.cts} +1 -1
- package/dist/{adult-content-DxasJdot.d.ts → adult-content-o0BxhFzc.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{keys-Bnvbkxoc.d.ts → keys-B_Z735bY.d.ts} +1 -1
- package/dist/{keys-0h1sHtHX.d.cts → keys-CMaEcp0g.d.cts} +1 -1
- package/dist/query/fetchers/index.cjs +23 -15
- 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 +23 -15
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +23 -15
- 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 +23 -15
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +23 -15
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +23 -15
- package/dist/query/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions, i as CreateResult, W as WriteResult } from '../../keys-
|
|
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-
|
|
3
|
-
import { c as Profile, r as ProfilePosition, w as SkillRef } from '../../adult-content-
|
|
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';
|
|
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';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions, i as CreateResult, W as WriteResult } from '../../keys-
|
|
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-
|
|
3
|
-
import { c as Profile, r as ProfilePosition, w as SkillRef } from '../../adult-content-
|
|
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';
|
|
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';
|
|
6
6
|
|
|
@@ -12,6 +12,14 @@ var ApiError = class extends Error {
|
|
|
12
12
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
13
13
|
var MAX_RATE_LIMIT_RETRIES = 3;
|
|
14
14
|
var RATE_LIMIT_RETRY_CAP_SECONDS = 3;
|
|
15
|
+
function encodeIdentifier(value) {
|
|
16
|
+
let decoded = value;
|
|
17
|
+
try {
|
|
18
|
+
decoded = decodeURIComponent(value);
|
|
19
|
+
} catch {
|
|
20
|
+
}
|
|
21
|
+
return encodeURIComponent(decoded);
|
|
22
|
+
}
|
|
15
23
|
async function apiFetch(config, path, options = {}) {
|
|
16
24
|
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
17
25
|
const url = `${config.baseUrl}${path}`;
|
|
@@ -100,14 +108,14 @@ function apiWriteCreate(config, path, body, options = {}) {
|
|
|
100
108
|
|
|
101
109
|
// src/query/fetchers/profile.ts
|
|
102
110
|
function fetchProfile(config, handleOrDid, options = {}) {
|
|
103
|
-
const path = `/api/profile/${
|
|
111
|
+
const path = `/api/profile/${encodeIdentifier(handleOrDid)}`;
|
|
104
112
|
return apiFetchOrNull(config, path, {
|
|
105
113
|
retryOn429: true,
|
|
106
114
|
...options
|
|
107
115
|
});
|
|
108
116
|
}
|
|
109
117
|
async function fetchAtFundLink(config, did, options = {}) {
|
|
110
|
-
const path = `/api/profiles/${
|
|
118
|
+
const path = `/api/profiles/${encodeIdentifier(did)}/at-fund-link`;
|
|
111
119
|
try {
|
|
112
120
|
const data = await apiFetch(config, path, {
|
|
113
121
|
next: { revalidate: 3600 },
|
|
@@ -283,7 +291,7 @@ function deleteProfileLocation(config, rkey, options = {}) {
|
|
|
283
291
|
|
|
284
292
|
// src/query/fetchers/external-accounts.ts
|
|
285
293
|
async function fetchExternalAccounts(config, handleOrDid, options = {}) {
|
|
286
|
-
const path = `/api/profile/${
|
|
294
|
+
const path = `/api/profile/${encodeIdentifier(handleOrDid)}/external-accounts`;
|
|
287
295
|
try {
|
|
288
296
|
const data = await apiFetch(config, path, {
|
|
289
297
|
credentials: "include",
|
|
@@ -543,7 +551,7 @@ async function searchSkills(config, query, limit = 10, options = {}) {
|
|
|
543
551
|
// src/query/fetchers/discovery.ts
|
|
544
552
|
async function fetchSimilarProfiles(config, did, opts = {}) {
|
|
545
553
|
const limit = opts.limit ?? 5;
|
|
546
|
-
const path = `/api/discover/similar/${
|
|
554
|
+
const path = `/api/discover/similar/${encodeIdentifier(did)}?limit=${limit}`;
|
|
547
555
|
try {
|
|
548
556
|
const data = await apiFetch(config, path, {
|
|
549
557
|
next: { revalidate: 300 },
|
|
@@ -621,7 +629,7 @@ function followUser(config, handle, opts = {}) {
|
|
|
621
629
|
const { note, ...rest } = opts;
|
|
622
630
|
return apiWrite(
|
|
623
631
|
config,
|
|
624
|
-
`/api/follow/${
|
|
632
|
+
`/api/follow/${encodeIdentifier(handle)}`,
|
|
625
633
|
"POST",
|
|
626
634
|
{
|
|
627
635
|
body: note !== void 0 ? { note } : void 0,
|
|
@@ -630,7 +638,7 @@ function followUser(config, handle, opts = {}) {
|
|
|
630
638
|
);
|
|
631
639
|
}
|
|
632
640
|
function unfollowUser(config, handle, opts = {}) {
|
|
633
|
-
return apiWrite(config, `/api/follow/${
|
|
641
|
+
return apiWrite(config, `/api/follow/${encodeIdentifier(handle)}`, "DELETE", opts);
|
|
634
642
|
}
|
|
635
643
|
function buildListPath(prefix, opts) {
|
|
636
644
|
const params = new URLSearchParams();
|
|
@@ -645,7 +653,7 @@ async function getFollowers(config, handle, opts = {}) {
|
|
|
645
653
|
try {
|
|
646
654
|
const res = await apiFetch(
|
|
647
655
|
config,
|
|
648
|
-
buildListPath(`/api/profile/${
|
|
656
|
+
buildListPath(`/api/profile/${encodeIdentifier(handle)}/followers`, opts),
|
|
649
657
|
{ credentials: "include", cache: "no-store", ...opts, headers }
|
|
650
658
|
);
|
|
651
659
|
return { follows: res.follows, cursor: res.cursor ?? null };
|
|
@@ -659,7 +667,7 @@ async function getFollowing(config, handle, opts = {}) {
|
|
|
659
667
|
try {
|
|
660
668
|
const res = await apiFetch(
|
|
661
669
|
config,
|
|
662
|
-
buildListPath(`/api/profile/${
|
|
670
|
+
buildListPath(`/api/profile/${encodeIdentifier(handle)}/following`, opts),
|
|
663
671
|
{ credentials: "include", cache: "no-store", ...opts, headers }
|
|
664
672
|
);
|
|
665
673
|
return { follows: res.follows, cursor: res.cursor ?? null };
|
|
@@ -714,7 +722,7 @@ async function fetchFollowProfilePage(config, path, opts) {
|
|
|
714
722
|
async function getMutuals(config, handleOrDid, opts = {}) {
|
|
715
723
|
return fetchFollowProfilePage(
|
|
716
724
|
config,
|
|
717
|
-
buildListPath2(`/api/profile/${
|
|
725
|
+
buildListPath2(`/api/profile/${encodeIdentifier(handleOrDid)}/mutuals`, opts),
|
|
718
726
|
opts
|
|
719
727
|
);
|
|
720
728
|
}
|
|
@@ -747,7 +755,7 @@ function addFeatureAllowlist(config, flag, did, opts = {}) {
|
|
|
747
755
|
function removeFeatureAllowlist(config, flag, did, opts = {}) {
|
|
748
756
|
return apiWrite(
|
|
749
757
|
config,
|
|
750
|
-
`/api/admin/feature-allowlists/${encodeURIComponent(flag)}/${
|
|
758
|
+
`/api/admin/feature-allowlists/${encodeURIComponent(flag)}/${encodeIdentifier(did)}`,
|
|
751
759
|
"DELETE",
|
|
752
760
|
opts
|
|
753
761
|
);
|
|
@@ -755,7 +763,7 @@ function removeFeatureAllowlist(config, flag, did, opts = {}) {
|
|
|
755
763
|
|
|
756
764
|
// src/query/fetchers/activity.ts
|
|
757
765
|
async function fetchHeatmapData(config, handleOrDid, days, options = {}) {
|
|
758
|
-
const path = `/api/activity/${
|
|
766
|
+
const path = `/api/activity/${encodeIdentifier(handleOrDid)}/heatmap?days=${days}`;
|
|
759
767
|
try {
|
|
760
768
|
return await apiFetch(config, path, {
|
|
761
769
|
next: { revalidate: 900, tags: [`heatmap-${handleOrDid}`] },
|
|
@@ -771,7 +779,7 @@ async function fetchActivityTeaser(config, handleOrDid, options = {}) {
|
|
|
771
779
|
try {
|
|
772
780
|
return await apiFetch(
|
|
773
781
|
config,
|
|
774
|
-
`/api/activity/${
|
|
782
|
+
`/api/activity/${encodeIdentifier(handleOrDid)}/teaser`,
|
|
775
783
|
{
|
|
776
784
|
credentials: "include",
|
|
777
785
|
timeoutMs: 8e3,
|
|
@@ -795,7 +803,7 @@ async function fetchActivityFeed(config, handleOrDid, options = {}) {
|
|
|
795
803
|
try {
|
|
796
804
|
return await apiFetch(
|
|
797
805
|
config,
|
|
798
|
-
`/api/activity/${
|
|
806
|
+
`/api/activity/${encodeIdentifier(handleOrDid)}${qs ? `?${qs}` : ""}`,
|
|
799
807
|
{
|
|
800
808
|
credentials: "include",
|
|
801
809
|
cache: "no-store",
|
|
@@ -810,7 +818,7 @@ async function fetchActivityFeed(config, handleOrDid, options = {}) {
|
|
|
810
818
|
|
|
811
819
|
// src/query/fetchers/endorsement.ts
|
|
812
820
|
async function fetchEndorsementCount(config, did, options = {}) {
|
|
813
|
-
const path = `/api/endorsement/${
|
|
821
|
+
const path = `/api/endorsement/${encodeIdentifier(did)}`;
|
|
814
822
|
try {
|
|
815
823
|
const data = await apiFetch(config, path, {
|
|
816
824
|
cache: "no-store",
|
|
@@ -834,7 +842,7 @@ async function fetchNetworkStreamCount(config, did, options = {}) {
|
|
|
834
842
|
try {
|
|
835
843
|
const data = await apiFetch(
|
|
836
844
|
config,
|
|
837
|
-
`/api/stream/network?did=${
|
|
845
|
+
`/api/stream/network?did=${encodeIdentifier(did)}`,
|
|
838
846
|
{
|
|
839
847
|
cache: "no-store",
|
|
840
848
|
timeoutMs: 5e3,
|