@singi-labs/sifa-sdk 0.16.0 → 0.18.0

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.d.cts CHANGED
@@ -1444,6 +1444,71 @@ declare function getPublisherFromSiteUrl(siteUrl: string): Publisher;
1444
1444
  * embeds, content labels) are layered on in sifa-web and are not part of the
1445
1445
  * shared contract.
1446
1446
  */
1447
+ interface HypercertContributorView {
1448
+ displayName: string;
1449
+ imageUrl?: string;
1450
+ /**
1451
+ * Where the contributor lives. A GitHub profile URL on every
1452
+ * `contributorInformation` record sampled to date, never a DID or atproto
1453
+ * handle, so this does not resolve to a Sifa profile.
1454
+ */
1455
+ identifier?: string;
1456
+ /** Percentage share of the claim; weights across a claim sum to 100. */
1457
+ weight?: number;
1458
+ }
1459
+ interface HypercertAttachmentView {
1460
+ title?: string;
1461
+ url: string;
1462
+ }
1463
+ /**
1464
+ * Contributor and attachment detail for an `org.hypercerts.claim.activity`
1465
+ * record, resolved by sifa-api out of sidecar records in the claim's own repo.
1466
+ * A card cannot reach them itself.
1467
+ */
1468
+ interface HypercertDetailsView {
1469
+ contributors: HypercertContributorView[];
1470
+ /** Total before truncation, so a renderer can show "+N more". */
1471
+ contributorCount: number;
1472
+ attachments: HypercertAttachmentView[];
1473
+ }
1474
+ /** An account a Certified record points at: a badge recipient, or a group. */
1475
+ interface CertifiedActorView {
1476
+ did: string;
1477
+ /**
1478
+ * The account's handle. Falls back to the DID when nothing resolved. Note
1479
+ * that some accounts in this ecosystem are not on Bluesky at all (the
1480
+ * Hypercerts Foundation's own account resolves only through its DID
1481
+ * document), so a Bluesky-only lookup is not sufficient.
1482
+ */
1483
+ handle: string;
1484
+ displayName?: string;
1485
+ avatar?: string;
1486
+ }
1487
+ /** The badge definition behind an award: what the badge is, and why. */
1488
+ interface CertifiedBadgeView {
1489
+ title: string;
1490
+ /** Why the badge exists, straight from the definition record. */
1491
+ description?: string;
1492
+ /** Emoji from the definition, e.g. a medal. */
1493
+ icon?: string;
1494
+ /** e.g. "endorsement", "evaluator". */
1495
+ badgeType?: string;
1496
+ }
1497
+ /**
1498
+ * Certified enrichment, resolved by sifa-api. Covers both directions: a badge
1499
+ * the person awarded to someone else, and one they received and accepted.
1500
+ */
1501
+ interface CertifiedDetailsView {
1502
+ badge?: CertifiedBadgeView;
1503
+ /** Who received the badge, for an award the person issued. */
1504
+ recipient?: CertifiedActorView;
1505
+ /** Who issued the badge, for one the person received and accepted. */
1506
+ issuer?: CertifiedActorView;
1507
+ /** The group joined, for a membership record. */
1508
+ group?: CertifiedActorView;
1509
+ /** Role on a membership, e.g. "owner", "admin", "member". */
1510
+ role?: string;
1511
+ }
1447
1512
  interface ActivityItem {
1448
1513
  /** Full at-uri of the record: stable key + permalink source. */
1449
1514
  uri: string;
@@ -1487,6 +1552,17 @@ interface ActivityItem {
1487
1552
  * a `StreamCardVM` too.
1488
1553
  */
1489
1554
  subject?: ActivityItem;
1555
+ /**
1556
+ * Hypercert claim enrichment, set by sifa-api. Absent for non-hypercert
1557
+ * items, for claims with neither contributors nor attachments, and for
1558
+ * responses predating the field.
1559
+ */
1560
+ hypercertDetails?: HypercertDetailsView;
1561
+ /**
1562
+ * Certified enrichment: the badge behind an award and the resolved accounts
1563
+ * it points at. Absent for non-Certified items and legacy responses.
1564
+ */
1565
+ certifiedDetails?: CertifiedDetailsView;
1490
1566
  }
1491
1567
 
1492
1568
  /**
@@ -1798,6 +1874,17 @@ interface StreamCardVM {
1798
1874
  externalLink?: StreamExternalLink;
1799
1875
  theme?: StreamTheme;
1800
1876
  subject?: StreamCardSubject;
1877
+ /**
1878
+ * Contributor and attachment detail for a hypercert claim, passed through
1879
+ * from the `ActivityItem` sifa-api hydrated. Renderers show a credit roll
1880
+ * and the claim's outbound links instead of a bare contributor count.
1881
+ */
1882
+ hypercertDetails?: HypercertDetailsView;
1883
+ /**
1884
+ * Certified badge + resolved accounts, passed through from the ActivityItem
1885
+ * sifa-api hydrated.
1886
+ */
1887
+ certifiedDetails?: CertifiedDetailsView;
1801
1888
  }
