@singi-labs/sifa-sdk 0.12.68 → 0.12.69

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 (53) hide show
  1. package/dist/{feed-dOSy_48Z.d.cts → feed-BMm9Pkew.d.cts} +1 -1
  2. package/dist/{feed-dOSy_48Z.d.ts → feed-BMm9Pkew.d.ts} +1 -1
  3. package/dist/{index-Cj6jfpAE.d.cts → index-a3xqWsNm.d.cts} +38 -1
  4. package/dist/{index-Cj6jfpAE.d.ts → index-a3xqWsNm.d.ts} +38 -1
  5. package/dist/index.cjs +86 -1
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +47 -9
  8. package/dist/index.d.ts +47 -9
  9. package/dist/index.js +76 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/jsonld/index.d.cts +1 -1
  12. package/dist/jsonld/index.d.ts +1 -1
  13. package/dist/{index-BARfrksZ.d.cts → network-map-CpwO3k-e.d.cts} +5 -5
  14. package/dist/{index-C0iPs_NQ.d.ts → network-map-DpEQ65cq.d.ts} +5 -5
  15. package/dist/{org-ClPPJ3-J.d.cts → org-DJyiwPcL.d.cts} +4 -4
  16. package/dist/{org-wLJm-WXC.d.ts → org-DxhtogOn.d.ts} +4 -4
  17. package/dist/{org-settings-B8e01iZx.d.cts → org-settings-CZ_tmAYl.d.cts} +1 -1
  18. package/dist/{org-settings-B8e01iZx.d.ts → org-settings-CZ_tmAYl.d.ts} +1 -1
  19. package/dist/{shared-BibYErTJ.d.cts → profile-investment-DmtsZK8d.d.cts} +43 -1
  20. package/dist/{shared-BibYErTJ.d.ts → profile-investment-DmtsZK8d.d.ts} +43 -1
  21. package/dist/{profile-summary-sEHAdvfm.d.cts → profile-summary-BTZAwG1z.d.cts} +1 -1
  22. package/dist/{profile-summary-Cbtnh04E.d.ts → profile-summary-Do5FY7Q0.d.ts} +1 -1
  23. package/dist/query/fetchers/index.cjs +17 -0
  24. package/dist/query/fetchers/index.cjs.map +1 -1
  25. package/dist/query/fetchers/index.d.cts +27 -7
  26. package/dist/query/fetchers/index.d.ts +27 -7
  27. package/dist/query/fetchers/index.js +15 -1
  28. package/dist/query/fetchers/index.js.map +1 -1
  29. package/dist/query/hooks/index.cjs +67 -0
  30. package/dist/query/hooks/index.cjs.map +1 -1
  31. package/dist/query/hooks/index.d.cts +27 -7
  32. package/dist/query/hooks/index.d.ts +27 -7
  33. package/dist/query/hooks/index.js +65 -1
  34. package/dist/query/hooks/index.js.map +1 -1
  35. package/dist/query/index.d.cts +10 -10
  36. package/dist/query/index.d.ts +10 -10
  37. package/dist/schemas/index.cjs +33 -0
  38. package/dist/schemas/index.cjs.map +1 -1
  39. package/dist/schemas/index.d.cts +2 -2
  40. package/dist/schemas/index.d.ts +2 -2
  41. package/dist/schemas/index.js +32 -1
  42. package/dist/schemas/index.js.map +1 -1
  43. package/dist/schemas/write/index.cjs +26 -0
  44. package/dist/schemas/write/index.cjs.map +1 -1
  45. package/dist/schemas/write/index.d.cts +37 -2
  46. package/dist/schemas/write/index.d.ts +37 -2
  47. package/dist/schemas/write/index.js +26 -1
  48. package/dist/schemas/write/index.js.map +1 -1
  49. package/dist/{types-BtoIc4cG.d.ts → types-C3xxTGUE.d.ts} +2 -2
  50. package/dist/{types-DNrRbi9D.d.cts → types-D0LWpGtY.d.cts} +2 -2
  51. package/dist/{index-B61EZesA.d.ts → use-org-notification-emails-C3TuUp8c.d.ts} +5 -5
  52. package/dist/{index-DQrudL91.d.cts → use-org-notification-emails-ChctAwP5.d.cts} +5 -5
  53. package/package.json +1 -1
@@ -2860,6 +2860,70 @@ function useRemoveOrgNotificationEmail(options) {
2860
2860
  });
2861
2861
  }
2862
2862
 
