@singi-labs/sifa-sdk 0.12.3 → 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 (47) hide show
  1. package/dist/{adult-content-DDGP8W1e.d.cts → adult-content-BOY_T6j3.d.cts} +295 -1
  2. package/dist/{adult-content-DDGP8W1e.d.ts → adult-content-BOY_T6j3.d.ts} +295 -1
  3. package/dist/{index-CNh-GI9A.d.cts → index-BJV2XHOP.d.cts} +16 -3
  4. package/dist/{index-IMvNS08M.d.ts → index-C1SIpwOj.d.ts} +16 -3
  5. package/dist/{index-iAzeLOcz.d.ts → index-m5MELVUQ.d.ts} +95 -3
  6. package/dist/{index-BS7zO7KI.d.cts → index-xcu81B4E.d.cts} +95 -3
  7. package/dist/index.cjs +73 -1
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +96 -5
  10. package/dist/index.d.ts +96 -5
  11. package/dist/index.js +68 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/{keys-Bn36IA8Q.d.cts → org-92bvwL8H.d.cts} +89 -2
  14. package/dist/{keys-5oyp950_.d.ts → org-Bxz__jbx.d.ts} +89 -2
  15. package/dist/org-settings-CmaSX5ZI.d.cts +74 -0
  16. package/dist/org-settings-CmaSX5ZI.d.ts +74 -0
  17. package/dist/query/fetchers/index.cjs +60 -0
  18. package/dist/query/fetchers/index.cjs.map +1 -1
  19. package/dist/query/fetchers/index.d.cts +4 -3
  20. package/dist/query/fetchers/index.d.ts +4 -3
  21. package/dist/query/fetchers/index.js +54 -1
  22. package/dist/query/fetchers/index.js.map +1 -1
  23. package/dist/query/hooks/index.cjs +144 -0
  24. package/dist/query/hooks/index.cjs.map +1 -1
  25. package/dist/query/hooks/index.d.cts +4 -3
  26. package/dist/query/hooks/index.d.ts +4 -3
  27. package/dist/query/hooks/index.js +137 -1
  28. package/dist/query/hooks/index.js.map +1 -1
  29. package/dist/query/index.cjs +147 -0
  30. package/dist/query/index.cjs.map +1 -1
  31. package/dist/query/index.d.cts +6 -5
  32. package/dist/query/index.d.ts +6 -5
  33. package/dist/query/index.js +133 -1
  34. package/dist/query/index.js.map +1 -1
  35. package/dist/schemas/index.cjs +27 -0
  36. package/dist/schemas/index.cjs.map +1 -1
  37. package/dist/schemas/index.d.cts +67 -1
  38. package/dist/schemas/index.d.ts +67 -1
  39. package/dist/schemas/index.js +26 -1
  40. package/dist/schemas/index.js.map +1 -1
  41. package/dist/schemas/write/index.cjs +36 -0
  42. package/dist/schemas/write/index.cjs.map +1 -1
  43. package/dist/schemas/write/index.d.cts +1 -0
  44. package/dist/schemas/write/index.d.ts +1 -0
  45. package/dist/schemas/write/index.js +32 -1
  46. package/dist/schemas/write/index.js.map +1 -1
  47. 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)
@@ -2540,12 +2563,122 @@ function useUpdateBskyContentLabelPrefs() {
2540
2563
  });
2541
2564
  }
2542
2565
 