1802
1889
 
1803
1890
  declare const streamSourceSchema: z.ZodType<StreamSource>;
package/dist/index.d.ts CHANGED
@@ -1444,6 +1444,71 @@ declare function getPublisherFromSiteUrl(siteUrl: string): Publisher;
1444
1444
  * embeds, content labels) are layered on in sifa-web and are not part of the
1445
1445
  * shared contract.
1446
1446
  */
1447
+ interface HypercertContributorView {
1448
+ displayName: string;
1449
+ imageUrl?: string;
1450
+ /**
1451
+ * Where the contributor lives. A GitHub profile URL on every
1452
+ * `contributorInformation` record sampled to date, never a DID or atproto
1453
+ * handle, so this does not resolve to a Sifa profile.
1454
+ */
1455
+ identifier?: string;
1456
+ /** Percentage share of the claim; weights across a claim sum to 100. */
1457
+ weight?: number;
1458
+ }
1459
+ interface HypercertAttachmentView {
1460
+ title?: string;
1461
+ url: string;
1462
+ }
1463
+ /**
1464
+ * Contributor and attachment detail for an `org.hypercerts.claim.activity`
1465
+ * record, resolved by sifa-api out of sidecar records in the claim's own repo.
1466
+ * A card cannot reach them itself.
1467
+ */
1468
+ interface HypercertDetailsView {
1469
+ contributors: HypercertContributorView[];
1470
+ /** Total before truncation, so a renderer can show "+N more". */
1471
+ contributorCount: number;
1472
+ attachments: HypercertAttachmentView[];
1473
+ }
1474
+ /** An account a Certified record points at: a badge recipient, or a group. */
1475
+ interface CertifiedActorView {
1476
+ did: string;
1477
+ /**
1478
+ * The account's handle. Falls back to the DID when nothing resolved. Note
1479
+ * that some accounts in this ecosystem are not on Bluesky at all (the
1480
+ * Hypercerts Foundation's own account resolves only through its DID
1481
+ * document), so a Bluesky-only lookup is not sufficient.
1482
+ */
1483
+ handle: string;
1484
+ displayName?: string;
1485
+ avatar?: string;
1486
+ }
1487
+ /** The badge definition behind an award: what the badge is, and why. */
1488
+ interface CertifiedBadgeView {
1489
+ title: string;
1490
+ /** Why the badge exists, straight from the definition record. */
1491
+ description?: string;
1492
+ /** Emoji from the definition, e.g. a medal. */
1493
+ icon?: string;
1494
+ /** e.g. "endorsement", "evaluator". */
1495
+ badgeType?: string;
1496
+ }
1497
+ /**
1498
+ * Certified enrichment, resolved by sifa-api. Covers both directions: a badge
1499
+ * the person awarded to someone else, and one they received and accepted.
1500
+ */
1501
+ interface CertifiedDetailsView {
1502
+ badge?: CertifiedBadgeView;
1503
+ /** Who received the badge, for an award the person issued. */
1504
+ recipient?: CertifiedActorView;
1505
+ /** Who issued the badge, for one the person received and accepted. */
1506
+ issuer?: CertifiedActorView;
1507
+ /** The group joined, for a membership record. */
1508
+ group?: CertifiedActorView;
1509
+ /** Role on a membership, e.g. "owner", "admin", "member". */
1510
+ role?: string;
1511
+ }
1447
1512
  interface ActivityItem {
1448
1513
  /** Full at-uri of the record: stable key + permalink source. */
1449
1514
  uri: string;
@@ -1487,6 +1552,17 @@ interface ActivityItem {
1487
1552
  * a `StreamCardVM` too.
1488
1553
  */
1489
1554
  subject?: ActivityItem;
1555
+ /**
1556
+ * Hypercert claim enrichment, set by sifa-api. Absent for non-hypercert
1557
+ * items, for claims with neither contributors nor attachments, and for
1558
+ * responses predating the field.
1559
+ */
1560
+ hypercertDetails?: HypercertDetailsView;
1561
+ /**
1562
+ * Certified enrichment: the badge behind an award and the resolved accounts
1563
+ * it points at. Absent for non-Certified items and legacy responses.
1564
+ */
1565
+ certifiedDetails?: CertifiedDetailsView;
1490
1566
  }
1491
1567
 
1492
1568
  /**
@@ -1798,6 +1874,17 @@ interface StreamCardVM {
1798
1874
  externalLink?: StreamExternalLink;
1799
1875
  theme?: StreamTheme;
1800
1876
  subject?: StreamCardSubject;
1877
+ /**
1878
+ * Contributor and attachment detail for a hypercert claim, passed through
1879
+ * from the `ActivityItem` sifa-api hydrated. Renderers show a credit roll
1880
+ * and the claim's outbound links instead of a bare contributor count.
1881
+ */
1882
+ hypercertDetails?: HypercertDetailsView;
1883
+ /**
1884
+ * Certified badge + resolved accounts, passed through from the ActivityItem
1885
+ * sifa-api hydrated.
1886
+ */
1887
+ certifiedDetails?: CertifiedDetailsView;
1801
1888
  }
