@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.
Files changed (33) hide show
  1. package/dist/{adult-content-n2uy3rT3.d.cts → adult-content-BOY_T6j3.d.cts} +265 -1
  2. package/dist/{adult-content-n2uy3rT3.d.ts → adult-content-BOY_T6j3.d.ts} +265 -1
  3. package/dist/{index-HTTNUcN4.d.cts → index-BJV2XHOP.d.cts} +16 -3
  4. package/dist/{index-BLv2bK_K.d.ts → index-C1SIpwOj.d.ts} +16 -3
  5. package/dist/{index-tkWmoZAu.d.ts → index-m5MELVUQ.d.ts} +12 -3
  6. package/dist/{index-COjgkXRe.d.cts → index-xcu81B4E.d.cts} +12 -3
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +2 -2
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.js +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/{org-lIB6pSYc.d.cts → org-92bvwL8H.d.cts} +2 -1
  14. package/dist/{org-BZcAnLab.d.ts → org-Bxz__jbx.d.ts} +2 -1
  15. package/dist/query/fetchers/index.cjs +15 -0
  16. package/dist/query/fetchers/index.cjs.map +1 -1
  17. package/dist/query/fetchers/index.d.cts +3 -3
  18. package/dist/query/fetchers/index.d.ts +3 -3
  19. package/dist/query/fetchers/index.js +15 -1
  20. package/dist/query/fetchers/index.js.map +1 -1
  21. package/dist/query/hooks/index.cjs +26 -0
  22. package/dist/query/hooks/index.cjs.map +1 -1
  23. package/dist/query/hooks/index.d.cts +3 -3
  24. package/dist/query/hooks/index.d.ts +3 -3
  25. package/dist/query/hooks/index.js +26 -1
  26. package/dist/query/hooks/index.js.map +1 -1
  27. package/dist/query/index.cjs +25 -0
  28. package/dist/query/index.cjs.map +1 -1
  29. package/dist/query/index.d.cts +5 -5
  30. package/dist/query/index.d.ts +5 -5
  31. package/dist/query/index.js +24 -1
  32. package/dist/query/index.js.map +1 -1
  33. 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;