@singi-labs/sifa-sdk 0.18.15 → 0.18.16

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 (49) hide show
  1. package/dist/{index-DIwi3bpk.d.cts → index-E2qQbMnv.d.cts} +10 -0
  2. package/dist/{index-DIwi3bpk.d.ts → index-E2qQbMnv.d.ts} +10 -0
  3. package/dist/index.cjs +13 -1
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +32 -7
  6. package/dist/index.d.ts +32 -7
  7. package/dist/index.js +13 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/jsonld/index.d.cts +1 -1
  10. package/dist/jsonld/index.d.ts +1 -1
  11. package/dist/{network-map-CfAPUSb6.d.ts → network-map-BYdQF1tr.d.ts} +4 -4
  12. package/dist/{network-map-B2VRYlgb.d.cts → network-map-BdDqR9-B.d.cts} +4 -4
  13. package/dist/{org-C3e5hz3h.d.ts → org-BftCzySH.d.ts} +20 -3
  14. package/dist/{org-CLi7-wje.d.cts → org-DhAmipS-.d.cts} +20 -3
  15. package/dist/{profile-investment-CIG7Hy8g.d.cts → profile-investment-vmHROP_v.d.cts} +5 -0
  16. package/dist/{profile-investment-CIG7Hy8g.d.ts → profile-investment-vmHROP_v.d.ts} +5 -0
  17. package/dist/{profile-summary-B9EQmnC7.d.cts → profile-summary-BeiM3TmH.d.cts} +1 -1
  18. package/dist/{profile-summary-nbzILRkf.d.ts → profile-summary-CKAuwczF.d.ts} +1 -1
  19. package/dist/query/fetchers/index.cjs +22 -0
  20. package/dist/query/fetchers/index.cjs.map +1 -1
  21. package/dist/query/fetchers/index.d.cts +6 -6
  22. package/dist/query/fetchers/index.d.ts +6 -6
  23. package/dist/query/fetchers/index.js +21 -1
  24. package/dist/query/fetchers/index.js.map +1 -1
  25. package/dist/query/hooks/index.cjs +85 -24
  26. package/dist/query/hooks/index.cjs.map +1 -1
  27. package/dist/query/hooks/index.d.cts +5 -5
  28. package/dist/query/hooks/index.d.ts +5 -5
  29. package/dist/query/hooks/index.js +84 -25
  30. package/dist/query/hooks/index.js.map +1 -1
  31. package/dist/query/index.cjs +82 -23
  32. package/dist/query/index.cjs.map +1 -1
  33. package/dist/query/index.d.cts +8 -8
  34. package/dist/query/index.d.ts +8 -8
  35. package/dist/query/index.js +79 -24
  36. package/dist/query/index.js.map +1 -1
  37. package/dist/resume/index.d.cts +1 -1
  38. package/dist/resume/index.d.ts +1 -1
  39. package/dist/schemas/index.cjs +5 -0
  40. package/dist/schemas/index.cjs.map +1 -1
  41. package/dist/schemas/index.d.cts +1 -1
  42. package/dist/schemas/index.d.ts +1 -1
  43. package/dist/schemas/index.js +5 -0
  44. package/dist/schemas/index.js.map +1 -1
  45. package/dist/{types-XejLm3AA.d.cts → types-2qTC_DBy.d.cts} +6 -1
  46. package/dist/{types-DqVbTzXo.d.ts → types-CLrLfvXz.d.ts} +6 -1
  47. package/dist/{use-org-notification-emails-DHLosH0F.d.cts → use-org-notification-emails-CR2PDfjF.d.cts} +13 -4
  48. package/dist/{use-org-notification-emails-6VO57byN.d.ts → use-org-notification-emails-CxBtveF9.d.ts} +13 -4
  49. package/package.json +1 -1
@@ -779,6 +779,63 @@ function useDeleteEducation(ownerHandleOrDid, options) {
779
779
  });
780
780
  }
781
781
 
