@singi-labs/sifa-sdk 0.11.17 → 0.11.19

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
@@ -470,6 +470,21 @@ declare const CALENDAR_EVENT_STATUS_LABELS: Record<string, string>;
470
470
  /** Resolve a label for a calendar-event status token. Falls back to the raw value. */
471
471
  declare function getCalendarEventStatusLabel(value: string | undefined | null): string | undefined;
472
472
 
473
+ /**
474
+ * Best-effort title-case for a company display name.
475
+ *
476
+ * Company names from the PDL crawl are stored all-lowercase ("spryker",
477
+ * "spryker systems gmbh"), which reads poorly in the UI. This capitalizes them
478
+ * for display. Names that already carry any uppercase (ROR / Wikidata, e.g.
479
+ * "University of Testing" or "IBM") are assumed correctly cased and returned
480
+ * unchanged, so a proper name is never mangled ("University Of Testing").
481
+ *
482
+ * It is intentionally not a canonicalizer: acronyms it can't know about stay
483
+ * word-cased ("gmbh" -> "Gmbh"). The user's own custom display name is the
484
+ * escape hatch when the heuristic is wrong.
485
+ */
486
+ declare function formatCompanyName(name: string): string;
487
+
473
488
  /**
474
489
  * Format a date string as a relative time (e.g. "5m ago", "3d ago").
475
490
  * Returns an empty string for invalid or future dates.
@@ -1041,6 +1056,34 @@ declare function searchResultDisambiguation(result: EntitySearchResult): string;
1041
1056
  /** Stable per-row identity for React keys and dedupe (entity id or PDL id). */
1042
1057
  declare function entityResultKey(result: EntitySearchResult): string;
1043
1058
 
1059
+ /**
1060
+ * Anchor-quality classification for a position's `entityRef` pointer (#159).
1061
+ *
1062
+ * A durable company link tiers by the quality of its anchor, which drives the
1063
+ * link indicator in the UI (registry-backed reads stronger than a Sifa-scoped
1064
+ * PDL pointer, per the ratified D5 chip policy). The classification is derived
1065
+ * purely from the ref URI's host, so it is a shared, cross-platform predicate
1066
+ * (web today, the native app later).
1067
+ *
1068
+ * registry -- a portable external id any atproto app can resolve
1069
+ * (Wikidata / ROR / GLEIF). Renders as a full "Linked" indicator.
1070
+ * sifa -- a Sifa-scoped `sifa.id/company/<publicId>` pointer for a
1071
+ * PDL-only company. Renders as a muted "Linked" (no glyph).
1072
+ * unlinked -- no ref, a malformed URL, or an unrecognized host. Free text.
1073
+ *
1074
+ * NEVER surfaced as "verified": a link is not a verification.
1075
+ */
1076
+ declare const ENTITY_REF_ANCHORS: readonly ["registry", "sifa", "unlinked"];
1077
+ type EntityRefAnchor = (typeof ENTITY_REF_ANCHORS)[number];
1078
+ /**
1079
+ * Classify an entityRef by anchor quality. Uses strict host parsing (never
1080
+ * substring matching) so a hostile URL that merely contains a registry host in a
1081
+ * query string is treated as unlinked, not falsely linked.
1082
+ */
1083
+ declare function classifyEntityRef(entityRef: string | null | undefined): EntityRefAnchor;
1084
+ /** Whether a position carries a durable link of any anchor quality. */
1085
+ declare function isLinked(entityRef: string | null | undefined): boolean;
1086
+
1044
1087
  /**
1045
1088
  * Sifa SDK -- public client library for the Sifa AppView on AT Protocol.
1046
1089
  *
@@ -1050,4 +1093,4 @@ declare function entityResultKey(result: EntitySearchResult): string;
1050
1093
  */
1051
1094
  declare const SIFA_SDK_VERSION: string;
1052
1095
 
