@singi-labs/sifa-sdk 0.12.83 → 0.12.85

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/{index-B0hFFPZ-.d.cts → index-jNyd5QP7.d.cts} +12 -0
  2. package/dist/{index-B0hFFPZ-.d.ts → index-jNyd5QP7.d.ts} +12 -0
  3. package/dist/index.cjs +2 -1
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +6 -6
  6. package/dist/index.d.ts +6 -6
  7. package/dist/index.js +2 -1
  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-D4fSIGnS.d.ts → network-map-GfIVEYpr.d.ts} +4 -4
  12. package/dist/{network-map-DSs6hrPJ.d.cts → network-map-y6U7m-hX.d.cts} +4 -4
  13. package/dist/{org-CSEOW8H6.d.cts → org-ClDqS3CM.d.cts} +20 -3
  14. package/dist/{org-C6MV4vE6.d.ts → org-GlACA06R.d.ts} +20 -3
  15. package/dist/{profile-investment-C97ssnBV.d.cts → profile-investment-CmiQxk5C.d.cts} +1 -0
  16. package/dist/{profile-investment-C97ssnBV.d.ts → profile-investment-CmiQxk5C.d.ts} +1 -0
  17. package/dist/{profile-summary-BG-cvwtJ.d.ts → profile-summary-8fapqzHv.d.ts} +1 -1
  18. package/dist/{profile-summary-CA40DYqQ.d.cts → profile-summary-DY78IoL9.d.cts} +1 -1
  19. package/dist/query/fetchers/index.cjs +30 -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 +29 -1
  24. package/dist/query/fetchers/index.js.map +1 -1
  25. package/dist/query/hooks/index.cjs +62 -0
  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 +61 -1
  30. package/dist/query/hooks/index.js.map +1 -1
  31. package/dist/query/index.cjs +64 -0
  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 +61 -1
  36. package/dist/query/index.js.map +1 -1
  37. package/dist/schemas/index.cjs +1 -0
  38. package/dist/schemas/index.cjs.map +1 -1
  39. package/dist/schemas/index.d.cts +1 -1
  40. package/dist/schemas/index.d.ts +1 -1
  41. package/dist/schemas/index.js +1 -0
  42. package/dist/schemas/index.js.map +1 -1
  43. package/dist/schemas/write/index.cjs +1 -0
  44. package/dist/schemas/write/index.cjs.map +1 -1
  45. package/dist/schemas/write/index.d.cts +1 -0
  46. package/dist/schemas/write/index.d.ts +1 -0
  47. package/dist/schemas/write/index.js +1 -0
  48. package/dist/schemas/write/index.js.map +1 -1
  49. package/dist/{types-Dbvf5D_Q.d.ts → types-8JaS6abh.d.ts} +1 -1
  50. package/dist/{types-CIWnMcKx.d.cts → types-8wAWvS-T.d.cts} +1 -1
  51. package/dist/{use-org-notification-emails-C1kpS75h.d.cts → use-org-notification-emails-B-oGiDHo.d.cts} +11 -4
  52. package/dist/{use-org-notification-emails-lL0SKnbt.d.ts → use-org-notification-emails-DGzW9MH6.d.ts} +11 -4
  53. package/package.json +1 -1
@@ -243,6 +243,34 @@ async function uploadAvatar(config, file, options = {}) {
243
243
  function deleteAvatarOverride(config, options = {}) {
244
244
  return apiWrite(config, "/api/profile/avatar", "DELETE", options);
245
245
  }
246
+ async function uploadNamePronunciationAudio(config, file, options = {}) {
247
+ const fetchFn = config.fetch ?? globalThis.fetch;
248
+ const url = `${config.baseUrl}/api/profile/pronunciation-audio`;
249
+ const formData = new FormData();
250
+ formData.append("file", file);
251
+ try {
252
+ const res = await fetchFn(url, {
253
+ method: "POST",
254
+ credentials: options.credentials ?? "include",
255
+ body: formData,
256
+ signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 3e4),
257
+ headers: options.headers
258
+ });
259
+ if (!res.ok) {
260
+ const errBody = await res.json().catch(() => ({}));
261
+ const msg = errBody.message ?? `Request failed (${res.status})`;
262
+ const pdsHost = errBody.pdsHost;
263
+ return { success: false, error: msg, ...pdsHost ? { pdsHost } : {} };
264
+ }
265
+ const data = await res.json();
266
+ return { success: true, url: data.url };
267
+ } catch {
268
+ return { success: false, error: "Network error" };
269
+ }
270
+ }
271
+ function deleteNamePronunciationAudio(config, options = {}) {
272
+ return apiWrite(config, "/api/profile/pronunciation-audio", "DELETE", options);
273
+ }
246
274
 
