@singi-labs/sifa-sdk 0.7.0 → 0.7.2
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-IDRpze8y.d.cts → index-CpM21_Oy.d.cts} +1 -1
- package/dist/{index-IDRpze8y.d.ts → index-CpM21_Oy.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/query/index.cjs +423 -1
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +363 -3
- package/dist/query/index.d.ts +363 -3
- package/dist/query/index.js +396 -2
- package/dist/query/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -250,4 +250,4 @@ interface Profile {
|
|
|
250
250
|
externalAccounts?: ExternalAccount[];
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
export type { ActiveApp as A, Endorsement as E, FeedItem as F, LocationValue as L,
|
|
253
|
+
export type { ActiveApp as A, Endorsement as E, FeedItem as F, LocationValue as L, ProfileSkill as P, SkillRef as S, TrustStat as T, VerifiedAccount as V, PdsProviderInfo as a, EndorsementData as b, ExternalAccount as c, ExternalAccountKeytraceClaim as d, LanguageProficiency as e, Profile as f, ProfileCertification as g, ProfileCourse as h, ProfileEducation as i, ProfileHonor as j, ProfileIndustry as k, ProfileLanguage as l, ProfileLocation as m, ProfileOverrideSource as n, ProfilePosition as o, ProfileProject as p, ProfilePublication as q, ProfileVolunteering as r, PublicationContributor as s, SkillSuggestion as t };
|
|
@@ -250,4 +250,4 @@ interface Profile {
|
|
|
250
250
|
externalAccounts?: ExternalAccount[];
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
export type { ActiveApp as A, Endorsement as E, FeedItem as F, LocationValue as L,
|
|
253
|
+
export type { ActiveApp as A, Endorsement as E, FeedItem as F, LocationValue as L, ProfileSkill as P, SkillRef as S, TrustStat as T, VerifiedAccount as V, PdsProviderInfo as a, EndorsementData as b, ExternalAccount as c, ExternalAccountKeytraceClaim as d, LanguageProficiency as e, Profile as f, ProfileCertification as g, ProfileCourse as h, ProfileEducation as i, ProfileHonor as j, ProfileIndustry as k, ProfileLanguage as l, ProfileLocation as m, ProfileOverrideSource as n, ProfilePosition as o, ProfileProject as p, ProfilePublication as q, ProfileVolunteering as r, PublicationContributor as s, SkillSuggestion as t };
|
package/dist/index.cjs
CHANGED
|
@@ -1088,7 +1088,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
1088
1088
|
});
|
|
1089
1089
|
|
|
1090
1090
|
// src/index.ts
|
|
1091
|
-
var SIFA_SDK_VERSION = "0.7.
|
|
1091
|
+
var SIFA_SDK_VERSION = "0.7.2";
|
|
1092
1092
|
|
|
1093
1093
|
exports.CATEGORY_LABELS = CATEGORY_LABELS;
|
|
1094
1094
|
exports.CATEGORY_ORDER = CATEGORY_ORDER;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActiveApp, E as Endorsement,
|
|
1
|
+
import { P as ProfileSkill, L as LocationValue, a as PdsProviderInfo } from './index-CpM21_Oy.cjs';
|
|
2
|
+
export { A as ActiveApp, E as Endorsement, b as EndorsementData, c as ExternalAccount, d as ExternalAccountKeytraceClaim, F as FeedItem, e as LanguageProficiency, f as Profile, g as ProfileCertification, h as ProfileCourse, i as ProfileEducation, j as ProfileHonor, k as ProfileIndustry, l as ProfileLanguage, m as ProfileLocation, n as ProfileOverrideSource, o as ProfilePosition, p as ProfileProject, q as ProfilePublication, r as ProfileVolunteering, s as PublicationContributor, S as SkillRef, t as SkillSuggestion, T as TrustStat, V as VerifiedAccount } from './index-CpM21_Oy.cjs';
|
|
3
3
|
export { EndorsementConfirmationRecord, EndorsementConfirmationRecordSchema, EndorsementRecord, EndorsementRecordSchema, GraphFollowRecord, GraphFollowRecordSchema, ProfileCertificationRecord, ProfileCertificationRecordSchema, ProfileCourseRecord, ProfileCourseRecordSchema, ProfileEducationRecord, ProfileEducationRecordSchema, ProfileExternalAccountRecord, ProfileExternalAccountRecordSchema, ProfileHonorRecord, ProfileHonorRecordSchema, ProfileLanguageRecord, ProfileLanguageRecordSchema, ProfilePositionRecord, ProfilePositionRecordSchema, ProfileProjectRecord, ProfileProjectRecordSchema, ProfilePublicationRecord, ProfilePublicationRecordSchema, ProfileSelfRecord, ProfileSelfRecordSchema, ProfileSkillRecord, ProfileSkillRecordSchema, ProfileVolunteeringRecord, ProfileVolunteeringRecordSchema, PublicationAuthor, PublicationAuthorSchema, atUriSchema, cidSchema, datetimeSchema, didSchema, languageTagSchema, maxGraphemes, selfLabelsSchema, strongRefSchema, uriSchema } from './schemas/index.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActiveApp, E as Endorsement,
|
|
1
|
+
import { P as ProfileSkill, L as LocationValue, a as PdsProviderInfo } from './index-CpM21_Oy.js';
|
|
2
|
+
export { A as ActiveApp, E as Endorsement, b as EndorsementData, c as ExternalAccount, d as ExternalAccountKeytraceClaim, F as FeedItem, e as LanguageProficiency, f as Profile, g as ProfileCertification, h as ProfileCourse, i as ProfileEducation, j as ProfileHonor, k as ProfileIndustry, l as ProfileLanguage, m as ProfileLocation, n as ProfileOverrideSource, o as ProfilePosition, p as ProfileProject, q as ProfilePublication, r as ProfileVolunteering, s as PublicationContributor, S as SkillRef, t as SkillSuggestion, T as TrustStat, V as VerifiedAccount } from './index-CpM21_Oy.js';
|
|
3
3
|
export { EndorsementConfirmationRecord, EndorsementConfirmationRecordSchema, EndorsementRecord, EndorsementRecordSchema, GraphFollowRecord, GraphFollowRecordSchema, ProfileCertificationRecord, ProfileCertificationRecordSchema, ProfileCourseRecord, ProfileCourseRecordSchema, ProfileEducationRecord, ProfileEducationRecordSchema, ProfileExternalAccountRecord, ProfileExternalAccountRecordSchema, ProfileHonorRecord, ProfileHonorRecordSchema, ProfileLanguageRecord, ProfileLanguageRecordSchema, ProfilePositionRecord, ProfilePositionRecordSchema, ProfileProjectRecord, ProfileProjectRecordSchema, ProfilePublicationRecord, ProfilePublicationRecordSchema, ProfileSelfRecord, ProfileSelfRecordSchema, ProfileSkillRecord, ProfileSkillRecordSchema, ProfileVolunteeringRecord, ProfileVolunteeringRecordSchema, PublicationAuthor, PublicationAuthorSchema, atUriSchema, cidSchema, datetimeSchema, didSchema, languageTagSchema, maxGraphemes, selfLabelsSchema, strongRefSchema, uriSchema } from './schemas/index.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -1086,7 +1086,7 @@ var ProfileVolunteeringRecordSchema = z.object({
|
|
|
1086
1086
|
});
|
|
1087
1087
|
|
|
1088
1088
|
// src/index.ts
|
|
1089
|
-
var SIFA_SDK_VERSION = "0.7.
|
|
1089
|
+
var SIFA_SDK_VERSION = "0.7.2";
|
|
1090
1090
|
|
|
1091
1091
|
export { CATEGORY_LABELS, CATEGORY_ORDER, CONTINENTS, COUNTRIES, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, GraphFollowRecordSchema, INDUSTRY_OPTIONS, PLATFORM_LABELS, PLATFORM_OPTIONS, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, SIFA_SDK_VERSION, SKILL_CATEGORIES, atUriSchema, certDateExtractor, cidSchema, contrastRatio, countryCodeToFlag, dateRangeExtractor, datetimeSchema, dedupeSkills, detectPdsProvider, didSchema, findIndustry, formatDistanceToNow, formatLocation, formatRelativeTime, getContinent, getDisplayLabel, getFaviconUrl, getHandleStem, getIndustryLabelKey, getPdsDisplayName, getPlatformLabel, groupSkillsByCategory, isKnownPlatform, isValidRgbColor, languageTagSchema, lexiconDateExtractor, maxGraphemes, meetsContrastAA, parseLocationString, pdsProviderFromApi, relativeLuminance, rgbToString, sanitizeHandleInput, selfLabelsSchema, singleDateExtractor, sortByDateDesc, strongRefSchema, truncateGraphemes, uriSchema };
|
|
1092
1092
|
//# sourceMappingURL=index.js.map
|
package/dist/query/index.cjs
CHANGED
|
@@ -97,6 +97,19 @@ function fetchProfile(config, handleOrDid, options = {}) {
|
|
|
97
97
|
...options
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
+
async function fetchAtFundLink(config, did, options = {}) {
|
|
101
|
+
const path = `/api/profiles/${encodeURIComponent(did)}/at-fund-link`;
|
|
102
|
+
try {
|
|
103
|
+
const data = await apiFetch(config, path, {
|
|
104
|
+
next: { revalidate: 3600 },
|
|
105
|
+
timeoutMs: 5e3,
|
|
106
|
+
...options
|
|
107
|
+
});
|
|
108
|
+
return typeof data.url === "string" ? data.url : null;
|
|
109
|
+
} catch {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
100
113
|
|
|
101
114
|
// src/query/fetchers/positions.ts
|
|
102
115
|
function createPosition(config, data, options = {}) {
|
|
@@ -108,6 +121,44 @@ function createPosition(config, data, options = {}) {
|
|
|
108
121
|
});
|
|
109
122
|
}
|
|
110
123
|
|
|
124
|
+
// src/query/fetchers/stats.ts
|
|
125
|
+
async function fetchStats(config, options = {}) {
|
|
126
|
+
try {
|
|
127
|
+
return await apiFetch(config, "/api/stats", {
|
|
128
|
+
next: { revalidate: 900 },
|
|
129
|
+
...options
|
|
130
|
+
});
|
|
131
|
+
} catch {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/query/fetchers/apps.ts
|
|
137
|
+
async function fetchAppsRegistry(config, options = {}) {
|
|
138
|
+
try {
|
|
139
|
+
return await apiFetch(config, "/api/apps/registry", {
|
|
140
|
+
next: { revalidate: 86400 },
|
|
141
|
+
...options
|
|
142
|
+
});
|
|
143
|
+
} catch {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
async function fetchHiddenApps(config, options = {}) {
|
|
148
|
+
const headers = { ...options.headers ?? {} };
|
|
149
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
150
|
+
try {
|
|
151
|
+
const data = await apiFetch(config, "/api/profile/hidden-apps", {
|
|
152
|
+
credentials: "include",
|
|
153
|
+
...options,
|
|
154
|
+
headers
|
|
155
|
+
});
|
|
156
|
+
return data.apps;
|
|
157
|
+
} catch {
|
|
158
|
+
return [];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
111
162
|
// src/query/fetchers/search.ts
|
|
112
163
|
var EMPTY_SEARCH = { profiles: [], total: 0, limit: 20, offset: 0 };
|
|
113
164
|
var EMPTY_FILTERS = { countries: [], industries: [], apps: [] };
|
|
@@ -225,12 +276,211 @@ async function fetchFollowing(config, opts = {}) {
|
|
|
225
276
|
}
|
|
226
277
|
}
|
|
227
278
|
|
|
279
|
+
// src/query/fetchers/activity.ts
|
|
280
|
+
async function fetchHeatmapData(config, handleOrDid, days, options = {}) {
|
|
281
|
+
const path = `/api/activity/${encodeURIComponent(handleOrDid)}/heatmap?days=${days}`;
|
|
282
|
+
try {
|
|
283
|
+
return await apiFetch(config, path, {
|
|
284
|
+
next: { revalidate: 900, tags: [`heatmap-${handleOrDid}`] },
|
|
285
|
+
...options
|
|
286
|
+
});
|
|
287
|
+
} catch {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
async function fetchActivityTeaser(config, handleOrDid, options = {}) {
|
|
292
|
+
const headers = { ...options.headers ?? {} };
|
|
293
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
294
|
+
try {
|
|
295
|
+
return await apiFetch(
|
|
296
|
+
config,
|
|
297
|
+
`/api/activity/${encodeURIComponent(handleOrDid)}/teaser`,
|
|
298
|
+
{
|
|
299
|
+
credentials: "include",
|
|
300
|
+
timeoutMs: 8e3,
|
|
301
|
+
next: { revalidate: 300, tags: [`activity-teaser-${handleOrDid}`] },
|
|
302
|
+
...options,
|
|
303
|
+
headers
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
} catch {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
async function fetchActivityFeed(config, handleOrDid, options = {}) {
|
|
311
|
+
const params = new URLSearchParams();
|
|
312
|
+
if (options.category) params.set("category", options.category);
|
|
313
|
+
if (options.limit) params.set("limit", String(options.limit));
|
|
314
|
+
if (options.cursor) params.set("cursor", options.cursor);
|
|
315
|
+
const qs = params.toString();
|
|
316
|
+
const headers = { ...options.headers ?? {} };
|
|
317
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
318
|
+
try {
|
|
319
|
+
return await apiFetch(
|
|
320
|
+
config,
|
|
321
|
+
`/api/activity/${encodeURIComponent(handleOrDid)}${qs ? `?${qs}` : ""}`,
|
|
322
|
+
{
|
|
323
|
+
credentials: "include",
|
|
324
|
+
cache: "no-store",
|
|
325
|
+
...options,
|
|
326
|
+
headers
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
} catch {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// src/query/fetchers/endorsement.ts
|
|
335
|
+
async function fetchEndorsementCount(config, did, options = {}) {
|
|
336
|
+
const path = `/api/endorsement/${encodeURIComponent(did)}`;
|
|
337
|
+
try {
|
|
338
|
+
const data = await apiFetch(config, path, {
|
|
339
|
+
cache: "no-store",
|
|
340
|
+
timeoutMs: 5e3,
|
|
341
|
+
...options
|
|
342
|
+
});
|
|
343
|
+
if (typeof data !== "object" || data === null || !("endorsements" in data)) {
|
|
344
|
+
return 0;
|
|
345
|
+
}
|
|
346
|
+
const endorsements = data.endorsements;
|
|
347
|
+
return Array.isArray(endorsements) ? endorsements.length : 0;
|
|
348
|
+
} catch {
|
|
349
|
+
return 0;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// src/query/fetchers/stream.ts
|
|
354
|
+
async function fetchNetworkStreamCount(config, did, options = {}) {
|
|
355
|
+
const headers = { ...options.headers ?? {} };
|
|
356
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
357
|
+
try {
|
|
358
|
+
const data = await apiFetch(
|
|
359
|
+
config,
|
|
360
|
+
`/api/stream/network?did=${encodeURIComponent(did)}`,
|
|
361
|
+
{
|
|
362
|
+
cache: "no-store",
|
|
363
|
+
timeoutMs: 5e3,
|
|
364
|
+
...options.cookieHeader ? {} : { credentials: "include" },
|
|
365
|
+
...options,
|
|
366
|
+
headers
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
if (typeof data !== "object" || data === null || !("items" in data)) {
|
|
370
|
+
return 0;
|
|
371
|
+
}
|
|
372
|
+
const items = data.items;
|
|
373
|
+
return Array.isArray(items) ? items.length : 0;
|
|
374
|
+
} catch {
|
|
375
|
+
return 0;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// src/query/fetchers/reactions.ts
|
|
380
|
+
async function fetchReactionStatus(config, uris, options = {}) {
|
|
381
|
+
if (uris.length === 0) return {};
|
|
382
|
+
const headers = { ...options.headers ?? {} };
|
|
383
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
384
|
+
try {
|
|
385
|
+
return await apiFetch(
|
|
386
|
+
config,
|
|
387
|
+
`/api/reactions/status?uris=${encodeURIComponent(uris.join(","))}`,
|
|
388
|
+
{
|
|
389
|
+
credentials: "include",
|
|
390
|
+
...options,
|
|
391
|
+
headers
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
} catch {
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
async function checkAppAccount(config, appId, options = {}) {
|
|
399
|
+
const headers = { ...options.headers ?? {} };
|
|
400
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
401
|
+
try {
|
|
402
|
+
return await apiFetch(
|
|
403
|
+
config,
|
|
404
|
+
`/api/reactions/account-check/${encodeURIComponent(appId)}`,
|
|
405
|
+
{
|
|
406
|
+
credentials: "include",
|
|
407
|
+
...options,
|
|
408
|
+
headers
|
|
409
|
+
}
|
|
410
|
+
);
|
|
411
|
+
} catch {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// src/query/fetchers/quoted-posts.ts
|
|
417
|
+
var QUOTED_POSTS_BATCH_MAX = 20;
|
|
418
|
+
async function resolveQuotedPosts(config, uris, options = {}) {
|
|
419
|
+
if (uris.length === 0) return {};
|
|
420
|
+
const unique = [...new Set(uris)];
|
|
421
|
+
const batches = [];
|
|
422
|
+
for (let i = 0; i < unique.length; i += QUOTED_POSTS_BATCH_MAX) {
|
|
423
|
+
batches.push(unique.slice(i, i + QUOTED_POSTS_BATCH_MAX));
|
|
424
|
+
}
|
|
425
|
+
const headers = { ...options.headers ?? {} };
|
|
426
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
427
|
+
const results = {};
|
|
428
|
+
await Promise.all(
|
|
429
|
+
batches.map(async (batch) => {
|
|
430
|
+
try {
|
|
431
|
+
const data = await apiFetch(
|
|
432
|
+
config,
|
|
433
|
+
"/api/quoted-posts/resolve",
|
|
434
|
+
{
|
|
435
|
+
method: "POST",
|
|
436
|
+
body: { uris: batch },
|
|
437
|
+
credentials: "include",
|
|
438
|
+
timeoutMs: 8e3,
|
|
439
|
+
...options,
|
|
440
|
+
headers
|
|
441
|
+
}
|
|
442
|
+
);
|
|
443
|
+
Object.assign(results, data);
|
|
444
|
+
} catch {
|
|
445
|
+
}
|
|
446
|
+
})
|
|
447
|
+
);
|
|
448
|
+
return results;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// src/query/fetchers/roadmap.ts
|
|
452
|
+
async function fetchRoadmapVotes(config, options = {}) {
|
|
453
|
+
try {
|
|
454
|
+
return await apiFetch(config, "/api/roadmap/votes", {
|
|
455
|
+
cache: "no-store",
|
|
456
|
+
...options
|
|
457
|
+
});
|
|
458
|
+
} catch {
|
|
459
|
+
return {};
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
async function fetchMyRoadmapVotes(config, options = {}) {
|
|
463
|
+
const headers = { ...options.headers ?? {} };
|
|
464
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
465
|
+
try {
|
|
466
|
+
const data = await apiFetch(config, "/api/roadmap/votes/me", {
|
|
467
|
+
credentials: "include",
|
|
468
|
+
...options,
|
|
469
|
+
headers
|
|
470
|
+
});
|
|
471
|
+
return data.voted ?? [];
|
|
472
|
+
} catch {
|
|
473
|
+
return [];
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
228
477
|
// src/query/keys.ts
|
|
229
478
|
var sifaQueryKeys = {
|
|
230
479
|
all: () => ["sifa"],
|
|
231
480
|
profile: {
|
|
232
481
|
all: () => ["sifa", "profile"],
|
|
233
|
-
byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid]
|
|
482
|
+
byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid],
|
|
483
|
+
atFundLink: (did) => ["sifa", "profile", "at-fund-link", did]
|
|
234
484
|
},
|
|
235
485
|
position: {
|
|
236
486
|
all: () => ["sifa", "position"],
|
|
@@ -252,6 +502,39 @@ var sifaQueryKeys = {
|
|
|
252
502
|
follow: {
|
|
253
503
|
all: () => ["sifa", "follow"],
|
|
254
504
|
following: (opts) => ["sifa", "follow", "following", opts]
|
|
505
|
+
},
|
|
506
|
+
stats: {
|
|
507
|
+
all: () => ["sifa", "stats"],
|
|
508
|
+
homepage: () => ["sifa", "stats", "homepage"]
|
|
509
|
+
},
|
|
510
|
+
apps: {
|
|
511
|
+
all: () => ["sifa", "apps"],
|
|
512
|
+
registry: () => ["sifa", "apps", "registry"],
|
|
513
|
+
hidden: () => ["sifa", "apps", "hidden"]
|
|
514
|
+
},
|
|
515
|
+
activity: {
|
|
516
|
+
all: () => ["sifa", "activity"],
|
|
517
|
+
heatmap: (handleOrDid, days) => ["sifa", "activity", "heatmap", handleOrDid, days],
|
|
518
|
+
teaser: (handleOrDid) => ["sifa", "activity", "teaser", handleOrDid],
|
|
519
|
+
feed: (handleOrDid, opts) => ["sifa", "activity", "feed", handleOrDid, opts]
|
|
520
|
+
},
|
|
521
|
+
endorsement: {
|
|
522
|
+
all: () => ["sifa", "endorsement"],
|
|
523
|
+
count: (did) => ["sifa", "endorsement", "count", did]
|
|
524
|
+
},
|
|
525
|
+
stream: {
|
|
526
|
+
all: () => ["sifa", "stream"],
|
|
527
|
+
networkCount: (did) => ["sifa", "stream", "network-count", did]
|
|
528
|
+
},
|
|
529
|
+
reactions: {
|
|
530
|
+
all: () => ["sifa", "reactions"],
|
|
531
|
+
status: (uris) => ["sifa", "reactions", "status", uris],
|
|
532
|
+
accountCheck: (appId) => ["sifa", "reactions", "account-check", appId]
|
|
533
|
+
},
|
|
534
|
+
roadmap: {
|
|
535
|
+
all: () => ["sifa", "roadmap"],
|
|
536
|
+
votes: () => ["sifa", "roadmap", "votes"],
|
|
537
|
+
myVotes: () => ["sifa", "roadmap", "my-votes"]
|
|
255
538
|
}
|
|
256
539
|
};
|
|
257
540
|
|
|
@@ -265,6 +548,15 @@ function useProfile(handleOrDid, options) {
|
|
|
265
548
|
...options
|
|
266
549
|
});
|
|
267
550
|
}
|
|
551
|
+
function useAtFundLink(did, options) {
|
|
552
|
+
const config = useSifaConfig();
|
|
553
|
+
return reactQuery.useQuery({
|
|
554
|
+
queryKey: sifaQueryKeys.profile.atFundLink(did ?? ""),
|
|
555
|
+
queryFn: () => fetchAtFundLink(config, did ?? ""),
|
|
556
|
+
enabled: Boolean(did) && (options?.enabled ?? true),
|
|
557
|
+
...options
|
|
558
|
+
});
|
|
559
|
+
}
|
|
268
560
|
function useCreatePosition(ownerDid, options) {
|
|
269
561
|
const config = useSifaConfig();
|
|
270
562
|
const queryClient = reactQuery.useQueryClient();
|
|
@@ -280,6 +572,30 @@ function useCreatePosition(ownerDid, options) {
|
|
|
280
572
|
...options
|
|
281
573
|
});
|
|
282
574
|
}
|
|
575
|
+
function useStats(options) {
|
|
576
|
+
const config = useSifaConfig();
|
|
577
|
+
return reactQuery.useQuery({
|
|
578
|
+
queryKey: sifaQueryKeys.stats.homepage(),
|
|
579
|
+
queryFn: () => fetchStats(config),
|
|
580
|
+
...options
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
function useAppsRegistry(options) {
|
|
584
|
+
const config = useSifaConfig();
|
|
585
|
+
return reactQuery.useQuery({
|
|
586
|
+
queryKey: sifaQueryKeys.apps.registry(),
|
|
587
|
+
queryFn: () => fetchAppsRegistry(config),
|
|
588
|
+
...options
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
function useHiddenApps(options) {
|
|
592
|
+
const config = useSifaConfig();
|
|
593
|
+
return reactQuery.useQuery({
|
|
594
|
+
queryKey: sifaQueryKeys.apps.hidden(),
|
|
595
|
+
queryFn: () => fetchHiddenApps(config),
|
|
596
|
+
...options
|
|
597
|
+
});
|
|
598
|
+
}
|
|
283
599
|
function useSearchProfiles(filters, options) {
|
|
284
600
|
const config = useSifaConfig();
|
|
285
601
|
return reactQuery.useQuery({
|
|
@@ -347,31 +663,137 @@ function useFollowing(opts = {}, options) {
|
|
|
347
663
|
...options
|
|
348
664
|
});
|
|
349
665
|
}
|
|
666
|
+
function useHeatmapData(handleOrDid, days, options) {
|
|
667
|
+
const config = useSifaConfig();
|
|
668
|
+
return reactQuery.useQuery({
|
|
669
|
+
queryKey: sifaQueryKeys.activity.heatmap(handleOrDid ?? "", days),
|
|
670
|
+
queryFn: () => fetchHeatmapData(config, handleOrDid ?? "", days),
|
|
671
|
+
enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
|
|
672
|
+
...options
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
function useActivityTeaser(handleOrDid, options) {
|
|
676
|
+
const config = useSifaConfig();
|
|
677
|
+
return reactQuery.useQuery({
|
|
678
|
+
queryKey: sifaQueryKeys.activity.teaser(handleOrDid ?? ""),
|
|
679
|
+
queryFn: () => fetchActivityTeaser(config, handleOrDid ?? ""),
|
|
680
|
+
enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
|
|
681
|
+
...options
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
function useActivityFeed(handleOrDid, opts = {}, options) {
|
|
685
|
+
const config = useSifaConfig();
|
|
686
|
+
return reactQuery.useQuery({
|
|
687
|
+
queryKey: sifaQueryKeys.activity.feed(handleOrDid ?? "", opts),
|
|
688
|
+
queryFn: () => fetchActivityFeed(config, handleOrDid ?? "", opts),
|
|
689
|
+
enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
|
|
690
|
+
...options
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
function useEndorsementCount(did, options) {
|
|
694
|
+
const config = useSifaConfig();
|
|
695
|
+
return reactQuery.useQuery({
|
|
696
|
+
queryKey: sifaQueryKeys.endorsement.count(did ?? ""),
|
|
697
|
+
queryFn: () => fetchEndorsementCount(config, did ?? ""),
|
|
698
|
+
enabled: Boolean(did) && (options?.enabled ?? true),
|
|
699
|
+
...options
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
function useNetworkStreamCount(did, options) {
|
|
703
|
+
const config = useSifaConfig();
|
|
704
|
+
return reactQuery.useQuery({
|
|
705
|
+
queryKey: sifaQueryKeys.stream.networkCount(did ?? ""),
|
|
706
|
+
queryFn: () => fetchNetworkStreamCount(config, did ?? ""),
|
|
707
|
+
enabled: Boolean(did) && (options?.enabled ?? true),
|
|
708
|
+
...options
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
function useReactionStatus(uris, options) {
|
|
712
|
+
const config = useSifaConfig();
|
|
713
|
+
return reactQuery.useQuery({
|
|
714
|
+
queryKey: sifaQueryKeys.reactions.status(uris),
|
|
715
|
+
queryFn: () => fetchReactionStatus(config, uris),
|
|
716
|
+
...options
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
function useAppAccountCheck(appId, options) {
|
|
720
|
+
const config = useSifaConfig();
|
|
721
|
+
return reactQuery.useQuery({
|
|
722
|
+
queryKey: sifaQueryKeys.reactions.accountCheck(appId ?? ""),
|
|
723
|
+
queryFn: () => checkAppAccount(config, appId ?? ""),
|
|
724
|
+
enabled: Boolean(appId) && (options?.enabled ?? true),
|
|
725
|
+
...options
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
function useRoadmapVotes(options) {
|
|
729
|
+
const config = useSifaConfig();
|
|
730
|
+
return reactQuery.useQuery({
|
|
731
|
+
queryKey: sifaQueryKeys.roadmap.votes(),
|
|
732
|
+
queryFn: () => fetchRoadmapVotes(config),
|
|
733
|
+
...options
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
function useMyRoadmapVotes(options) {
|
|
737
|
+
const config = useSifaConfig();
|
|
738
|
+
return reactQuery.useQuery({
|
|
739
|
+
queryKey: sifaQueryKeys.roadmap.myVotes(),
|
|
740
|
+
queryFn: () => fetchMyRoadmapVotes(config),
|
|
741
|
+
...options
|
|
742
|
+
});
|
|
743
|
+
}
|
|
350
744
|
|
|
351
745
|
exports.ApiError = ApiError;
|
|
746
|
+
exports.QUOTED_POSTS_BATCH_MAX = QUOTED_POSTS_BATCH_MAX;
|
|
352
747
|
exports.SifaProvider = SifaProvider;
|
|
353
748
|
exports.apiFetch = apiFetch;
|
|
354
749
|
exports.apiFetchOrNull = apiFetchOrNull;
|
|
750
|
+
exports.checkAppAccount = checkAppAccount;
|
|
355
751
|
exports.createPosition = createPosition;
|
|
752
|
+
exports.fetchActivityFeed = fetchActivityFeed;
|
|
753
|
+
exports.fetchActivityTeaser = fetchActivityTeaser;
|
|
754
|
+
exports.fetchAppsRegistry = fetchAppsRegistry;
|
|
755
|
+
exports.fetchAtFundLink = fetchAtFundLink;
|
|
756
|
+
exports.fetchEndorsementCount = fetchEndorsementCount;
|
|
356
757
|
exports.fetchFeaturedProfile = fetchFeaturedProfile;
|
|
357
758
|
exports.fetchFollowing = fetchFollowing;
|
|
759
|
+
exports.fetchHeatmapData = fetchHeatmapData;
|
|
760
|
+
exports.fetchHiddenApps = fetchHiddenApps;
|
|
761
|
+
exports.fetchMyRoadmapVotes = fetchMyRoadmapVotes;
|
|
762
|
+
exports.fetchNetworkStreamCount = fetchNetworkStreamCount;
|
|
358
763
|
exports.fetchProfile = fetchProfile;
|
|
764
|
+
exports.fetchReactionStatus = fetchReactionStatus;
|
|
765
|
+
exports.fetchRoadmapVotes = fetchRoadmapVotes;
|
|
359
766
|
exports.fetchSearchFilters = fetchSearchFilters;
|
|
360
767
|
exports.fetchSearchProfiles = fetchSearchProfiles;
|
|
361
768
|
exports.fetchSimilarProfiles = fetchSimilarProfiles;
|
|
362
769
|
exports.fetchSkillSuggestions = fetchSkillSuggestions;
|
|
770
|
+
exports.fetchStats = fetchStats;
|
|
363
771
|
exports.fetchSuggestionCount = fetchSuggestionCount;
|
|
364
772
|
exports.fetchSuggestions = fetchSuggestions;
|
|
773
|
+
exports.resolveQuotedPosts = resolveQuotedPosts;
|
|
365
774
|
exports.sifaQueryKeys = sifaQueryKeys;
|
|
775
|
+
exports.useActivityFeed = useActivityFeed;
|
|
776
|
+
exports.useActivityTeaser = useActivityTeaser;
|
|
777
|
+
exports.useAppAccountCheck = useAppAccountCheck;
|
|
778
|
+
exports.useAppsRegistry = useAppsRegistry;
|
|
779
|
+
exports.useAtFundLink = useAtFundLink;
|
|
366
780
|
exports.useCreatePosition = useCreatePosition;
|
|
781
|
+
exports.useEndorsementCount = useEndorsementCount;
|
|
367
782
|
exports.useFeaturedProfile = useFeaturedProfile;
|
|
368
783
|
exports.useFollowing = useFollowing;
|
|
784
|
+
exports.useHeatmapData = useHeatmapData;
|
|
785
|
+
exports.useHiddenApps = useHiddenApps;
|
|
786
|
+
exports.useMyRoadmapVotes = useMyRoadmapVotes;
|
|
787
|
+
exports.useNetworkStreamCount = useNetworkStreamCount;
|
|
369
788
|
exports.useProfile = useProfile;
|
|
789
|
+
exports.useReactionStatus = useReactionStatus;
|
|
790
|
+
exports.useRoadmapVotes = useRoadmapVotes;
|
|
370
791
|
exports.useSearchFilters = useSearchFilters;
|
|
371
792
|
exports.useSearchProfiles = useSearchProfiles;
|
|
372
793
|
exports.useSifaConfig = useSifaConfig;
|
|
373
794
|
exports.useSimilarProfiles = useSimilarProfiles;
|
|
374
795
|
exports.useSkillSuggestions = useSkillSuggestions;
|
|
796
|
+
exports.useStats = useStats;
|
|
375
797
|
exports.useSuggestionCount = useSuggestionCount;
|
|
376
798
|
exports.useSuggestions = useSuggestions;
|
|
377
799
|
//# sourceMappingURL=index.cjs.map
|