@singi-labs/sifa-sdk 0.12.76 → 0.12.78
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-a3xqWsNm.d.cts → index-Uj1NC0QC.d.cts} +28 -1
- package/dist/{index-a3xqWsNm.d.ts → index-Uj1NC0QC.d.ts} +28 -1
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +9 -3
- 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-D5PJAs_l.d.cts → network-map-DMpXK9rM.d.cts} +30 -5
- package/dist/{network-map-BFjdjlj3.d.ts → network-map-kR4Ndke4.d.ts} +30 -5
- package/dist/{org-Co9muK52.d.ts → org-CnAMbO63.d.ts} +4 -3
- package/dist/{org-BOivj-0M.d.cts → org-DQyVyZ65.d.cts} +4 -3
- package/dist/{profile-summary-BTZAwG1z.d.cts → profile-summary-CbzSrQoE.d.cts} +1 -1
- package/dist/{profile-summary-Do5FY7Q0.d.ts → profile-summary-Yq3_odUX.d.ts} +1 -1
- package/dist/query/fetchers/index.cjs +24 -1
- 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 +24 -2
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +4 -1
- 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 +4 -1
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +33 -1
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +19 -10
- package/dist/query/index.d.ts +19 -10
- package/dist/query/index.js +32 -2
- package/dist/query/index.js.map +1 -1
- package/dist/{types-D0LWpGtY.d.cts → types-B3KOVEYy.d.cts} +1 -1
- package/dist/{types-C3xxTGUE.d.ts → types-Ct7WNyn9.d.ts} +1 -1
- package/dist/{use-org-notification-emails-Do-Zjtf8.d.cts → use-org-notification-emails-C45soS39.d.cts} +3 -3
- package/dist/{use-org-notification-emails-Cz6OldEp.d.ts → use-org-notification-emails-DaZqJMfA.d.ts} +3 -3
- package/package.json +1 -2
package/dist/query/index.cjs
CHANGED
|
@@ -447,6 +447,25 @@ function confirmEndorsement(config, data, options = {}) {
|
|
|
447
447
|
);
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
// src/query/fetchers/reciprocity.ts
|
|
451
|
+
async function fetchReciprocityCandidate(config, options = {}) {
|
|
452
|
+
try {
|
|
453
|
+
const data = await apiFetch(
|
|
454
|
+
config,
|
|
455
|
+
"/api/endorsements/reciprocity-candidate",
|
|
456
|
+
{
|
|
457
|
+
cache: "no-store",
|
|
458
|
+
credentials: "include",
|
|
459
|
+
timeoutMs: 5e3,
|
|
460
|
+
...options
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
return data?.candidate ?? null;
|
|
464
|
+
} catch {
|
|
465
|
+
return null;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
450
469
|
// src/query/fetchers/endorsement-inbox.ts
|
|
451
470
|
async function fetchPendingEndorsements(config, options = {}) {
|
|
452
471
|
try {
|
|
@@ -1522,7 +1541,10 @@ var sifaQueryKeys = {
|
|
|
1522
1541
|
count: (did) => ["sifa", "endorsement", "count", did],
|
|
1523
1542
|
// Scoped to the session rather than a DID -- the AppView reads the subject
|
|
1524
1543
|
// from the session cookie, so there is only ever one inbox per client.
|
|
1525
|
-
pending: () => ["sifa", "endorsement", "pending"]
|
|
1544
|
+
pending: () => ["sifa", "endorsement", "pending"],
|
|
1545
|
+
// Also session-scoped: the AppView picks the candidate from the viewer's
|
|
1546
|
+
// own follows, dismissals and blocks.
|
|
1547
|
+
reciprocity: () => ["sifa", "endorsement", "reciprocity"]
|
|
1526
1548
|
},
|
|
1527
1549
|
confirmation: {
|
|
1528
1550
|
all: () => ["sifa", "confirmation"],
|
|
@@ -2159,6 +2181,14 @@ function useCreateEndorsement(endorsedHandleOrDid, options) {
|
|
|
2159
2181
|
}
|
|
2160
2182
|
});
|
|
2161
2183
|
}
|
|
2184
|
+
function useReciprocityCandidate(options) {
|
|
2185
|
+
const config = useSifaConfig();
|
|
2186
|
+
return reactQuery.useQuery({
|
|
2187
|
+
queryKey: sifaQueryKeys.endorsement.reciprocity(),
|
|
2188
|
+
queryFn: () => fetchReciprocityCandidate(config),
|
|
2189
|
+
...options
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2162
2192
|
function usePendingEndorsements(options) {
|
|
2163
2193
|
const config = useSifaConfig();
|
|
2164
2194
|
return reactQuery.useQuery({
|
|
@@ -3271,6 +3301,7 @@ exports.fetchPendingEndorsements = fetchPendingEndorsements;
|
|
|
3271
3301
|
exports.fetchProfile = fetchProfile;
|
|
3272
3302
|
exports.fetchProfileSummary = fetchProfileSummary;
|
|
3273
3303
|
exports.fetchReactionStatus = fetchReactionStatus;
|
|
3304
|
+
exports.fetchReciprocityCandidate = fetchReciprocityCandidate;
|
|
3274
3305
|
exports.fetchRepoInventory = fetchRepoInventory;
|
|
3275
3306
|
exports.fetchResolveActor = fetchResolveActor;
|
|
3276
3307
|
exports.fetchRoadmapVotes = fetchRoadmapVotes;
|
|
@@ -3414,6 +3445,7 @@ exports.usePendingConfirmations = usePendingConfirmations;
|
|
|
3414
3445
|
exports.usePendingEndorsements = usePendingEndorsements;
|
|
3415
3446
|
exports.useProfile = useProfile;
|
|
3416
3447
|
exports.useReactionStatus = useReactionStatus;
|
|
3448
|
+
exports.useReciprocityCandidate = useReciprocityCandidate;
|
|
3417
3449
|
exports.useRefreshOrcidPublications = useRefreshOrcidPublications;
|
|
3418
3450
|
exports.useRefreshPds = useRefreshPds;
|
|
3419
3451
|
exports.useRemoveFeatureAllowlist = useRemoveFeatureAllowlist;
|