@singi-labs/sifa-sdk 0.19.77 → 0.19.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.
Files changed (33) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/{network-map-DvALufF9.d.ts → network-map-D8JcKu28.d.ts} +1 -50
  4. package/dist/{network-map-DInAc_DB.d.cts → network-map-Db_EPUDX.d.cts} +1 -50
  5. package/dist/query/fetchers/index.cjs +28 -0
  6. package/dist/query/fetchers/index.cjs.map +1 -1
  7. package/dist/query/fetchers/index.d.cts +2 -2
  8. package/dist/query/fetchers/index.d.ts +2 -2
  9. package/dist/query/fetchers/index.js +5 -1
  10. package/dist/query/fetchers/index.js.map +1 -1
  11. package/dist/query/fetchers/rpg.js +22 -0
  12. package/dist/query/fetchers/rpg.js.map +1 -1
  13. package/dist/query/hooks/index.cjs +59 -0
  14. package/dist/query/hooks/index.cjs.map +1 -1
  15. package/dist/query/hooks/index.d.cts +2 -2
  16. package/dist/query/hooks/index.d.ts +2 -2
  17. package/dist/query/hooks/index.js +2 -0
  18. package/dist/query/hooks/index.js.map +1 -1
  19. package/dist/query/hooks/use-rpg-claimable.js +19 -0
  20. package/dist/query/hooks/use-rpg-claimable.js.map +1 -0
  21. package/dist/query/index.cjs +37 -0
  22. package/dist/query/index.cjs.map +1 -1
  23. package/dist/query/index.d.cts +5 -5
  24. package/dist/query/index.d.ts +5 -5
  25. package/dist/query/index.js +7 -1
  26. package/dist/query/index.js.map +1 -1
  27. package/dist/query/keys.js +6 -0
  28. package/dist/query/keys.js.map +1 -1
  29. package/dist/{use-user-settings-CYDXJNmI.d.cts → use-user-settings-DWj8BC5K.d.cts} +11 -2
  30. package/dist/{use-user-settings-B1rJmjQR.d.ts → use-user-settings-fWHkdX3c.d.ts} +11 -2
  31. package/dist/{user-settings-Qwi6wSnK.d.ts → user-settings-nov4rgwR.d.ts} +74 -2
  32. package/dist/{user-settings-lenJHz19.d.cts → user-settings-qkxxTwFP.d.cts} +74 -2
  33. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -7307,7 +7307,7 @@ function describeSifaRecord(collection, value) {
7307
7307
  }
7308
7308
 
7309
7309
  // src/index.ts
7310
- var SIFA_SDK_VERSION = "0.19.77";
7310
+ var SIFA_SDK_VERSION = "0.19.78";
7311
7311
 
7312
7312
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
7313
7313
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
package/dist/index.js CHANGED
@@ -370,7 +370,7 @@ import {
370
370
  roadmapIssueUrl
371
371
  } from "./roadmap/index.js";
372
372
  import { SIFA_REPO_GROUPS, describeSifaRecord, repoGroupForCollection } from "./repo/index.js";