782
+ // src/query/fetchers/section-primary.ts
783
+ function setSectionPrimary(config, section, rkey, options = {}) {
784
+ return apiWrite(
785
+ config,
786
+ `/api/profile/${section}/${encodeURIComponent(rkey)}/primary`,
787
+ "PUT",
788
+ options
789
+ );
790
+ }
791
+ function unsetSectionPrimary(config, section, rkey, options = {}) {
792
+ return apiWrite(
793
+ config,
794
+ `/api/profile/${section}/${encodeURIComponent(rkey)}/primary`,
795
+ "DELETE",
796
+ options
797
+ );
798
+ }
799
+
800
+ // src/query/hooks/use-section-primary-mutations.ts
801
+ async function invalidateProfile3(queryClient, ownerHandleOrDid) {
802
+ await queryClient.invalidateQueries({
803
+ queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
804
+ });
805
+ }
806
+ function useSetSectionPrimary(section, ownerHandleOrDid, options) {
807
+ const config = useSifaConfig();
808
+ const queryClient = reactQuery.useQueryClient();
809
+ return reactQuery.useMutation({
810
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
811
+ // handler below and silently drop cache invalidation (#453).
812
+ ...options,
813
+ mutationFn: (rkey) => setSectionPrimary(config, section, rkey),
814
+ onSuccess: async (result, variables, onMutateResult, context) => {
815
+ if (result.success) {
816
+ await invalidateProfile3(queryClient, ownerHandleOrDid);
817
+ }
818
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
819
+ }
820
+ });
821
+ }
822
+ function useUnsetSectionPrimary(section, ownerHandleOrDid, options) {
823
+ const config = useSifaConfig();
824
+ const queryClient = reactQuery.useQueryClient();
825
+ return reactQuery.useMutation({
826
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
827
+ // handler below and silently drop cache invalidation (#453).
828
+ ...options,
829
+ mutationFn: (rkey) => unsetSectionPrimary(config, section, rkey),
830
+ onSuccess: async (result, variables, onMutateResult, context) => {
831
+ if (result.success) {
832
+ await invalidateProfile3(queryClient, ownerHandleOrDid);
833
+ }
834
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
835
+ }
836
+ });
837
+ }
838
+
782
839
  // src/query/fetchers/skills.ts
