@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
package/dist/query/index.cjs
CHANGED
|
@@ -439,7 +439,12 @@ function createEndorsement(config, data, options = {}) {
|
|
|
439
439
|
return apiWriteCreate(config, "/api/endorsement", data, options);
|
|
440
440
|
}
|
|
441
441
|
function confirmEndorsement(config, data, options = {}) {
|
|
442
|
-
return apiWriteCreate(
|
|
442
|
+
return apiWriteCreate(
|
|
443
|
+
config,
|
|
444
|
+
"/api/endorsement/confirm",
|
|
445
|
+
data,
|
|
446
|
+
options
|
|
447
|
+
);
|
|
443
448
|
}
|
|
444
449
|
|
|
445
450
|
// src/query/fetchers/endorsement-inbox.ts
|
|
@@ -460,6 +465,30 @@ function dismissEndorsement(config, data, options = {}) {
|
|
|
460
465
|
return apiWrite(config, "/api/endorsement/dismiss", "POST", { body: data, ...options });
|
|
461
466
|
}
|
|
462
467
|
|
|
468
|
+
// src/query/fetchers/confirmations.ts
|
|
469
|
+
async function fetchPendingConfirmations(config, options = {}) {
|
|
470
|
+
try {
|
|
471
|
+
const data = await apiFetch(config, "/api/confirmations/pending", {
|
|
472
|
+
cache: "no-store",
|
|
473
|
+
credentials: "include",
|
|
474
|
+
timeoutMs: 5e3,
|
|
475
|
+
...options
|
|
476
|
+
});
|
|
477
|
+
return { confirmations: data?.confirmations ?? [], cursor: data?.cursor };
|
|
478
|
+
} catch {
|
|
479
|
+
return { confirmations: [] };
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function createConfirmation(config, data, options = {}) {
|
|
483
|
+
return apiWriteCreate(config, "/api/confirmation", data, options);
|
|
484
|
+
}
|
|
485
|
+
function dismissConfirmation(config, data, options = {}) {
|
|
486
|
+
return apiWrite(config, "/api/confirmation/dismiss", "POST", { body: data, ...options });
|
|
487
|
+
}
|
|
488
|
+
function revokeConfirmation(config, data, options = {}) {
|
|
489
|
+
return apiWrite(config, "/api/confirmation/revoke", "POST", { body: data, ...options });
|
|
490
|
+
}
|
|
491
|
+
|
|
463
492
|
// src/query/fetchers/actor.ts
|
|
464
493
|
async function fetchResolveActor(config, handleOrDid, options = {}) {
|
|
465
494
|
const q = handleOrDid.trim().replace(/^@/, "");
|
|
@@ -1440,6 +1469,13 @@ var sifaQueryKeys = {
|
|
|
1440
1469
|
// from the session cookie, so there is only ever one inbox per client.
|
|
1441
1470
|
pending: () => ["sifa", "endorsement", "pending"]
|
|
1442
1471
|
},
|
|
1472
|
+
confirmation: {
|
|
1473
|
+
all: () => ["sifa", "confirmation"],
|
|
1474
|
+
// Scoped to the session for the same reason as the endorsement inbox: the
|
|
1475
|
+
// AppView reads the subject from the session cookie, so there is only ever
|
|
1476
|
+
// one inbox per client.
|
|
1477
|
+
pending: () => ["sifa", "confirmation", "pending"]
|
|
1478
|
+
},
|
|
1443
1479
|
stream: {
|
|
1444
1480
|
all: () => ["sifa", "stream"],
|
|
1445
1481
|
networkCount: (did) => ["sifa", "stream", "network-count", did]
|
|
@@ -2048,6 +2084,72 @@ function useDismissEndorsement(options) {
|
|
|
2048
2084
|
...options
|
|
2049
2085
|
});
|
|
2050
2086
|
}
|
|
2087
|
+
function usePendingConfirmations(options) {
|
|
2088
|
+
const config = useSifaConfig();
|
|
2089
|
+
return reactQuery.useQuery({
|
|
2090
|
+
queryKey: sifaQueryKeys.confirmation.pending(),
|
|
2091
|
+
queryFn: () => fetchPendingConfirmations(config),
|
|
2092
|
+
...options
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
function useCreateConfirmation(claimerHandleOrDid, options) {
|
|
2096
|
+
const config = useSifaConfig();
|
|
2097
|
+
const queryClient = reactQuery.useQueryClient();
|
|
2098
|
+
return reactQuery.useMutation({
|
|
2099
|
+
mutationFn: (data) => createConfirmation(config, data),
|
|
2100
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
2101
|
+
if (result.success) {
|
|
2102
|
+
await queryClient.invalidateQueries({
|
|
2103
|
+
queryKey: sifaQueryKeys.confirmation.pending()
|
|
2104
|
+
});
|
|
2105
|
+
if (claimerHandleOrDid) {
|
|
2106
|
+
await queryClient.invalidateQueries({
|
|
2107
|
+
queryKey: sifaQueryKeys.profile.byHandle(claimerHandleOrDid)
|
|
2108
|
+
});
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
2112
|
+
},
|
|
2113
|
+
...options
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
function useDismissConfirmation(options) {
|
|
2117
|
+
const config = useSifaConfig();
|
|
2118
|
+
const queryClient = reactQuery.useQueryClient();
|
|
2119
|
+
return reactQuery.useMutation({
|
|
2120
|
+
mutationFn: (data) => dismissConfirmation(config, data),
|
|
2121
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
2122
|
+
if (result.success) {
|
|
2123
|
+
await queryClient.invalidateQueries({
|
|
2124
|
+
queryKey: sifaQueryKeys.confirmation.pending()
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
2128
|
+
},
|
|
2129
|
+
...options
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
function useRevokeConfirmation(claimerHandleOrDid, options) {
|
|
2133
|
+
const config = useSifaConfig();
|
|
2134
|
+
const queryClient = reactQuery.useQueryClient();
|
|
2135
|
+
return reactQuery.useMutation({
|
|
2136
|
+
mutationFn: (data) => revokeConfirmation(config, data),
|
|
2137
|
+
onSuccess: async (result, variables, onMutateResult, context) => {
|
|
2138
|
+
if (result.success) {
|
|
2139
|
+
await queryClient.invalidateQueries({
|
|
2140
|
+
queryKey: sifaQueryKeys.confirmation.pending()
|
|
2141
|
+
});
|
|
2142
|
+
if (claimerHandleOrDid) {
|
|
2143
|
+
await queryClient.invalidateQueries({
|
|
2144
|
+
queryKey: sifaQueryKeys.profile.byHandle(claimerHandleOrDid)
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
await options?.onSuccess?.(result, variables, onMutateResult, context);
|
|
2149
|
+
},
|
|
2150
|
+
...options
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2051
2153
|
async function invalidateProfile6(queryClient, ownerHandleOrDid) {
|
|
2052
2154
|
await queryClient.invalidateQueries({
|
|
2053
2155
|
queryKey: sifaQueryKeys.profile.byHandle(ownerHandleOrDid)
|
|
@@ -2917,6 +3019,7 @@ exports.castRoadmapVote = castRoadmapVote;
|
|
|
2917
3019
|
exports.checkAppAccount = checkAppAccount;
|
|
2918
3020
|
exports.checkNetworkMapJobStatus = checkNetworkMapJobStatus;
|
|
2919
3021
|
exports.confirmEndorsement = confirmEndorsement;
|
|
3022
|
+
exports.createConfirmation = createConfirmation;
|
|
2920
3023
|
exports.createEducation = createEducation;
|
|
2921
3024
|
exports.createEndorsement = createEndorsement;
|
|
2922
3025
|
exports.createExternalAccount = createExternalAccount;
|
|
@@ -2934,6 +3037,7 @@ exports.deleteProfileLocation = deleteProfileLocation;
|
|
|
2934
3037
|
exports.deleteReaction = deleteReaction;
|
|
2935
3038
|
exports.deleteRecord = deleteRecord;
|
|
2936
3039
|
exports.deleteSkill = deleteSkill;
|
|
3040
|
+
exports.dismissConfirmation = dismissConfirmation;
|
|
2937
3041
|
exports.dismissEndorsement = dismissEndorsement;
|
|
2938
3042
|
exports.effectiveContentVisibility = effectiveContentVisibility;
|
|
2939
3043
|
exports.fetchActivityFeed = fetchActivityFeed;
|
|
@@ -2953,6 +3057,7 @@ exports.fetchMyGithubPullRequests = fetchMyGithubPullRequests;
|
|
|
2953
3057
|
exports.fetchMyRoadmapVotes = fetchMyRoadmapVotes;
|
|
2954
3058
|
exports.fetchNetworkMap = fetchNetworkMap;
|
|
2955
3059
|
exports.fetchNetworkStreamCount = fetchNetworkStreamCount;
|
|
3060
|
+
exports.fetchPendingConfirmations = fetchPendingConfirmations;
|
|
2956
3061
|
exports.fetchPendingEndorsements = fetchPendingEndorsements;
|
|
2957
3062
|
exports.fetchProfile = fetchProfile;
|
|
2958
3063
|
exports.fetchProfileSummary = fetchProfileSummary;
|
|
@@ -2994,6 +3099,7 @@ exports.resolveEntityDomain = resolveEntityDomain;
|
|
|
2994
3099
|
exports.resolveQuotedPosts = resolveQuotedPosts;
|
|
2995
3100
|
exports.retractRoadmapVote = retractRoadmapVote;
|
|
2996
3101
|
exports.revealMarqueDomain = revealMarqueDomain;
|
|
3102
|
+
exports.revokeConfirmation = revokeConfirmation;
|
|
2997
3103
|
exports.searchSkills = searchSkills;
|
|
2998
3104
|
exports.selectEntity = selectEntity;
|
|
2999
3105
|
exports.setExternalAccountPrimary = setExternalAccountPrimary;
|
|
@@ -3039,6 +3145,7 @@ exports.useBulkUnhideStandardPublications = useBulkUnhideStandardPublications;
|
|
|
3039
3145
|
exports.useCanonicalSkillSearch = useCanonicalSkillSearch;
|
|
3040
3146
|
exports.useCastRoadmapVote = useCastRoadmapVote;
|
|
3041
3147
|
exports.useConfirmEndorsement = useConfirmEndorsement;
|
|
3148
|
+
exports.useCreateConfirmation = useCreateConfirmation;
|
|
3042
3149
|
exports.useCreateEducation = useCreateEducation;
|
|
3043
3150
|
exports.useCreateEndorsement = useCreateEndorsement;
|
|
3044
3151
|
exports.useCreateExternalAccount = useCreateExternalAccount;
|
|
@@ -3057,6 +3164,7 @@ exports.useDeleteProfileLocation = useDeleteProfileLocation;
|
|
|
3057
3164
|
exports.useDeleteReaction = useDeleteReaction;
|
|
3058
3165
|
exports.useDeleteRecord = useDeleteRecord;
|
|
3059
3166
|
exports.useDeleteSkill = useDeleteSkill;
|
|
3167
|
+
exports.useDismissConfirmation = useDismissConfirmation;
|
|
3060
3168
|
exports.useDismissEndorsement = useDismissEndorsement;
|
|
3061
3169
|
exports.useEndorsementCount = useEndorsementCount;
|
|
3062
3170
|
exports.useEntitySearch = useEntitySearch;
|
|
@@ -3087,6 +3195,7 @@ exports.useOrgClaim = useOrgClaim;
|
|
|
3087
3195
|
exports.useOrgDomainChallenge = useOrgDomainChallenge;
|
|
3088
3196
|
exports.useOrgDomainVerify = useOrgDomainVerify;
|
|
3089
3197
|
exports.useOrgProfile = useOrgProfile;
|
|
3198
|
+
exports.usePendingConfirmations = usePendingConfirmations;
|
|
3090
3199
|
exports.usePendingEndorsements = usePendingEndorsements;
|
|
3091
3200
|
exports.useProfile = useProfile;
|
|
3092
3201
|
exports.useReactionStatus = useReactionStatus;
|
|
@@ -3098,6 +3207,7 @@ exports.useResetProfile = useResetProfile;
|
|
|
3098
3207
|
exports.useResolveEntityDomain = useResolveEntityDomain;
|
|
3099
3208
|
exports.useRetractRoadmapVote = useRetractRoadmapVote;
|
|
3100
3209
|
exports.useRevealMarqueDomain = useRevealMarqueDomain;
|
|
3210
|
+
exports.useRevokeConfirmation = useRevokeConfirmation;
|
|
3101
3211
|
exports.useRoadmapVotes = useRoadmapVotes;
|
|
3102
3212
|
exports.useSearchFilters = useSearchFilters;
|
|
3103
3213
|
exports.useSearchProfiles = useSearchProfiles;
|