1802
1889
 
1803
1890
  declare const streamSourceSchema: z.ZodType<StreamSource>;
package/dist/index.js CHANGED
@@ -1152,7 +1152,7 @@ function categoryForApp(appId) {
1152
1152
  // src/taxonomy/activity-tiers.json
1153
1153
  var activity_tiers_default = {
1154
1154
  $schema: "https://sifa.id/schemas/activity-tiers/v1.json",
1155
- version: "1.2.0",
1155
+ version: "1.3.0",
1156
1156
  updated: "2026-08-25",
1157
1157
  tiers: {
1158
1158
  creation: {
@@ -1256,6 +1256,11 @@ var activity_tiers_default = {
1256
1256
  app: "certified",
1257
1257
  notes: "An endorsement issued to another DID. A trust signal the actor contributes, like a Bluesky verification."
1258
1258
  },
1259
+ "app.certified.badge.response": {
1260
+ tier: "creation",
1261
+ app: "certified",
1262
+ notes: "The recipient's acceptance of a badge someone else awarded them. An accepted badge is a credential the person holds; rejected ones are hidden by an ACTIVITY_VISIBILITY_RULES predicate."
1263
+ },
1259
1264
  "app.collectivesocial.feed.list": {
1260
1265
  tier: "creation",
1261
1266
  app: "collectivesocial",
@@ -3703,11 +3708,15 @@ function marginAnnotationHasBody(record) {
3703
3708
  }
3704
3709
  return false;
3705
3710
  }
3711
+ function certifiedBadgeAccepted(record) {
3712
+ return record.response === "accepted";
3713
+ }
3706
3714
  var ACTIVITY_VISIBILITY_RULES = Object.freeze({
3707
3715
  "buzz.bookhive.book": bookhiveHasOpinion,
3708
3716
  "app.beaconbits.beacon": beaconbitsHasContent,
3709
3717
  "at.margin.bookmark": marginBookmarkHasSource,
3710
- "at.margin.annotation": marginAnnotationHasBody
3718
+ "at.margin.annotation": marginAnnotationHasBody,
3719
+ "app.certified.badge.response": certifiedBadgeAccepted
3711
3720
  });
3712
3721
  function isVisibleActivityItem(collection, record) {
3713
3722
  if (record === null || typeof record !== "object") return false;
@@ -4068,6 +4077,36 @@ var streamCardSubjectSchema = z.discriminatedUnion("kind", [
4068
4077
  title: z.string().optional()
4069
4078
  })
4070
4079
  ]);
4080
+ var hypercertDetailsSchema = z.object({
4081
+ contributors: z.array(
4082
+ z.object({
4083
+ displayName: z.string(),
4084
+ imageUrl: z.string().optional(),
4085
+ identifier: z.string().optional(),
4086
+ weight: z.number().optional()
4087
+ })
4088
+ ),
4089
+ contributorCount: z.number(),
4090
+ attachments: z.array(z.object({ title: z.string().optional(), url: z.string() }))
4091
+ });
4092
+ var certifiedActorSchema = z.object({
4093
+ did: z.string(),
4094
+ handle: z.string(),
4095
+ displayName: z.string().optional(),
4096
+ avatar: z.string().optional()
4097
+ });
4098
+ var certifiedDetailsSchema = z.object({
4099
+ badge: z.object({
4100
+ title: z.string(),
4101
+ description: z.string().optional(),
4102
+ icon: z.string().optional(),
4103
+ badgeType: z.string().optional()
4104
+ }).optional(),
4105
+ recipient: certifiedActorSchema.optional(),
4106
+ issuer: certifiedActorSchema.optional(),
4107
+ group: certifiedActorSchema.optional(),
4108
+ role: z.string().optional()
4109
+ });
4071
4110
  var streamCardVMSchema = z.lazy(
4072
4111
  () => z.object({
4073
4112
  uri: z.string(),
@@ -4083,7 +4122,9 @@ var streamCardVMSchema = z.lazy(
4083
4122
  media: z.array(streamMediaSchema).optional(),
4084
4123
  externalLink: streamExternalLinkSchema.optional(),
4085
4124
  theme: streamThemeSchema.optional(),
4086
- subject: z.lazy(() => streamCardSubjectSchema).optional()
4125
+ subject: z.lazy(() => streamCardSubjectSchema).optional(),
4126
+ hypercertDetails: hypercertDetailsSchema.optional(),
4127
+ certifiedDetails: certifiedDetailsSchema.optional()
4087
4128
  })
4088
4129
  );
4089
4130
  function maxGraphemes(max) {
@@ -4806,6 +4847,8 @@ function toStreamCardVM(item, options = {}) {
4806
4847
  const sourceUrl = resolveSourceUrl(item, record);
4807
4848
  if (sourceUrl) vm.sourceUrl = sourceUrl;
4808
4849
  }
4850
+ if (item.hypercertDetails) vm.hypercertDetails = item.hypercertDetails;
4851
+ if (item.certifiedDetails) vm.certifiedDetails = item.certifiedDetails;
4809
4852
  if (item.subject) {
4810
4853
  vm.subject = { kind: "post", post: toStreamCardVM(item.subject, options) };
4811
4854
  }
@@ -6022,7 +6065,7 @@ function describeSifaRecord(collection, value) {
6022
6065
  }
6023
6066
 
6024
6067
  // src/index.ts
6025
- var SIFA_SDK_VERSION = "0.16.0";
6068
+ var SIFA_SDK_VERSION = "0.18.0";
6026
6069
 
6027
6070
  export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, ArtifactLinkSchema, AtmosphereFeedItemSchema, BlobRefSchema, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, DIMENSIONS_MAX_SCORE, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, EntityImportSearchResponseSchema, EntityMintDomainResponseSchema, EntityResolveDomainRequestSchema, EntityResolveDomainResponseSchema, EntitySearchResponseSchema, EntitySearchResultSchema, EntitySelectRequestSchema, EntitySelectResponseSchema, FEATURE_FLAGS, FeatureAllowlistEntrySchema, FeedActorSchema, FollowFeedItemSchema, FollowFeedPageSchema, FollowProfilePageSchema, FollowProfileSchema, GraphFollowRecordSchema, INDUSTRY_OPTIONS, INVESTMENT_ROLE_LABELS, INVESTMENT_ROLE_OPTIONS, INVESTMENT_STAGE_LABELS, INVESTMENT_STAGE_OPTIONS, INVESTMENT_STATUS_LABELS, INVESTMENT_STATUS_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, InvestmentAmountSchema, MIN_SKILLS, ON_BEHALF_OF_EMPLOYMENT_TYPES, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, OrgEmploymentAttestationRecordSchema, OrgProfileRecordSchema, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PROFILE_INVESTMENT_NSID, PROFILE_INVOLVEMENT_NSID, PROJECT_ROLES, PUBLICATION_TYPE_LABELS, PUBLICATION_TYPE_OPTIONS, PUBLISHERS, PresentationDurationSchema, PresentationLinkSchema, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileInvestmentRecordSchema, ProfileInvolvementRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfilePresentationDeliveryRecordSchema, ProfilePresentationRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, ROADMAP_ISSUES_REPO, ROADMAP_ITEM_META, SECTION_GROUPS, SECTION_LABELS, SIFA_REPO_GROUPS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, SifaFeedItemSchema, VERIFICATION_PROVIDERS, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, atUriSchema, buildMetaDescription, buildTalkSlug, categoryForApp, certDateExtractor, cidSchema, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countRecentActivity, countryCodeToFlag, dateRangeExtractor, datetimeSchema, decodeFeedCursor, dedupeSkills, describeSifaRecord, detectPdsProvider, didSchema, dimensionsFromInputs, durationFromMinutes, encodeFeedCursor, entityDisambiguationLabel, entityResultKey, externalRecordRefSchema, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDisplayUrl, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasAdultContent, hasPersonalProfileContent, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRoleLineRedundant, isSectionPopulated, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, locationSegments, looksLikeDomain, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeCompanyKey, normalizeDoi, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeSkillCategory, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, partialDateSchema, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, relativeLuminance, rendersCompanyProfile, rendersPersonalProfile, repoGroupForCollection, resolveAccountFacetMode, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, roadmapIssueUrl, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, singleDateExtractor, skillRefSchema, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, strongRefSchema, summarizePresentationDeliveries, summarizeProfileView, toStreamCardVM, toStreamCardVMs, truncateGraphemes, uriSchema, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
6028
6071
  //# sourceMappingURL=index.js.map