@singi-labs/sifa-sdk 0.7.0 → 0.7.1
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 +386 -1
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +303 -3
- package/dist/query/index.d.ts +303 -3
- package/dist/query/index.js +361 -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.1";
|
|
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.1";
|
|
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,176 @@ 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/roadmap.ts
|
|
417
|
+
async function fetchRoadmapVotes(config, options = {}) {
|
|
418
|
+
try {
|
|
419
|
+
return await apiFetch(config, "/api/roadmap/votes", {
|
|
420
|
+
cache: "no-store",
|
|
421
|
+
...options
|
|
422
|
+
});
|
|
423
|
+
} catch {
|
|
424
|
+
return {};
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
async function fetchMyRoadmapVotes(config, options = {}) {
|
|
428
|
+
const headers = { ...options.headers ?? {} };
|
|
429
|
+
if (options.cookieHeader) headers.cookie = options.cookieHeader;
|
|
430
|
+
try {
|
|
431
|
+
const data = await apiFetch(config, "/api/roadmap/votes/me", {
|
|
432
|
+
credentials: "include",
|
|
433
|
+
...options,
|
|
434
|
+
headers
|
|
435
|
+
});
|
|
436
|
+
return data.voted ?? [];
|
|
437
|
+
} catch {
|
|
438
|
+
return [];
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
228
442
|
// src/query/keys.ts
|
|
229
443
|
var sifaQueryKeys = {
|
|
230
444
|
all: () => ["sifa"],
|
|
231
445
|
profile: {
|
|
232
446
|
all: () => ["sifa", "profile"],
|
|
233
|
-
byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid]
|
|
447
|
+
byHandle: (handleOrDid) => ["sifa", "profile", handleOrDid],
|
|
448
|
+
atFundLink: (did) => ["sifa", "profile", "at-fund-link", did]
|
|
234
449
|
},
|
|
235
450
|
position: {
|
|
236
451
|
all: () => ["sifa", "position"],
|
|
@@ -252,6 +467,39 @@ var sifaQueryKeys = {
|
|
|
252
467
|
follow: {
|
|
253
468
|
all: () => ["sifa", "follow"],
|
|
254
469
|
following: (opts) => ["sifa", "follow", "following", opts]
|
|
470
|
+
},
|
|
471
|
+
stats: {
|
|
472
|
+
all: () => ["sifa", "stats"],
|
|
473
|
+
homepage: () => ["sifa", "stats", "homepage"]
|
|
474
|
+
},
|
|
475
|
+
apps: {
|
|
476
|
+
all: () => ["sifa", "apps"],
|
|
477
|
+
registry: () => ["sifa", "apps", "registry"],
|
|
478
|
+
hidden: () => ["sifa", "apps", "hidden"]
|
|
479
|
+
},
|
|
480
|
+
activity: {
|
|
481
|
+
all: () => ["sifa", "activity"],
|
|
482
|
+
heatmap: (handleOrDid, days) => ["sifa", "activity", "heatmap", handleOrDid, days],
|
|
483
|
+
teaser: (handleOrDid) => ["sifa", "activity", "teaser", handleOrDid],
|
|
484
|
+
feed: (handleOrDid, opts) => ["sifa", "activity", "feed", handleOrDid, opts]
|
|
485
|
+
},
|
|
486
|
+
endorsement: {
|
|
487
|
+
all: () => ["sifa", "endorsement"],
|
|
488
|
+
count: (did) => ["sifa", "endorsement", "count", did]
|
|
489
|
+
},
|
|
490
|
+
stream: {
|
|
491
|
+
all: () => ["sifa", "stream"],
|
|
492
|
+
networkCount: (did) => ["sifa", "stream", "network-count", did]
|
|
493
|
+
},
|
|
494
|
+
reactions: {
|
|
495
|
+
all: () => ["sifa", "reactions"],
|
|
496
|
+
status: (uris) => ["sifa", "reactions", "status", uris],
|
|
497
|
+
accountCheck: (appId) => ["sifa", "reactions", "account-check", appId]
|
|
498
|
+
},
|
|
499
|
+
roadmap: {
|
|
500
|
+
all: () => ["sifa", "roadmap"],
|
|
501
|
+
votes: () => ["sifa", "roadmap", "votes"],
|
|
502
|
+
myVotes: () => ["sifa", "roadmap", "my-votes"]
|
|
255
503
|
}
|
|
256
504
|
};
|
|
257
505
|
|
|
@@ -265,6 +513,15 @@ function useProfile(handleOrDid, options) {
|
|
|
265
513
|
...options
|
|
266
514
|
});
|
|
267
515
|
}
|
|
516
|
+
function useAtFundLink(did, options) {
|
|
517
|
+
const config = useSifaConfig();
|
|
518
|
+
return reactQuery.useQuery({
|
|
519
|
+
queryKey: sifaQueryKeys.profile.atFundLink(did ?? ""),
|
|
520
|
+
queryFn: () => fetchAtFundLink(config, did ?? ""),
|
|
521
|
+
enabled: Boolean(did) && (options?.enabled ?? true),
|
|
522
|
+
...options
|
|
523
|
+
});
|
|
524
|
+
}
|
|
268
525
|
function useCreatePosition(ownerDid, options) {
|
|
269
526
|
const config = useSifaConfig();
|
|
270
527
|
const queryClient = reactQuery.useQueryClient();
|
|
@@ -280,6 +537,30 @@ function useCreatePosition(ownerDid, options) {
|
|
|
280
537
|
...options
|
|
281
538
|
});
|
|
282
539
|
}
|
|
540
|
+
function useStats(options) {
|
|
541
|
+
const config = useSifaConfig();
|
|
542
|
+
return reactQuery.useQuery({
|
|
543
|
+
queryKey: sifaQueryKeys.stats.homepage(),
|
|
544
|
+
queryFn: () => fetchStats(config),
|
|
545
|
+
...options
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
function useAppsRegistry(options) {
|
|
549
|
+
const config = useSifaConfig();
|
|
550
|
+
return reactQuery.useQuery({
|
|
551
|
+
queryKey: sifaQueryKeys.apps.registry(),
|
|
552
|
+
queryFn: () => fetchAppsRegistry(config),
|
|
553
|
+
...options
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
function useHiddenApps(options) {
|
|
557
|
+
const config = useSifaConfig();
|
|
558
|
+
return reactQuery.useQuery({
|
|
559
|
+
queryKey: sifaQueryKeys.apps.hidden(),
|
|
560
|
+
queryFn: () => fetchHiddenApps(config),
|
|
561
|
+
...options
|
|
562
|
+
});
|
|
563
|
+
}
|
|
283
564
|
function useSearchProfiles(filters, options) {
|
|
284
565
|
const config = useSifaConfig();
|
|
285
566
|
return reactQuery.useQuery({
|
|
@@ -347,31 +628,135 @@ function useFollowing(opts = {}, options) {
|
|
|
347
628
|
...options
|
|
348
629
|
});
|
|
349
630
|
}
|
|
631
|
+
function useHeatmapData(handleOrDid, days, options) {
|
|
632
|
+
const config = useSifaConfig();
|
|
633
|
+
return reactQuery.useQuery({
|
|
634
|
+
queryKey: sifaQueryKeys.activity.heatmap(handleOrDid ?? "", days),
|
|
635
|
+
queryFn: () => fetchHeatmapData(config, handleOrDid ?? "", days),
|
|
636
|
+
enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
|
|
637
|
+
...options
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
function useActivityTeaser(handleOrDid, options) {
|
|
641
|
+
const config = useSifaConfig();
|
|
642
|
+
return reactQuery.useQuery({
|
|
643
|
+
queryKey: sifaQueryKeys.activity.teaser(handleOrDid ?? ""),
|
|
644
|
+
queryFn: () => fetchActivityTeaser(config, handleOrDid ?? ""),
|
|
645
|
+
enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
|
|
646
|
+
...options
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
function useActivityFeed(handleOrDid, opts = {}, options) {
|
|
650
|
+
const config = useSifaConfig();
|
|
651
|
+
return reactQuery.useQuery({
|
|
652
|
+
queryKey: sifaQueryKeys.activity.feed(handleOrDid ?? "", opts),
|
|
653
|
+
queryFn: () => fetchActivityFeed(config, handleOrDid ?? "", opts),
|
|
654
|
+
enabled: Boolean(handleOrDid) && (options?.enabled ?? true),
|
|
655
|
+
...options
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
function useEndorsementCount(did, options) {
|
|
659
|
+
const config = useSifaConfig();
|
|
660
|
+
return reactQuery.useQuery({
|
|
661
|
+
queryKey: sifaQueryKeys.endorsement.count(did ?? ""),
|
|
662
|
+
queryFn: () => fetchEndorsementCount(config, did ?? ""),
|
|
663
|
+
enabled: Boolean(did) && (options?.enabled ?? true),
|
|
664
|
+
...options
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
function useNetworkStreamCount(did, options) {
|
|
668
|
+
const config = useSifaConfig();
|
|
669
|
+
return reactQuery.useQuery({
|
|
670
|
+
queryKey: sifaQueryKeys.stream.networkCount(did ?? ""),
|
|
671
|
+
queryFn: () => fetchNetworkStreamCount(config, did ?? ""),
|
|
672
|
+
enabled: Boolean(did) && (options?.enabled ?? true),
|
|
673
|
+
...options
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
function useReactionStatus(uris, options) {
|
|
677
|
+
const config = useSifaConfig();
|
|
678
|
+
return reactQuery.useQuery({
|
|
679
|
+
queryKey: sifaQueryKeys.reactions.status(uris),
|
|
680
|
+
queryFn: () => fetchReactionStatus(config, uris),
|
|
681
|
+
...options
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
function useAppAccountCheck(appId, options) {
|
|
685
|
+
const config = useSifaConfig();
|
|
686
|
+
return reactQuery.useQuery({
|
|
687
|
+
queryKey: sifaQueryKeys.reactions.accountCheck(appId ?? ""),
|
|
688
|
+
queryFn: () => checkAppAccount(config, appId ?? ""),
|
|
689
|
+
enabled: Boolean(appId) && (options?.enabled ?? true),
|
|
690
|
+
...options
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
function useRoadmapVotes(options) {
|
|
694
|
+
const config = useSifaConfig();
|
|
695
|
+
return reactQuery.useQuery({
|
|
696
|
+
queryKey: sifaQueryKeys.roadmap.votes(),
|
|
697
|
+
queryFn: () => fetchRoadmapVotes(config),
|
|
698
|
+
...options
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
function useMyRoadmapVotes(options) {
|
|
702
|
+
const config = useSifaConfig();
|
|
703
|
+
return reactQuery.useQuery({
|
|
704
|
+
queryKey: sifaQueryKeys.roadmap.myVotes(),
|
|
705
|
+
queryFn: () => fetchMyRoadmapVotes(config),
|
|
706
|
+
...options
|
|
707
|
+
});
|
|
708
|
+
}
|
|
350
709
|
|
|
351
710
|
exports.ApiError = ApiError;
|
|
352
711
|
exports.SifaProvider = SifaProvider;
|
|
353
712
|
exports.apiFetch = apiFetch;
|
|
354
713
|
exports.apiFetchOrNull = apiFetchOrNull;
|
|
714
|
+
exports.checkAppAccount = checkAppAccount;
|
|
355
715
|
exports.createPosition = createPosition;
|
|
716
|
+
exports.fetchActivityFeed = fetchActivityFeed;
|
|
717
|
+
exports.fetchActivityTeaser = fetchActivityTeaser;
|
|
718
|
+
exports.fetchAppsRegistry = fetchAppsRegistry;
|
|
719
|
+
exports.fetchAtFundLink = fetchAtFundLink;
|
|
720
|
+
exports.fetchEndorsementCount = fetchEndorsementCount;
|
|
356
721
|
exports.fetchFeaturedProfile = fetchFeaturedProfile;
|
|
357
722
|
exports.fetchFollowing = fetchFollowing;
|
|
723
|
+
exports.fetchHeatmapData = fetchHeatmapData;
|
|
724
|
+
exports.fetchHiddenApps = fetchHiddenApps;
|
|
725
|
+
exports.fetchMyRoadmapVotes = fetchMyRoadmapVotes;
|
|
726
|
+
exports.fetchNetworkStreamCount = fetchNetworkStreamCount;
|
|
358
727
|
exports.fetchProfile = fetchProfile;
|
|
728
|
+
exports.fetchReactionStatus = fetchReactionStatus;
|
|
729
|
+
exports.fetchRoadmapVotes = fetchRoadmapVotes;
|
|
359
730
|
exports.fetchSearchFilters = fetchSearchFilters;
|
|
360
731
|
exports.fetchSearchProfiles = fetchSearchProfiles;
|
|
361
732
|
exports.fetchSimilarProfiles = fetchSimilarProfiles;
|
|
362
733
|
exports.fetchSkillSuggestions = fetchSkillSuggestions;
|
|
734
|
+
exports.fetchStats = fetchStats;
|
|
363
735
|
exports.fetchSuggestionCount = fetchSuggestionCount;
|
|
364
736
|
exports.fetchSuggestions = fetchSuggestions;
|
|
365
737
|
exports.sifaQueryKeys = sifaQueryKeys;
|
|
738
|
+
exports.useActivityFeed = useActivityFeed;
|
|
739
|
+
exports.useActivityTeaser = useActivityTeaser;
|
|
740
|
+
exports.useAppAccountCheck = useAppAccountCheck;
|
|
741
|
+
exports.useAppsRegistry = useAppsRegistry;
|
|
742
|
+
exports.useAtFundLink = useAtFundLink;
|
|
366
743
|
exports.useCreatePosition = useCreatePosition;
|
|
744
|
+
exports.useEndorsementCount = useEndorsementCount;
|
|
367
745
|
exports.useFeaturedProfile = useFeaturedProfile;
|
|
368
746
|
exports.useFollowing = useFollowing;
|
|
747
|
+
exports.useHeatmapData = useHeatmapData;
|
|
748
|
+
exports.useHiddenApps = useHiddenApps;
|
|
749
|
+
exports.useMyRoadmapVotes = useMyRoadmapVotes;
|
|
750
|
+
exports.useNetworkStreamCount = useNetworkStreamCount;
|
|
369
751
|
exports.useProfile = useProfile;
|
|
752
|
+
exports.useReactionStatus = useReactionStatus;
|
|
753
|
+
exports.useRoadmapVotes = useRoadmapVotes;
|
|
370
754
|
exports.useSearchFilters = useSearchFilters;
|
|
371
755
|
exports.useSearchProfiles = useSearchProfiles;
|
|
372
756
|
exports.useSifaConfig = useSifaConfig;
|
|
373
757
|
exports.useSimilarProfiles = useSimilarProfiles;
|
|
374
758
|
exports.useSkillSuggestions = useSkillSuggestions;
|
|
759
|
+
exports.useStats = useStats;
|
|
375
760
|
exports.useSuggestionCount = useSuggestionCount;
|
|
376
761
|
exports.useSuggestions = useSuggestions;
|
|
377
762
|
//# sourceMappingURL=index.cjs.map
|