373
- var SIFA_SDK_VERSION = "0.19.77";
373
+ var SIFA_SDK_VERSION = "0.19.78";
374
374
  export {
375
375
  ACTIVITY_TIERS,
376
376
  ACTIVITY_VERBS,
@@ -2,7 +2,6 @@ import { c as Profile, d as ProfilePosition, W as SkillRef, z as PresentationLin
2
2
  import { a0 as SifaApiConfig, a1 as ApiFetchOptions, o as ProfileView, a2 as CreateResult, a3 as WriteResult } from './types-CI24asgo.js';
3
3
  import { S as SummarizeProfileViewOptions, P as ProfileSummary } from './profile-summary-PRDqxAQT.js';
4
4
  import { i as EntitySearchResponse, E as EntitySearchResult, c as EntityMintDomainResponse, g as EntityResolveDomainResponse, l as EntitySelectRequest, n as EntitySelectResponse } from './follow-profile-ceqefXAw.js';
5
- import { z } from 'zod';
6
5
 
7
6
  /**
8
7
  * Read the aggregated profile for a handle or DID.
@@ -389,54 +388,6 @@ declare function resolveEntityDomain(config: SifaApiConfig, domain: string, opti
389
388
  */
390
389
  declare function mintEntityDomain(config: SifaApiConfig, domain: string, options?: ApiFetchOptions): Promise<EntityMintDomainResponse>;
391
390
 
392
- /** One rpg.actor item and the viewer's progress on it, as served by `GET /api/rpg/status`. */
393
- declare const RpgItemStatusSchema: z.ZodObject<{
394
- id: z.ZodString;
395
- title: z.ZodString;
396
- description: z.ZodString;
397
- category: z.ZodString;
398
- earned: z.ZodBoolean;
399
- state: z.ZodEnum<{
400
- claimed: "claimed";
401
- earned: "earned";
402
- locked: "locked";
403
- given: "given";
404
- }>;
405
- worn: z.ZodDefault<z.ZodBoolean>;
406
- iconUrl: z.ZodNullable<z.ZodString>;
407
- }, z.core.$strip>;
408
- type RpgItemStatus = z.infer<typeof RpgItemStatusSchema>;
409
- declare const RpgStatusResponseSchema: z.ZodObject<{
410
- hasCharacter: z.ZodBoolean;
411
- canWriteItems: z.ZodBoolean;
412
- canCollect: z.ZodDefault<z.ZodBoolean>;
413
- items: z.ZodArray<z.ZodObject<{
414
- id: z.ZodString;
415
- title: z.ZodString;
416
- description: z.ZodString;
417
- category: z.ZodString;
418
- earned: z.ZodBoolean;
419
- state: z.ZodEnum<{
420
- claimed: "claimed";
421
- earned: "earned";
422
- locked: "locked";
423
- given: "given";
424
- }>;
425
- worn: z.ZodDefault<z.ZodBoolean>;
426
- iconUrl: z.ZodNullable<z.ZodString>;
427
- }, z.core.$strip>>;
428
- }, z.core.$strip>;
429
- type RpgStatusResponse = z.infer<typeof RpgStatusResponseSchema>;
430
- interface FetchRpgStatusOptions extends ApiFetchOptions {
431
- /** Forwarded as the `cookie` header for server-side (SSR) calls. */
432
- cookieHeader?: string;
433
- }
434
- /**
435
- * Fetch the authenticated viewer's rpg.actor item status. Auth-scoped: relies
436
- * on the session cookie (`credentials: 'include'`).
437
- */
438
- declare function fetchRpgStatus(config: SifaApiConfig, options?: FetchRpgStatusOptions): Promise<RpgStatusResponse>;
439
-
440
391
  /**
441
392
  * Counts confirmed endorsements received by a DID. The backend's
442
393
  * `GET /api/endorsement/:did` already returns only confirmed endorsements
@@ -558,4 +509,4 @@ declare function checkNetworkMapJobStatus(config: SifaApiConfig, jobId: string,
558
509
  */
559
510
  declare function fetchNetworkMap(config: SifaApiConfig, options?: ApiFetchOptions): Promise<NetworkMapResponse | null>;
560
511
 
561
- export { isNetworkMapResponse as $, deletePosition as A, deleteRecord as B, dismissEndorsement as C, type DismissEndorsementInput as D, fetchAtFundLink as E, type FetchNetworkStreamCountOptions as F, fetchEndorsementCount as G, fetchEntitySearch as H, fetchGetProfileView as I, fetchNetworkMap as J, fetchNetworkStreamCount as K, fetchPendingEndorsements as L, fetchProfile as M, type NetworkMapEdge as N, fetchProfileSummary as O, type PendingEndorsementsPage as P, fetchReceivedEndorsements as Q, type ReceivedEndorsementsPage as R, type SpeakerCard as S, type TalkEvent as T, fetchReciprocityCandidate as U, fetchRpgStatus as V, fetchSpeakers as W, fetchTalks as X, hideKeytraceClaim as Y, importSearchEntities as Z, initiateNetworkMapGeneration as _, type ReciprocityCandidate as a, linkSkillToPosition as a0, mintEntityDomain as a1, resolveEntityDomain as a2, revealMarqueDomain as a3, selectEntity as a4, setPositionPrimary as a5, unhideKeytraceClaim as a6, unlinkSkillFromPosition as a7, unrevealMarqueDomain as a8, unsetPositionPrimary as a9, updateEducation as aa, updatePosition as ab, updateRecord as ac, type FetchPendingEndorsementsOptions as b, type FetchRpgStatusOptions as c, type NetworkMapGenerationJob as d, type NetworkMapGraphData as e, type NetworkMapNode as f, type NetworkMapPendingJob as g, type NetworkMapResponse as h, type PendingEndorsement as i, type ReceivedEndorsement as j, type ReciprocitySkill as k, type RpgItemStatus as l, RpgItemStatusSchema as m, type RpgStatusResponse as n, RpgStatusResponseSchema as o, type SpeakerDirectoryFilters as p, type SpeakerGroup as q, type SpeakersResponse as r, type TalkRow as s, type TalkSpeaker as t, type TalksResponse as u, checkNetworkMapJobStatus as v, createEducation as w, createPosition as x, createRecord as y, deleteEducation as z };
512
+ export { setPositionPrimary as $, fetchEntitySearch as A, fetchGetProfileView as B, fetchNetworkMap as C, type DismissEndorsementInput as D, fetchNetworkStreamCount as E, type FetchNetworkStreamCountOptions as F, fetchPendingEndorsements as G, fetchProfile as H, fetchProfileSummary as I, fetchReceivedEndorsements as J, fetchReciprocityCandidate as K, fetchSpeakers as L, fetchTalks as M, type NetworkMapEdge as N, hideKeytraceClaim as O, type PendingEndorsementsPage as P, importSearchEntities as Q, type ReceivedEndorsementsPage as R, type SpeakerCard as S, type TalkEvent as T, initiateNetworkMapGeneration as U, isNetworkMapResponse as V, linkSkillToPosition as W, mintEntityDomain as X, resolveEntityDomain as Y, revealMarqueDomain as Z, selectEntity as _, type ReciprocityCandidate as a, unhideKeytraceClaim as a0, unlinkSkillFromPosition as a1, unrevealMarqueDomain as a2, unsetPositionPrimary as a3, updateEducation as a4, updatePosition as a5, updateRecord as a6, type FetchPendingEndorsementsOptions as b, type NetworkMapGenerationJob as c, type NetworkMapGraphData as d, type NetworkMapNode as e, type NetworkMapPendingJob as f, type NetworkMapResponse as g, type PendingEndorsement as h, type ReceivedEndorsement as i, type ReciprocitySkill as j, type SpeakerDirectoryFilters as k, type SpeakerGroup as l, type SpeakersResponse as m, type TalkRow as n, type TalkSpeaker as o, type TalksResponse as p, checkNetworkMapJobStatus as q, createEducation as r, createPosition as s, createRecord as t, deleteEducation as u, deletePosition as v, deleteRecord as w, dismissEndorsement as x, fetchAtFundLink as y, fetchEndorsementCount as z };
@@ -2,7 +2,6 @@ import { c as Profile, d as ProfilePosition, W as SkillRef, z as PresentationLin
2
2
  import { a0 as SifaApiConfig, a1 as ApiFetchOptions, o as ProfileView, a2 as CreateResult, a3 as WriteResult } from './types-qw55KvoV.cjs';
3
3
  import { S as SummarizeProfileViewOptions, P as ProfileSummary } from './profile-summary-BcbJrph1.cjs';
4
4
  import { i as EntitySearchResponse, E as EntitySearchResult, c as EntityMintDomainResponse, g as EntityResolveDomainResponse, l as EntitySelectRequest, n as EntitySelectResponse } from './follow-profile-CQ3DTTak.cjs';
5
- import { z } from 'zod';
6
5
 
7
6
  /**
8
7
  * Read the aggregated profile for a handle or DID.
@@ -389,54 +388,6 @@ declare function resolveEntityDomain(config: SifaApiConfig, domain: string, opti
389
388
  */
390
389
  declare function mintEntityDomain(config: SifaApiConfig, domain: string, options?: ApiFetchOptions): Promise<EntityMintDomainResponse>;
391
390
 
392
- /** One rpg.actor item and the viewer's progress on it, as served by `GET /api/rpg/status`. */
393
- declare const RpgItemStatusSchema: z.ZodObject<{
394
- id: z.ZodString;
395
- title: z.ZodString;
396
- description: z.ZodString;
397
- category: z.ZodString;
398
- earned: z.ZodBoolean;
399
- state: z.ZodEnum<{
400
- claimed: "claimed";
401
- earned: "earned";
402
- locked: "locked";
403
- given: "given";
404
- }>;
405
- worn: z.ZodDefault<z.ZodBoolean>;
406
- iconUrl: z.ZodNullable<z.ZodString>;
407
- }, z.core.$strip>;
408
- type RpgItemStatus = z.infer<typeof RpgItemStatusSchema>;
409
- declare const RpgStatusResponseSchema: z.ZodObject<{
410
- hasCharacter: z.ZodBoolean;
411
- canWriteItems: z.ZodBoolean;
412
- canCollect: z.ZodDefault<z.ZodBoolean>;
413
- items: z.ZodArray<z.ZodObject<{
414
- id: z.ZodString;
415
- title: z.ZodString;
416
- description: z.ZodString;
417
- category: z.ZodString;
418
- earned: z.ZodBoolean;
419
- state: z.ZodEnum<{
420
- claimed: "claimed";
421
- earned: "earned";
422
- locked: "locked";
423
- given: "given";
424
- }>;
425
- worn: z.ZodDefault<z.ZodBoolean>;
426
- iconUrl: z.ZodNullable<z.ZodString>;
427
- }, z.core.$strip>>;
428
- }, z.core.$strip>;
429
- type RpgStatusResponse = z.infer<typeof RpgStatusResponseSchema>;
430
- interface FetchRpgStatusOptions extends ApiFetchOptions {
431
- /** Forwarded as the `cookie` header for server-side (SSR) calls. */
432
- cookieHeader?: string;
433
- }
434
- /**
435
- * Fetch the authenticated viewer's rpg.actor item status. Auth-scoped: relies
436
- * on the session cookie (`credentials: 'include'`).
437
- */
438
- declare function fetchRpgStatus(config: SifaApiConfig, options?: FetchRpgStatusOptions): Promise<RpgStatusResponse>;
439
-
440
391
  /**
441
392
  * Counts confirmed endorsements received by a DID. The backend's
442
393
  * `GET /api/endorsement/:did` already returns only confirmed endorsements
@@ -558,4 +509,4 @@ declare function checkNetworkMapJobStatus(config: SifaApiConfig, jobId: string,
558
509
  */
559
510
  declare function fetchNetworkMap(config: SifaApiConfig, options?: ApiFetchOptions): Promise<NetworkMapResponse | null>;
560
511
 
561
- export { isNetworkMapResponse as $, deletePosition as A, deleteRecord as B, dismissEndorsement as C, type DismissEndorsementInput as D, fetchAtFundLink as E, type FetchNetworkStreamCountOptions as F, fetchEndorsementCount as G, fetchEntitySearch as H, fetchGetProfileView as I, fetchNetworkMap as J, fetchNetworkStreamCount as K, fetchPendingEndorsements as L, fetchProfile as M, type NetworkMapEdge as N, fetchProfileSummary as O, type PendingEndorsementsPage as P, fetchReceivedEndorsements as Q, type ReceivedEndorsementsPage as R, type SpeakerCard as S, type TalkEvent as T, fetchReciprocityCandidate as U, fetchRpgStatus as V, fetchSpeakers as W, fetchTalks as X, hideKeytraceClaim as Y, importSearchEntities as Z, initiateNetworkMapGeneration as _, type ReciprocityCandidate as a, linkSkillToPosition as a0, mintEntityDomain as a1, resolveEntityDomain as a2, revealMarqueDomain as a3, selectEntity as a4, setPositionPrimary as a5, unhideKeytraceClaim as a6, unlinkSkillFromPosition as a7, unrevealMarqueDomain as a8, unsetPositionPrimary as a9, updateEducation as aa, updatePosition as ab, updateRecord as ac, type FetchPendingEndorsementsOptions as b, type FetchRpgStatusOptions as c, type NetworkMapGenerationJob as d, type NetworkMapGraphData as e, type NetworkMapNode as f, type NetworkMapPendingJob as g, type NetworkMapResponse as h, type PendingEndorsement as i, type ReceivedEndorsement as j, type ReciprocitySkill as k, type RpgItemStatus as l, RpgItemStatusSchema as m, type RpgStatusResponse as n, RpgStatusResponseSchema as o, type SpeakerDirectoryFilters as p, type SpeakerGroup as q, type SpeakersResponse as r, type TalkRow as s, type TalkSpeaker as t, type TalksResponse as u, checkNetworkMapJobStatus as v, createEducation as w, createPosition as x, createRecord as y, deleteEducation as z };
512
+ export { setPositionPrimary as $, fetchEntitySearch as A, fetchGetProfileView as B, fetchNetworkMap as C, type DismissEndorsementInput as D, fetchNetworkStreamCount as E, type FetchNetworkStreamCountOptions as F, fetchPendingEndorsements as G, fetchProfile as H, fetchProfileSummary as I, fetchReceivedEndorsements as J, fetchReciprocityCandidate as K, fetchSpeakers as L, fetchTalks as M, type NetworkMapEdge as N, hideKeytraceClaim as O, type PendingEndorsementsPage as P, importSearchEntities as Q, type ReceivedEndorsementsPage as R, type SpeakerCard as S, type TalkEvent as T, initiateNetworkMapGeneration as U, isNetworkMapResponse as V, linkSkillToPosition as W, mintEntityDomain as X, resolveEntityDomain as Y, revealMarqueDomain as Z, selectEntity as _, type ReciprocityCandidate as a, unhideKeytraceClaim as a0, unlinkSkillFromPosition as a1, unrevealMarqueDomain as a2, unsetPositionPrimary as a3, updateEducation as a4, updatePosition as a5, updateRecord as a6, type FetchPendingEndorsementsOptions as b, type NetworkMapGenerationJob as c, type NetworkMapGraphData as d, type NetworkMapNode as e, type NetworkMapPendingJob as f, type NetworkMapResponse as g, type PendingEndorsement as h, type ReceivedEndorsement as i, type ReciprocitySkill as j, type SpeakerDirectoryFilters as k, type SpeakerGroup as l, type SpeakersResponse as m, type TalkRow as n, type TalkSpeaker as o, type TalksResponse as p, checkNetworkMapJobStatus as q, createEducation as r, createPosition as s, createRecord as t, deleteEducation as u, deletePosition as v, deleteRecord as w, dismissEndorsement as x, fetchAtFundLink as y, fetchEndorsementCount as z };
@@ -1408,6 +1408,26 @@ async function fetchRpgStatus(config, options = {}) {
1408
1408
  });
1409
1409
  return RpgStatusResponseSchema.parse(data);
1410
1410
  }
1411
+ var RpgClaimableResponseSchema = zod.z.object({
1412
+ count: zod.z.number().int().nonnegative()
1413
+ });
1414
+ async function fetchRpgClaimable(config, options = {}) {
1415
+ const { cookieHeader, ...fetchOptions } = options;
1416
+ const headers = { ...options.headers ?? {} };
1417
+ if (cookieHeader) headers.cookie = cookieHeader;
1418
+ try {
1419
+ const data = await apiFetch(config, "/api/rpg/claimable", {
1420
+ credentials: "include",
1421
+ cache: "no-store",
1422
+ timeoutMs: 5e3,
1423
+ ...fetchOptions,
1424
+ headers
1425
+ });
1426
+ return RpgClaimableResponseSchema.parse(data);
1427
+ } catch {
1428
+ return { count: 0 };
1429
+ }
1430
+ }
1411
1431
 
1412
1432
  // src/query/fetchers/endorsement.ts
1413
1433
  async function fetchEndorsementCount(config, did, options = {}) {
@@ -1945,6 +1965,12 @@ var sifaQueryKeys = {
1945
1965
  all: () => ["sifa", "inbox"],
1946
1966
  counts: () => ["sifa", "inbox", "counts"]
1947
1967
  },
1968
+ // Session-scoped: how many rpg.actor items the signed-in user can claim, for
1969
+ // the Inbox item and the bell dropdown.
1970
+ rpg: {
1971
+ all: () => ["sifa", "rpg"],
1972
+ claimable: () => ["sifa", "rpg", "claimable"]
1973
+ },
1948
1974
  search: {
1949
1975
  all: () => ["sifa", "search"],
1950
1976
  profiles: (filters) => ["sifa", "search", "profiles", filters],
@@ -2222,6 +2248,7 @@ exports.HIDDEN_ITEM_SOURCES = HIDDEN_ITEM_SOURCES;
2222
2248
  exports.HIDDEN_ITEM_TYPES = HIDDEN_ITEM_TYPES;
2223
2249
  exports.PROFILE_COMPLETENESS_SIGNALS = PROFILE_COMPLETENESS_SIGNALS;
2224
2250
  exports.QUOTED_POSTS_BATCH_MAX = QUOTED_POSTS_BATCH_MAX;
2251
+ exports.RpgClaimableResponseSchema = RpgClaimableResponseSchema;
2225
2252
  exports.RpgItemStatusSchema = RpgItemStatusSchema;
2226
2253
  exports.RpgStatusResponseSchema = RpgStatusResponseSchema;
2227
2254
  exports.UserSettingsSchema = UserSettingsSchema;
@@ -2297,6 +2324,7 @@ exports.fetchReceivedEndorsements = fetchReceivedEndorsements;
2297
2324
  exports.fetchReciprocityCandidate = fetchReciprocityCandidate;
2298
2325
  exports.fetchRepoInventory = fetchRepoInventory;
2299
2326
  exports.fetchRoadmapVotes = fetchRoadmapVotes;
2327
+ exports.fetchRpgClaimable = fetchRpgClaimable;
2300
2328
  exports.fetchRpgStatus = fetchRpgStatus;
2301
2329
  exports.fetchSearchCompanies = fetchSearchCompanies;
2302
2330
  exports.fetchSearchFilters = fetchSearchFilters;