2863
+ // src/query/fetchers/investments.ts
2864
+ function createInvestment(config, data, options = {}) {
2865
+ return apiWriteCreate(config, "/api/profile/investment", data, options);
2866
+ }
2867
+ function updateInvestment(config, rkey, data, options = {}) {
2868
+ return apiWrite(config, `/api/profile/investment/${encodeURIComponent(rkey)}`, "PUT", {
2869
+ body: data,
2870
+ ...options
2871
+ });
2872
+ }
2873
+ function deleteInvestment(config, rkey, options = {}) {
2874
+ return apiWrite(config, `/api/profile/investment/${encodeURIComponent(rkey)}`, "DELETE", options);
2875
+ }
2876
+
2877
+ // src/query/hooks/use-investment-mutations.ts
2878
+ function useCreateInvestment(ownerDid, options) {
2879
+ const config = useSifaConfig();
2880
+ const queryClient = reactQuery.useQueryClient();
2881
+ return reactQuery.useMutation({
2882
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the handler
2883
+ // below and silently drop cache invalidation. The handler forwards to it instead.
2884
+ ...options,
2885
+ mutationFn: (data) => createInvestment(config, data),
2886
+ onSuccess: async (result, variables, onMutateResult, context) => {
2887
+ if (result.success) {
2888
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });
2889
+ }
2890
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2891
+ }
2892
+ });
2893
+ }
2894
+ function useUpdateInvestment(ownerDid, options) {
2895
+ const config = useSifaConfig();
2896
+ const queryClient = reactQuery.useQueryClient();
2897
+ return reactQuery.useMutation({
2898
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the handler
2899
+ // below and silently drop cache invalidation. The handler forwards to it instead.
2900
+ ...options,
2901
+ mutationFn: ({ rkey, data }) => updateInvestment(config, rkey, data),
2902
+ onSuccess: async (result, variables, onMutateResult, context) => {
2903
+ if (result.success) {
2904
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });
2905
+ }
2906
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2907
+ }
2908
+ });
2909
+ }
2910
+ function useDeleteInvestment(ownerDid, options) {
2911
+ const config = useSifaConfig();
2912
+ const queryClient = reactQuery.useQueryClient();
2913
+ return reactQuery.useMutation({
2914
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the handler
2915
+ // below and silently drop cache invalidation. The handler forwards to it instead.
2916
+ ...options,
2917
+ mutationFn: (rkey) => deleteInvestment(config, rkey),
2918
+ onSuccess: async (result, variables, onMutateResult, context) => {
2919
+ if (result.success) {
2920
+ await queryClient.invalidateQueries({ queryKey: sifaQueryKeys.profile.byHandle(ownerDid) });
2921
+ }
2922
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2923
+ }
2924
+ });
2925
+ }
2926
+
2863
2927
  exports.SifaProvider = SifaProvider;
2864
2928
  exports.sifaQueryKeys = sifaQueryKeys;
2865
2929
  exports.useActivityFeed = useActivityFeed;
@@ -2881,6 +2945,7 @@ exports.useCreateConfirmation = useCreateConfirmation;
2881
2945
  exports.useCreateEducation = useCreateEducation;
2882
2946
  exports.useCreateEndorsement = useCreateEndorsement;
2883
2947
  exports.useCreateExternalAccount = useCreateExternalAccount;
2948
+ exports.useCreateInvestment = useCreateInvestment;
2884
2949
  exports.useCreatePosition = useCreatePosition;
2885
2950
  exports.useCreateProfileLocation = useCreateProfileLocation;
2886
2951
  exports.useCreateReaction = useCreateReaction;
@@ -2891,6 +2956,7 @@ exports.useDeleteAccount = useDeleteAccount;
2891
2956
  exports.useDeleteAvatarOverride = useDeleteAvatarOverride;
2892
2957
  exports.useDeleteEducation = useDeleteEducation;
2893
2958
  exports.useDeleteExternalAccount = useDeleteExternalAccount;
2959
+ exports.useDeleteInvestment = useDeleteInvestment;
2894
2960
  exports.useDeletePosition = useDeletePosition;
2895
2961
  exports.useDeleteProfileLocation = useDeleteProfileLocation;
2896
2962
  exports.useDeleteReaction = useDeleteReaction;
@@ -2963,6 +3029,7 @@ exports.useUnsetExternalAccountPrimary = useUnsetExternalAccountPrimary;
2963
3029
  exports.useUnsetPositionPrimary = useUnsetPositionPrimary;
2964
3030
  exports.useUpdateEducation = useUpdateEducation;
2965
3031
  exports.useUpdateExternalAccount = useUpdateExternalAccount;
3032
+ exports.useUpdateInvestment = useUpdateInvestment;
2966
3033
  exports.useUpdateOrgProfile = useUpdateOrgProfile;
2967
3034
  exports.useUpdatePosition = useUpdatePosition;
2968
3035
  exports.useUpdateProfileLocation = useUpdateProfileLocation;