@singi-labs/sifa-sdk 0.12.4 → 0.12.6
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-n2uy3rT3.d.cts → adult-content-BOY_T6j3.d.cts} +265 -1
- package/dist/{adult-content-n2uy3rT3.d.ts → adult-content-BOY_T6j3.d.ts} +265 -1
- package/dist/{index-COjgkXRe.d.cts → index-CUUZmpCG.d.cts} +13 -4
- package/dist/{index-tkWmoZAu.d.ts → index-DS4b3pZJ.d.ts} +13 -4
- package/dist/{index-BLv2bK_K.d.ts → index-Dxwi4T3Z.d.ts} +16 -3
- package/dist/{index-HTTNUcN4.d.cts → index-Dz00ddQP.d.cts} +16 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{org-lIB6pSYc.d.cts → org-0DdoEMXx.d.cts} +32 -3
- package/dist/{org-BZcAnLab.d.ts → org-DxfxHBN8.d.ts} +32 -3
- package/dist/query/fetchers/index.cjs +24 -4
- 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 +24 -5
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +35 -4
- 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 +35 -5
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +34 -4
- 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 +33 -5
- package/dist/query/index.js.map +1 -1
- package/package.json +1 -1
package/dist/query/index.cjs
CHANGED
|
@@ -148,6 +148,19 @@ async function fetchAtFundLink(config, did, options = {}) {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
// src/query/fetchers/get-profile-view.ts
|
|
152
|
+
async function fetchGetProfileView(config, actor, options = {}) {
|
|
153
|
+
const path = `/xrpc/id.sifa.getProfileView?actor=${encodeIdentifier(actor)}`;
|
|
154
|
+
try {
|
|
155
|
+
return await apiFetch(config, path, { retryOn429: true, ...options });
|
|
156
|
+
} catch (e) {
|
|
157
|
+
if (e instanceof ApiError && e.status === 400 && typeof e.body === "object" && e.body !== null && e.body.error === "ProfileNotFound") {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
throw e;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
151
164
|
// src/query/fetchers/profile-mutations.ts
|
|
152
165
|
function updateProfileSelf(config, data, options = {}) {
|
|
153
166
|
return apiWrite(config, "/api/profile/self", "PUT", { body: data, ...options });
|
|
@@ -1190,10 +1203,15 @@ function resetProfile(config, deletePdsData, options = {}) {
|
|
|
1190
1203
|
});
|
|
1191
1204
|
}
|
|
1192
1205
|
function deleteAccount(config, deletePdsData, options = {}) {
|
|
1193
|
-
return apiWrite(
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1206
|
+
return apiWrite(
|
|
1207
|
+
config,
|
|
1208
|
+
"/api/profile/account",
|
|
1209
|
+
"DELETE",
|
|
1210
|
+
{
|
|
1211
|
+
body: { deletePdsData },
|
|
1212
|
+
...options
|
|
1213
|
+
}
|
|
1214
|
+
);
|
|
1197
1215
|
}
|
|
1198
1216
|
|
|
1199
1217
|
// src/query/fetchers/network-map.ts
|
|
@@ -1232,6 +1250,7 @@ var sifaQueryKeys = {
|
|
|
1232
1250
|
all: () => ["sifa", "profile"],
|
|
1233
1251
|
byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid],
|
|
1234
1252
|
atFundLink: (did) => ["sifa", "profile", "at-fund-link", did],
|
|
1253
|
+
view: (actor) => ["sifa", "profile", "view", actor],
|
|
1235
1254
|
externalAccounts: (handleOrDid) => ["sifa", "profile", "external-accounts", handleOrDid]
|
|
1236
1255
|
},
|
|
1237
1256
|
position: {
|
|
@@ -1327,6 +1346,15 @@ function useAtFundLink(did, options) {
|
|
|
1327
1346
|
...options
|
|
1328
1347
|
});
|
|
1329
1348
|
}
|
|
1349
|
+
function useGetProfileView(actor, options) {
|
|
1350
|
+
const config = useSifaConfig();
|
|
1351
|
+
return reactQuery.useQuery({
|
|
1352
|
+
queryKey: sifaQueryKeys.profile.view(actor ?? ""),
|
|
1353
|
+
queryFn: () => fetchGetProfileView(config, actor ?? ""),
|
|
1354
|
+
enabled: Boolean(actor) && (options?.enabled ?? true),
|
|
1355
|
+
...options
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1330
1358
|
async function invalidateProfile(queryClient, ownerHandleOrDid) {
|
|
1331
1359
|
await queryClient.invalidateQueries({
|
|
1332
1360
|
queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
|
|
@@ -2695,6 +2723,7 @@ exports.fetchEntitySearch = fetchEntitySearch;
|
|
|
2695
2723
|
exports.fetchExternalAccounts = fetchExternalAccounts;
|
|
2696
2724
|
exports.fetchFeaturedProfile = fetchFeaturedProfile;
|
|
2697
2725
|
exports.fetchFollowing = fetchFollowing;
|
|
2726
|
+
exports.fetchGetProfileView = fetchGetProfileView;
|
|
2698
2727
|
exports.fetchHeatmapData = fetchHeatmapData;
|
|
2699
2728
|
exports.fetchHiddenApps = fetchHiddenApps;
|
|
2700
2729
|
exports.fetchMyRoadmapVotes = fetchMyRoadmapVotes;
|
|
@@ -2809,6 +2838,7 @@ exports.useFollowers = useFollowers;
|
|
|
2809
2838
|
exports.useFollowing = useFollowing;
|
|
2810
2839
|
exports.useFollowingFeed = useFollowingFeed;
|
|
2811
2840
|
exports.useFollowingList = useFollowingList;
|
|
2841
|
+
exports.useGetProfileView = useGetProfileView;
|
|
2812
2842
|
exports.useHeatmapData = useHeatmapData;
|
|
2813
2843
|
exports.useHiddenApps = useHiddenApps;
|
|
2814
2844
|
exports.useHideKeytraceClaim = useHideKeytraceClaim;
|