2566
+ // src/query/fetchers/org.ts
2567
+ function submitOrgClaim(config, body, options = {}) {
2568
+ return apiWrite(config, "/api/org/claim", "POST", { body, ...options });
2569
+ }
2570
+ function updateOrgProfile(config, body, options = {}) {
2571
+ return apiWrite(config, "/api/org/profile", "PUT", {
2572
+ body,
2573
+ ...options
2574
+ });
2575
+ }
2576
+ function requestOrgDomainChallenge(config, body, options = {}) {
2577
+ return apiWrite(config, "/api/org/domains/challenge", "POST", {
2578
+ body,
2579
+ ...options
2580
+ });
2581
+ }
2582
+ function verifyOrgDomain(config, body, options = {}) {
2583
+ return apiWrite(config, "/api/org/domains/verify", "POST", {
2584
+ body,
2585
+ ...options
2586
+ });
2587
+ }
2588
+ function addOrgNotificationEmail(config, body, options = {}) {
2589
+ return apiWrite(
2590
+ config,
2591
+ "/api/org/notification-emails",
2592
+ "POST",
2593
+ { body, ...options }
2594
+ );
2595
+ }
2596
+ function removeOrgNotificationEmail(config, body, options = {}) {
2597
+ return apiWrite(
2598
+ config,
2599
+ "/api/org/notification-emails",
2600
+ "DELETE",
2601
+ { body, ...options }
2602
+ );
2603
+ }
2604
+ function useOrgProfile(handleOrDid, options) {
2605
+ const config = useSifaConfig();
2606
+ return reactQuery.useQuery({
2607
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid ?? ""),
2608
+ queryFn: () => fetchProfile(config, handleOrDid ?? ""),
2609
+ enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
2610
+ select: (profile) => profile?.org ?? null,
2611
+ ...options
2612
+ });
2613
+ }
2614
+ function useOrgClaim(handleOrDid, options) {
2615
+ const config = useSifaConfig();
2616
+ const queryClient = reactQuery.useQueryClient();
2617
+ return reactQuery.useMutation({
2618
+ mutationFn: (body) => submitOrgClaim(config, body),
2619
+ onSuccess: async (result, variables, onMutateResult, context) => {
2620
+ if (result.success && handleOrDid) {
2621
+ await queryClient.invalidateQueries({
2622
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid)
2623
+ });
2624
+ }
2625
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2626
+ },
2627
+ ...options
2628
+ });
2629
+ }
2630
+ function useUpdateOrgProfile(handleOrDid, options) {
2631
+ const config = useSifaConfig();
2632
+ const queryClient = reactQuery.useQueryClient();
2633
+ return reactQuery.useMutation({
2634
+ mutationFn: (body) => updateOrgProfile(config, body),
2635
+ onSuccess: async (result, variables, onMutateResult, context) => {
2636
+ if (result.success && handleOrDid) {
2637
+ await queryClient.invalidateQueries({
2638
+ queryKey: sifaQueryKeys.profile.byHandle(handleOrDid)
2639
+ });
2640
+ }
2641
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2642
+ },
2643
+ ...options
2644
+ });
2645
+ }
2646
+ function useOrgDomainChallenge(options) {
2647
+ const config = useSifaConfig();
2648
+ return reactQuery.useMutation({
2649
+ mutationFn: (body) => requestOrgDomainChallenge(config, body),
2650
+ ...options
2651
+ });
2652
+ }
2653
+ function useOrgDomainVerify(options) {
2654
+ const config = useSifaConfig();
2655
+ return reactQuery.useMutation({
2656
+ mutationFn: (body) => verifyOrgDomain(config, body),
2657
+ ...options
2658
+ });
2659
+ }
2660
+ function useAddOrgNotificationEmail(options) {
2661
+ const config = useSifaConfig();
2662
+ return reactQuery.useMutation({
2663
+ mutationFn: (body) => addOrgNotificationEmail(config, body),
2664
+ ...options
2665
+ });
2666
+ }
2667
+ function useRemoveOrgNotificationEmail(options) {
2668
+ const config = useSifaConfig();
2669
+ return reactQuery.useMutation({
2670
+ mutationFn: (body) => removeOrgNotificationEmail(config, body),
2671
+ ...options
2672
+ });
2673
+ }
2674
+
2543
2675
  exports.ApiError = ApiError;
2544
2676
  exports.HIDDEN_ITEM_SOURCES = HIDDEN_ITEM_SOURCES;
2545
2677
  exports.HIDDEN_ITEM_TYPES = HIDDEN_ITEM_TYPES;
2546
2678
  exports.QUOTED_POSTS_BATCH_MAX = QUOTED_POSTS_BATCH_MAX;
2547
2679
  exports.SifaProvider = SifaProvider;
2548
2680
  exports.addFeatureAllowlist = addFeatureAllowlist;
2681
+ exports.addOrgNotificationEmail = addOrgNotificationEmail;
2549
2682
  exports.apiFetch = apiFetch;
2550
2683
  exports.apiFetchOrNull = apiFetchOrNull;
2551
2684
  exports.apiWrite = apiWrite;
@@ -2585,6 +2718,7 @@ exports.fetchEntitySearch = fetchEntitySearch;
2585
2718
  exports.fetchExternalAccounts = fetchExternalAccounts;
2586
2719
  exports.fetchFeaturedProfile = fetchFeaturedProfile;
2587
2720
  exports.fetchFollowing = fetchFollowing;
2721
+ exports.fetchGetProfileView = fetchGetProfileView;
2588
2722
  exports.fetchHeatmapData = fetchHeatmapData;
2589
2723
  exports.fetchHiddenApps = fetchHiddenApps;
2590
2724
  exports.fetchMyRoadmapVotes = fetchMyRoadmapVotes;
@@ -2621,6 +2755,8 @@ exports.mintEntityDomain = mintEntityDomain;
2621
2755
  exports.refreshOrcidPublications = refreshOrcidPublications;
2622
2756
  exports.refreshPds = refreshPds;
2623
2757
  exports.removeFeatureAllowlist = removeFeatureAllowlist;
2758
+ exports.removeOrgNotificationEmail = removeOrgNotificationEmail;
2759
+ exports.requestOrgDomainChallenge = requestOrgDomainChallenge;
2624
2760
  exports.resetProfile = resetProfile;
2625
2761
  exports.resolveEntityDomain = resolveEntityDomain;
2626
2762
  exports.resolveQuotedPosts = resolveQuotedPosts;
@@ -2632,6 +2768,7 @@ exports.setExternalAccountPrimary = setExternalAccountPrimary;
2632
2768
  exports.setPositionPrimary = setPositionPrimary;
