@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.
- package/dist/{index-B0hFFPZ-.d.cts → index-jNyd5QP7.d.cts} +12 -0
- package/dist/{index-B0hFFPZ-.d.ts → index-jNyd5QP7.d.ts} +12 -0
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/jsonld/index.d.cts +1 -1
- package/dist/jsonld/index.d.ts +1 -1
- package/dist/{network-map-D4fSIGnS.d.ts → network-map-GfIVEYpr.d.ts} +4 -4
- package/dist/{network-map-DSs6hrPJ.d.cts → network-map-y6U7m-hX.d.cts} +4 -4
- package/dist/{org-CSEOW8H6.d.cts → org-ClDqS3CM.d.cts} +20 -3
- package/dist/{org-C6MV4vE6.d.ts → org-GlACA06R.d.ts} +20 -3
- package/dist/{profile-investment-C97ssnBV.d.cts → profile-investment-CmiQxk5C.d.cts} +1 -0
- package/dist/{profile-investment-C97ssnBV.d.ts → profile-investment-CmiQxk5C.d.ts} +1 -0
- package/dist/{profile-summary-BG-cvwtJ.d.ts → profile-summary-8fapqzHv.d.ts} +1 -1
- package/dist/{profile-summary-CA40DYqQ.d.cts → profile-summary-DY78IoL9.d.cts} +1 -1
- package/dist/query/fetchers/index.cjs +30 -0
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +6 -6
- package/dist/query/fetchers/index.d.ts +6 -6
- package/dist/query/fetchers/index.js +29 -1
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +62 -0
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +5 -5
- package/dist/query/hooks/index.d.ts +5 -5
- package/dist/query/hooks/index.js +61 -1
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +64 -0
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +8 -8
- package/dist/query/index.d.ts +8 -8
- package/dist/query/index.js +61 -1
- package/dist/query/index.js.map +1 -1
- package/dist/schemas/index.cjs +1 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/write/index.cjs +1 -0
- package/dist/schemas/write/index.cjs.map +1 -1
- package/dist/schemas/write/index.d.cts +1 -0
- package/dist/schemas/write/index.d.ts +1 -0
- package/dist/schemas/write/index.js +1 -0
- package/dist/schemas/write/index.js.map +1 -1
- package/dist/{types-Dbvf5D_Q.d.ts → types-8JaS6abh.d.ts} +1 -1
- package/dist/{types-CIWnMcKx.d.cts → types-8wAWvS-T.d.cts} +1 -1
- package/dist/{use-org-notification-emails-C1kpS75h.d.cts → use-org-notification-emails-B-oGiDHo.d.cts} +11 -4
- package/dist/{use-org-notification-emails-lL0SKnbt.d.ts → use-org-notification-emails-DGzW9MH6.d.ts} +11 -4
- package/package.json +1 -1
|
@@ -354,6 +354,34 @@ async function uploadAvatar(config, file, options = {}) {
|
|
|
354
354
|
function deleteAvatarOverride(config, options = {}) {
|
|
355
355
|
return apiWrite(config, "/api/profile/avatar", "DELETE", options);
|
|
356
356
|
}
|
|
357
|
+
async function uploadNamePronunciationAudio(config, file, options = {}) {
|
|
358
|
+
const fetchFn = config.fetch ?? globalThis.fetch;
|
|
359
|
+
const url = `${config.baseUrl}/api/profile/pronunciation-audio`;
|
|
360
|
+
const formData = new FormData();
|
|
361
|
+
formData.append("file", file);
|
|
362
|
+
try {
|
|
363
|
+
const res = await fetchFn(url, {
|
|
364
|
+
method: "POST",
|
|
365
|
+
credentials: options.credentials ?? "include",
|
|
366
|
+
body: formData,
|
|
367
|
+
signal: options.signal ?? AbortSignal.timeout(options.timeoutMs ?? 3e4),
|
|
368
|
+
headers: options.headers
|
|
369
|
+
});
|
|
370
|
+
if (!res.ok) {
|
|
371
|
+
const errBody = await res.json().catch(() => ({}));
|
|
372
|
+
const msg = errBody.message ?? `Request failed (${res.status})`;
|
|
373
|
+
const pdsHost = errBody.pdsHost;
|
|
374
|
+
return { success: false, error: msg, ...pdsHost ? { pdsHost } : {} };
|
|
375
|
+
}
|
|
376
|
+
const data = await res.json();
|
|
377
|
+
return { success: true, url: data.url };
|
|
378
|
+
} catch {
|
|
379
|
+
return { success: false, error: "Network error" };
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function deleteNamePronunciationAudio(config, options = {}) {
|
|
383
|
+
return apiWrite(config, "/api/profile/pronunciation-audio", "DELETE", options);
|
|
384
|
+
}
|
|
357
385
|
|
|
358
386
|
// src/query/hooks/use-profile-mutations.ts
|
|
359
387
|
async function invalidateProfile(queryClient, ownerHandleOrDid) {
|
|
@@ -441,6 +469,38 @@ function useDeleteAvatarOverride(ownerHandleOrDid, options) {
|
|
|
441
469
|
}
|
|
442
470
|
});
|
|
443
471
|
}
|
|
472
|
+
function useUploadNamePronunciationAudio(ownerHandleOrDid, options) {
|
|
473
|
+
const config = useSifaConfig();
|
|
474
|
+
const queryClient = reactQuery.useQueryClient();
|
|
475
|
+
return reactQuery.useMutation({
|
|
476
|
+
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
477
|
+
// handler below and silently drop cache invalidation (#453).
|
|
478
|
+
...options,
|
|
479
|
+
mutationFn: (file) => uploadNamePronunciationAudio(config, file),
|
|
480
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
481
|
+
if (result.success) {
|
|
482
|
+
await invalidateProfile(queryClient, ownerHandleOrDid);
|
|
483
|
+
}
|
|
484
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
function useDeleteNamePronunciationAudio(ownerHandleOrDid, options) {
|
|
489
|
+
const config = useSifaConfig();
|
|
490
|
+
const queryClient = reactQuery.useQueryClient();
|
|
491
|
+
return reactQuery.useMutation({
|
|
492
|
+
// Spread first: a consumer-supplied onSuccess would otherwise replace the
|
|
493
|
+
// handler below and silently drop cache invalidation (#453).
|
|
494
|
+
...options,
|
|
495
|
+
mutationFn: () => deleteNamePronunciationAudio(config),
|
|
496
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
497
|
+
if (result.success) {
|
|
498
|
+
await invalidateProfile(queryClient, ownerHandleOrDid);
|
|
499
|
+
}
|
|
500
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
}
|
|
444
504
|
|
|
445
505
|
// src/query/fetchers/positions.ts
|
|
446
506
|
function createPosition(config, data, options = {}) {
|
|
@@ -3203,6 +3263,7 @@ exports.useDeleteAvatarOverride = useDeleteAvatarOverride;
|
|
|
3203
3263
|
exports.useDeleteEducation = useDeleteEducation;
|
|
3204
3264
|
exports.useDeleteExternalAccount = useDeleteExternalAccount;
|
|
3205
3265
|
exports.useDeleteInvestment = useDeleteInvestment;
|
|
3266
|
+
exports.useDeleteNamePronunciationAudio = useDeleteNamePronunciationAudio;
|
|
3206
3267
|
exports.useDeletePosition = useDeletePosition;
|
|
3207
3268
|
exports.useDeleteProfileLocation = useDeleteProfileLocation;
|
|
3208
3269
|
exports.useDeleteReaction = useDeleteReaction;
|
|
@@ -3286,6 +3347,7 @@ exports.useUpdateRecord = useUpdateRecord;
|
|
|
3286
3347
|
exports.useUpdateSkill = useUpdateSkill;
|
|
3287
3348
|
exports.useUpdateSkillSubCategories = useUpdateSkillSubCategories;
|
|
3288
3349
|
exports.useUploadAvatar = useUploadAvatar;
|
|
3350
|
+
exports.useUploadNamePronunciationAudio = useUploadNamePronunciationAudio;
|
|
3289
3351
|
exports.useVerifyExternalAccount = useVerifyExternalAccount;
|
|
3290
3352
|
exports.useWipePreview = useWipePreview;
|
|
3291
3353
|
//# sourceMappingURL=index.cjs.map
|