@singi-labs/sifa-sdk 0.12.10 → 0.12.11
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 +212 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +212 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1230,6 +1230,19 @@ interface StreamExternalLink {
|
|
|
1230
1230
|
title?: string;
|
|
1231
1231
|
thumb?: string;
|
|
1232
1232
|
}
|
|
1233
|
+
/**
|
|
1234
|
+
* One span of a rich-text body. Built from `app.bsky.richtext.facet`-style
|
|
1235
|
+
* facets (byte-offset ranges over the plain `text`). Plain runs carry only
|
|
1236
|
+
* `text`; enriched runs additionally carry exactly one of `link` (resolved
|
|
1237
|
+
* URL), `mention` (DID), or `tag` (hashtag). `body.text` always holds the full
|
|
1238
|
+
* plain string, so a renderer can ignore `richSegments` and still show content.
|
|
1239
|
+
*/
|
|
1240
|
+
interface StreamRichSegment {
|
|
1241
|
+
text: string;
|
|
1242
|
+
link?: string;
|
|
1243
|
+
mention?: string;
|
|
1244
|
+
tag?: string;
|
|
1245
|
+
}
|
|
1233
1246
|
/** A geo coordinate pair (beacon `location`). */
|
|
1234
1247
|
interface StreamGeo {
|
|
1235
1248
|
latitude: number;
|
|
@@ -1255,12 +1268,18 @@ interface StreamAddress {
|
|
|
1255
1268
|
type StreamCardBody = {
|
|
1256
1269
|
kind: 'text';
|
|
1257
1270
|
text: string;
|
|
1271
|
+
/** Facet-derived spans over `text` (links/mentions/tags). Additive. */
|
|
1272
|
+
richSegments?: StreamRichSegment[];
|
|
1273
|
+
/** Hashtags carried alongside the text (e.g. asq questions). */
|
|
1274
|
+
tags?: string[];
|
|
1258
1275
|
} | {
|
|
1259
1276
|
kind: 'media';
|
|
1260
1277
|
text?: string;
|
|
1278
|
+
tags?: string[];
|
|
1261
1279
|
} | {
|
|
1262
1280
|
kind: 'link';
|
|
1263
1281
|
text?: string;
|
|
1282
|
+
tags?: string[];
|
|
1264
1283
|
} | {
|
|
1265
1284
|
kind: 'track';
|
|
1266
1285
|
text?: string;
|
|
@@ -1269,6 +1288,7 @@ type StreamCardBody = {
|
|
|
1269
1288
|
} | {
|
|
1270
1289
|
kind: 'generic';
|
|
1271
1290
|
text?: string;
|
|
1291
|
+
tags?: string[];
|
|
1272
1292
|
} | {
|
|
1273
1293
|
kind: 'github-pr';
|
|
1274
1294
|
repoOwner: string;
|
|
@@ -1409,6 +1429,7 @@ declare const streamMediaSchema: z.ZodType<StreamMedia>;
|
|
|
1409
1429
|
declare const streamExternalLinkSchema: z.ZodType<StreamExternalLink>;
|
|
1410
1430
|
declare const streamGeoSchema: z.ZodType<StreamGeo>;
|
|
1411
1431
|
declare const streamAddressSchema: z.ZodType<StreamAddress>;
|
|
1432
|
+
declare const streamRichSegmentSchema: z.ZodType<StreamRichSegment>;
|
|
1412
1433
|
declare const streamCardBodySchema: z.ZodType<StreamCardBody>;
|
|
1413
1434
|
/**
|
|
1414
1435
|
* A stream item's repost / reply / quote target. The `post` variant nests a
|
|
@@ -1441,7 +1462,9 @@ interface ToStreamCardVMOptions {
|
|
|
1441
1462
|
* (`github-pr`, `book`, `media-review`, `event-rsvp`, `verification`,
|
|
1442
1463
|
* `membership`, `location`, `travel`, `standard-site`) are enriched from their
|
|
1443
1464
|
* raw record below; `at.youandme.connection` and `fyi.asq.answer` populate a
|
|
1444
|
-
* person / record `subject`. Everything else
|
|
1465
|
+
* person / record `subject`. Everything else (base collections + unknown apps)
|
|
1466
|
+
* flows through {@link applyGeneric}, which extracts text / media / link /
|
|
1467
|
+
* subject from common record shapes, degrading to an empty generic body.
|
|
1445
1468
|
*/
|
|
1446
1469
|
declare function toStreamCardVM(item: ActivityItem, options?: ToStreamCardVMOptions): StreamCardVM;
|
|
1447
1470
|
/**
|
|
@@ -1919,4 +1942,4 @@ declare function groupInvolvementByHeading(items: ProfileInvolvement[]): Involve
|
|
|
1919
1942
|
*/
|
|
1920
1943
|
declare const SIFA_SDK_VERSION: string;
|
|
1921
1944
|
|
|
1922
|
-
export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, type AccountVerification, type ActivityItem, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type ActivityVerbMap, type AppCategoryId, type AppUrlPatterns, type ArtifactLinkKindOption, 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, type CardHealth, type CardHealthStrategy, type CompanyFirmographics, type ContinentCode, type CsvRow, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, type DisambiguationFields, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, type EmploymentTypeGroup, type EmploymentTypeOption, type EntityRefAnchor, EntitySearchResult, INDUSTRY_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, type IndustryOption, type InvolvementGroup, type InvolvementKindOption, type KnownAppId, type LexiconEntry, LocationValue, MIN_SKILLS, type MergedProfileSkill, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, type OpenToGroup, type OpenToOption, OrgProfileRecord, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLISHERS, type ParsedDelivery, type ParsedPresentation, type PdsProvider, PdsProviderInfo, type PlatformId, type PresentationDeliverySummary, PresentationDuration, type PresentationLinkTypeOption, type PresentationRoleOption, type PrimaryPositionCandidate, Profile, ProfileCertification, type ProfileCompletion, type ProfileDimensionInputs, ProfileEducation, ProfileHonor, ProfileInvolvement, ProfileLanguage, ProfilePosition, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileProject, ProfilePublication, ProfileSkill, type Publisher, type RgbColor, SECTION_GROUPS, SECTION_LABELS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, type SectionGroupId, type SectionId, type SkillCategory, type StreamAddress, type StreamCardBody, type StreamCardSubject, type StreamCardVM, type StreamExternalLink, type StreamGeo, type StreamMedia, type StreamMediaBase, type StreamMediaBlob, type StreamMediaResolved, type StreamSource, type StreamTheme, type StreamVerb, type TierMeta, type ToStreamCardVMOptions, VERIFICATION_PROVIDERS, type VerificationProvider, type VerificationProviderId, type VerificationSource, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, categoryForApp, certDateExtractor, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, 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, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isPseudoEmployer, isRegistrableDomainHandle, isSectionPopulated, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, looksLikeDomain, meetsContrastAA, normalizeCompanyKey, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, relativeLuminance, resolveCardHealth, resolveCardUrl, resolveVerifierProvider, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, singleDateExtractor, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, streamAddressSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, verbForCollection, visibleItems };
|
|
1945
|
+
export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, type AccountVerification, type ActivityItem, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type ActivityVerbMap, type AppCategoryId, type AppUrlPatterns, type ArtifactLinkKindOption, 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, type CardHealth, type CardHealthStrategy, type CompanyFirmographics, type ContinentCode, type CsvRow, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, type DisambiguationFields, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, type EmploymentTypeGroup, type EmploymentTypeOption, type EntityRefAnchor, EntitySearchResult, INDUSTRY_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, type IndustryOption, type InvolvementGroup, type InvolvementKindOption, type KnownAppId, type LexiconEntry, LocationValue, MIN_SKILLS, type MergedProfileSkill, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, type OpenToGroup, type OpenToOption, OrgProfileRecord, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLISHERS, type ParsedDelivery, type ParsedPresentation, type PdsProvider, PdsProviderInfo, type PlatformId, type PresentationDeliverySummary, PresentationDuration, type PresentationLinkTypeOption, type PresentationRoleOption, type PrimaryPositionCandidate, Profile, ProfileCertification, type ProfileCompletion, type ProfileDimensionInputs, ProfileEducation, ProfileHonor, ProfileInvolvement, ProfileLanguage, ProfilePosition, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileProject, ProfilePublication, ProfileSkill, type Publisher, type RgbColor, SECTION_GROUPS, SECTION_LABELS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, type SectionGroupId, type SectionId, type SkillCategory, type StreamAddress, type StreamCardBody, type StreamCardSubject, type StreamCardVM, type StreamExternalLink, type StreamGeo, type StreamMedia, type StreamMediaBase, type StreamMediaBlob, type StreamMediaResolved, type StreamRichSegment, type StreamSource, type StreamTheme, type StreamVerb, type TierMeta, type ToStreamCardVMOptions, VERIFICATION_PROVIDERS, type VerificationProvider, type VerificationProviderId, type VerificationSource, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, categoryForApp, certDateExtractor, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, 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, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isPseudoEmployer, isRegistrableDomainHandle, isSectionPopulated, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, looksLikeDomain, meetsContrastAA, normalizeCompanyKey, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, relativeLuminance, resolveCardHealth, resolveCardUrl, resolveVerifierProvider, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, singleDateExtractor, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, streamAddressSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, verbForCollection, visibleItems };
|
package/dist/index.d.ts
CHANGED
|
@@ -1230,6 +1230,19 @@ interface StreamExternalLink {
|
|
|
1230
1230
|
title?: string;
|
|
1231
1231
|
thumb?: string;
|
|
1232
1232
|
}
|
|
1233
|
+
/**
|
|
1234
|
+
* One span of a rich-text body. Built from `app.bsky.richtext.facet`-style
|
|
1235
|
+
* facets (byte-offset ranges over the plain `text`). Plain runs carry only
|
|
1236
|
+
* `text`; enriched runs additionally carry exactly one of `link` (resolved
|
|
1237
|
+
* URL), `mention` (DID), or `tag` (hashtag). `body.text` always holds the full
|
|
1238
|
+
* plain string, so a renderer can ignore `richSegments` and still show content.
|
|
1239
|
+
*/
|
|
1240
|
+
interface StreamRichSegment {
|
|
1241
|
+
text: string;
|
|
1242
|
+
link?: string;
|
|
1243
|
+
mention?: string;
|
|
1244
|
+
tag?: string;
|
|
1245
|
+
}
|
|
1233
1246
|
/** A geo coordinate pair (beacon `location`). */
|
|
1234
1247
|
interface StreamGeo {
|
|
1235
1248
|
latitude: number;
|
|
@@ -1255,12 +1268,18 @@ interface StreamAddress {
|
|
|
1255
1268
|
type StreamCardBody = {
|
|
1256
1269
|
kind: 'text';
|
|
1257
1270
|
text: string;
|
|
1271
|
+
/** Facet-derived spans over `text` (links/mentions/tags). Additive. */
|
|
1272
|
+
richSegments?: StreamRichSegment[];
|
|
1273
|
+
/** Hashtags carried alongside the text (e.g. asq questions). */
|
|
1274
|
+
tags?: string[];
|
|
1258
1275
|
} | {
|
|
1259
1276
|
kind: 'media';
|
|
1260
1277
|
text?: string;
|
|
1278
|
+
tags?: string[];
|
|
1261
1279
|
} | {
|
|
1262
1280
|
kind: 'link';
|
|
1263
1281
|
text?: string;
|
|
1282
|
+
tags?: string[];
|
|
1264
1283
|
} | {
|
|
1265
1284
|
kind: 'track';
|
|
1266
1285
|
text?: string;
|
|
@@ -1269,6 +1288,7 @@ type StreamCardBody = {
|
|
|
1269
1288
|
} | {
|
|
1270
1289
|
kind: 'generic';
|
|
1271
1290
|
text?: string;
|
|
1291
|
+
tags?: string[];
|
|
1272
1292
|
} | {
|
|
1273
1293
|
kind: 'github-pr';
|
|
1274
1294
|
repoOwner: string;
|
|
@@ -1409,6 +1429,7 @@ declare const streamMediaSchema: z.ZodType<StreamMedia>;
|
|
|
1409
1429
|
declare const streamExternalLinkSchema: z.ZodType<StreamExternalLink>;
|
|
1410
1430
|
declare const streamGeoSchema: z.ZodType<StreamGeo>;
|
|
1411
1431
|
declare const streamAddressSchema: z.ZodType<StreamAddress>;
|
|
1432
|
+
declare const streamRichSegmentSchema: z.ZodType<StreamRichSegment>;
|
|
1412
1433
|
declare const streamCardBodySchema: z.ZodType<StreamCardBody>;
|
|
1413
1434
|
/**
|
|
1414
1435
|
* A stream item's repost / reply / quote target. The `post` variant nests a
|
|
@@ -1441,7 +1462,9 @@ interface ToStreamCardVMOptions {
|
|
|
1441
1462
|
* (`github-pr`, `book`, `media-review`, `event-rsvp`, `verification`,
|
|
1442
1463
|
* `membership`, `location`, `travel`, `standard-site`) are enriched from their
|
|
1443
1464
|
* raw record below; `at.youandme.connection` and `fyi.asq.answer` populate a
|
|
1444
|
-
* person / record `subject`. Everything else
|
|
1465
|
+
* person / record `subject`. Everything else (base collections + unknown apps)
|
|
1466
|
+
* flows through {@link applyGeneric}, which extracts text / media / link /
|
|
1467
|
+
* subject from common record shapes, degrading to an empty generic body.
|
|
1445
1468
|
*/
|
|
1446
1469
|
declare function toStreamCardVM(item: ActivityItem, options?: ToStreamCardVMOptions): StreamCardVM;
|
|
1447
1470
|
/**
|
|
@@ -1919,4 +1942,4 @@ declare function groupInvolvementByHeading(items: ProfileInvolvement[]): Involve
|
|
|
1919
1942
|
*/
|
|
1920
1943
|
declare const SIFA_SDK_VERSION: string;
|
|
1921
1944
|
|
|
1922
|
-
export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, type AccountVerification, type ActivityItem, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type ActivityVerbMap, type AppCategoryId, type AppUrlPatterns, type ArtifactLinkKindOption, 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, type CardHealth, type CardHealthStrategy, type CompanyFirmographics, type ContinentCode, type CsvRow, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, type DisambiguationFields, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, type EmploymentTypeGroup, type EmploymentTypeOption, type EntityRefAnchor, EntitySearchResult, INDUSTRY_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, type IndustryOption, type InvolvementGroup, type InvolvementKindOption, type KnownAppId, type LexiconEntry, LocationValue, MIN_SKILLS, type MergedProfileSkill, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, type OpenToGroup, type OpenToOption, OrgProfileRecord, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLISHERS, type ParsedDelivery, type ParsedPresentation, type PdsProvider, PdsProviderInfo, type PlatformId, type PresentationDeliverySummary, PresentationDuration, type PresentationLinkTypeOption, type PresentationRoleOption, type PrimaryPositionCandidate, Profile, ProfileCertification, type ProfileCompletion, type ProfileDimensionInputs, ProfileEducation, ProfileHonor, ProfileInvolvement, ProfileLanguage, ProfilePosition, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileProject, ProfilePublication, ProfileSkill, type Publisher, type RgbColor, SECTION_GROUPS, SECTION_LABELS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, type SectionGroupId, type SectionId, type SkillCategory, type StreamAddress, type StreamCardBody, type StreamCardSubject, type StreamCardVM, type StreamExternalLink, type StreamGeo, type StreamMedia, type StreamMediaBase, type StreamMediaBlob, type StreamMediaResolved, type StreamSource, type StreamTheme, type StreamVerb, type TierMeta, type ToStreamCardVMOptions, VERIFICATION_PROVIDERS, type VerificationProvider, type VerificationProviderId, type VerificationSource, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, categoryForApp, certDateExtractor, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, 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, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isPseudoEmployer, isRegistrableDomainHandle, isSectionPopulated, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, looksLikeDomain, meetsContrastAA, normalizeCompanyKey, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, relativeLuminance, resolveCardHealth, resolveCardUrl, resolveVerifierProvider, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, singleDateExtractor, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, streamAddressSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, verbForCollection, visibleItems };
|
|
1945
|
+
export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, type AccountVerification, type ActivityItem, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type ActivityVerbMap, type AppCategoryId, type AppUrlPatterns, type ArtifactLinkKindOption, 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, type CardHealth, type CardHealthStrategy, type CompanyFirmographics, type ContinentCode, type CsvRow, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, type DisambiguationFields, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, type EmploymentTypeGroup, type EmploymentTypeOption, type EntityRefAnchor, EntitySearchResult, INDUSTRY_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, type IndustryOption, type InvolvementGroup, type InvolvementKindOption, type KnownAppId, type LexiconEntry, LocationValue, MIN_SKILLS, type MergedProfileSkill, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, type OpenToGroup, type OpenToOption, OrgProfileRecord, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLISHERS, type ParsedDelivery, type ParsedPresentation, type PdsProvider, PdsProviderInfo, type PlatformId, type PresentationDeliverySummary, PresentationDuration, type PresentationLinkTypeOption, type PresentationRoleOption, type PrimaryPositionCandidate, Profile, ProfileCertification, type ProfileCompletion, type ProfileDimensionInputs, ProfileEducation, ProfileHonor, ProfileInvolvement, ProfileLanguage, ProfilePosition, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileProject, ProfilePublication, ProfileSkill, type Publisher, type RgbColor, SECTION_GROUPS, SECTION_LABELS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, type SectionGroupId, type SectionId, type SkillCategory, type StreamAddress, type StreamCardBody, type StreamCardSubject, type StreamCardVM, type StreamExternalLink, type StreamGeo, type StreamMedia, type StreamMediaBase, type StreamMediaBlob, type StreamMediaResolved, type StreamRichSegment, type StreamSource, type StreamTheme, type StreamVerb, type TierMeta, type ToStreamCardVMOptions, VERIFICATION_PROVIDERS, type VerificationProvider, type VerificationProviderId, type VerificationSource, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, categoryForApp, certDateExtractor, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, 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, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isPseudoEmployer, isRegistrableDomainHandle, isSectionPopulated, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, looksLikeDomain, meetsContrastAA, normalizeCompanyKey, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, relativeLuminance, resolveCardHealth, resolveCardUrl, resolveVerifierProvider, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, singleDateExtractor, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, streamAddressSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, verbForCollection, visibleItems };
|
package/dist/index.js
CHANGED
|
@@ -2718,17 +2718,40 @@ var streamAddressSchema = z.object({
|
|
|
2718
2718
|
country: z.string().optional(),
|
|
2719
2719
|
postalCode: z.string().optional()
|
|
2720
2720
|
});
|
|
2721
|
+
var streamRichSegmentSchema = z.object({
|
|
2722
|
+
text: z.string(),
|
|
2723
|
+
link: z.string().optional(),
|
|
2724
|
+
mention: z.string().optional(),
|
|
2725
|
+
tag: z.string().optional()
|
|
2726
|
+
});
|
|
2721
2727
|
var streamCardBodySchema = z.discriminatedUnion("kind", [
|
|
2722
|
-
z.object({
|
|
2723
|
-
|
|
2724
|
-
|
|
2728
|
+
z.object({
|
|
2729
|
+
kind: z.literal("text"),
|
|
2730
|
+
text: z.string(),
|
|
2731
|
+
richSegments: z.array(streamRichSegmentSchema).optional(),
|
|
2732
|
+
tags: z.array(z.string()).optional()
|
|
2733
|
+
}),
|
|
2734
|
+
z.object({
|
|
2735
|
+
kind: z.literal("media"),
|
|
2736
|
+
text: z.string().optional(),
|
|
2737
|
+
tags: z.array(z.string()).optional()
|
|
2738
|
+
}),
|
|
2739
|
+
z.object({
|
|
2740
|
+
kind: z.literal("link"),
|
|
2741
|
+
text: z.string().optional(),
|
|
2742
|
+
tags: z.array(z.string()).optional()
|
|
2743
|
+
}),
|
|
2725
2744
|
z.object({
|
|
2726
2745
|
kind: z.literal("track"),
|
|
2727
2746
|
text: z.string().optional(),
|
|
2728
2747
|
trackTitle: z.string().optional(),
|
|
2729
2748
|
artist: z.string().optional()
|
|
2730
2749
|
}),
|
|
2731
|
-
z.object({
|
|
2750
|
+
z.object({
|
|
2751
|
+
kind: z.literal("generic"),
|
|
2752
|
+
text: z.string().optional(),
|
|
2753
|
+
tags: z.array(z.string()).optional()
|
|
2754
|
+
}),
|
|
2732
2755
|
z.object({
|
|
2733
2756
|
kind: z.literal("github-pr"),
|
|
2734
2757
|
repoOwner: z.string(),
|
|
@@ -3314,6 +3337,188 @@ function applyAsqAnswer(vm, record) {
|
|
|
3314
3337
|
vm.body = { kind: "generic" };
|
|
3315
3338
|
return vm;
|
|
3316
3339
|
}
|
|
3340
|
+
function nonBlankString(value) {
|
|
3341
|
+
return typeof value === "string" && value.trim().length > 0 ? value : void 0;
|
|
3342
|
+
}
|
|
3343
|
+
function readBodyField(value) {
|
|
3344
|
+
const direct = nonBlankString(value);
|
|
3345
|
+
if (direct) return direct;
|
|
3346
|
+
return nonBlankString(asRecord(value)?.value);
|
|
3347
|
+
}
|
|
3348
|
+
function httpUrl(value) {
|
|
3349
|
+
return typeof value === "string" && /^https?:\/\//i.test(value) ? value : void 0;
|
|
3350
|
+
}
|
|
3351
|
+
var GENERIC_TEXT_ORDER = [
|
|
3352
|
+
"text",
|
|
3353
|
+
"title",
|
|
3354
|
+
"name",
|
|
3355
|
+
"description",
|
|
3356
|
+
"content",
|
|
3357
|
+
"body",
|
|
3358
|
+
"message",
|
|
3359
|
+
"note",
|
|
3360
|
+
"caption",
|
|
3361
|
+
"summary",
|
|
3362
|
+
"status"
|
|
3363
|
+
];
|
|
3364
|
+
function genericText(collection, record) {
|
|
3365
|
+
if (collection === "social.passports.fiftyStates.visit") {
|
|
3366
|
+
return nonBlankString(record.city);
|
|
3367
|
+
}
|
|
3368
|
+
for (const field of GENERIC_TEXT_ORDER) {
|
|
3369
|
+
if (field === "body") {
|
|
3370
|
+
const body = readBodyField(record.body);
|
|
3371
|
+
if (body) return body;
|
|
3372
|
+
continue;
|
|
3373
|
+
}
|
|
3374
|
+
const value = nonBlankString(record[field]);
|
|
3375
|
+
if (value) return value;
|
|
3376
|
+
}
|
|
3377
|
+
return void 0;
|
|
3378
|
+
}
|
|
3379
|
+
function genericTags(record) {
|
|
3380
|
+
const tags = record.tags;
|
|
3381
|
+
if (!Array.isArray(tags)) return void 0;
|
|
3382
|
+
const out = tags.filter((t) => typeof t === "string" && t.length > 0);
|
|
3383
|
+
return out.length > 0 ? out : void 0;
|
|
3384
|
+
}
|
|
3385
|
+
function genericMedia(record, did, alt) {
|
|
3386
|
+
const fromArray = (raw) => {
|
|
3387
|
+
const img = asRecord(raw);
|
|
3388
|
+
if (!img) return void 0;
|
|
3389
|
+
return blobMedia(img.image ?? raw, did, asNonEmptyString(img.alt) ?? alt);
|
|
3390
|
+
};
|
|
3391
|
+
const images = record.images;
|
|
3392
|
+
if (Array.isArray(images)) {
|
|
3393
|
+
const out = images.map(fromArray).filter((m) => m !== void 0);
|
|
3394
|
+
if (out.length > 0) return out;
|
|
3395
|
+
}
|
|
3396
|
+
const embed = asRecord(record.embed);
|
|
3397
|
+
if (embed && Array.isArray(embed.images)) {
|
|
3398
|
+
const out = embed.images.map(fromArray).filter((m) => m !== void 0);
|
|
3399
|
+
if (out.length > 0) return out;
|
|
3400
|
+
}
|
|
3401
|
+
const single = blobMedia(record.image, did, alt) ?? blobMedia(record.thumbnail, did, alt) ?? blobMedia(record.thumb, did, alt) ?? blobMedia(record.photo, did, alt) ?? (embed ? blobMedia(embed.thumbnail, did, alt) : void 0);
|
|
3402
|
+
if (single) return [single];
|
|
3403
|
+
const coverCid = asRecord(record.galleryMeta)?.coverPhotoCid;
|
|
3404
|
+
if (typeof coverCid === "string" && coverCid.length > 0) {
|
|
3405
|
+
return [{ did, cid: coverCid, alt }];
|
|
3406
|
+
}
|
|
3407
|
+
return [];
|
|
3408
|
+
}
|
|
3409
|
+
function genericExternalLink(record) {
|
|
3410
|
+
const embed = asRecord(record.embed);
|
|
3411
|
+
if (embed) {
|
|
3412
|
+
const fromEmbed = bskyExternal(embed);
|
|
3413
|
+
if (fromEmbed) return fromEmbed;
|
|
3414
|
+
}
|
|
3415
|
+
const url = httpUrl(record.source) ?? httpUrl(record.subject) ?? httpUrl(record.url);
|
|
3416
|
+
return url ? { url } : void 0;
|
|
3417
|
+
}
|
|
3418
|
+
function genericSubject(record) {
|
|
3419
|
+
const subject = record.subject;
|
|
3420
|
+
if (typeof subject === "string") {
|
|
3421
|
+
if (subject.startsWith("at://")) return { kind: "record", uri: subject };
|
|
3422
|
+
if (subject.startsWith("did:")) return { kind: "person", did: subject };
|
|
3423
|
+
return void 0;
|
|
3424
|
+
}
|
|
3425
|
+
const uri = nonBlankString(asRecord(subject)?.uri);
|
|
3426
|
+
if (uri && uri.startsWith("at://")) return { kind: "record", uri };
|
|
3427
|
+
return void 0;
|
|
3428
|
+
}
|
|
3429
|
+
function parseFacetFeature(features) {
|
|
3430
|
+
for (const raw of features) {
|
|
3431
|
+
const feat = asRecord(raw);
|
|
3432
|
+
if (!feat) continue;
|
|
3433
|
+
const type = asNonEmptyString(feat["$type"]) ?? "";
|
|
3434
|
+
const uri = asNonEmptyString(feat.uri);
|
|
3435
|
+
const did = asNonEmptyString(feat.did);
|
|
3436
|
+
const tag = asNonEmptyString(feat.tag);
|
|
3437
|
+
if (type.endsWith("#link") && uri) return { link: uri };
|
|
3438
|
+
if (type.endsWith("#mention") && did) return { mention: did };
|
|
3439
|
+
if (type.endsWith("#tag") && tag) return { tag };
|
|
3440
|
+
if (uri) return { link: uri };
|
|
3441
|
+
if (did) return { mention: did };
|
|
3442
|
+
if (tag) return { tag };
|
|
3443
|
+
}
|
|
3444
|
+
return void 0;
|
|
3445
|
+
}
|
|
3446
|
+
function genericRichSegments(text, record) {
|
|
3447
|
+
const facets = record.facets;
|
|
3448
|
+
if (!Array.isArray(facets)) return void 0;
|
|
3449
|
+
const parsed3 = [];
|
|
3450
|
+
for (const raw of facets) {
|
|
3451
|
+
const facet = asRecord(raw);
|
|
3452
|
+
const index = asRecord(facet?.index);
|
|
3453
|
+
const start = asFiniteNumber(index?.byteStart);
|
|
3454
|
+
const end = asFiniteNumber(index?.byteEnd);
|
|
3455
|
+
if (start === void 0 || end === void 0 || start < 0 || end <= start) continue;
|
|
3456
|
+
const features = facet?.features;
|
|
3457
|
+
if (!Array.isArray(features)) continue;
|
|
3458
|
+
const feature = parseFacetFeature(features);
|
|
3459
|
+
if (!feature) continue;
|
|
3460
|
+
parsed3.push({ start, end, ...feature });
|
|
3461
|
+
}
|
|
3462
|
+
if (parsed3.length === 0) return void 0;
|
|
3463
|
+
const bytes = new TextEncoder().encode(text);
|
|
3464
|
+
const decoder = new TextDecoder();
|
|
3465
|
+
parsed3.sort((a, b) => a.start - b.start);
|
|
3466
|
+
const segments = [];
|
|
3467
|
+
let cursor = 0;
|
|
3468
|
+
for (const span of parsed3) {
|
|
3469
|
+
if (span.start < cursor || span.start > bytes.length) continue;
|
|
3470
|
+
const end = Math.min(span.end, bytes.length);
|
|
3471
|
+
if (span.start > cursor) {
|
|
3472
|
+
const plain = decoder.decode(bytes.slice(cursor, span.start));
|
|
3473
|
+
if (plain) segments.push({ text: plain });
|
|
3474
|
+
}
|
|
3475
|
+
const seg = { text: decoder.decode(bytes.slice(span.start, end)) };
|
|
3476
|
+
if (span.link) seg.link = span.link;
|
|
3477
|
+
if (span.mention) seg.mention = span.mention;
|
|
3478
|
+
if (span.tag) seg.tag = span.tag;
|
|
3479
|
+
segments.push(seg);
|
|
3480
|
+
cursor = end;
|
|
3481
|
+
}
|
|
3482
|
+
if (cursor < bytes.length) {
|
|
3483
|
+
const rest = decoder.decode(bytes.slice(cursor));
|
|
3484
|
+
if (rest) segments.push({ text: rest });
|
|
3485
|
+
}
|
|
3486
|
+
return segments.some((s) => s.link ?? s.mention ?? s.tag) ? segments : void 0;
|
|
3487
|
+
}
|
|
3488
|
+
function applyGeneric(vm, item, record) {
|
|
3489
|
+
if (!record) return withGeneric(vm);
|
|
3490
|
+
const text = genericText(item.collection, record);
|
|
3491
|
+
const tags = genericTags(record);
|
|
3492
|
+
const did = didFromUri(item.uri);
|
|
3493
|
+
if (did) {
|
|
3494
|
+
const media = genericMedia(record, did, text ?? "");
|
|
3495
|
+
if (media.length > 0) vm.media = media;
|
|
3496
|
+
}
|
|
3497
|
+
const externalLink = genericExternalLink(record);
|
|
3498
|
+
if (externalLink) vm.externalLink = externalLink;
|
|
3499
|
+
if (!vm.subject) {
|
|
3500
|
+
const subject = genericSubject(record);
|
|
3501
|
+
if (subject) vm.subject = subject;
|
|
3502
|
+
}
|
|
3503
|
+
let body;
|
|
3504
|
+
if (text) {
|
|
3505
|
+
body = { kind: "text", text };
|
|
3506
|
+
const richSegments = genericRichSegments(text, record);
|
|
3507
|
+
if (richSegments) body.richSegments = richSegments;
|
|
3508
|
+
if (tags) body.tags = tags;
|
|
3509
|
+
} else if (vm.media) {
|
|
3510
|
+
body = { kind: "media" };
|
|
3511
|
+
if (tags) body.tags = tags;
|
|
3512
|
+
} else if (vm.externalLink) {
|
|
3513
|
+
body = { kind: "link" };
|
|
3514
|
+
if (tags) body.tags = tags;
|
|
3515
|
+
} else {
|
|
3516
|
+
body = { kind: "generic" };
|
|
3517
|
+
if (tags) body.tags = tags;
|
|
3518
|
+
}
|
|
3519
|
+
vm.body = body;
|
|
3520
|
+
return vm;
|
|
3521
|
+
}
|
|
3317
3522
|
function toStreamCardVM(item, options = {}) {
|
|
3318
3523
|
const verb = verbForCollection(item.collection);
|
|
3319
3524
|
const source = buildSource(item, options);
|
|
@@ -3362,7 +3567,7 @@ function toStreamCardVM(item, options = {}) {
|
|
|
3362
3567
|
if (record && item.collection.startsWith("social.popfeed.feed.")) {
|
|
3363
3568
|
return applyMediaReview(vm, item, record);
|
|
3364
3569
|
}
|
|
3365
|
-
return
|
|
3570
|
+
return applyGeneric(vm, item, record);
|
|
3366
3571
|
}
|
|
3367
3572
|
function toStreamCardVMs(items, options = {}) {
|
|
3368
3573
|
const out = [];
|
|
@@ -4172,8 +4377,8 @@ var ProfileVolunteeringRecordSchema = z.object({
|
|
|
4172
4377
|
});
|
|
4173
4378
|
|
|
4174
4379
|
// src/index.ts
|
|
4175
|
-
var SIFA_SDK_VERSION = "0.12.
|
|
4380
|
+
var SIFA_SDK_VERSION = "0.12.11";
|
|
4176
4381
|
|
|
4177
|
-
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, 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, 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, partialDateSchema, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, relativeLuminance, resolveCardHealth, resolveCardUrl, resolveVerifierProvider, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, singleDateExtractor, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, streamAddressSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, strongRefSchema, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, uriSchema, verbForCollection, visibleItems };
|
|
4382
|
+
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, 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, 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, partialDateSchema, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, relativeLuminance, resolveCardHealth, resolveCardUrl, resolveVerifierProvider, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, singleDateExtractor, 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 };
|
|
4178
4383
|
//# sourceMappingURL=index.js.map
|
|
4179
4384
|
//# sourceMappingURL=index.js.map
|