@singi-labs/sifa-sdk 0.10.17 → 0.10.18

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
@@ -156,6 +156,16 @@ declare const PLATFORM_LABELS: {
156
156
  readonly keyoxide: "Keyoxide";
157
157
  };
158
158
  type PlatformId = keyof typeof PLATFORM_LABELS;
159
+ /**
160
+ * Normalize a platform value to the short code used throughout the app (the
161
+ * editor, the API `VALID_PLATFORMS` enum, the DB, and {@link PLATFORM_LABELS}).
162
+ *
163
+ * External-account records may carry `platform` as the raw lexicon knownValue
164
+ * token (`id.sifa.defs#platformLinkedin`) instead of the short code — written by
165
+ * some third-party apps. This maps the token to its lowercase suffix
166
+ * (`linkedin`) and passes short codes / unknown values through unchanged.
167
+ */
168
+ declare function normalizePlatformId(platform: string): string;
159
169
  declare function isKnownPlatform(platform: string): platform is PlatformId;
160
170
  declare function getPlatformLabel(platform: string): string;
161
171
  /** Platforms available in the "Add Links" dropdown. */
@@ -838,4 +848,4 @@ declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positio
838
848
  */
839
849
  declare const SIFA_SDK_VERSION: string;
840
850
 
841
- 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, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, type ContinentCode, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, type EmploymentTypeGroup, type EmploymentTypeOption, 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, PUBLISHERS, type PdsProvider, PdsProviderInfo, type PlatformId, type PrimaryPositionCandidate, Profile, type ProfileCompletion, type ProfileDimensionInputs, 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, findIndustry, formatDistanceToNow, formatLocation, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, normalizeOpenTo, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
851
+ 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, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, type ContinentCode, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, type EmploymentTypeGroup, type EmploymentTypeOption, 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, PUBLISHERS, type PdsProvider, PdsProviderInfo, type PlatformId, type PrimaryPositionCandidate, Profile, type ProfileCompletion, type ProfileDimensionInputs, 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, findIndustry, formatDistanceToNow, formatLocation, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
package/dist/index.d.ts CHANGED
@@ -156,6 +156,16 @@ declare const PLATFORM_LABELS: {
156
156
  readonly keyoxide: "Keyoxide";
157
157
  };
158
158
  type PlatformId = keyof typeof PLATFORM_LABELS;
159
+ /**
160
+ * Normalize a platform value to the short code used throughout the app (the
161
+ * editor, the API `VALID_PLATFORMS` enum, the DB, and {@link PLATFORM_LABELS}).
162
+ *
163
+ * External-account records may carry `platform` as the raw lexicon knownValue
164
+ * token (`id.sifa.defs#platformLinkedin`) instead of the short code — written by
165
+ * some third-party apps. This maps the token to its lowercase suffix
166
+ * (`linkedin`) and passes short codes / unknown values through unchanged.
167
+ */
168
+ declare function normalizePlatformId(platform: string): string;
159
169
  declare function isKnownPlatform(platform: string): platform is PlatformId;
160
170
  declare function getPlatformLabel(platform: string): string;
161
171
  /** Platforms available in the "Add Links" dropdown. */
@@ -838,4 +848,4 @@ declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positio
838
848
  */
839
849
  declare const SIFA_SDK_VERSION: string;
840
850
 
841
- 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, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, type ContinentCode, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, type EmploymentTypeGroup, type EmploymentTypeOption, 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, PUBLISHERS, type PdsProvider, PdsProviderInfo, type PlatformId, type PrimaryPositionCandidate, Profile, type ProfileCompletion, type ProfileDimensionInputs, 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, findIndustry, formatDistanceToNow, formatLocation, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, normalizeOpenTo, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
851
+ 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, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, type ContinentCode, DIMENSIONS_MAX_SCORE, type DimensionKey, type DimensionMap, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, type EmploymentTypeGroup, type EmploymentTypeOption, 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, PUBLISHERS, type PdsProvider, PdsProviderInfo, type PlatformId, type PrimaryPositionCandidate, Profile, type ProfileCompletion, type ProfileDimensionInputs, 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, findIndustry, formatDistanceToNow, formatLocation, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
package/dist/index.js CHANGED
@@ -798,11 +798,19 @@ var PLATFORM_LABELS = {
798
798
  orcid: "ORCID",
799
799
  keyoxide: "Keyoxide"
800
800
  };
801
+ var PLATFORM_TOKEN_PREFIX = "id.sifa.defs#platform";
802
+ function normalizePlatformId(platform) {
803
+ if (platform.startsWith(PLATFORM_TOKEN_PREFIX)) {
804
+ return platform.slice(PLATFORM_TOKEN_PREFIX.length).toLowerCase();
805
+ }
806
+ return platform;
807
+ }
801
808
  function isKnownPlatform(platform) {
802
809
  return platform in PLATFORM_LABELS;
803
810
  }
804
811
  function getPlatformLabel(platform) {
805
- return isKnownPlatform(platform) ? PLATFORM_LABELS[platform] : PLATFORM_LABELS.website;
812
+ const normalized = normalizePlatformId(platform);
813
+ return isKnownPlatform(normalized) ? PLATFORM_LABELS[normalized] : PLATFORM_LABELS.website;
806
814
  }
807
815
  var EXCLUDED_FROM_DROPDOWN = /* @__PURE__ */ new Set(["bluesky", "dns", "tangled"]);
808
816
  var PLATFORM_OPTIONS = Object.entries(PLATFORM_LABELS).filter(([value]) => !EXCLUDED_FROM_DROPDOWN.has(value)).map(([value, label]) => ({ value, label }));
@@ -2330,8 +2338,8 @@ var ProfileVolunteeringRecordSchema = z.object({
2330
2338
  });
2331
2339
 
2332
2340
  // src/index.ts
2333
- var SIFA_SDK_VERSION = "0.10.17";
2341
+ var SIFA_SDK_VERSION = "0.10.18";
2334
2342
 
2335
- export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, AtmosphereFeedItemSchema, 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, 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, PUBLISHERS, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, 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, encodeFeedCursor, findIndustry, formatDistanceToNow, formatLocation, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, hasAdultContent, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeOpenTo, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, selfLabelsSchema, singleDateExtractor, sortByDateDesc, strongRefSchema, truncateGraphemes, uriSchema };
2343
+ export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, AtmosphereFeedItemSchema, 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, 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, PUBLISHERS, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, 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, encodeFeedCursor, findIndustry, formatDistanceToNow, formatLocation, formatRelativeTime, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, hasAdultContent, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeOpenTo, normalizePlatformId, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, selfLabelsSchema, singleDateExtractor, sortByDateDesc, strongRefSchema, truncateGraphemes, uriSchema };
2336
2344
  //# sourceMappingURL=index.js.map
2337
2345
  //# sourceMappingURL=index.js.map