@singi-labs/sifa-sdk 0.10.2 → 0.10.4
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-DYUYJxOs.d.cts → adult-content-BjbP46ad.d.cts} +40 -1
- package/dist/{index-DYUYJxOs.d.ts → adult-content-BjbP46ad.d.ts} +40 -1
- package/dist/index.cjs +98 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -3
- package/dist/index.d.ts +77 -3
- package/dist/index.js +92 -2
- package/dist/index.js.map +1 -1
- package/dist/{keys-D-vNPzXx.d.ts → keys-Ba4_wCnj.d.ts} +8 -1
- package/dist/{keys-DRD79nDE.d.cts → keys-DPeDdYki.d.cts} +8 -1
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +3 -3
- package/dist/query/fetchers/index.d.ts +3 -3
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +3 -3
- package/dist/query/hooks/index.d.ts +3 -3
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +2 -2
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProfileSkill, L as LocationValue, a as PdsProviderInfo, b as Profile } from './
|
|
2
|
-
export {
|
|
1
|
+
import { P as ProfileSkill, L as LocationValue, a as PdsProviderInfo, b as Profile } from './adult-content-BjbP46ad.cjs';
|
|
2
|
+
export { c as ADULT_CONTENT_LABELS, d as ActiveApp, A as ActivityLabel, e as AdultContentLabel, f as Endorsement, g as EndorsementData, E as ExternalAccount, h as ExternalAccountKeytraceClaim, F as FeedItem, i as LanguageProficiency, j as ProfileCertification, k as ProfileCourse, l as ProfileEducation, m as ProfileHonor, n as ProfileIndustry, o as ProfileLanguage, p as ProfileLocation, q as ProfileOverrideSource, r as ProfilePosition, s as ProfileProject, t as ProfilePublication, u as ProfileVolunteering, v as PublicationContributor, w as SkillRef, S as SkillSuggestion, T as TrustStat, V as VerifiedAccount, x as hasAdultContent } from './adult-content-BjbP46ad.cjs';
|
|
3
3
|
export { EndorsementConfirmationRecord, EndorsementConfirmationRecordSchema, EndorsementRecord, EndorsementRecordSchema, GraphFollowRecord, GraphFollowRecordSchema, ProfileCertificationRecord, ProfileCertificationRecordSchema, ProfileCourseRecord, ProfileCourseRecordSchema, ProfileEducationRecord, ProfileEducationRecordSchema, ProfileExternalAccountRecord, ProfileExternalAccountRecordSchema, ProfileHonorRecord, ProfileHonorRecordSchema, ProfileLanguageRecord, ProfileLanguageRecordSchema, ProfilePositionRecord, ProfilePositionRecordSchema, ProfileProjectRecord, ProfileProjectRecordSchema, ProfilePublicationRecord, ProfilePublicationRecordSchema, ProfileSelfRecord, ProfileSelfRecordSchema, ProfileSkillRecord, ProfileSkillRecordSchema, ProfileVolunteeringRecord, ProfileVolunteeringRecordSchema, PublicationAuthor, PublicationAuthorSchema, atUriSchema, cidSchema, datetimeSchema, didSchema, languageTagSchema, makeGraphFollowRecordSchema, maxGraphemes, selfLabelsSchema, strongRefSchema, uriSchema } from './schemas/index.cjs';
|
|
4
4
|
export { A as AtmosphereFeedItem, d as AtmosphereFeedItemSchema, e as FEATURE_FLAGS, b as FeatureAllowlistEntry, f as FeatureAllowlistEntrySchema, c as FeatureFlag, g as FeedActor, h as FeedActorSchema, i as FeedCursor, j as FollowFeedItem, k as FollowFeedItemSchema, F as FollowFeedPage, l as FollowFeedPageSchema, a as FollowProfileItem, m as FollowProfilePage, n as FollowProfilePageSchema, o as FollowProfileSchema, S as SifaFeedItem, p as SifaFeedItemSchema, q as decodeFeedCursor, r as encodeFeedCursor } from './feed-DHTy7fUN.cjs';
|
|
5
5
|
import 'zod';
|
|
@@ -602,6 +602,80 @@ declare const ACTIVITY_VISIBILITY_RULES: Readonly<Record<string, VisibilityPredi
|
|
|
602
602
|
*/
|
|
603
603
|
declare function isVisibleActivityItem(collection: string, record: unknown): boolean;
|
|
604
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
|
+
|
|
605
679
|
/**
|
|
606
680
|
* Profile completeness scoring.
|
|
607
681
|
*
|
|
@@ -709,4 +783,4 @@ declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positio
|
|
|
709
783
|
*/
|
|
710
784
|
declare const SIFA_SDK_VERSION: string;
|
|
711
785
|
|
|
712
|
-
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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProfileSkill, L as LocationValue, a as PdsProviderInfo, b as Profile } from './
|
|
2
|
-
export {
|
|
1
|
+
import { P as ProfileSkill, L as LocationValue, a as PdsProviderInfo, b as Profile } from './adult-content-BjbP46ad.js';
|
|
2
|
+
export { c as ADULT_CONTENT_LABELS, d as ActiveApp, A as ActivityLabel, e as AdultContentLabel, f as Endorsement, g as EndorsementData, E as ExternalAccount, h as ExternalAccountKeytraceClaim, F as FeedItem, i as LanguageProficiency, j as ProfileCertification, k as ProfileCourse, l as ProfileEducation, m as ProfileHonor, n as ProfileIndustry, o as ProfileLanguage, p as ProfileLocation, q as ProfileOverrideSource, r as ProfilePosition, s as ProfileProject, t as ProfilePublication, u as ProfileVolunteering, v as PublicationContributor, w as SkillRef, S as SkillSuggestion, T as TrustStat, V as VerifiedAccount, x as hasAdultContent } from './adult-content-BjbP46ad.js';
|
|
3
3
|
export { EndorsementConfirmationRecord, EndorsementConfirmationRecordSchema, EndorsementRecord, EndorsementRecordSchema, GraphFollowRecord, GraphFollowRecordSchema, ProfileCertificationRecord, ProfileCertificationRecordSchema, ProfileCourseRecord, ProfileCourseRecordSchema, ProfileEducationRecord, ProfileEducationRecordSchema, ProfileExternalAccountRecord, ProfileExternalAccountRecordSchema, ProfileHonorRecord, ProfileHonorRecordSchema, ProfileLanguageRecord, ProfileLanguageRecordSchema, ProfilePositionRecord, ProfilePositionRecordSchema, ProfileProjectRecord, ProfileProjectRecordSchema, ProfilePublicationRecord, ProfilePublicationRecordSchema, ProfileSelfRecord, ProfileSelfRecordSchema, ProfileSkillRecord, ProfileSkillRecordSchema, ProfileVolunteeringRecord, ProfileVolunteeringRecordSchema, PublicationAuthor, PublicationAuthorSchema, atUriSchema, cidSchema, datetimeSchema, didSchema, languageTagSchema, makeGraphFollowRecordSchema, maxGraphemes, selfLabelsSchema, strongRefSchema, uriSchema } from './schemas/index.js';
|
|
4
4
|
export { A as AtmosphereFeedItem, d as AtmosphereFeedItemSchema, e as FEATURE_FLAGS, b as FeatureAllowlistEntry, f as FeatureAllowlistEntrySchema, c as FeatureFlag, g as FeedActor, h as FeedActorSchema, i as FeedCursor, j as FollowFeedItem, k as FollowFeedItemSchema, F as FollowFeedPage, l as FollowFeedPageSchema, a as FollowProfileItem, m as FollowProfilePage, n as FollowProfilePageSchema, o as FollowProfileSchema, S as SifaFeedItem, p as SifaFeedItemSchema, q as decodeFeedCursor, r as encodeFeedCursor } from './feed-DHTy7fUN.js';
|
|
5
5
|
import 'zod';
|
|
@@ -602,6 +602,80 @@ declare const ACTIVITY_VISIBILITY_RULES: Readonly<Record<string, VisibilityPredi
|
|
|
602
602
|
*/
|
|
603
603
|
declare function isVisibleActivityItem(collection: string, record: unknown): boolean;
|
|
604
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
|
+
|
|
605
679
|
/**
|
|
606
680
|
* Profile completeness scoring.
|
|
607
681
|
*
|
|
@@ -709,4 +783,4 @@ declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positio
|
|
|
709
783
|
*/
|
|
710
784
|
declare const SIFA_SDK_VERSION: string;
|
|
711
785
|
|
|
712
|
-
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
|
@@ -1747,6 +1747,96 @@ function isVisibleActivityItem(collection, record) {
|
|
|
1747
1747
|
return rule(record);
|
|
1748
1748
|
}
|
|
1749
1749
|
|
|
1750
|
+
// src/cards/adult-content.ts
|
|
1751
|
+
var ADULT_CONTENT_LABELS = ["porn", "sexual", "nudity", "graphic-media"];
|
|
1752
|
+
function hasAdultContent(item) {
|
|
1753
|
+
const labels = item.labels;
|
|
1754
|
+
if (!labels || labels.length === 0) return false;
|
|
1755
|
+
return labels.some(
|
|
1756
|
+
(label) => !label.neg && ADULT_CONTENT_LABELS.includes(label.val)
|
|
1757
|
+
);
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
// src/publishers/registry.ts
|
|
1761
|
+
var STANDARD_PUBLISHER_ID = "standard";
|
|
1762
|
+
var PUBLISHERS = Object.freeze([
|
|
1763
|
+
{
|
|
1764
|
+
id: "leaflet",
|
|
1765
|
+
name: "Leaflet",
|
|
1766
|
+
hostSuffixes: ["leaflet.pub"],
|
|
1767
|
+
homeUrl: "https://leaflet.pub"
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
id: "pckt",
|
|
1771
|
+
name: "pckt",
|
|
1772
|
+
hostSuffixes: ["pckt.blog"],
|
|
1773
|
+
homeUrl: "https://pckt.blog"
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
id: "offprint",
|
|
1777
|
+
name: "Offprint",
|
|
1778
|
+
hostSuffixes: ["offprint.app"],
|
|
1779
|
+
homeUrl: "https://offprint.app"
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
id: "whitewind",
|
|
1783
|
+
name: "WhiteWind",
|
|
1784
|
+
hostSuffixes: ["whtwnd.com"],
|
|
1785
|
+
homeUrl: "https://whtwnd.com"
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
id: "unthread",
|
|
1789
|
+
name: "Unthread",
|
|
1790
|
+
hostSuffixes: ["unthread.at"],
|
|
1791
|
+
homeUrl: "https://unthread.at"
|
|
1792
|
+
},
|
|
1793
|
+
{
|
|
1794
|
+
id: "blento",
|
|
1795
|
+
name: "Blento",
|
|
1796
|
+
hostSuffixes: ["blento.io"],
|
|
1797
|
+
homeUrl: "https://blento.io"
|
|
1798
|
+
}
|
|
1799
|
+
]);
|
|
1800
|
+
var PUBLISHERS_BY_ID = new Map(PUBLISHERS.map((p) => [p.id, p]));
|
|
1801
|
+
function getPublisherById(id) {
|
|
1802
|
+
return PUBLISHERS_BY_ID.get(id);
|
|
1803
|
+
}
|
|
1804
|
+
function getPublisherByHost(hostname) {
|
|
1805
|
+
const host = hostname.toLowerCase();
|
|
1806
|
+
for (const publisher of PUBLISHERS) {
|
|
1807
|
+
for (const suffix of publisher.hostSuffixes) {
|
|
1808
|
+
if (host === suffix || host.endsWith(`.${suffix}`)) {
|
|
1809
|
+
return publisher;
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
return void 0;
|
|
1814
|
+
}
|
|
1815
|
+
function getPublisherFromSiteUrl(siteUrl) {
|
|
1816
|
+
let hostname;
|
|
1817
|
+
let homeUrl;
|
|
1818
|
+
try {
|
|
1819
|
+
const parsed2 = new URL(siteUrl);
|
|
1820
|
+
hostname = parsed2.hostname;
|
|
1821
|
+
homeUrl = `${parsed2.protocol}//${parsed2.hostname}`;
|
|
1822
|
+
} catch {
|
|
1823
|
+
return {
|
|
1824
|
+
id: STANDARD_PUBLISHER_ID,
|
|
1825
|
+
name: siteUrl,
|
|
1826
|
+
hostSuffixes: [],
|
|
1827
|
+
homeUrl: siteUrl
|
|
1828
|
+
};
|
|
1829
|
+
}
|
|
1830
|
+
const matched = getPublisherByHost(hostname);
|
|
1831
|
+
if (matched) return matched;
|
|
1832
|
+
return {
|
|
1833
|
+
id: STANDARD_PUBLISHER_ID,
|
|
1834
|
+
name: hostname,
|
|
1835
|
+
hostSuffixes: [],
|
|
1836
|
+
homeUrl
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1750
1840
|
// src/logic/profile-completeness.ts
|
|
1751
1841
|
var COMPLETENESS_MAX_SCORE = 6;
|
|
1752
1842
|
function completenessScore(c) {
|
|
@@ -2066,8 +2156,8 @@ var ProfileVolunteeringRecordSchema = z.object({
|
|
|
2066
2156
|
});
|
|
2067
2157
|
|
|
2068
2158
|
// src/index.ts
|
|
2069
|
-
var SIFA_SDK_VERSION = "0.10.
|
|
2159
|
+
var SIFA_SDK_VERSION = "0.10.4";
|
|
2070
2160
|
|
|
2071
|
-
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 };
|
|
2161
|
+
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, 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, hasAdultContent, 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 };
|
|
2072
2162
|
//# sourceMappingURL=index.js.map
|
|
2073
2163
|
//# sourceMappingURL=index.js.map
|