@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 CHANGED
@@ -836,7 +836,6 @@ var APP_CATEGORY_MAP = {
836
836
  grain: "Photos",
837
837
  whitewind: "Articles",
838
838
  frontpage: "Links",
839
- picosky: "Chat",
840
839
  pastesphere: "Pastes",
841
840
  standard: "Articles",
842
841
  aetheros: "Pages",
@@ -1750,6 +1749,86 @@ function isVisibleActivityItem(collection, record) {
1750
1749
  return rule(record);
1751
1750
  }
1752
1751
 
1752
+ // src/publishers/registry.ts
1753
+ var STANDARD_PUBLISHER_ID = "standard";
1754
+ var PUBLISHERS = Object.freeze([
1755
+ {
1756
+ id: "leaflet",
1757
+ name: "Leaflet",
1758
+ hostSuffixes: ["leaflet.pub"],
1759
+ homeUrl: "https://leaflet.pub"
1760
+ },
1761
+ {
1762
+ id: "pckt",
1763
+ name: "pckt",
1764
+ hostSuffixes: ["pckt.blog"],
1765
+ homeUrl: "https://pckt.blog"
1766
+ },
1767
+ {
1768
+ id: "offprint",
1769
+ name: "Offprint",
1770
+ hostSuffixes: ["offprint.app"],
1771
+ homeUrl: "https://offprint.app"
1772
+ },
1773
+ {
1774
+ id: "whitewind",
1775
+ name: "WhiteWind",
1776
+ hostSuffixes: ["whtwnd.com"],
1777
+ homeUrl: "https://whtwnd.com"
1778
+ },
1779
+ {
1780
+ id: "unthread",
1781
+ name: "Unthread",
1782
+ hostSuffixes: ["unthread.at"],
1783
+ homeUrl: "https://unthread.at"
1784
+ },
1785
+ {
1786
+ id: "blento",
1787
+ name: "Blento",
1788
+ hostSuffixes: ["blento.io"],
1789
+ homeUrl: "https://blento.io"
1790
+ }
1791
+ ]);
1792
+ var PUBLISHERS_BY_ID = new Map(PUBLISHERS.map((p) => [p.id, p]));
1793
+ function getPublisherById(id) {
1794
+ return PUBLISHERS_BY_ID.get(id);
1795
+ }
1796
+ function getPublisherByHost(hostname) {
1797
+ const host = hostname.toLowerCase();
1798
+ for (const publisher of PUBLISHERS) {
1799
+ for (const suffix of publisher.hostSuffixes) {
1800
+ if (host === suffix || host.endsWith(`.${suffix}`)) {
1801
+ return publisher;
1802
+ }
1803
+ }
1804
+ }
1805
+ return void 0;
1806
+ }
1807
+ function getPublisherFromSiteUrl(siteUrl) {
1808
+ let hostname;
1809
+ let homeUrl;
1810
+ try {
1811
+ const parsed2 = new URL(siteUrl);
1812
+ hostname = parsed2.hostname;
1813
+ homeUrl = `${parsed2.protocol}//${parsed2.hostname}`;
1814
+ } catch {
1815
+ return {
1816
+ id: STANDARD_PUBLISHER_ID,
1817
+ name: siteUrl,
1818
+ hostSuffixes: [],
1819
+ homeUrl: siteUrl
1820
+ };
1821
+ }
1822
+ const matched = getPublisherByHost(hostname);
1823
+ if (matched) return matched;
1824
+ return {
1825
+ id: STANDARD_PUBLISHER_ID,
1826
+ name: hostname,
1827
+ hostSuffixes: [],
1828
+ homeUrl
1829
+ };
1830
+ }
1831
+
1753
1832
  // src/logic/profile-completeness.ts
1754
1833
  var COMPLETENESS_MAX_SCORE = 6;
1755
1834
  function completenessScore(c) {
@@ -2069,7 +2148,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
2069
2148
  });
2070
2149
 
2071
2150
  // src/index.ts
2072
- var SIFA_SDK_VERSION = "0.10.1";
2151
+ var SIFA_SDK_VERSION = "0.10.3";
2073
2152
 
2074
2153
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
2075
2154
  exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
@@ -2102,6 +2181,7 @@ exports.MIN_SKILLS = MIN_SKILLS;
2102
2181
  exports.OPEN_TO_OPTIONS = OPEN_TO_OPTIONS;
2103
2182
  exports.PLATFORM_LABELS = PLATFORM_LABELS;
2104
2183
  exports.PLATFORM_OPTIONS = PLATFORM_OPTIONS;
2184
+ exports.PUBLISHERS = PUBLISHERS;
2105
2185
  exports.ProfileCertificationRecordSchema = ProfileCertificationRecordSchema;
2106
2186
  exports.ProfileCourseRecordSchema = ProfileCourseRecordSchema;
2107
2187
  exports.ProfileEducationRecordSchema = ProfileEducationRecordSchema;
@@ -2117,6 +2197,7 @@ exports.ProfileVolunteeringRecordSchema = ProfileVolunteeringRecordSchema;
2117
2197
  exports.PublicationAuthorSchema = PublicationAuthorSchema;
2118
2198
  exports.SIFA_SDK_VERSION = SIFA_SDK_VERSION;
2119
2199
  exports.SKILL_CATEGORIES = SKILL_CATEGORIES;
2200
+ exports.STANDARD_PUBLISHER_ID = STANDARD_PUBLISHER_ID;
2120
2201
  exports.SifaFeedItemSchema = SifaFeedItemSchema;
2121
2202
  exports.WORKPLACE_TYPE_LABELS = WORKPLACE_TYPE_LABELS;
2122
2203
  exports.WORKPLACE_TYPE_OPTIONS = WORKPLACE_TYPE_OPTIONS;
@@ -2156,6 +2237,9 @@ exports.getLexiconEntry = getLexiconEntry;
2156
2237
  exports.getOpenToLabelKey = getOpenToLabelKey;
2157
2238
  exports.getPdsDisplayName = getPdsDisplayName;
2158
2239
  exports.getPlatformLabel = getPlatformLabel;
2240
+ exports.getPublisherByHost = getPublisherByHost;
2241
+ exports.getPublisherById = getPublisherById;
2242
+ exports.getPublisherFromSiteUrl = getPublisherFromSiteUrl;
2159
2243
  exports.getTierMeta = getTierMeta;
2160
2244
  exports.getWorkplaceTypeLabel = getWorkplaceTypeLabel;
2161
2245
  exports.groupSkillsByCategory = groupSkillsByCategory;