783
840
  function createSkill(config, data, options = {}) {
784
841
  return apiWriteCreate(config, "/api/profile/skill", data, options);
@@ -800,7 +857,7 @@ function deleteSkill(config, rkey, options = {}) {
800
857
  }
801
858
 
802
859
  // src/query/hooks/use-skill-mutations.ts
803
- async function invalidateProfile3(queryClient, ownerHandleOrDid) {
860
+ async function invalidateProfile4(queryClient, ownerHandleOrDid) {
804
861
  await queryClient.invalidateQueries({
805
862
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
806
863
  });
@@ -815,7 +872,7 @@ function useCreateSkill(ownerHandleOrDid, options) {
815
872
  mutationFn: (data) => createSkill(config, data),
816
873
  onSuccess: async (result, variables, onMutateResult, context) => {
817
874
  if (result.success) {
818
- await invalidateProfile3(queryClient, ownerHandleOrDid);
875
+ await invalidateProfile4(queryClient, ownerHandleOrDid);
819
876
  }
820
877
  await options?.onSuccess?.(result, variables, onMutateResult, context);
821
878
  }
@@ -831,7 +888,7 @@ function useUpdateSkill(ownerHandleOrDid, options) {
831
888
  mutationFn: ({ rkey, data }) => updateSkill(config, rkey, data),
832
889
  onSuccess: async (result, variables, onMutateResult, context) => {
833
890
  if (result.success) {
834
- await invalidateProfile3(queryClient, ownerHandleOrDid);
891
+ await invalidateProfile4(queryClient, ownerHandleOrDid);
835
892
  }
836
893
  await options?.onSuccess?.(result, variables, onMutateResult, context);
837
894
  }
@@ -849,7 +906,7 @@ function useUpdateSkillSubCategories(ownerHandleOrDid, options) {
849
906
  ...options,
850
907
  onSuccess: async (result, variables, onMutateResult, context) => {
851
908
  if (result.success) {
852
- await invalidateProfile3(queryClient, ownerHandleOrDid);
909
+ await invalidateProfile4(queryClient, ownerHandleOrDid);
853
910
  }
854
911
  await options?.onSuccess?.(result, variables, onMutateResult, context);
855
912
  }
@@ -865,7 +922,7 @@ function useDeleteSkill(ownerHandleOrDid, options) {
865
922
  mutationFn: (rkey) => deleteSkill(config, rkey),
866
923
  onSuccess: async (result, variables, onMutateResult, context) => {
867
924
  if (result.success) {
868
- await invalidateProfile3(queryClient, ownerHandleOrDid);
925
+ await invalidateProfile4(queryClient, ownerHandleOrDid);
869
926
  }
870
927
  await options?.onSuccess?.(result, variables, onMutateResult, context);
871
928
  }
@@ -891,7 +948,7 @@ function deleteRecord(config, collection, rkey, options = {}) {
891
948
  }
892
949
 
893
950
  // src/query/hooks/use-record-mutations.ts
894
- async function invalidateProfile4(queryClient, ownerHandleOrDid) {
951
+ async function invalidateProfile5(queryClient, ownerHandleOrDid) {
895
952
  await queryClient.invalidateQueries({
896
953
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
897
954
  });
@@ -906,7 +963,7 @@ function useCreateRecord(ownerHandleOrDid, options) {
906
963
  mutationFn: ({ collection, data }) => createRecord(config, collection, data),
907
964
  onSuccess: async (result, variables, onMutateResult, context) => {
908
965
  if (result.success) {
909
- await invalidateProfile4(queryClient, ownerHandleOrDid);
966
+ await invalidateProfile5(queryClient, ownerHandleOrDid);
910
967
  }
911
968
  await options?.onSuccess?.(result, variables, onMutateResult, context);
912
969
  }
@@ -922,7 +979,7 @@ function useUpdateRecord(ownerHandleOrDid, options) {
922
979
  mutationFn: ({ collection, rkey, data }) => updateRecord(config, collection, rkey, data),
923
980
  onSuccess: async (result, variables, onMutateResult, context) => {
924
981
  if (result.success) {
925
- await invalidateProfile4(queryClient, ownerHandleOrDid);
982
+ await invalidateProfile5(queryClient, ownerHandleOrDid);
926
983
  }
927
984
  await options?.onSuccess?.(result, variables, onMutateResult, context);
928
985
  }
@@ -938,7 +995,7 @@ function useDeleteRecord(ownerHandleOrDid, options) {
938
995
  mutationFn: ({ collection, rkey }) => deleteRecord(config, collection, rkey),
939
996
  onSuccess: async (result, variables, onMutateResult, context) => {
940
997
  if (result.success) {
941
- await invalidateProfile4(queryClient, ownerHandleOrDid);
998
+ await invalidateProfile5(queryClient, ownerHandleOrDid);
942
999
  }
943
1000
  await options?.onSuccess?.(result, variables, onMutateResult, context);
944
1001
  }
@@ -960,7 +1017,7 @@ function deleteProfileLocation(config, rkey, options = {}) {
960
1017
  }
961
1018
 
962
1019
  // src/query/hooks/use-location-mutations.ts
963
- async function invalidateProfile5(queryClient, ownerHandleOrDid) {
1020
+ async function invalidateProfile6(queryClient, ownerHandleOrDid) {
964
1021
  await queryClient.invalidateQueries({
965
1022
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
966
1023
  });
@@ -975,7 +1032,7 @@ function useCreateProfileLocation(ownerHandleOrDid, options) {
975
1032
  mutationFn: (data) => createProfileLocation(config, data),
976
1033
  onSuccess: async (result, variables, onMutateResult, context) => {
977
1034
  if (result.success) {
978
- await invalidateProfile5(queryClient, ownerHandleOrDid);
1035
+ await invalidateProfile6(queryClient, ownerHandleOrDid);
979
1036
  }
980
1037
  await options?.onSuccess?.(result, variables, onMutateResult, context);
981
1038
  }
@@ -991,7 +1048,7 @@ function useUpdateProfileLocation(ownerHandleOrDid, options) {
991
1048
  mutationFn: ({ rkey, data }) => updateProfileLocation(config, rkey, data),
992
1049
  onSuccess: async (result, variables, onMutateResult, context) => {
993
1050
  if (result.success) {
994
- await invalidateProfile5(queryClient, ownerHandleOrDid);
1051
+ await invalidateProfile6(queryClient, ownerHandleOrDid);
995
1052
  }
996
1053
  await options?.onSuccess?.(result, variables, onMutateResult, context);
997
1054
  }
@@ -1007,7 +1064,7 @@ function useDeleteProfileLocation(ownerHandleOrDid, options) {
1007
1064
  mutationFn: (rkey) => deleteProfileLocation(config, rkey),
1008
1065
  onSuccess: async (result, variables, onMutateResult, context) => {
1009
1066
  if (result.success) {
1010
- await invalidateProfile5(queryClient, ownerHandleOrDid);
1067
+ await invalidateProfile6(queryClient, ownerHandleOrDid);
1011
1068
  }
1012
1069
  await options?.onSuccess?.(result, variables, onMutateResult, context);
1013
1070
  }
@@ -1510,7 +1567,7 @@ function unhideKeytraceClaim(config, rkey, options = {}) {
1510
1567
  }
1511
1568
 
1512
1569
  // src/query/hooks/use-keytrace-claims.ts
1513
- async function invalidateProfile6(queryClient, ownerHandleOrDid) {
1570
+ async function invalidateProfile7(queryClient, ownerHandleOrDid) {
1514
1571
  await queryClient.invalidateQueries({
1515
1572
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
1516
1573
  });
@@ -1525,7 +1582,7 @@ function useHideKeytraceClaim(ownerHandleOrDid, options) {
1525
1582
  mutationFn: (rkey) => hideKeytraceClaim(config, rkey),
1526
1583
  onSuccess: async (result, variables, onMutateResult, context) => {
1527
1584
  if (result.success) {
1528
- await invalidateProfile6(queryClient, ownerHandleOrDid);
1585
+ await invalidateProfile7(queryClient, ownerHandleOrDid);
1529
1586
  }
1530
1587
  await options?.onSuccess?.(result, variables, onMutateResult, context);
1531
1588
  }
@@ -1541,7 +1598,7 @@ function useUnhideKeytraceClaim(ownerHandleOrDid, options) {
1541
1598
  mutationFn: (rkey) => unhideKeytraceClaim(config, rkey),
1542
1599
  onSuccess: async (result, variables, onMutateResult, context) => {
1543
1600
  if (result.success) {
1544
- await invalidateProfile6(queryClient, ownerHandleOrDid);
1601
+ await invalidateProfile7(queryClient, ownerHandleOrDid);
1545
1602
  }
1546
1603
  await options?.onSuccess?.(result, variables, onMutateResult, context);
1547
1604
  }
@@ -1567,7 +1624,7 @@ function unrevealMarqueDomain(config, domain, options = {}) {
1567
1624
  }
1568
1625
 
1569
1626
  // src/query/hooks/use-marque-domains.ts
1570
- async function invalidateProfile7(queryClient, ownerHandleOrDid) {
1627
+ async function invalidateProfile8(queryClient, ownerHandleOrDid) {
1571
1628
  await queryClient.invalidateQueries({
1572
1629
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
1573
1630
  });
@@ -1582,7 +1639,7 @@ function useRevealMarqueDomain(ownerHandleOrDid, options) {
1582
1639
  mutationFn: (domain) => revealMarqueDomain(config, domain),
1583
1640
  onSuccess: async (result, variables, onMutateResult, context) => {
1584
1641
  if (result.success) {
1585
- await invalidateProfile7(queryClient, ownerHandleOrDid);
1642
+ await invalidateProfile8(queryClient, ownerHandleOrDid);
1586
1643
  }
1587
1644
  await options?.onSuccess?.(result, variables, onMutateResult, context);
1588
1645
  }
@@ -1598,7 +1655,7 @@ function useUnrevealMarqueDomain(ownerHandleOrDid, options) {
1598
1655
  mutationFn: (domain) => unrevealMarqueDomain(config, domain),
1599
1656
  onSuccess: async (result, variables, onMutateResult, context) => {
1600
1657
  if (result.success) {
1601
- await invalidateProfile7(queryClient, ownerHandleOrDid);
1658
+ await invalidateProfile8(queryClient, ownerHandleOrDid);
1602
1659
  }
1603
1660
  await options?.onSuccess?.(result, variables, onMutateResult, context);
1604
1661
  }
@@ -1660,7 +1717,7 @@ async function refreshOrcidPublications(config, options = {}) {
1660
1717
  }
1661
1718
 
1662
1719
  // src/query/hooks/use-publication-mutations.ts
1663
- async function invalidateProfile8(queryClient, ownerHandleOrDid) {
1720
+ async function invalidateProfile9(queryClient, ownerHandleOrDid) {
1664
1721
  await queryClient.invalidateQueries({
1665
1722
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
1666
1723
  });
@@ -1676,7 +1733,7 @@ function makeWriteHook(fetcher) {
1676
1733
  mutationFn: (v) => fetcher(config, v),
1677
1734
  onSuccess: async (result, variables, onMutateResult, context) => {
1678
1735
  if (result.success) {
1679
- await invalidateProfile8(queryClient, ownerHandleOrDid);
1736
+ await invalidateProfile9(queryClient, ownerHandleOrDid);
1680
1737
  }
1681
1738
  await options?.onSuccess?.(result, variables, onMutateResult, context);
1682
1739
  }
@@ -1714,7 +1771,7 @@ function useRefreshOrcidPublications(ownerHandleOrDid, options) {
1714
1771
  mutationFn: () => refreshOrcidPublications(config),
1715
1772
  onSuccess: async (result, variables, onMutateResult, context) => {
1716
1773
  if (result.success) {
1717
- await invalidateProfile8(queryClient, ownerHandleOrDid);
1774
+ await invalidateProfile9(queryClient, ownerHandleOrDid);
1718
1775
  }
1719
1776
  await options?.onSuccess?.(result, variables, onMutateResult, context);
1720
1777
  }
@@ -1736,7 +1793,7 @@ function bulkUnhideProfileItems(config, input, options = {}) {
1736
1793
  }
1737
1794
 
1738
1795
  // src/query/hooks/use-profile-items-hide.ts
1739
- async function invalidateProfile9(queryClient, ownerHandleOrDid) {
1796
+ async function invalidateProfile10(queryClient, ownerHandleOrDid) {
1740
1797
  await queryClient.invalidateQueries({
1741
1798
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
1742
1799
  });
@@ -1749,7 +1806,7 @@ function makeWriteHook2(fetcher) {
1749
1806
  mutationFn: (v) => fetcher(config, v),
1750
1807
  onSuccess: async (result, variables, onMutateResult, context) => {
1751
1808
  if (result.success) {
1752
- await invalidateProfile9(queryClient, ownerHandleOrDid);
1809
+ await invalidateProfile10(queryClient, ownerHandleOrDid);
1753
1810
  }
1754
1811
  await options?.onSuccess?.(result, variables, onMutateResult, context);
1755
1812
  },
@@ -3362,6 +3419,7 @@ zod.z.object({
3362
3419
  startedAt: partialDateSchema.optional(),
3363
3420
  endedAt: partialDateSchema.optional(),
3364
3421
  labels: selfLabelsSchema.optional(),
3422
+ isPrimary: zod.z.boolean().optional(),
3365
3423
  createdAt: datetimeSchema
3366
3424
  });
3367
3425
 
@@ -3391,6 +3449,7 @@ zod.z.object({
3391
3449
  labels: selfLabelsSchema.optional(),
3392
3450
  collaborators: zod.z.array(projectMemberRefSchema).max(50).optional(),
3393
3451
  sameAs: externalRecordRefSchema.optional(),
3452
+ isPrimary: zod.z.boolean().optional(),
3394
3453
  createdAt: datetimeSchema
3395
3454
  }).passthrough();
3396
3455
 
@@ -3584,6 +3643,7 @@ exports.useSearchProfiles = useSearchProfiles;
3584
3643
  exports.useSelectEntity = useSelectEntity;
3585
3644
  exports.useSetExternalAccountPrimary = useSetExternalAccountPrimary;
3586
3645
  exports.useSetPositionPrimary = useSetPositionPrimary;
3646
+ exports.useSetSectionPrimary = useSetSectionPrimary;
3587
3647
  exports.useSifaConfig = useSifaConfig;
3588
3648
  exports.useSimilarProfiles = useSimilarProfiles;
3589
3649
  exports.useSkillSuggestions = useSkillSuggestions;
@@ -3602,6 +3662,7 @@ exports.useUnlinkedPositions = useUnlinkedPositions;
3602
3662
  exports.useUnrevealMarqueDomain = useUnrevealMarqueDomain;
3603
3663
  exports.useUnsetExternalAccountPrimary = useUnsetExternalAccountPrimary;
3604
3664
  exports.useUnsetPositionPrimary = useUnsetPositionPrimary;
3665
+ exports.useUnsetSectionPrimary = useUnsetSectionPrimary;
3605
3666
  exports.useUpdateEducation = useUpdateEducation;
3606
3667
  exports.useUpdateExternalAccount = useUpdateExternalAccount;
3607
3668
  exports.useUpdateInvestment = useUpdateInvestment;