@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.
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-COjgkXRe.d.cts → index-CUUZmpCG.d.cts} +13 -4
  4. package/dist/{index-tkWmoZAu.d.ts → index-DS4b3pZJ.d.ts} +13 -4
  5. package/dist/{index-BLv2bK_K.d.ts → index-Dxwi4T3Z.d.ts} +16 -3
  6. package/dist/{index-HTTNUcN4.d.cts → index-Dz00ddQP.d.cts} +16 -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-0DdoEMXx.d.cts} +32 -3
  14. package/dist/{org-BZcAnLab.d.ts → org-DxfxHBN8.d.ts} +32 -3
  15. package/dist/query/fetchers/index.cjs +24 -4
  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 +24 -5
  20. package/dist/query/fetchers/index.js.map +1 -1
  21. package/dist/query/hooks/index.cjs +35 -4
  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 +35 -5
  26. package/dist/query/hooks/index.js.map +1 -1
  27. package/dist/query/index.cjs +34 -4
  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 +33 -5
  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 });
@@ -2242,10 +2267,15 @@ function resetProfile(config, deletePdsData, options = {}) {
2242
2267
  });
2243
2268
  }
2244
2269
  function deleteAccount(config, deletePdsData, options = {}) {
2245
- return apiWrite(config, "/api/profile/account", "DELETE", {
2246
- body: { deletePdsData },
2247
- ...options
2248
- });
2270
+ return apiWrite(
2271
+ config,
2272
+ "/api/profile/account",
2273
+ "DELETE",
2274
+ {
2275
+ body: { deletePdsData },
2276
+ ...options
2277
+ }
2278
+ );
2249
2279
  }
2250
2280
 
2251
2281
  // src/query/hooks/use-destructive.ts
@@ -2553,6 +2583,7 @@ exports.useFollowers = useFollowers;
2553
2583
  exports.useFollowing = useFollowing;
2554
2584
  exports.useFollowingFeed = useFollowingFeed;
2555
2585
  exports.useFollowingList = useFollowingList;
2586
+ exports.useGetProfileView = useGetProfileView;
2556
2587
  exports.useHeatmapData = useHeatmapData;
2557
2588
  exports.useHiddenApps = useHiddenApps;
2558
2589
  exports.useHideKeytraceClaim = useHideKeytraceClaim;