@singi-labs/sifa-sdk 0.17.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.cjs +33 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1471,6 +1471,44 @@ interface HypercertDetailsView {
|
|
|
1471
1471
|
contributorCount: number;
|
|
1472
1472
|
attachments: HypercertAttachmentView[];
|
|
1473
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
|
+
}
|
|
1474
1512
|
interface ActivityItem {
|
|
1475
1513
|
/** Full at-uri of the record: stable key + permalink source. */
|
|
1476
1514
|
uri: string;
|
|
@@ -1520,6 +1558,11 @@ interface ActivityItem {
|
|
|
1520
1558
|
* responses predating the field.
|
|
1521
1559
|
*/
|
|
1522
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;
|
|
1523
1566
|
}
|
|
1524
1567
|
|
|
1525
1568
|
/**
|
|
@@ -1837,6 +1880,11 @@ interface StreamCardVM {
|
|
|
1837
1880
|
* and the claim's outbound links instead of a bare contributor count.
|
|
1838
1881
|
*/
|
|
1839
1882
|
hypercertDetails?: HypercertDetailsView;
|
|
1883
|
+
/**
|
|
1884
|
+
* Certified badge + resolved accounts, passed through from the ActivityItem
|
|
1885
|
+
* sifa-api hydrated.
|
|
1886
|
+
*/
|
|
1887
|
+
certifiedDetails?: CertifiedDetailsView;
|
|
1840
1888
|
}
|
|
1841
1889
|
|
|
1842
1890
|
declare const streamSourceSchema: z.ZodType<StreamSource>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1471,6 +1471,44 @@ interface HypercertDetailsView {
|
|
|
1471
1471
|
contributorCount: number;
|
|
1472
1472
|
attachments: HypercertAttachmentView[];
|
|
1473
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
|
+
}
|
|
1474
1512
|
interface ActivityItem {
|
|
1475
1513
|
/** Full at-uri of the record: stable key + permalink source. */
|
|
1476
1514
|
uri: string;
|
|
@@ -1520,6 +1558,11 @@ interface ActivityItem {
|
|
|
1520
1558
|
* responses predating the field.
|
|
1521
1559
|
*/
|
|
1522
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;
|
|
1523
1566
|
}
|
|
1524
1567
|
|
|
1525
1568
|
/**
|
|
@@ -1837,6 +1880,11 @@ interface StreamCardVM {
|
|
|
1837
1880
|
* and the claim's outbound links instead of a bare contributor count.
|
|
1838
1881
|
*/
|
|
1839
1882
|
hypercertDetails?: HypercertDetailsView;
|
|
1883
|
+
/**
|
|
1884
|
+
* Certified badge + resolved accounts, passed through from the ActivityItem
|
|
1885
|
+
* sifa-api hydrated.
|
|
1886
|
+
*/
|
|
1887
|
+
certifiedDetails?: CertifiedDetailsView;
|
|
1840
1888
|
}
|
|
1841
1889
|
|
|
1842
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.
|
|
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;
|
|
@@ -4080,6 +4089,24 @@ var hypercertDetailsSchema = z.object({
|
|
|
4080
4089
|
contributorCount: z.number(),
|
|
4081
4090
|
attachments: z.array(z.object({ title: z.string().optional(), url: z.string() }))
|
|
4082
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
|
+
});
|
|
4083
4110
|
var streamCardVMSchema = z.lazy(
|
|
4084
4111
|
() => z.object({
|
|
4085
4112
|
uri: z.string(),
|
|
@@ -4096,7 +4123,8 @@ var streamCardVMSchema = z.lazy(
|
|
|
4096
4123
|
externalLink: streamExternalLinkSchema.optional(),
|
|
4097
4124
|
theme: streamThemeSchema.optional(),
|
|
4098
4125
|
subject: z.lazy(() => streamCardSubjectSchema).optional(),
|
|
4099
|
-
hypercertDetails: hypercertDetailsSchema.optional()
|
|
4126
|
+
hypercertDetails: hypercertDetailsSchema.optional(),
|
|
4127
|
+
certifiedDetails: certifiedDetailsSchema.optional()
|
|
4100
4128
|
})
|
|
4101
4129
|
);
|
|
4102
4130
|
function maxGraphemes(max) {
|
|
@@ -4820,6 +4848,7 @@ function toStreamCardVM(item, options = {}) {
|
|
|
4820
4848
|
if (sourceUrl) vm.sourceUrl = sourceUrl;
|
|
4821
4849
|
}
|
|
4822
4850
|
if (item.hypercertDetails) vm.hypercertDetails = item.hypercertDetails;
|
|
4851
|
+
if (item.certifiedDetails) vm.certifiedDetails = item.certifiedDetails;
|
|
4823
4852
|
if (item.subject) {
|
|
4824
4853
|
vm.subject = { kind: "post", post: toStreamCardVM(item.subject, options) };
|
|
4825
4854
|
}
|
|
@@ -6036,7 +6065,7 @@ function describeSifaRecord(collection, value) {
|
|
|
6036
6065
|
}
|
|
6037
6066
|
|
|
6038
6067
|
// src/index.ts
|
|
6039
|
-
var SIFA_SDK_VERSION = "0.
|
|
6068
|
+
var SIFA_SDK_VERSION = "0.18.0";
|
|
6040
6069
|
|
|
6041
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 };
|
|
6042
6071
|
//# sourceMappingURL=index.js.map
|