1053
- export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type AppCategoryId, type AppUrlPatterns, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, type CardHealth, type CardHealthStrategy, type ContinentCode, type CsvRow, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, type DisambiguationFields, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, type EmploymentTypeGroup, type EmploymentTypeOption, EntitySearchResult, INDUSTRY_OPTIONS, type IndustryOption, 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, 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, type ProfileCompletion, type ProfileDimensionInputs, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileSkill, type Publisher, type RgbColor, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, type SkillCategory, type TierMeta, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, categoryForApp, certDateExtractor, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, findIndustry, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isPseudoEmployer, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, profileToDimensionInputs, relativeLuminance, resolveCardHealth, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, singleDateExtractor, sortByDateDesc, stripHtmlToText, summarizePresentationDeliveries, truncateGraphemes };
1096
+ export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type AppCategoryId, type AppUrlPatterns, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, type CardHealth, type CardHealthStrategy, 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, type IndustryOption, 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, 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, type ProfileCompletion, type ProfileDimensionInputs, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileSkill, type Publisher, type RgbColor, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, type SkillCategory, type TierMeta, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, categoryForApp, certDateExtractor, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, findIndustry, formatCompanyName, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isLinked, isPseudoEmployer, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, profileToDimensionInputs, relativeLuminance, resolveCardHealth, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, singleDateExtractor, sortByDateDesc, stripHtmlToText, summarizePresentationDeliveries, truncateGraphemes };
package/dist/index.d.ts CHANGED
@@ -470,6 +470,21 @@ declare const CALENDAR_EVENT_STATUS_LABELS: Record<string, string>;
470
470
  /** Resolve a label for a calendar-event status token. Falls back to the raw value. */
471
471
  declare function getCalendarEventStatusLabel(value: string | undefined | null): string | undefined;
472
472
 
473
+ /**
474
+ * Best-effort title-case for a company display name.
475
+ *
476
+ * Company names from the PDL crawl are stored all-lowercase ("spryker",
477
+ * "spryker systems gmbh"), which reads poorly in the UI. This capitalizes them
478
+ * for display. Names that already carry any uppercase (ROR / Wikidata, e.g.
479
+ * "University of Testing" or "IBM") are assumed correctly cased and returned
480
+ * unchanged, so a proper name is never mangled ("University Of Testing").
481
+ *
482
+ * It is intentionally not a canonicalizer: acronyms it can't know about stay
483
+ * word-cased ("gmbh" -> "Gmbh"). The user's own custom display name is the
484
+ * escape hatch when the heuristic is wrong.
485
+ */
486
+ declare function formatCompanyName(name: string): string;
487
+
473
488
  /**
474
489
  * Format a date string as a relative time (e.g. "5m ago", "3d ago").
475
490
  * Returns an empty string for invalid or future dates.
@@ -1041,6 +1056,34 @@ declare function searchResultDisambiguation(result: EntitySearchResult): string;
1041
1056
  /** Stable per-row identity for React keys and dedupe (entity id or PDL id). */
1042
1057
  declare function entityResultKey(result: EntitySearchResult): string;
1043
1058
 
1059
+ /**
1060
+ * Anchor-quality classification for a position's `entityRef` pointer (#159).
1061
+ *
1062
+ * A durable company link tiers by the quality of its anchor, which drives the
1063
+ * link indicator in the UI (registry-backed reads stronger than a Sifa-scoped
1064
+ * PDL pointer, per the ratified D5 chip policy). The classification is derived
1065
+ * purely from the ref URI's host, so it is a shared, cross-platform predicate
1066
+ * (web today, the native app later).
1067
+ *
1068
+ * registry -- a portable external id any atproto app can resolve
1069
+ * (Wikidata / ROR / GLEIF). Renders as a full "Linked" indicator.
1070
+ * sifa -- a Sifa-scoped `sifa.id/company/<publicId>` pointer for a
1071
+ * PDL-only company. Renders as a muted "Linked" (no glyph).
1072
+ * unlinked -- no ref, a malformed URL, or an unrecognized host. Free text.
1073
+ *
1074
+ * NEVER surfaced as "verified": a link is not a verification.
1075
+ */
1076
+ declare const ENTITY_REF_ANCHORS: readonly ["registry", "sifa", "unlinked"];
1077
+ type EntityRefAnchor = (typeof ENTITY_REF_ANCHORS)[number];
1078
+ /**
1079
+ * Classify an entityRef by anchor quality. Uses strict host parsing (never
1080
+ * substring matching) so a hostile URL that merely contains a registry host in a
1081
+ * query string is treated as unlinked, not falsely linked.
1082
+ */
1083
+ declare function classifyEntityRef(entityRef: string | null | undefined): EntityRefAnchor;
1084
+ /** Whether a position carries a durable link of any anchor quality. */
1085
+ declare function isLinked(entityRef: string | null | undefined): boolean;
1086
+
1044
1087
  /**
1045
1088
  * Sifa SDK -- public client library for the Sifa AppView on AT Protocol.
1046
1089
  *
@@ -1050,4 +1093,4 @@ declare function entityResultKey(result: EntitySearchResult): string;
1050
1093
  */
