@singi-labs/sifa-sdk 0.12.13 → 0.12.15
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 +29 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +29 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1191,6 +1191,13 @@ interface ActivityItem {
|
|
|
1191
1191
|
rkey: string;
|
|
1192
1192
|
/** The raw record from the PDS / AppView. Parsed defensively by the transform. */
|
|
1193
1193
|
record: unknown;
|
|
1194
|
+
/**
|
|
1195
|
+
* The record author's handle, injected by the AppView. The activity snapshot
|
|
1196
|
+
* is per-author, so the api sets this per item (and per `subject` item) to let
|
|
1197
|
+
* handle-keyed apps (Bluesky, Popfeed, Tangled, ...) resolve a `sourceUrl`.
|
|
1198
|
+
* Absent when the handle is unknown; the transform then relies on the DID.
|
|
1199
|
+
*/
|
|
1200
|
+
authorHandle?: string;
|
|
1194
1201
|
/** App id from the app registry, e.g. `bluesky`. */
|
|
1195
1202
|
appId: string;
|
|
1196
1203
|
/** Human app name from the app registry, e.g. `Bluesky`. */
|
|
@@ -1213,12 +1220,13 @@ interface ActivityItem {
|
|
|
1213
1220
|
* standard-site; "posted" spans Bluesky and Picosky) so a day-grouped feed
|
|
1214
1221
|
* reads like sentences.
|
|
1215
1222
|
*/
|
|
1216
|
-
declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presented", "endorsed", "joined", "shipped", "created"];
|
|
1223
|
+
declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presented", "endorsed", "joined", "shipped", "reviewed", "created"];
|
|
1217
1224
|
type StreamVerb = (typeof STREAM_VERBS)[number];
|
|
1218
1225
|
/** Zod enum for a {@link StreamVerb}, shared with the view-model schema. */
|
|
1219
1226
|
declare const streamVerbSchema: z.ZodEnum<{
|
|
1220
1227
|
created: "created";
|
|
1221
1228
|
posted: "posted";
|
|
1229
|
+
reviewed: "reviewed";
|
|
1222
1230
|
reposted: "reposted";
|
|
1223
1231
|
published: "published";
|
|
1224
1232
|
presented: "presented";
|
|
@@ -1486,6 +1494,13 @@ interface StreamCardVM {
|
|
|
1486
1494
|
timestamp: string;
|
|
1487
1495
|
/** Human sentence fragment, verb-aware. */
|
|
1488
1496
|
title: string;
|
|
1497
|
+
/**
|
|
1498
|
+
* Canonical http(s) permalink to this record on its source app (e.g. a
|
|
1499
|
+
* Bluesky post's `bsky.app` URL). Absent when no linkable URL is available —
|
|
1500
|
+
* see {@link resolveCardUrl}, which keys some apps on the author handle the
|
|
1501
|
+
* transform may not have. Consumers use this to make the card click through.
|
|
1502
|
+
*/
|
|
1503
|
+
sourceUrl?: string;
|
|
1489
1504
|
body?: StreamCardBody;
|
|
1490
1505
|
media?: StreamMedia[];
|
|
1491
1506
|
externalLink?: StreamExternalLink;
|
package/dist/index.d.ts
CHANGED
|
@@ -1191,6 +1191,13 @@ interface ActivityItem {
|
|
|
1191
1191
|
rkey: string;
|
|
1192
1192
|
/** The raw record from the PDS / AppView. Parsed defensively by the transform. */
|
|
1193
1193
|
record: unknown;
|
|
1194
|
+
/**
|
|
1195
|
+
* The record author's handle, injected by the AppView. The activity snapshot
|
|
1196
|
+
* is per-author, so the api sets this per item (and per `subject` item) to let
|
|
1197
|
+
* handle-keyed apps (Bluesky, Popfeed, Tangled, ...) resolve a `sourceUrl`.
|
|
1198
|
+
* Absent when the handle is unknown; the transform then relies on the DID.
|
|
1199
|
+
*/
|
|
1200
|
+
authorHandle?: string;
|
|
1194
1201
|
/** App id from the app registry, e.g. `bluesky`. */
|
|
1195
1202
|
appId: string;
|
|
1196
1203
|
/** Human app name from the app registry, e.g. `Bluesky`. */
|
|
@@ -1213,12 +1220,13 @@ interface ActivityItem {
|
|
|
1213
1220
|
* standard-site; "posted" spans Bluesky and Picosky) so a day-grouped feed
|
|
1214
1221
|
* reads like sentences.
|
|
1215
1222
|
*/
|
|
1216
|
-
declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presented", "endorsed", "joined", "shipped", "created"];
|
|
1223
|
+
declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presented", "endorsed", "joined", "shipped", "reviewed", "created"];
|
|
1217
1224
|
type StreamVerb = (typeof STREAM_VERBS)[number];
|
|
1218
1225
|
/** Zod enum for a {@link StreamVerb}, shared with the view-model schema. */
|
|
1219
1226
|
declare const streamVerbSchema: z.ZodEnum<{
|
|
1220
1227
|
created: "created";
|
|
1221
1228
|
posted: "posted";
|
|
1229
|
+
reviewed: "reviewed";
|
|
1222
1230
|
reposted: "reposted";
|
|
1223
1231
|
published: "published";
|
|
1224
1232
|
presented: "presented";
|
|
@@ -1486,6 +1494,13 @@ interface StreamCardVM {
|
|
|
1486
1494
|
timestamp: string;
|
|
1487
1495
|
/** Human sentence fragment, verb-aware. */
|
|
1488
1496
|
title: string;
|
|
1497
|
+
/**
|
|
1498
|
+
* Canonical http(s) permalink to this record on its source app (e.g. a
|
|
1499
|
+
* Bluesky post's `bsky.app` URL). Absent when no linkable URL is available —
|
|
1500
|
+
* see {@link resolveCardUrl}, which keys some apps on the author handle the
|
|
1501
|
+
* transform may not have. Consumers use this to make the card click through.
|
|
1502
|
+
*/
|
|
1503
|
+
sourceUrl?: string;
|
|
1489
1504
|
body?: StreamCardBody;
|
|
1490
1505
|
media?: StreamMedia[];
|
|
1491
1506
|
externalLink?: StreamExternalLink;
|
package/dist/index.js
CHANGED
|
@@ -2745,8 +2745,8 @@ function getPublisherFromSiteUrl(siteUrl) {
|
|
|
2745
2745
|
// src/stream/verbs.json
|
|
2746
2746
|
var verbs_default = {
|
|
2747
2747
|
$schema: "https://sifa.id/schemas/activity-verbs/v1.json",
|
|
2748
|
-
version: "1.
|
|
2749
|
-
updated: "2026-07-
|
|
2748
|
+
version: "1.1.0",
|
|
2749
|
+
updated: "2026-07-19",
|
|
2750
2750
|
defaultVerb: "created",
|
|
2751
2751
|
verbs: {
|
|
2752
2752
|
"app.bsky.feed.post": "posted",
|
|
@@ -2754,6 +2754,8 @@ var verbs_default = {
|
|
|
2754
2754
|
"social.psky.feed.post": "posted",
|
|
2755
2755
|
"social.popfeed.feed.post": "posted",
|
|
2756
2756
|
"social.popfeed.feed.note": "posted",
|
|
2757
|
+
"social.popfeed.feed.review": "reviewed",
|
|
2758
|
+
"buzz.bookhive.book": "reviewed",
|
|
2757
2759
|
"fyi.unravel.frontpage.post": "posted",
|
|
2758
2760
|
"forum.barazo.post": "posted",
|
|
2759
2761
|
"app.bsky.feed.repost": "reposted",
|
|
@@ -2788,6 +2790,7 @@ var STREAM_VERBS = [
|
|
|
2788
2790
|
"endorsed",
|
|
2789
2791
|
"joined",
|
|
2790
2792
|
"shipped",
|
|
2793
|
+
"reviewed",
|
|
2791
2794
|
"created"
|
|
2792
2795
|
];
|
|
2793
2796
|
var streamVerbSchema = z.enum(STREAM_VERBS);
|
|
@@ -3006,6 +3009,7 @@ var streamCardVMSchema = z.lazy(
|
|
|
3006
3009
|
tier: z.enum(["creation", "action", "filtered"]),
|
|
3007
3010
|
timestamp: z.string(),
|
|
3008
3011
|
title: z.string(),
|
|
3012
|
+
sourceUrl: z.string().optional(),
|
|
3009
3013
|
body: streamCardBodySchema.optional(),
|
|
3010
3014
|
media: z.array(streamMediaSchema).optional(),
|
|
3011
3015
|
externalLink: streamExternalLinkSchema.optional(),
|
|
@@ -3168,18 +3172,33 @@ function buildSource(item, options) {
|
|
|
3168
3172
|
};
|
|
3169
3173
|
}
|
|
3170
3174
|
var TITLE_BY_VERB = {
|
|
3171
|
-
posted: (
|
|
3172
|
-
reposted: () => "Reposted
|
|
3175
|
+
posted: () => "Posted",
|
|
3176
|
+
reposted: () => "Reposted",
|
|
3173
3177
|
published: (label) => `Published on ${label}`,
|
|
3174
3178
|
presented: () => "Gave a presentation",
|
|
3175
3179
|
endorsed: () => "Wrote an endorsement",
|
|
3176
3180
|
joined: (label) => `Joined ${label}`,
|
|
3177
3181
|
shipped: (label) => `Shipped on ${label}`,
|
|
3178
|
-
|
|
3182
|
+
reviewed: (label) => `Reviewed on ${label}`,
|
|
3183
|
+
created: (label) => `Shared on ${label}`
|
|
3179
3184
|
};
|
|
3180
3185
|
function buildTitle(verb, label) {
|
|
3181
3186
|
return TITLE_BY_VERB[verb](label);
|
|
3182
3187
|
}
|
|
3188
|
+
function resolveSourceUrl(item, record) {
|
|
3189
|
+
const authorDid = didFromUri(item.uri);
|
|
3190
|
+
if (!authorDid) return void 0;
|
|
3191
|
+
const authorHandle = asNonEmptyString(item.authorHandle) ?? asNonEmptyString(record.handle);
|
|
3192
|
+
const url = resolveCardUrl({
|
|
3193
|
+
collection: item.collection,
|
|
3194
|
+
record,
|
|
3195
|
+
uri: item.uri,
|
|
3196
|
+
rkey: item.rkey,
|
|
3197
|
+
authorDid,
|
|
3198
|
+
...authorHandle ? { authorHandle } : {}
|
|
3199
|
+
});
|
|
3200
|
+
return url && /^https?:\/\//i.test(url) ? url : void 0;
|
|
3201
|
+
}
|
|
3183
3202
|
function readTheme(record) {
|
|
3184
3203
|
const theme = asRecord(record?.publicationTheme ?? record?.theme);
|
|
3185
3204
|
if (!theme) return void 0;
|
|
@@ -3677,6 +3696,10 @@ function toStreamCardVM(item, options = {}) {
|
|
|
3677
3696
|
};
|
|
3678
3697
|
const theme = readTheme(record);
|
|
3679
3698
|
if (theme) vm.theme = theme;
|
|
3699
|
+
if (record) {
|
|
3700
|
+
const sourceUrl = resolveSourceUrl(item, record);
|
|
3701
|
+
if (sourceUrl) vm.sourceUrl = sourceUrl;
|
|
3702
|
+
}
|
|
3680
3703
|
if (item.subject) {
|
|
3681
3704
|
vm.subject = { kind: "post", post: toStreamCardVM(item.subject, options) };
|
|
3682
3705
|
}
|
|
@@ -4538,7 +4561,7 @@ var ProfileVolunteeringRecordSchema = z.object({
|
|
|
4538
4561
|
});
|
|
4539
4562
|
|
|
4540
4563
|
// src/index.ts
|
|
4541
|
-
var SIFA_SDK_VERSION = "0.12.
|
|
4564
|
+
var SIFA_SDK_VERSION = "0.12.15";
|
|
4542
4565
|
|
|
4543
4566
|
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, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, MIN_SKILLS, 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_INVOLVEMENT_NSID, PUBLISHERS, PresentationDurationSchema, PresentationLinkSchema, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileInvolvementRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfilePresentationDeliveryRecordSchema, ProfilePresentationRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, SECTION_GROUPS, SECTION_LABELS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, SifaFeedItemSchema, VERIFICATION_PROVIDERS, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, atUriSchema, buildTalkSlug, categoryForApp, certDateExtractor, cidSchema, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, datetimeSchema, decodeFeedCursor, dedupeSkills, detectPdsProvider, didSchema, dimensionsFromInputs, durationFromMinutes, encodeFeedCursor, entityDisambiguationLabel, entityResultKey, externalRecordRefSchema, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupSkillsByCategory, hasAdultContent, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isPseudoEmployer, isRegistrableDomainHandle, isSectionPopulated, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, looksLikeDomain, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeCompanyKey, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, partialDateSchema, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, relativeLuminance, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, singleDateExtractor, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, streamAddressSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, strongRefSchema, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, uriSchema, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
|
|
4544
4567
|
//# sourceMappingURL=index.js.map
|