@singi-labs/sifa-sdk 0.12.49 → 0.12.50
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-r5KywRfC.d.cts → index-10rMsh0Y.d.cts} +13 -2
- package/dist/{index-L1xPmzKP.d.ts → index-CatO6M_Y.d.ts} +1 -1
- package/dist/{index-wf6rbBZZ.d.cts → index-CxZBzRTC.d.cts} +1 -1
- package/dist/{index-CddvYEbj.d.ts → index-KQD7YLsb.d.ts} +13 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{org-CZvX0wc7.d.ts → org-8ysVY69a.d.ts} +33 -2
- package/dist/{org-CVLKBRsw.d.cts → org-Be0SH7dO.d.cts} +33 -2
- package/dist/query/fetchers/index.cjs +16 -1
- 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 +16 -2
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +27 -1
- 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 +27 -2
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +28 -1
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +5 -5
- package/dist/query/index.d.ts +5 -5
- package/dist/query/index.js +27 -2
- package/dist/query/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -230,7 +230,9 @@ var sifaQueryKeys = {
|
|
|
230
230
|
// Scoped to the session for the same reason as the endorsement inbox: the
|
|
231
231
|
// AppView reads the subject from the session cookie, so there is only ever
|
|
232
232
|
// one inbox per client.
|
|
233
|
-
pending: () => ["sifa", "confirmation", "pending"]
|
|
233
|
+
pending: () => ["sifa", "confirmation", "pending"],
|
|
234
|
+
/** Confirmations this session has given, for the withdraw surface. */
|
|
235
|
+
given: () => ["sifa", "confirmation", "given"]
|
|
234
236
|
},
|
|
235
237
|
stream: {
|
|
236
238
|
all: () => ["sifa", "stream"],
|
|
@@ -1077,6 +1079,18 @@ async function fetchPendingConfirmations(config, options = {}) {
|
|
|
1077
1079
|
return { confirmations: [] };
|
|
1078
1080
|
}
|
|
1079
1081
|
}
|
|
1082
|
+
async function fetchGivenConfirmations(config, options = {}) {
|
|
1083
|
+
try {
|
|
1084
|
+
const data = await apiFetch(
|
|
1085
|
+
config,
|
|
1086
|
+
"/api/confirmations/mine",
|
|
1087
|
+
{ cache: "no-store", credentials: "include", timeoutMs: 5e3, ...options }
|
|
1088
|
+
);
|
|
1089
|
+
return { confirmations: data?.confirmations ?? [] };
|
|
1090
|
+
} catch {
|
|
1091
|
+
return { confirmations: [] };
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1080
1094
|
function createConfirmation(config, data, options = {}) {
|
|
1081
1095
|
return apiWriteCreate(config, "/api/confirmation", data, options);
|
|
1082
1096
|
}
|
|
@@ -1096,6 +1110,14 @@ function usePendingConfirmations(options) {
|
|
|
1096
1110
|
...options
|
|
1097
1111
|
});
|
|
1098
1112
|
}
|
|
1113
|
+
function useGivenConfirmations(options) {
|
|
1114
|
+
const config = useSifaConfig();
|
|
1115
|
+
return reactQuery.useQuery({
|
|
1116
|
+
queryKey: sifaQueryKeys.confirmation.given(),
|
|
1117
|
+
queryFn: () => fetchGivenConfirmations(config),
|
|
1118
|
+
...options
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1099
1121
|
function useCreateConfirmation(claimerHandleOrDid, options) {
|
|
1100
1122
|
const config = useSifaConfig();
|
|
1101
1123
|
const queryClient = reactQuery.useQueryClient();
|
|
@@ -1106,6 +1128,9 @@ function useCreateConfirmation(claimerHandleOrDid, options) {
|
|
|
1106
1128
|
await queryClient.invalidateQueries({
|
|
1107
1129
|
queryKey: sifaQueryKeys.confirmation.pending()
|
|
1108
1130
|
});
|
|
1131
|
+
await queryClient.invalidateQueries({
|
|
1132
|
+
queryKey: sifaQueryKeys.confirmation.given()
|
|
1133
|
+
});
|
|
1109
1134
|
if (claimerHandleOrDid) {
|
|
1110
1135
|
await queryClient.invalidateQueries({
|
|
1111
1136
|
queryKey: sifaQueryKeys.profile.byHandle(claimerHandleOrDid)
|
|
@@ -2841,6 +2866,7 @@ exports.useFollowing = useFollowing;
|
|
|
2841
2866
|
exports.useFollowingFeed = useFollowingFeed;
|
|
2842
2867
|
exports.useFollowingList = useFollowingList;
|
|
2843
2868
|
exports.useGetProfileView = useGetProfileView;
|
|
2869
|
+
exports.useGivenConfirmations = useGivenConfirmations;
|
|
2844
2870
|
exports.useHeatmapData = useHeatmapData;
|
|
2845
2871
|
exports.useHiddenApps = useHiddenApps;
|
|
2846
2872
|
exports.useHideKeytraceClaim = useHideKeytraceClaim;
|