1051
1094
  declare const SIFA_SDK_VERSION: string;
1052
1095
 
1053
- export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type AppCategoryId, type AppUrlPatterns, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, type CardHealth, type CardHealthStrategy, type ContinentCode, type CsvRow, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, type DisambiguationFields, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, type EmploymentTypeGroup, type EmploymentTypeOption, EntitySearchResult, INDUSTRY_OPTIONS, type IndustryOption, 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, 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, type ProfileCompletion, type ProfileDimensionInputs, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileSkill, type Publisher, type RgbColor, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, type SkillCategory, type TierMeta, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, categoryForApp, certDateExtractor, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, findIndustry, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isPseudoEmployer, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, profileToDimensionInputs, relativeLuminance, resolveCardHealth, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, singleDateExtractor, sortByDateDesc, stripHtmlToText, summarizePresentationDeliveries, truncateGraphemes };
1096
+ export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type AppCategoryId, type AppUrlPatterns, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, type CardHealth, type CardHealthStrategy, 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, type IndustryOption, 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, 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, type ProfileCompletion, type ProfileDimensionInputs, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileSkill, type Publisher, type RgbColor, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, type SkillCategory, type TierMeta, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, categoryForApp, certDateExtractor, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, findIndustry, formatCompanyName, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isLinked, isPseudoEmployer, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, profileToDimensionInputs, relativeLuminance, resolveCardHealth, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, singleDateExtractor, sortByDateDesc, stripHtmlToText, summarizePresentationDeliveries, truncateGraphemes };
package/dist/index.js CHANGED
@@ -1428,6 +1428,56 @@ function getCalendarEventStatusLabel(value) {
1428
1428
  return CALENDAR_EVENT_STATUS_LABELS[value] ?? value;
1429
1429
  }
1430
1430
 
1431
+ // src/format/company-name.ts
1432
+ var SMALL_WORDS = /* @__PURE__ */ new Set([
1433
+ "a",
1434
+ "an",
1435
+ "and",
1436
+ "the",
1437
+ "of",
1438
+ "for",
1439
+ "to",
1440
+ "in",
1441
+ "on",
1442
+ "at",
1443
+ "by",
1444
+ "or",
1445
+ "nor",
1446
+ "but",
1447
+ "as",
1448
+ "vs",
1449
+ "via",
1450
+ "with",
1451
+ "de",
1452
+ "del",
1453
+ "van",
1454
+ "von",
1455
+ "der",
1456
+ "den",
1457
+ "het",
1458
+ "la",
1459
+ "le",
1460
+ "y"
1461
+ ]);
1462
+ function capitalizeWord(word) {
1463
+ return word.replace(
1464
+ /^([^\p{L}\p{N}]*)(\p{L})/u,
1465
+ (_m, lead, ch) => lead + ch.toUpperCase()
1466
+ );
1467
+ }
1468
+ function formatCompanyName(name) {
1469
+ const trimmed = name.trim();
1470
+ if (!trimmed || trimmed !== trimmed.toLowerCase()) return trimmed;
1471
+ let seenWord = false;
1472
+ return trimmed.split(/(\s+)/).map((token) => {
1473
+ if (token.length === 0 || /^\s+$/.test(token)) return token;
1474
+ const isFirst = !seenWord;
1475
+ seenWord = true;
1476
+ if (!isFirst && SMALL_WORDS.has(token)) return token;
1477
+ return capitalizeWord(token);
1478
+ }).join("");
1479
+ }
1480
+
1431
1481
  // src/format/format-time.ts
