@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
@@ -350,6 +350,24 @@ function deleteEducation(config, rkey, options = {}) {
350
350
  return apiWrite(config, `/api/profile/education/${encodeURIComponent(rkey)}`, "DELETE", options);
351
351
  }
352
352
 
353
+ // src/query/fetchers/section-primary.ts
354
+ function setSectionPrimary(config, section, rkey, options = {}) {
355
+ return apiWrite(
356
+ config,
357
+ `/api/profile/${section}/${encodeURIComponent(rkey)}/primary`,
358
+ "PUT",
359
+ options
360
+ );
361
+ }
362
+ function unsetSectionPrimary(config, section, rkey, options = {}) {
363
+ return apiWrite(
364
+ config,
365
+ `/api/profile/${section}/${encodeURIComponent(rkey)}/primary`,
366
+ "DELETE",
367
+ options
368
+ );
369
+ }
370
+
353
371
  // src/query/fetchers/skills.ts
354
372
  function createSkill(config, data, options = {}) {
355
373
  return apiWriteCreate(config, "/api/profile/skill", data, options);
@@ -2169,6 +2187,43 @@ async function invalidateProfile3(queryClient, ownerHandleOrDid) {
2169
2187
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
2170
2188
  });
2171
2189
  }
2190
+ function useSetSectionPrimary(section, ownerHandleOrDid, options) {
2191
+ const config = useSifaConfig();
2192
+ const queryClient = reactQuery.useQueryClient();
2193
+ return reactQuery.useMutation({
2194
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
2195
+ // handler below and silently drop cache invalidation (#453).
2196
+ ...options,
2197
+ mutationFn: (rkey) => setSectionPrimary(config, section, rkey),
2198
+ onSuccess: async (result, variables, onMutateResult, context) => {
2199
+ if (result.success) {
2200
+ await invalidateProfile3(queryClient, ownerHandleOrDid);
2201
+ }
2202
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2203
+ }
2204
+ });
2205
+ }
2206
+ function useUnsetSectionPrimary(section, ownerHandleOrDid, options) {
2207
+ const config = useSifaConfig();
2208
+ const queryClient = reactQuery.useQueryClient();
2209
+ return reactQuery.useMutation({
2210
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
2211
+ // handler below and silently drop cache invalidation (#453).
2212
+ ...options,
2213
+ mutationFn: (rkey) => unsetSectionPrimary(config, section, rkey),
2214
+ onSuccess: async (result, variables, onMutateResult, context) => {
2215
+ if (result.success) {
2216
+ await invalidateProfile3(queryClient, ownerHandleOrDid);
2217
+ }
2218
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
2219
+ }
2220
+ });
2221
+ }
2222
+ async function invalidateProfile4(queryClient, ownerHandleOrDid) {
2223
+ await queryClient.invalidateQueries({
2224
+ queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
2225
+ });
2226
+ }
2172
2227
  function useCreateSkill(ownerHandleOrDid, options) {
2173
2228
  const config = useSifaConfig();
2174
2229
  const queryClient = reactQuery.useQueryClient();
@@ -2179,7 +2234,7 @@ function useCreateSkill(ownerHandleOrDid, options) {
2179
2234
  mutationFn: (data) => createSkill(config, data),
2180
2235
  onSuccess: async (result, variables, onMutateResult, context) => {
2181
2236
  if (result.success) {
2182
- await invalidateProfile3(queryClient, ownerHandleOrDid);
2237
+ await invalidateProfile4(queryClient, ownerHandleOrDid);
2183
2238
  }
2184
2239
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2185
2240
  }
@@ -2195,7 +2250,7 @@ function useUpdateSkill(ownerHandleOrDid, options) {
2195
2250
  mutationFn: ({ rkey, data }) => updateSkill(config, rkey, data),
2196
2251
  onSuccess: async (result, variables, onMutateResult, context) => {
2197
2252
  if (result.success) {
2198
- await invalidateProfile3(queryClient, ownerHandleOrDid);
2253
+ await invalidateProfile4(queryClient, ownerHandleOrDid);
2199
2254
  }
2200
2255
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2201
2256
  }
@@ -2213,7 +2268,7 @@ function useUpdateSkillSubCategories(ownerHandleOrDid, options) {
2213
2268
  ...options,
2214
2269
  onSuccess: async (result, variables, onMutateResult, context) => {
2215
2270
  if (result.success) {
2216
- await invalidateProfile3(queryClient, ownerHandleOrDid);
2271
+ await invalidateProfile4(queryClient, ownerHandleOrDid);
2217
2272
  }
2218
2273
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2219
2274
  }
@@ -2229,13 +2284,13 @@ function useDeleteSkill(ownerHandleOrDid, options) {
2229
2284
  mutationFn: (rkey) => deleteSkill(config, rkey),
2230
2285
  onSuccess: async (result, variables, onMutateResult, context) => {
2231
2286
  if (result.success) {
2232
- await invalidateProfile3(queryClient, ownerHandleOrDid);
2287
+ await invalidateProfile4(queryClient, ownerHandleOrDid);
2233
2288
  }
2234
2289
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2235
2290
  }
2236
2291
  });
2237
2292
  }
2238
- async function invalidateProfile4(queryClient, ownerHandleOrDid) {
2293
+ async function invalidateProfile5(queryClient, ownerHandleOrDid) {
2239
2294
  await queryClient.invalidateQueries({
2240
2295
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
2241
2296
  });
@@ -2250,7 +2305,7 @@ function useCreateRecord(ownerHandleOrDid, options) {
2250
2305
  mutationFn: ({ collection, data }) => createRecord(config, collection, data),
2251
2306
  onSuccess: async (result, variables, onMutateResult, context) => {
2252
2307
  if (result.success) {
2253
- await invalidateProfile4(queryClient, ownerHandleOrDid);
2308
+ await invalidateProfile5(queryClient, ownerHandleOrDid);
2254
2309
  }
2255
2310
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2256
2311
  }
@@ -2266,7 +2321,7 @@ function useUpdateRecord(ownerHandleOrDid, options) {
2266
2321
  mutationFn: ({ collection, rkey, data }) => updateRecord(config, collection, rkey, data),
2267
2322
  onSuccess: async (result, variables, onMutateResult, context) => {
2268
2323
  if (result.success) {
2269
- await invalidateProfile4(queryClient, ownerHandleOrDid);
2324
+ await invalidateProfile5(queryClient, ownerHandleOrDid);
2270
2325
  }
2271
2326
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2272
2327
  }
@@ -2282,13 +2337,13 @@ function useDeleteRecord(ownerHandleOrDid, options) {
2282
2337
  mutationFn: ({ collection, rkey }) => deleteRecord(config, collection, rkey),
2283
2338
  onSuccess: async (result, variables, onMutateResult, context) => {
2284
2339
  if (result.success) {
2285
- await invalidateProfile4(queryClient, ownerHandleOrDid);
2340
+ await invalidateProfile5(queryClient, ownerHandleOrDid);
2286
2341
  }
2287
2342
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2288
2343
  }
2289
2344
  });
2290
2345
  }
2291
- async function invalidateProfile5(queryClient, ownerHandleOrDid) {
2346
+ async function invalidateProfile6(queryClient, ownerHandleOrDid) {
2292
2347
  await queryClient.invalidateQueries({
2293
2348
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
2294
2349
  });
@@ -2303,7 +2358,7 @@ function useCreateProfileLocation(ownerHandleOrDid, options) {
2303
2358
  mutationFn: (data) => createProfileLocation(config, data),
2304
2359
  onSuccess: async (result, variables, onMutateResult, context) => {
2305
2360
  if (result.success) {
2306
- await invalidateProfile5(queryClient, ownerHandleOrDid);
2361
+ await invalidateProfile6(queryClient, ownerHandleOrDid);
2307
2362
  }
2308
2363
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2309
2364
  }
@@ -2319,7 +2374,7 @@ function useUpdateProfileLocation(ownerHandleOrDid, options) {
2319
2374
  mutationFn: ({ rkey, data }) => updateProfileLocation(config, rkey, data),
2320
2375
  onSuccess: async (result, variables, onMutateResult, context) => {
2321
2376
  if (result.success) {
2322
- await invalidateProfile5(queryClient, ownerHandleOrDid);
2377
+ await invalidateProfile6(queryClient, ownerHandleOrDid);
2323
2378
  }
2324
2379
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2325
2380
  }
@@ -2335,7 +2390,7 @@ function useDeleteProfileLocation(ownerHandleOrDid, options) {
2335
2390
  mutationFn: (rkey) => deleteProfileLocation(config, rkey),
2336
2391
  onSuccess: async (result, variables, onMutateResult, context) => {
2337
2392
  if (result.success) {
2338
- await invalidateProfile5(queryClient, ownerHandleOrDid);
2393
+ await invalidateProfile6(queryClient, ownerHandleOrDid);
2339
2394
  }
2340
2395
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2341
2396
  }
@@ -2687,7 +2742,7 @@ function useProfileCompleteness(options) {
2687
2742
  ...options
2688
2743
  });
2689
2744
  }
2690
- async function invalidateProfile6(queryClient, ownerHandleOrDid) {
2745
+ async function invalidateProfile7(queryClient, ownerHandleOrDid) {
2691
2746
  await queryClient.invalidateQueries({
2692
2747
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
2693
2748
  });
@@ -2702,7 +2757,7 @@ function useHideKeytraceClaim(ownerHandleOrDid, options) {
2702
2757
  mutationFn: (rkey) => hideKeytraceClaim(config, rkey),
2703
2758
  onSuccess: async (result, variables, onMutateResult, context) => {
2704
2759
  if (result.success) {
2705
- await invalidateProfile6(queryClient, ownerHandleOrDid);
2760
+ await invalidateProfile7(queryClient, ownerHandleOrDid);
2706
2761
  }
2707
2762
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2708
2763
  }
@@ -2718,13 +2773,13 @@ function useUnhideKeytraceClaim(ownerHandleOrDid, options) {
2718
2773
  mutationFn: (rkey) => unhideKeytraceClaim(config, rkey),
2719
2774
  onSuccess: async (result, variables, onMutateResult, context) => {
2720
2775
  if (result.success) {
2721
- await invalidateProfile6(queryClient, ownerHandleOrDid);
2776
+ await invalidateProfile7(queryClient, ownerHandleOrDid);
2722
2777
  }
2723
2778
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2724
2779
  }
2725
2780
  });
2726
2781
  }
2727
- async function invalidateProfile7(queryClient, ownerHandleOrDid) {
2782
+ async function invalidateProfile8(queryClient, ownerHandleOrDid) {
2728
2783
  await queryClient.invalidateQueries({
2729
2784
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
2730
2785
  });
@@ -2739,7 +2794,7 @@ function useRevealMarqueDomain(ownerHandleOrDid, options) {
2739
2794
  mutationFn: (domain) => revealMarqueDomain(config, domain),
2740
2795
  onSuccess: async (result, variables, onMutateResult, context) => {
2741
2796
  if (result.success) {
2742
- await invalidateProfile7(queryClient, ownerHandleOrDid);
2797
+ await invalidateProfile8(queryClient, ownerHandleOrDid);
2743
2798
  }
2744
2799
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2745
2800
  }
@@ -2755,13 +2810,13 @@ function useUnrevealMarqueDomain(ownerHandleOrDid, options) {
2755
2810
  mutationFn: (domain) => unrevealMarqueDomain(config, domain),
2756
2811
  onSuccess: async (result, variables, onMutateResult, context) => {
2757
2812
  if (result.success) {
2758
- await invalidateProfile7(queryClient, ownerHandleOrDid);
2813
+ await invalidateProfile8(queryClient, ownerHandleOrDid);
2759
2814
  }
2760
2815
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2761
2816
  }
2762
2817
  });
2763
2818
  }
2764
- async function invalidateProfile8(queryClient, ownerHandleOrDid) {
2819
+ async function invalidateProfile9(queryClient, ownerHandleOrDid) {
2765
2820
  await queryClient.invalidateQueries({
2766
2821
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
2767
2822
  });
@@ -2777,7 +2832,7 @@ function makeWriteHook(fetcher) {
2777
2832
  mutationFn: (v) => fetcher(config, v),
2778
2833
  onSuccess: async (result, variables, onMutateResult, context) => {
2779
2834
  if (result.success) {
2780
- await invalidateProfile8(queryClient, ownerHandleOrDid);
2835
+ await invalidateProfile9(queryClient, ownerHandleOrDid);
2781
2836
  }
2782
2837
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2783
2838
  }
@@ -2815,13 +2870,13 @@ function useRefreshOrcidPublications(ownerHandleOrDid, options) {
2815
2870
  mutationFn: () => refreshOrcidPublications(config),
2816
2871
  onSuccess: async (result, variables, onMutateResult, context) => {
2817
2872
  if (result.success) {
2818
- await invalidateProfile8(queryClient, ownerHandleOrDid);
2873
+ await invalidateProfile9(queryClient, ownerHandleOrDid);
2819
2874
  }
2820
2875
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2821
2876
  }
2822
2877
  });
2823
2878
  }
2824
- async function invalidateProfile9(queryClient, ownerHandleOrDid) {
2879
+ async function invalidateProfile10(queryClient, ownerHandleOrDid) {
2825
2880
  await queryClient.invalidateQueries({
2826
2881
  queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
2827
2882
  });
@@ -2834,7 +2889,7 @@ function makeWriteHook2(fetcher) {
2834
2889
  mutationFn: (v) => fetcher(config, v),
2835
2890
  onSuccess: async (result, variables, onMutateResult, context) => {
2836
2891
  if (result.success) {
2837
- await invalidateProfile9(queryClient, ownerHandleOrDid);
2892
+ await invalidateProfile10(queryClient, ownerHandleOrDid);
2838
2893
  }
2839
2894
  await options?.onSuccess?.(result, variables, onMutateResult, context);
2840
2895
  },
@@ -3761,6 +3816,7 @@ exports.searchSkills = searchSkills;
3761
3816
  exports.selectEntity = selectEntity;
3762
3817
  exports.setExternalAccountPrimary = setExternalAccountPrimary;
3763
3818
  exports.setPositionPrimary = setPositionPrimary;
3819
+ exports.setSectionPrimary = setSectionPrimary;
3764
3820
  exports.shouldGateAdultMedia = shouldGateAdultMedia;
3765
3821
  exports.sifaQueryKeys = sifaQueryKeys;
3766
3822
  exports.submitOrgClaim = submitOrgClaim;
@@ -3776,6 +3832,7 @@ exports.unlinkSkillFromPosition = unlinkSkillFromPosition;
3776
3832
  exports.unrevealMarqueDomain = unrevealMarqueDomain;
3777
3833
  exports.unsetExternalAccountPrimary = unsetExternalAccountPrimary;
3778
3834
  exports.unsetPositionPrimary = unsetPositionPrimary;
3835
+ exports.unsetSectionPrimary = unsetSectionPrimary;
3779
3836
  exports.updateBskyContentLabelPrefs = updateBskyContentLabelPrefs;
3780
3837
  exports.updateEducation = updateEducation;
3781
3838
  exports.updateExternalAccount = updateExternalAccount;
@@ -3887,6 +3944,7 @@ exports.useSearchProfiles = useSearchProfiles;
3887
3944
  exports.useSelectEntity = useSelectEntity;
3888
3945
  exports.useSetExternalAccountPrimary = useSetExternalAccountPrimary;
3889
3946
  exports.useSetPositionPrimary = useSetPositionPrimary;
3947
+ exports.useSetSectionPrimary = useSetSectionPrimary;
3890
3948
  exports.useSifaConfig = useSifaConfig;
3891
3949
  exports.useSimilarProfiles = useSimilarProfiles;
3892
3950
  exports.useSkillSuggestions = useSkillSuggestions;
@@ -3905,6 +3963,7 @@ exports.useUnlinkedPositions = useUnlinkedPositions;
3905
3963
  exports.useUnrevealMarqueDomain = useUnrevealMarqueDomain;
3906
3964
  exports.useUnsetExternalAccountPrimary = useUnsetExternalAccountPrimary;
3907
3965
  exports.useUnsetPositionPrimary = useUnsetPositionPrimary;
3966
+ exports.useUnsetSectionPrimary = useUnsetSectionPrimary;
3908
3967
  exports.useUpdateBskyContentLabelPrefs = useUpdateBskyContentLabelPrefs;
3909
3968
  exports.useUpdateEducation = useUpdateEducation;
3910
3969
  exports.useUpdateExternalAccount = useUpdateExternalAccount;