2633
2769
  exports.shouldGateAdultMedia = shouldGateAdultMedia;
2634
2770
  exports.sifaQueryKeys = sifaQueryKeys;
2771
+ exports.submitOrgClaim = submitOrgClaim;
2635
2772
  exports.unfollowUser = unfollowUser;
2636
2773
  exports.unhideKeytraceClaim = unhideKeytraceClaim;
2637
2774
  exports.unhideOrcidPublication = unhideOrcidPublication;
@@ -2645,6 +2782,7 @@ exports.unsetPositionPrimary = unsetPositionPrimary;
2645
2782
  exports.updateBskyContentLabelPrefs = updateBskyContentLabelPrefs;
2646
2783
  exports.updateEducation = updateEducation;
2647
2784
  exports.updateExternalAccount = updateExternalAccount;
2785
+ exports.updateOrgProfile = updateOrgProfile;
2648
2786
  exports.updatePosition = updatePosition;
2649
2787
  exports.updateProfileLocation = updateProfileLocation;
2650
2788
  exports.updateProfileOverride = updateProfileOverride;
@@ -2655,6 +2793,7 @@ exports.uploadAvatar = uploadAvatar;
2655
2793
  exports.useActivityFeed = useActivityFeed;
2656
2794
  exports.useActivityTeaser = useActivityTeaser;
2657
2795
  exports.useAddFeatureAllowlist = useAddFeatureAllowlist;
2796
+ exports.useAddOrgNotificationEmail = useAddOrgNotificationEmail;
2658
2797
  exports.useAppAccountCheck = useAppAccountCheck;
2659
2798
  exports.useAppsRegistry = useAppsRegistry;
2660
2799
  exports.useAtFundLink = useAtFundLink;
@@ -2694,6 +2833,7 @@ exports.useFollowers = useFollowers;
2694
2833
  exports.useFollowing = useFollowing;
2695
2834
  exports.useFollowingFeed = useFollowingFeed;
2696
2835
  exports.useFollowingList = useFollowingList;
2836
+ exports.useGetProfileView = useGetProfileView;
2697
2837
  exports.useHeatmapData = useHeatmapData;
2698
2838
  exports.useHiddenApps = useHiddenApps;
2699
2839
  exports.useHideKeytraceClaim = useHideKeytraceClaim;
@@ -2707,11 +2847,16 @@ exports.useMintEntityDomain = useMintEntityDomain;
2707
2847
  exports.useMutuals = useMutuals;
2708
2848
  exports.useMyRoadmapVotes = useMyRoadmapVotes;
2709
2849
  exports.useNetworkStreamCount = useNetworkStreamCount;
2850
+ exports.useOrgClaim = useOrgClaim;
2851
+ exports.useOrgDomainChallenge = useOrgDomainChallenge;
2852
+ exports.useOrgDomainVerify = useOrgDomainVerify;
2853
+ exports.useOrgProfile = useOrgProfile;
2710
2854
  exports.useProfile = useProfile;
2711
2855
  exports.useReactionStatus = useReactionStatus;
2712
2856
  exports.useRefreshOrcidPublications = useRefreshOrcidPublications;
2713
2857
  exports.useRefreshPds = useRefreshPds;
2714
2858
  exports.useRemoveFeatureAllowlist = useRemoveFeatureAllowlist;
2859
+ exports.useRemoveOrgNotificationEmail = useRemoveOrgNotificationEmail;
2715
2860
  exports.useResetProfile = useResetProfile;
2716
2861
  exports.useResolveEntityDomain = useResolveEntityDomain;
2717
2862
  exports.useRetractRoadmapVote = useRetractRoadmapVote;
@@ -2741,6 +2886,7 @@ exports.useUnsetPositionPrimary = useUnsetPositionPrimary;
2741
2886
  exports.useUpdateBskyContentLabelPrefs = useUpdateBskyContentLabelPrefs;
2742
2887
  exports.useUpdateEducation = useUpdateEducation;
2743
2888
  exports.useUpdateExternalAccount = useUpdateExternalAccount;
2889
+ exports.useUpdateOrgProfile = useUpdateOrgProfile;
2744
2890
  exports.useUpdatePosition = useUpdatePosition;
2745
2891
  exports.useUpdateProfileLocation = useUpdateProfileLocation;
2746
2892
  exports.useUpdateProfileOverride = useUpdateProfileOverride;
@@ -2750,5 +2896,6 @@ exports.useUpdateSkill = useUpdateSkill;
2750
2896
  exports.useUploadAvatar = useUploadAvatar;
2751
2897
  exports.useVerifyExternalAccount = useVerifyExternalAccount;
2752
2898
  exports.verifyExternalAccount = verifyExternalAccount;
2899
+ exports.verifyOrgDomain = verifyOrgDomain;
2753
2900
  //# sourceMappingURL=index.cjs.map
2754
2901
  //# sourceMappingURL=index.cjs.map