1432
1482
  function formatRelativeTime(dateString) {
1433
1483
  const date = new Date(dateString);
@@ -2452,6 +2502,34 @@ function searchResultDisambiguation(result) {
2452
2502
  function entityResultKey(result) {
2453
2503
  return result.source === "entity" ? `entity:${result.entityId}` : `pdl:${result.pdlId}`;
2454
2504
  }
2505
+
2506
+ // src/logic/entity-ref-anchor.ts
2507
+ var ENTITY_REF_ANCHORS = ["registry", "sifa", "unlinked"];
2508
+ var REGISTRY_HOSTS = /* @__PURE__ */ new Set([
2509
+ "wikidata.org",
2510
+ "www.wikidata.org",
2511
+ "ror.org",
2512
+ "gleif.org",
2513
+ "www.gleif.org"
2514
+ ]);
2515
+ var SIFA_HOST = "sifa.id";
2516
+ function classifyEntityRef(entityRef) {
2517
+ if (!entityRef || !entityRef.trim()) return "unlinked";
2518
+ let url;
2519
+ try {
2520
+ url = new URL(entityRef.trim());
2521
+ } catch {
2522
+ return "unlinked";
2523
+ }
2524
+ if (url.protocol !== "https:" && url.protocol !== "http:") return "unlinked";
2525
+ const host = url.hostname.toLowerCase();
2526
+ if (REGISTRY_HOSTS.has(host)) return "registry";
2527
+ if (host === SIFA_HOST) return "sifa";
2528
+ return "unlinked";
2529
+ }
2530
+ function isLinked(entityRef) {
2531
+ return classifyEntityRef(entityRef) !== "unlinked";
2532
+ }
2455
2533
  function maxGraphemes(max) {
2456
2534
  return (value) => {
2457
2535
  const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
@@ -2799,8 +2877,8 @@ var ProfileVolunteeringRecordSchema = z.object({
2799
2877
  });
2800
2878
 
2801
2879
  // src/index.ts
2802
- var SIFA_SDK_VERSION = "0.11.17";
2880
+ var SIFA_SDK_VERSION = "0.11.19";
2803
2881
 
2804
- export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, AtmosphereFeedItemSchema, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, DIMENSIONS_MAX_SCORE, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, EntityImportSearchResponseSchema, EntitySearchResponseSchema, EntitySearchResultSchema, EntitySelectRequestSchema, EntitySelectResponseSchema, FEATURE_FLAGS, FeatureAllowlistEntrySchema, FeedActorSchema, FollowFeedItemSchema, FollowFeedPageSchema, FollowProfilePageSchema, FollowProfileSchema, GraphFollowRecordSchema, INDUSTRY_OPTIONS, MIN_SKILLS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLISHERS, PresentationDurationSchema, PresentationLinkSchema, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfilePresentationDeliveryRecordSchema, ProfilePresentationRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, SifaFeedItemSchema, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, atUriSchema, categoryForApp, certDateExtractor, cidSchema, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, datetimeSchema, decodeFeedCursor, dedupeSkills, detectPdsProvider, didSchema, dimensionsFromInputs, durationFromMinutes, encodeFeedCursor, entityDisambiguationLabel, entityResultKey, externalRecordRefSchema, findIndustry, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, hasAdultContent, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isPseudoEmployer, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, profileToDimensionInputs, relativeLuminance, resolveCardHealth, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, singleDateExtractor, sortByDateDesc, stripHtmlToText, strongRefSchema, summarizePresentationDeliveries, truncateGraphemes, uriSchema };
2882
+ export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, AtmosphereFeedItemSchema, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, DIMENSIONS_MAX_SCORE, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, EntityImportSearchResponseSchema, EntitySearchResponseSchema, EntitySearchResultSchema, EntitySelectRequestSchema, EntitySelectResponseSchema, FEATURE_FLAGS, FeatureAllowlistEntrySchema, FeedActorSchema, FollowFeedItemSchema, FollowFeedPageSchema, FollowProfilePageSchema, FollowProfileSchema, GraphFollowRecordSchema, INDUSTRY_OPTIONS, MIN_SKILLS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLISHERS, PresentationDurationSchema, PresentationLinkSchema, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfilePresentationDeliveryRecordSchema, ProfilePresentationRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, SifaFeedItemSchema, 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, findIndustry, formatCompanyName, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, hasAdultContent, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isLinked, isPseudoEmployer, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, profileToDimensionInputs, relativeLuminance, resolveCardHealth, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, singleDateExtractor, sortByDateDesc, stripHtmlToText, strongRefSchema, summarizePresentationDeliveries, truncateGraphemes, uriSchema };
2805
2883
  //# sourceMappingURL=index.js.map
2806
2884
  //# sourceMappingURL=index.js.map