@singi-labs/sifa-sdk 0.12.4 → 0.12.5
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-HTTNUcN4.d.cts → index-BJV2XHOP.d.cts} +16 -3
- package/dist/{index-BLv2bK_K.d.ts → index-C1SIpwOj.d.ts} +16 -3
- package/dist/{index-tkWmoZAu.d.ts → index-m5MELVUQ.d.ts} +12 -3
- package/dist/{index-COjgkXRe.d.cts → index-xcu81B4E.d.cts} +12 -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-92bvwL8H.d.cts} +2 -1
- package/dist/{org-BZcAnLab.d.ts → org-Bxz__jbx.d.ts} +2 -1
- package/dist/query/fetchers/index.cjs +15 -0
- 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 +15 -1
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +26 -0
- 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 +26 -1
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +25 -0
- 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 +24 -1
- package/dist/query/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -157,6 +157,7 @@ var sifaQueryKeys = {
|
|
|
157
157
|
all: () => ["sifa", "profile"],
|
|
158
158
|
byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid],
|
|
159
159
|
atFundLink: (did) => ["sifa", "profile", "at-fund-link", did],
|
|
160
|
+
view: (actor) => ["sifa", "profile", "view", actor],
|
|
160
161
|
externalAccounts: (handleOrDid) => ["sifa", "profile", "external-accounts", handleOrDid]
|
|
161
162
|
},
|
|
162
163
|
position: {
|
|
@@ -253,6 +254,30 @@ function useAtFundLink(did, options) {
|
|
|
253
254
|
});
|
|
254
255
|
}
|
|
255
256
|
|
|
257
|
+
// src/query/fetchers/get-profile-view.ts
|
|
258
|
+
async function fetchGetProfileView(config, actor, options = {}) {
|
|
259
|
+
const path = `/xrpc/id.sifa.getProfileView?actor=${encodeIdentifier(actor)}`;
|
|
260
|
+
try {
|
|
261
|
+
return await apiFetch(config, path, { retryOn429: true, ...options });
|
|
262
|
+
} catch (e) {
|
|
263
|
+
if (e instanceof ApiError && e.status === 400 && typeof e.body === "object" && e.body !== null && e.body.error === "ProfileNotFound") {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
throw e;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// src/query/hooks/use-get-profile-view.ts
|
|
271
|
+
function useGetProfileView(actor, options) {
|
|
272
|
+
const config = useSifaConfig();
|
|
273
|
+
return reactQuery.useQuery({
|
|
274
|
+
queryKey: sifaQueryKeys.profile.view(actor ?? ""),
|
|
275
|
+
queryFn: () => fetchGetProfileView(config, actor ?? ""),
|
|
276
|
+
enabled: Boolean(actor) && (options?.enabled ?? true),
|
|
277
|
+
...options
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
|
|
256
281
|
// src/query/fetchers/profile-mutations.ts
|
|
257
282
|
function updateProfileSelf(config, data, options = {}) {
|
|
258
283
|
return apiWrite(config, "/api/profile/self", "PUT", { body: data, ...options });
|
|
@@ -2553,6 +2578,7 @@ exports.useFollowers = useFollowers;
|
|
|
2553
2578
|
exports.useFollowing = useFollowing;
|
|
2554
2579
|
exports.useFollowingFeed = useFollowingFeed;
|
|
2555
2580
|
exports.useFollowingList = useFollowingList;
|
|
2581
|
+
exports.useGetProfileView = useGetProfileView;
|
|
2556
2582
|
exports.useHeatmapData = useHeatmapData;
|
|
2557
2583
|
exports.useHiddenApps = useHiddenApps;
|
|
2558
2584
|
exports.useHideKeytraceClaim = useHideKeytraceClaim;
|