@singi-labs/sifa-sdk 0.12.31 → 0.12.33
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/README.md +1 -1
- package/dist/{index-ZoAKneCP.d.ts → index-CQiMQ3NO.d.ts} +21 -2
- package/dist/{index-CZAG8uku.d.ts → index-CtWYlM7v.d.ts} +2 -12
- package/dist/{index-C95t5Gg5.d.cts → index-D-Vlq0r4.d.cts} +21 -2
- package/dist/{index-O2oJHRq0.d.cts → index-DhO1kFRj.d.cts} +2 -12
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{org-Octhy3vS.d.ts → org-BjiTIiWq.d.ts} +59 -2
- package/dist/{org-DWAqK-TV.d.cts → org-CcbXH1FW.d.cts} +59 -2
- package/dist/query/fetchers/index.cjs +11 -0
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +2 -2
- package/dist/query/fetchers/index.d.ts +2 -2
- package/dist/query/fetchers/index.js +11 -1
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +46 -0
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +2 -2
- package/dist/query/hooks/index.d.ts +2 -2
- package/dist/query/hooks/index.js +45 -1
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +48 -0
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +4 -4
- package/dist/query/index.d.ts +4 -4
- package/dist/query/index.js +45 -1
- package/dist/query/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -235,6 +235,10 @@ var sifaQueryKeys = {
|
|
|
235
235
|
bskyPreferences: {
|
|
236
236
|
all: () => ["sifa", "bsky-preferences"],
|
|
237
237
|
contentLabels: () => ["sifa", "bsky-preferences", "content-labels"]
|
|
238
|
+
},
|
|
239
|
+
destructive: {
|
|
240
|
+
all: () => ["sifa", "destructive"],
|
|
241
|
+
wipePreview: () => ["sifa", "destructive", "wipe-preview"]
|
|
238
242
|
}
|
|
239
243
|
};
|
|
240
244
|
|
|
@@ -649,6 +653,12 @@ function updateSkill(config, rkey, data, options = {}) {
|
|
|
649
653
|
...options
|
|
650
654
|
});
|
|
651
655
|
}
|
|
656
|
+
function updateSkillSubCategories(config, rkeys, subCategory, options = {}) {
|
|
657
|
+
return apiWrite(config, "/api/profile/skills/subcategory", "POST", {
|
|
658
|
+
body: { rkeys, subCategory },
|
|
659
|
+
...options
|
|
660
|
+
});
|
|
661
|
+
}
|
|
652
662
|
function deleteSkill(config, rkey, options = {}) {
|
|
653
663
|
return apiWrite(config, `/api/profile/skill/${encodeURIComponent(rkey)}`, "DELETE", options);
|
|
654
664
|
}
|
|
@@ -687,6 +697,24 @@ function useUpdateSkill(ownerHandleOrDid, options) {
|
|
|
687
697
|
...options
|
|
688
698
|
});
|
|
689
699
|
}
|
|
700
|
+
function useUpdateSkillSubCategories(ownerHandleOrDid, options) {
|
|
701
|
+
const config = useSifaConfig();
|
|
702
|
+
const queryClient = reactQuery.useQueryClient();
|
|
703
|
+
return reactQuery.useMutation({
|
|
704
|
+
mutationFn: ({ rkeys, subCategory }) => updateSkillSubCategories(config, rkeys, subCategory),
|
|
705
|
+
// `...options` comes first so a caller-supplied onSuccess cannot replace the
|
|
706
|
+
// wrapper below and silently skip profile invalidation; the wrapper calls it
|
|
707
|
+
// instead. The older skill hooks in this file spread options last and still
|
|
708
|
+
// carry that bug.
|
|
709
|
+
...options,
|
|
710
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
711
|
+
if (result.success) {
|
|
712
|
+
await invalidateProfile3(queryClient, ownerHandleOrDid);
|
|
713
|
+
}
|
|
714
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
690
718
|
function useDeleteSkill(ownerHandleOrDid, options) {
|
|
691
719
|
const config = useSifaConfig();
|
|
692
720
|
const queryClient = reactQuery.useQueryClient();
|
|
@@ -2320,6 +2348,12 @@ function useRetractRoadmapVote(options) {
|
|
|
2320
2348
|
}
|
|
2321
2349
|
|
|
2322
2350
|
// src/query/fetchers/destructive.ts
|
|
2351
|
+
function fetchWipePreview(config, options = {}) {
|
|
2352
|
+
return apiFetch(config, "/api/profile/wipe-preview", {
|
|
2353
|
+
credentials: "include",
|
|
2354
|
+
...options
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2323
2357
|
function resetProfile(config, deletePdsData, options = {}) {
|
|
2324
2358
|
return apiWrite(config, "/api/profile/reset", "DELETE", {
|
|
2325
2359
|
body: { deletePdsData },
|
|
@@ -2339,6 +2373,16 @@ function deleteAccount(config, deletePdsData, options = {}) {
|
|
|
2339
2373
|
}
|
|
2340
2374
|
|
|
2341
2375
|
// src/query/hooks/use-destructive.ts
|
|
2376
|
+
function useWipePreview(options) {
|
|
2377
|
+
const config = useSifaConfig();
|
|
2378
|
+
return reactQuery.useQuery({
|
|
2379
|
+
queryKey: sifaQueryKeys.destructive.wipePreview(),
|
|
2380
|
+
queryFn: () => fetchWipePreview(config),
|
|
2381
|
+
staleTime: 0,
|
|
2382
|
+
gcTime: 0,
|
|
2383
|
+
...options
|
|
2384
|
+
});
|
|
2385
|
+
}
|
|
2342
2386
|
function useResetProfile(options) {
|
|
2343
2387
|
const config = useSifaConfig();
|
|
2344
2388
|
const queryClient = reactQuery.useQueryClient();
|
|
@@ -2701,7 +2745,9 @@ exports.useUpdateProfileOverride = useUpdateProfileOverride;
|
|
|
2701
2745
|
exports.useUpdateProfileSelf = useUpdateProfileSelf;
|
|
2702
2746
|
exports.useUpdateRecord = useUpdateRecord;
|
|
2703
2747
|
exports.useUpdateSkill = useUpdateSkill;
|
|
2748
|
+
exports.useUpdateSkillSubCategories = useUpdateSkillSubCategories;
|
|
2704
2749
|
exports.useUploadAvatar = useUploadAvatar;
|
|
2705
2750
|
exports.useVerifyExternalAccount = useVerifyExternalAccount;
|
|
2751
|
+
exports.useWipePreview = useWipePreview;
|
|
2706
2752
|
//# sourceMappingURL=index.cjs.map
|
|
2707
2753
|
//# sourceMappingURL=index.cjs.map
|