@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
@@ -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 });
@@ -1232,6 +1245,7 @@ var sifaQueryKeys = {
1232
1245
  all: () => ["sifa", "profile"],
1233
1246
  byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid],
1234
1247
  atFundLink: (did) => ["sifa", "profile", "at-fund-link", did],
1248
+ view: (actor) => ["sifa", "profile", "view", actor],
1235
1249
  externalAccounts: (handleOrDid) => ["sifa", "profile", "external-accounts", handleOrDid]
1236
1250
  },
1237
1251
  position: {
@@ -1327,6 +1341,15 @@ function useAtFundLink(did, options) {
1327
1341
  ...options
1328
1342
  });
1329
1343
  }
1344
+ function useGetProfileView(actor, options) {
1345
+ const config = useSifaConfig();
1346
+ return reactQuery.useQuery({
1347
+ queryKey: sifaQueryKeys.profile.view(actor ?? ""),
1348
+ queryFn: () => fetchGetProfileView(config, actor ?? ""),
1349
+ enabled: Boolean(actor) && (options?.enabled ?? true),
1350
+ ...options
1351
+ });
1352
+ }
1330
1353
  async function invalidateProfile(queryClient, ownerHandleOrDid) {
1331
1354
  await queryClient.invalidateQueries({
1332
1355
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
@@ -2695,6 +2718,7 @@ exports.fetchEntitySearch = fetchEntitySearch;
2695
2718
  exports.fetchExternalAccounts = fetchExternalAccounts;
2696
2719
  exports.fetchFeaturedProfile = fetchFeaturedProfile;
2697
2720
  exports.fetchFollowing = fetchFollowing;
2721
+ exports.fetchGetProfileView = fetchGetProfileView;
2698
2722
  exports.fetchHeatmapData = fetchHeatmapData;
2699
2723
  exports.fetchHiddenApps = fetchHiddenApps;
2700
2724
  exports.fetchMyRoadmapVotes = fetchMyRoadmapVotes;
@@ -2809,6 +2833,7 @@ exports.useFollowers = useFollowers;
2809
2833
  exports.useFollowing = useFollowing;
2810
2834
  exports.useFollowingFeed = useFollowingFeed;
2811
2835
  exports.useFollowingList = useFollowingList;
2836
+ exports.useGetProfileView = useGetProfileView;
2812
2837
  exports.useHeatmapData = useHeatmapData;
2813
2838
  exports.useHiddenApps = useHiddenApps;
2814
2839
  exports.useHideKeytraceClaim = useHideKeytraceClaim;