@singi-labs/sifa-sdk 0.10.1 → 0.10.3
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 +86 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -2
- package/dist/index.d.ts +75 -2
- package/dist/index.js +82 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -267,7 +267,6 @@ declare const APP_CATEGORY_MAP: {
|
|
|
267
267
|
readonly grain: "Photos";
|
|
268
268
|
readonly whitewind: "Articles";
|
|
269
269
|
readonly frontpage: "Links";
|
|
270
|
-
readonly picosky: "Chat";
|
|
271
270
|
readonly pastesphere: "Pastes";
|
|
272
271
|
readonly standard: "Articles";
|
|
273
272
|
readonly aetheros: "Pages";
|
|
@@ -603,6 +602,80 @@ declare const ACTIVITY_VISIBILITY_RULES: Readonly<Record<string, VisibilityPredi
|
|
|
603
602
|
*/
|
|
604
603
|
declare function isVisibleActivityItem(collection: string, record: unknown): boolean;
|
|
605
604
|
|
|
605
|
+
/**
|
|
606
|
+
* Publisher registry — single source of truth for apps that publish documents
|
|
607
|
+
* through the shared `site.standard.*` namespace (Leaflet, Pckt, Offprint, …).
|
|
608
|
+
*
|
|
609
|
+
* Why this exists:
|
|
610
|
+
* A document published via Leaflet, Pckt, Offprint, etc. lives canonically as a
|
|
611
|
+
* `site.standard.document` record. The publisher is metadata, identifiable from
|
|
612
|
+
* the publication's hostname. The activity-card, the publication merger in
|
|
613
|
+
* sifa-api, and the external-URL health scanner all need the same hostname →
|
|
614
|
+
* publisher mapping. Keeping it in one place stops the registry from drifting.
|
|
615
|
+
*
|
|
616
|
+
* What lives here:
|
|
617
|
+
* - `id` — stable appId, also keys sifa-web's branding (logo, color)
|
|
618
|
+
* - `name` — display name
|
|
619
|
+
* - `hostSuffixes` — hostnames that identify a publication URL as this publisher
|
|
620
|
+
* - `homeUrl` — last-resort URL when no per-document URL is available
|
|
621
|
+
*
|
|
622
|
+
* What does NOT live here:
|
|
623
|
+
* - Logo components, color tokens, React chrome — those belong in sifa-web
|
|
624
|
+
* keyed by `id`.
|
|
625
|
+
* - Per-document URL construction — Standard documents are always
|
|
626
|
+
* `${publication.url}${document.path}`. The publisher doesn't change that.
|
|
627
|
+
*/
|
|
628
|
+
interface Publisher {
|
|
629
|
+
/**
|
|
630
|
+
* Stable identifier. Used as the `appId` across Sifa so that sifa-web's
|
|
631
|
+
* `getAppMeta(id)` lookup yields the right logo and color, and so that
|
|
632
|
+
* activity-stat rows tag correctly.
|
|
633
|
+
*/
|
|
634
|
+
id: string;
|
|
635
|
+
/** Display name shown in pills and headers. */
|
|
636
|
+
name: string;
|
|
637
|
+
/**
|
|
638
|
+
* Hostnames that identify a publication URL as belonging to this publisher.
|
|
639
|
+
* Matches the publication URL's hostname when it equals the suffix
|
|
640
|
+
* (e.g. `leaflet.pub`) OR ends with it as a dotted suffix
|
|
641
|
+
* (e.g. `notesbyarielm.leaflet.pub`).
|
|
642
|
+
*
|
|
643
|
+
* Allow multiple entries to future-proof against rebrands or aliases.
|
|
644
|
+
*/
|
|
645
|
+
hostSuffixes: readonly string[];
|
|
646
|
+
/** Public homepage of the publisher, used as a profile-level fallback URL. */
|
|
647
|
+
homeUrl: string;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Neutral fallback used when no branded publisher matches.
|
|
651
|
+
*
|
|
652
|
+
* Synthetic publishers returned by `getPublisherFromSiteUrl` use this `id` but
|
|
653
|
+
* carry the document's own hostname in `name`, so cards can still show e.g.
|
|
654
|
+
* "feeds.byarielm.fyi" as the publisher label.
|
|
655
|
+
*/
|
|
656
|
+
declare const STANDARD_PUBLISHER_ID: "standard";
|
|
657
|
+
declare const PUBLISHERS: readonly Publisher[];
|
|
658
|
+
/** Lookup a registered publisher by id. Returns `undefined` for unknown ids. */
|
|
659
|
+
declare function getPublisherById(id: string): Publisher | undefined;
|
|
660
|
+
/**
|
|
661
|
+
* Match a hostname against the registry. Returns the registered publisher when
|
|
662
|
+
* the hostname equals or is a dotted-subdomain of any of its `hostSuffixes`.
|
|
663
|
+
* Returns `undefined` when no match is found (caller decides on the fallback).
|
|
664
|
+
*/
|
|
665
|
+
declare function getPublisherByHost(hostname: string): Publisher | undefined;
|
|
666
|
+
/**
|
|
667
|
+
* Resolve the publisher for a publication's site URL.
|
|
668
|
+
*
|
|
669
|
+
* - On a branded host: returns the registered `Publisher` verbatim.
|
|
670
|
+
* - On any other valid URL: returns a synthetic neutral publisher with
|
|
671
|
+
* `id: 'standard'`, `name: <hostname>`, `hostSuffixes: []`, and the URL
|
|
672
|
+
* as `homeUrl`. Cards can therefore always render a meaningful pill label.
|
|
673
|
+
* - On an unparseable string: returns the same neutral shape with the raw
|
|
674
|
+
* input as `name` and `homeUrl` (defensive — should never happen for data
|
|
675
|
+
* coming from a valid `site.standard.publication`).
|
|
676
|
+
*/
|
|
677
|
+
declare function getPublisherFromSiteUrl(siteUrl: string): Publisher;
|
|
678
|
+
|
|
606
679
|
/**
|
|
607
680
|
* Profile completeness scoring.
|
|
608
681
|
*
|
|
@@ -710,4 +783,4 @@ declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positio
|
|
|
710
783
|
*/
|
|
711
784
|
declare const SIFA_SDK_VERSION: string;
|
|
712
785
|
|
|
713
|
-
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, 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, type OpenToOption, PLATFORM_LABELS, PLATFORM_OPTIONS, type PdsProvider, PdsProviderInfo, type PlatformId, type PrimaryPositionCandidate, Profile, type ProfileCompletion, type ProfileDimensionInputs, ProfileSkill, type RgbColor, SIFA_SDK_VERSION, SKILL_CATEGORIES, 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, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
|
|
786
|
+
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, 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, 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, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
|
package/dist/index.d.ts
CHANGED
|
@@ -267,7 +267,6 @@ declare const APP_CATEGORY_MAP: {
|
|
|
267
267
|
readonly grain: "Photos";
|
|
268
268
|
readonly whitewind: "Articles";
|
|
269
269
|
readonly frontpage: "Links";
|
|
270
|
-
readonly picosky: "Chat";
|
|
271
270
|
readonly pastesphere: "Pastes";
|
|
272
271
|
readonly standard: "Articles";
|
|
273
272
|
readonly aetheros: "Pages";
|
|
@@ -603,6 +602,80 @@ declare const ACTIVITY_VISIBILITY_RULES: Readonly<Record<string, VisibilityPredi
|
|
|
603
602
|
*/
|
|
604
603
|
declare function isVisibleActivityItem(collection: string, record: unknown): boolean;
|
|
605
604
|
|
|
605
|
+
/**
|
|
606
|
+
* Publisher registry — single source of truth for apps that publish documents
|
|
607
|
+
* through the shared `site.standard.*` namespace (Leaflet, Pckt, Offprint, …).
|
|
608
|
+
*
|
|
609
|
+
* Why this exists:
|
|
610
|
+
* A document published via Leaflet, Pckt, Offprint, etc. lives canonically as a
|
|
611
|
+
* `site.standard.document` record. The publisher is metadata, identifiable from
|
|
612
|
+
* the publication's hostname. The activity-card, the publication merger in
|
|
613
|
+
* sifa-api, and the external-URL health scanner all need the same hostname →
|
|
614
|
+
* publisher mapping. Keeping it in one place stops the registry from drifting.
|
|
615
|
+
*
|
|
616
|
+
* What lives here:
|
|
617
|
+
* - `id` — stable appId, also keys sifa-web's branding (logo, color)
|
|
618
|
+
* - `name` — display name
|
|
619
|
+
* - `hostSuffixes` — hostnames that identify a publication URL as this publisher
|
|
620
|
+
* - `homeUrl` — last-resort URL when no per-document URL is available
|
|
621
|
+
*
|
|
622
|
+
* What does NOT live here:
|
|
623
|
+
* - Logo components, color tokens, React chrome — those belong in sifa-web
|
|
624
|
+
* keyed by `id`.
|
|
625
|
+
* - Per-document URL construction — Standard documents are always
|
|
626
|
+
* `${publication.url}${document.path}`. The publisher doesn't change that.
|
|
627
|
+
*/
|
|
628
|
+
interface Publisher {
|
|
629
|
+
/**
|
|
630
|
+
* Stable identifier. Used as the `appId` across Sifa so that sifa-web's
|
|
631
|
+
* `getAppMeta(id)` lookup yields the right logo and color, and so that
|
|
632
|
+
* activity-stat rows tag correctly.
|
|
633
|
+
*/
|
|
634
|
+
id: string;
|
|
635
|
+
/** Display name shown in pills and headers. */
|
|
636
|
+
name: string;
|
|
637
|
+
/**
|
|
638
|
+
* Hostnames that identify a publication URL as belonging to this publisher.
|
|
639
|
+
* Matches the publication URL's hostname when it equals the suffix
|
|
640
|
+
* (e.g. `leaflet.pub`) OR ends with it as a dotted suffix
|
|
641
|
+
* (e.g. `notesbyarielm.leaflet.pub`).
|
|
642
|
+
*
|
|
643
|
+
* Allow multiple entries to future-proof against rebrands or aliases.
|
|
644
|
+
*/
|
|
645
|
+
hostSuffixes: readonly string[];
|
|
646
|
+
/** Public homepage of the publisher, used as a profile-level fallback URL. */
|
|
647
|
+
homeUrl: string;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Neutral fallback used when no branded publisher matches.
|
|
651
|
+
*
|
|
652
|
+
* Synthetic publishers returned by `getPublisherFromSiteUrl` use this `id` but
|
|
653
|
+
* carry the document's own hostname in `name`, so cards can still show e.g.
|
|
654
|
+
* "feeds.byarielm.fyi" as the publisher label.
|
|
655
|
+
*/
|
|
656
|
+
declare const STANDARD_PUBLISHER_ID: "standard";
|
|
657
|
+
declare const PUBLISHERS: readonly Publisher[];
|
|
658
|
+
/** Lookup a registered publisher by id. Returns `undefined` for unknown ids. */
|
|
659
|
+
declare function getPublisherById(id: string): Publisher | undefined;
|
|
660
|
+
/**
|
|
661
|
+
* Match a hostname against the registry. Returns the registered publisher when
|
|
662
|
+
* the hostname equals or is a dotted-subdomain of any of its `hostSuffixes`.
|
|
663
|
+
* Returns `undefined` when no match is found (caller decides on the fallback).
|
|
664
|
+
*/
|
|
665
|
+
declare function getPublisherByHost(hostname: string): Publisher | undefined;
|
|
666
|
+
/**
|
|
667
|
+
* Resolve the publisher for a publication's site URL.
|
|
668
|
+
*
|
|
669
|
+
* - On a branded host: returns the registered `Publisher` verbatim.
|
|
670
|
+
* - On any other valid URL: returns a synthetic neutral publisher with
|
|
671
|
+
* `id: 'standard'`, `name: <hostname>`, `hostSuffixes: []`, and the URL
|
|
672
|
+
* as `homeUrl`. Cards can therefore always render a meaningful pill label.
|
|
673
|
+
* - On an unparseable string: returns the same neutral shape with the raw
|
|
674
|
+
* input as `name` and `homeUrl` (defensive — should never happen for data
|
|
675
|
+
* coming from a valid `site.standard.publication`).
|
|
676
|
+
*/
|
|
677
|
+
declare function getPublisherFromSiteUrl(siteUrl: string): Publisher;
|
|
678
|
+
|
|
606
679
|
/**
|
|
607
680
|
* Profile completeness scoring.
|
|
608
681
|
*
|
|
@@ -710,4 +783,4 @@ declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positio
|
|
|
710
783
|
*/
|
|
711
784
|
declare const SIFA_SDK_VERSION: string;
|
|
712
785
|
|
|
713
|
-
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, 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, type OpenToOption, PLATFORM_LABELS, PLATFORM_OPTIONS, type PdsProvider, PdsProviderInfo, type PlatformId, type PrimaryPositionCandidate, Profile, type ProfileCompletion, type ProfileDimensionInputs, ProfileSkill, type RgbColor, SIFA_SDK_VERSION, SKILL_CATEGORIES, 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, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
|
|
786
|
+
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, 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, 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, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, meetsContrastAA, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
|
package/dist/index.js
CHANGED
|
@@ -834,7 +834,6 @@ var APP_CATEGORY_MAP = {
|
|
|
834
834
|
grain: "Photos",
|
|
835
835
|
whitewind: "Articles",
|
|
836
836
|
frontpage: "Links",
|
|
837
|
-
picosky: "Chat",
|
|
838
837
|
pastesphere: "Pastes",
|
|
839
838
|
standard: "Articles",
|
|
840
839
|
aetheros: "Pages",
|
|
@@ -1748,6 +1747,86 @@ function isVisibleActivityItem(collection, record) {
|
|
|
1748
1747
|
return rule(record);
|
|
1749
1748
|
}
|
|
1750
1749
|
|
|
1750
|
+
// src/publishers/registry.ts
|
|
1751
|
+
var STANDARD_PUBLISHER_ID = "standard";
|
|
1752
|
+
var PUBLISHERS = Object.freeze([
|
|
1753
|
+
{
|
|
1754
|
+
id: "leaflet",
|
|
1755
|
+
name: "Leaflet",
|
|
1756
|
+
hostSuffixes: ["leaflet.pub"],
|
|
1757
|
+
homeUrl: "https://leaflet.pub"
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
id: "pckt",
|
|
1761
|
+
name: "pckt",
|
|
1762
|
+
hostSuffixes: ["pckt.blog"],
|
|
1763
|
+
homeUrl: "https://pckt.blog"
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
id: "offprint",
|
|
1767
|
+
name: "Offprint",
|
|
1768
|
+
hostSuffixes: ["offprint.app"],
|
|
1769
|
+
homeUrl: "https://offprint.app"
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
id: "whitewind",
|
|
1773
|
+
name: "WhiteWind",
|
|
1774
|
+
hostSuffixes: ["whtwnd.com"],
|
|
1775
|
+
homeUrl: "https://whtwnd.com"
|
|
1776
|
+
},
|
|
1777
|
+
{
|
|
1778
|
+
id: "unthread",
|
|
1779
|
+
name: "Unthread",
|
|
1780
|
+
hostSuffixes: ["unthread.at"],
|
|
1781
|
+
homeUrl: "https://unthread.at"
|
|
1782
|
+
},
|
|
1783
|
+
{
|
|
1784
|
+
id: "blento",
|
|
1785
|
+
name: "Blento",
|
|
1786
|
+
hostSuffixes: ["blento.io"],
|
|
1787
|
+
homeUrl: "https://blento.io"
|
|
1788
|
+
}
|
|
1789
|
+
]);
|
|
1790
|
+
var PUBLISHERS_BY_ID = new Map(PUBLISHERS.map((p) => [p.id, p]));
|
|
1791
|
+
function getPublisherById(id) {
|
|
1792
|
+
return PUBLISHERS_BY_ID.get(id);
|
|
1793
|
+
}
|
|
1794
|
+
function getPublisherByHost(hostname) {
|
|
1795
|
+
const host = hostname.toLowerCase();
|
|
1796
|
+
for (const publisher of PUBLISHERS) {
|
|
1797
|
+
for (const suffix of publisher.hostSuffixes) {
|
|
1798
|
+
if (host === suffix || host.endsWith(`.${suffix}`)) {
|
|
1799
|
+
return publisher;
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
return void 0;
|
|
1804
|
+
}
|
|
1805
|
+
function getPublisherFromSiteUrl(siteUrl) {
|
|
1806
|
+
let hostname;
|
|
1807
|
+
let homeUrl;
|
|
1808
|
+
try {
|
|
1809
|
+
const parsed2 = new URL(siteUrl);
|
|
1810
|
+
hostname = parsed2.hostname;
|
|
1811
|
+
homeUrl = `${parsed2.protocol}//${parsed2.hostname}`;
|
|
1812
|
+
} catch {
|
|
1813
|
+
return {
|
|
1814
|
+
id: STANDARD_PUBLISHER_ID,
|
|
1815
|
+
name: siteUrl,
|
|
1816
|
+
hostSuffixes: [],
|
|
1817
|
+
homeUrl: siteUrl
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1820
|
+
const matched = getPublisherByHost(hostname);
|
|
1821
|
+
if (matched) return matched;
|
|
1822
|
+
return {
|
|
1823
|
+
id: STANDARD_PUBLISHER_ID,
|
|
1824
|
+
name: hostname,
|
|
1825
|
+
hostSuffixes: [],
|
|
1826
|
+
homeUrl
|
|
1827
|
+
};
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1751
1830
|
// src/logic/profile-completeness.ts
|
|
1752
1831
|
var COMPLETENESS_MAX_SCORE = 6;
|
|
1753
1832
|
function completenessScore(c) {
|
|
@@ -2067,8 +2146,8 @@ var ProfileVolunteeringRecordSchema = z.object({
|
|
|
2067
2146
|
});
|
|
2068
2147
|
|
|
2069
2148
|
// src/index.ts
|
|
2070
|
-
var SIFA_SDK_VERSION = "0.10.
|
|
2149
|
+
var SIFA_SDK_VERSION = "0.10.3";
|
|
2071
2150
|
|
|
2072
|
-
export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, AtmosphereFeedItemSchema, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, 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, PLATFORM_LABELS, PLATFORM_OPTIONS, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, SIFA_SDK_VERSION, SKILL_CATEGORIES, 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, getTierMeta, getWorkplaceTypeLabel, groupSkillsByCategory, isAppCategory, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, selfLabelsSchema, singleDateExtractor, sortByDateDesc, strongRefSchema, truncateGraphemes, uriSchema };
|
|
2151
|
+
export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, AtmosphereFeedItemSchema, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, 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, 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, isAppCategory, isKnownAppId, isKnownPlatform, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, parseLocationString, pdsProviderFromApi, pickPrimaryPosition, profileToDimensionInputs, relativeLuminance, resolveCardUrl, rgbToString, sanitizeDisplayText, sanitizeHandleInput, selfLabelsSchema, singleDateExtractor, sortByDateDesc, strongRefSchema, truncateGraphemes, uriSchema };
|
|
2073
2152
|
//# sourceMappingURL=index.js.map
|
|
2074
2153
|
//# sourceMappingURL=index.js.map
|