247
275
  // src/query/fetchers/positions.ts
248
276
  function createPosition(config, data, options = {}) {
@@ -1713,6 +1741,38 @@ function useDeleteAvatarOverride(ownerHandleOrDid, options) {
1713
1741
  }
1714
1742
  });
1715
1743
  }
1744
+ function useUploadNamePronunciationAudio(ownerHandleOrDid, options) {
1745
+ const config = useSifaConfig();
1746
+ const queryClient = reactQuery.useQueryClient();
1747
+ return reactQuery.useMutation({
1748
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
1749
+ // handler below and silently drop cache invalidation (#453).
1750
+ ...options,
1751
+ mutationFn: (file) => uploadNamePronunciationAudio(config, file),
1752
+ onSuccess: async (result, variables, onMutateResult, context) => {
1753
+ if (result.success) {
1754
+ await invalidateProfile(queryClient, ownerHandleOrDid);
1755
+ }
1756
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
1757
+ }
1758
+ });
1759
+ }
1760
+ function useDeleteNamePronunciationAudio(ownerHandleOrDid, options) {
1761
+ const config = useSifaConfig();
1762
+ const queryClient = reactQuery.useQueryClient();
1763
+ return reactQuery.useMutation({
1764
+ // Spread first: a consumer-supplied onSuccess would otherwise replace the
1765
+ // handler below and silently drop cache invalidation (#453).
1766
+ ...options,
1767
+ mutationFn: () => deleteNamePronunciationAudio(config),
1768
+ onSuccess: async (result, variables, onMutateResult, context) => {
1769
+ if (result.success) {
1770
+ await invalidateProfile(queryClient, ownerHandleOrDid);
1771
+ }
1772
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
1773
+ }
1774
+ });
1775
+ }
1716
1776
  function useCreatePosition(ownerDid, options) {
1717
1777
  const config = useSifaConfig();
1718
1778
  const queryClient = reactQuery.useQueryClient();
@@ -3296,6 +3356,7 @@ exports.deleteAccount = deleteAccount;
3296
3356
  exports.deleteAvatarOverride = deleteAvatarOverride;
3297
3357
  exports.deleteEducation = deleteEducation;
3298
3358
  exports.deleteExternalAccount = deleteExternalAccount;
3359
+ exports.deleteNamePronunciationAudio = deleteNamePronunciationAudio;
3299
3360
  exports.deletePosition = deletePosition;
3300
3361
  exports.deleteProfileLocation = deleteProfileLocation;
3301
3362
  exports.deleteReaction = deleteReaction;
@@ -3400,6 +3461,7 @@ exports.updateRecord = updateRecord;
3400
3461
  exports.updateSkill = updateSkill;
3401
3462
  exports.updateSkillSubCategories = updateSkillSubCategories;
3402
3463
  exports.uploadAvatar = uploadAvatar;
3464
+ exports.uploadNamePronunciationAudio = uploadNamePronunciationAudio;
3403
3465
  exports.useActivityFeed = useActivityFeed;
3404
3466
  exports.useActivityTeaser = useActivityTeaser;
3405
3467
  exports.useAddFeatureAllowlist = useAddFeatureAllowlist;
@@ -3431,6 +3493,7 @@ exports.useDeleteAccount = useDeleteAccount;
3431
3493
  exports.useDeleteAvatarOverride = useDeleteAvatarOverride;
3432
3494
  exports.useDeleteEducation = useDeleteEducation;
3433
3495
  exports.useDeleteExternalAccount = useDeleteExternalAccount;
3496
+ exports.useDeleteNamePronunciationAudio = useDeleteNamePronunciationAudio;
3434
3497
  exports.useDeletePosition = useDeletePosition;
3435
3498
  exports.useDeleteProfileLocation = useDeleteProfileLocation;
3436
3499
  exports.useDeleteReaction = useDeleteReaction;
@@ -3519,6 +3582,7 @@ exports.useUpdateRecord = useUpdateRecord;
3519
3582
  exports.useUpdateSkill = useUpdateSkill;
3520
3583
  exports.useUpdateSkillSubCategories = useUpdateSkillSubCategories;
3521
3584
  exports.useUploadAvatar = useUploadAvatar;
3585
+ exports.useUploadNamePronunciationAudio = useUploadNamePronunciationAudio;
3522
3586
  exports.useVerifyExternalAccount = useVerifyExternalAccount;
3523
3587
  exports.useWipePreview = useWipePreview;
3524
3588
  exports.verifyExternalAccount = verifyExternalAccount;