@singi-labs/sifa-sdk 0.12.43 → 0.12.45
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/{adult-content-JKDlPIbL.d.cts → adult-content-DPbdzRqN.d.cts} +57 -1
- package/dist/{adult-content-JKDlPIbL.d.ts → adult-content-DPbdzRqN.d.ts} +57 -1
- package/dist/{feed-C8aHEPw4.d.cts → feed-dOSy_48Z.d.cts} +1 -1
- package/dist/{feed-C8aHEPw4.d.ts → feed-dOSy_48Z.d.ts} +1 -1
- package/dist/{index-BsIdD2su.d.ts → index-8tpQ3aa6.d.ts} +13 -6
- package/dist/{index-ti9RAkMn.d.cts → index-C5bE9r3L.d.cts} +13 -6
- package/dist/{index-CIQinrgP.d.ts → index-CC03zp-c.d.ts} +31 -4
- package/dist/{index-DFSDtTFz.d.cts → index-DtpqwUb4.d.cts} +31 -4
- package/dist/index.cjs +37 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +37 -7
- package/dist/index.js.map +1 -1
- package/dist/{org-EA4mshbf.d.ts → org-C827hinr.d.ts} +107 -7
- package/dist/{org-C0OTQnnV.d.cts → org-DvskXMpB.d.cts} +107 -7
- package/dist/{profile-summary-CSmXD7ll.d.cts → profile-summary-BawHMAG9.d.cts} +1 -1
- package/dist/{profile-summary-C9E-HPeP.d.ts → profile-summary-M_mQaHdp.d.ts} +1 -1
- package/dist/query/fetchers/index.cjs +41 -1
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +5 -5
- package/dist/query/fetchers/index.d.ts +5 -5
- package/dist/query/fetchers/index.js +38 -2
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +103 -0
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +4 -4
- package/dist/query/hooks/index.d.ts +4 -4
- package/dist/query/hooks/index.js +100 -1
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +111 -1
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +9 -9
- package/dist/query/index.d.ts +9 -9
- package/dist/query/index.js +104 -2
- package/dist/query/index.js.map +1 -1
- package/dist/schemas/index.cjs +44 -2
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +20 -589
- package/dist/schemas/index.d.ts +20 -589
- package/dist/schemas/index.js +43 -3
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/write/index.cjs +8 -0
- package/dist/schemas/write/index.cjs.map +1 -1
- package/dist/schemas/write/index.d.cts +9 -0
- package/dist/schemas/write/index.d.ts +9 -0
- package/dist/schemas/write/index.js +8 -0
- package/dist/schemas/write/index.js.map +1 -1
- package/dist/shared-CNr-iMpc.d.cts +614 -0
- package/dist/shared-CNr-iMpc.d.ts +614 -0
- package/package.json +1 -1
|
@@ -224,6 +224,13 @@ var sifaQueryKeys = {
|
|
|
224
224
|
// from the session cookie, so there is only ever one inbox per client.
|
|
225
225
|
pending: () => ["sifa", "endorsement", "pending"]
|
|
226
226
|
},
|
|
227
|
+
confirmation: {
|
|
228
|
+
all: () => ["sifa", "confirmation"],
|
|
229
|
+
// Scoped to the session for the same reason as the endorsement inbox: the
|
|
230
|
+
// AppView reads the subject from the session cookie, so there is only ever
|
|
231
|
+
// one inbox per client.
|
|
232
|
+
pending: () => ["sifa", "confirmation", "pending"]
|
|
233
|
+
},
|
|
227
234
|
stream: {
|
|
228
235
|
all: () => ["sifa", "stream"],
|
|
229
236
|
networkCount: (did) => ["sifa", "stream", "network-count", did]
|
|
@@ -1055,6 +1062,98 @@ function useCreateEndorsement(endorsedHandleOrDid, options) {
|
|
|
1055
1062
|
});
|
|
1056
1063
|
}
|
|
1057
1064
|
|
|
1065
|
+
// src/query/fetchers/confirmations.ts
|
|
1066
|
+
async function fetchPendingConfirmations(config, options = {}) {
|
|
1067
|
+
try {
|
|
1068
|
+
const data = await apiFetch(config, "/api/confirmations/pending", {
|
|
1069
|
+
cache: "no-store",
|
|
1070
|
+
credentials: "include",
|
|
1071
|
+
timeoutMs: 5e3,
|
|
1072
|
+
...options
|
|
1073
|
+
});
|
|
1074
|
+
return { confirmations: data?.confirmations ?? [], cursor: data?.cursor };
|
|
1075
|
+
} catch {
|
|
1076
|
+
return { confirmations: [] };
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
function createConfirmation(config, data, options = {}) {
|
|
1080
|
+
return apiWriteCreate(config, "/api/confirmation", data, options);
|
|
1081
|
+
}
|
|
1082
|
+
function dismissConfirmation(config, data, options = {}) {
|
|
1083
|
+
return apiWrite(config, "/api/confirmation/dismiss", "POST", { body: data, ...options });
|
|
1084
|
+
}
|
|
1085
|
+
function revokeConfirmation(config, data, options = {}) {
|
|
1086
|
+
return apiWrite(config, "/api/confirmation/revoke", "POST", { body: data, ...options });
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// src/query/hooks/use-confirmations.ts
|
|
1090
|
+
function usePendingConfirmations(options) {
|
|
1091
|
+
const config = useSifaConfig();
|
|
1092
|
+
return reactQuery.useQuery({
|
|
1093
|
+
queryKey: sifaQueryKeys.confirmation.pending(),
|
|
1094
|
+
queryFn: () => fetchPendingConfirmations(config),
|
|
1095
|
+
...options
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
function useCreateConfirmation(claimerHandleOrDid, options) {
|
|
1099
|
+
const config = useSifaConfig();
|
|
1100
|
+
const queryClient = reactQuery.useQueryClient();
|
|
1101
|
+
return reactQuery.useMutation({
|
|
1102
|
+
mutationFn: (data) => createConfirmation(config, data),
|
|
1103
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
1104
|
+
if (result.success) {
|
|
1105
|
+
await queryClient.invalidateQueries({
|
|
1106
|
+
queryKey: sifaQueryKeys.confirmation.pending()
|
|
1107
|
+
});
|
|
1108
|
+
if (claimerHandleOrDid) {
|
|
1109
|
+
await queryClient.invalidateQueries({
|
|
1110
|
+
queryKey: sifaQueryKeys.profile.byHandle(claimerHandleOrDid)
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
1115
|
+
},
|
|
1116
|
+
...options
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
function useDismissConfirmation(options) {
|
|
1120
|
+
const config = useSifaConfig();
|
|
1121
|
+
const queryClient = reactQuery.useQueryClient();
|
|
1122
|
+
return reactQuery.useMutation({
|
|
1123
|
+
mutationFn: (data) => dismissConfirmation(config, data),
|
|
1124
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
1125
|
+
if (result.success) {
|
|
1126
|
+
await queryClient.invalidateQueries({
|
|
1127
|
+
queryKey: sifaQueryKeys.confirmation.pending()
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
1131
|
+
},
|
|
1132
|
+
...options
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
function useRevokeConfirmation(claimerHandleOrDid, options) {
|
|
1136
|
+
const config = useSifaConfig();
|
|
1137
|
+
const queryClient = reactQuery.useQueryClient();
|
|
1138
|
+
return reactQuery.useMutation({
|
|
1139
|
+
mutationFn: (data) => revokeConfirmation(config, data),
|
|
1140
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
1141
|
+
if (result.success) {
|
|
1142
|
+
await queryClient.invalidateQueries({
|
|
1143
|
+
queryKey: sifaQueryKeys.confirmation.pending()
|
|
1144
|
+
});
|
|
1145
|
+
if (claimerHandleOrDid) {
|
|
1146
|
+
await queryClient.invalidateQueries({
|
|
1147
|
+
queryKey: sifaQueryKeys.profile.byHandle(claimerHandleOrDid)
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
1152
|
+
},
|
|
1153
|
+
...options
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1058
1157
|
// src/query/fetchers/keytrace-claims.ts
|
|
1059
1158
|
function hideKeytraceClaim(config, rkey, options = {}) {
|
|
1060
1159
|
return apiWrite(
|
|
@@ -2673,6 +2772,7 @@ exports.useBulkUnhideProfileItems = useBulkUnhideProfileItems;
|
|
|
2673
2772
|
exports.useBulkUnhideStandardPublications = useBulkUnhideStandardPublications;
|
|
2674
2773
|
exports.useCanonicalSkillSearch = useCanonicalSkillSearch;
|
|
2675
2774
|
exports.useCastRoadmapVote = useCastRoadmapVote;
|
|
2775
|
+
exports.useCreateConfirmation = useCreateConfirmation;
|
|
2676
2776
|
exports.useCreateEducation = useCreateEducation;
|
|
2677
2777
|
exports.useCreateEndorsement = useCreateEndorsement;
|
|
2678
2778
|
exports.useCreateExternalAccount = useCreateExternalAccount;
|
|
@@ -2691,6 +2791,7 @@ exports.useDeleteProfileLocation = useDeleteProfileLocation;
|
|
|
2691
2791
|
exports.useDeleteReaction = useDeleteReaction;
|
|
2692
2792
|
exports.useDeleteRecord = useDeleteRecord;
|
|
2693
2793
|
exports.useDeleteSkill = useDeleteSkill;
|
|
2794
|
+
exports.useDismissConfirmation = useDismissConfirmation;
|
|
2694
2795
|
exports.useEndorsementCount = useEndorsementCount;
|
|
2695
2796
|
exports.useEntitySearch = useEntitySearch;
|
|
2696
2797
|
exports.useExternalAccounts = useExternalAccounts;
|
|
@@ -2719,6 +2820,7 @@ exports.useOrgClaim = useOrgClaim;
|
|
|
2719
2820
|
exports.useOrgDomainChallenge = useOrgDomainChallenge;
|
|
2720
2821
|
exports.useOrgDomainVerify = useOrgDomainVerify;
|
|
2721
2822
|
exports.useOrgProfile = useOrgProfile;
|
|
2823
|
+
exports.usePendingConfirmations = usePendingConfirmations;
|
|
2722
2824
|
exports.useProfile = useProfile;
|
|
2723
2825
|
exports.useReactionStatus = useReactionStatus;
|
|
2724
2826
|
exports.useRefreshOrcidPublications = useRefreshOrcidPublications;
|
|
@@ -2728,6 +2830,7 @@ exports.useRemoveOrgNotificationEmail = useRemoveOrgNotificationEmail;
|
|
|
2728
2830
|
exports.useResetProfile = useResetProfile;
|
|
2729
2831
|
exports.useRetractRoadmapVote = useRetractRoadmapVote;
|
|
2730
2832
|
exports.useRevealMarqueDomain = useRevealMarqueDomain;
|
|
2833
|
+
exports.useRevokeConfirmation = useRevokeConfirmation;
|
|
2731
2834
|
exports.useRoadmapVotes = useRoadmapVotes;
|
|
2732
2835
|
exports.useSearchFilters = useSearchFilters;
|
|
2733
2836
|
exports.useSearchProfiles = useSearchProfiles;
|