@singi-labs/sifa-sdk 0.12.58 → 0.12.60

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
@@ -2605,6 +2605,146 @@ function parseTalkRkey(segment) {
2605
2605
  return idx === -1 ? segment : segment.slice(idx + 1);
2606
2606
  }
2607
2607
 
2608
+ // src/logic/primary-position.ts
2609
+ function pickPrimaryPosition(positions) {
2610
+ if (!positions || positions.length === 0) return void 0;
2611
+ const active = positions.filter((p) => !p.endedAt);
2612
+ if (active.length === 0) return void 0;
2613
+ const flagged = active.find((p) => p.primary === true);
2614
+ if (flagged) return flagged;
2615
+ return [...active].sort((a, b) => (b.startedAt ?? "").localeCompare(a.startedAt ?? ""))[0];
2616
+ }
2617
+
2618
+ // src/profile/section-model.ts
2619
+ var SECTION_GROUPS = [
2620
+ { id: "overview", labelKey: "groupOverview" },
2621
+ { id: "experience", labelKey: "groupExperience" },
2622
+ { id: "qualifications", labelKey: "groupQualifications" },
2623
+ { id: "more", labelKey: "groupMore" }
2624
+ ];
2625
+ var ALL_SECTIONS = [
2626
+ { id: "about", labelKey: "about", ns: "profile", group: "overview" },
2627
+ { id: "career", labelKey: "career", ns: "sections", group: "experience" },
2628
+ { id: "skills", labelKey: "skills", ns: "sections", group: "experience" },
2629
+ { id: "projects", labelKey: "projects", ns: "sections", group: "experience" },
2630
+ {
2631
+ id: "presentations",
2632
+ labelKey: "talksAndSessions",
2633
+ ns: "sections",
2634
+ group: "experience"
2635
+ },
2636
+ {
2637
+ id: "publications",
2638
+ labelKey: "publications",
2639
+ ns: "sections",
2640
+ group: "experience"
2641
+ },
2642
+ {
2643
+ id: "credentials",
2644
+ labelKey: "credentials",
2645
+ ns: "sections",
2646
+ group: "qualifications"
2647
+ },
2648
+ {
2649
+ id: "education",
2650
+ labelKey: "education",
2651
+ ns: "sections",
2652
+ group: "qualifications"
2653
+ },
2654
+ { id: "courses", labelKey: "courses", ns: "sections", group: "qualifications" },
2655
+ { id: "awards", labelKey: "awards", ns: "sections", group: "more" },
2656
+ { id: "involvement", labelKey: "involvement", ns: "sections", group: "more" },
2657
+ { id: "languages", labelKey: "languages", ns: "sections", group: "more" },
2658
+ {
2659
+ id: "other-profiles",
2660
+ labelKey: "otherProfiles",
2661
+ ns: "sections",
2662
+ group: "more"
2663
+ }
2664
+ ];
2665
+ function isSectionPopulated(profile, id) {
2666
+ switch (id) {
2667
+ case "about":
2668
+ return Boolean(profile.about && profile.headline);
2669
+ case "career":
2670
+ return Boolean(profile.positions?.length);
2671
+ case "education":
2672
+ return Boolean(profile.education?.length);
2673
+ case "courses":
2674
+ return Boolean(profile.courses?.length);
2675
+ case "skills":
2676
+ return Boolean(profile.skills?.length);
2677
+ case "projects":
2678
+ return Boolean(profile.projects?.length);
2679
+ case "credentials":
2680
+ return Boolean(profile.certifications?.length);
2681
+ case "publications":
2682
+ return Boolean(profile.publications?.length);
2683
+ case "presentations":
2684
+ return Boolean(profile.presentations?.length) || Boolean(profile.presentationDeliveries?.length);
2685
+ case "involvement":
2686
+ return Boolean(profile.involvement?.length);
2687
+ case "awards":
2688
+ return Boolean(profile.honors?.length);
2689
+ case "languages":
2690
+ return Boolean(profile.languages?.length);
2691
+ case "other-profiles":
2692
+ return Boolean(profile.externalAccounts?.length);
2693
+ default:
2694
+ return false;
2695
+ }
2696
+ }
2697
+ function getVisibleSectionIds(profile, isOwnProfile) {
2698
+ return ALL_SECTIONS.map((s) => s.id).filter(
2699
+ (id) => isOwnProfile || isSectionPopulated(profile, id)
2700
+ );
2701
+ }
2702
+ function filterHidden(items) {
2703
+ return (items ?? []).filter((i) => !i.hidden);
2704
+ }
2705
+ function visibleItems(items, isOwnProfile) {
2706
+ return isOwnProfile ? items ?? [] : filterHidden(items);
2707
+ }
2708
+ var SECTION_LABELS = {
2709
+ about: "About",
2710
+ career: "Career",
2711
+ skills: "Skills",
2712
+ projects: "Projects",
2713
+ presentations: "Talks & sessions",
2714
+ publications: "Publications",
2715
+ credentials: "Credentials",
2716
+ education: "Education",
2717
+ courses: "Courses",
2718
+ awards: "Awards",
2719
+ involvement: "Involvement",
2720
+ languages: "Languages",
2721
+ "other-profiles": "Links"
2722
+ };
2723
+
2724
+ // src/format/meta-description.ts
2725
+ var MEANINGFUL_TEXT_RE = /[\p{L}\p{N}]/u;
2726
+ function buildMetaDescription(profile) {
2727
+ const parts = [];
2728
+ if (typeof profile.headline === "string" && MEANINGFUL_TEXT_RE.test(profile.headline)) {
2729
+ parts.push(profile.headline);
2730
+ }
2731
+ const positions = filterHidden(profile.positions ? [...profile.positions] : void 0);
2732
+ const currentPosition = pickPrimaryPosition(positions);
2733
+ if (currentPosition) {
2734
+ const positionParts = [];
2735
+ if (currentPosition.title) positionParts.push(currentPosition.title);
2736
+ if (currentPosition.company) positionParts.push(`at ${currentPosition.company}`);
2737
+ if (positionParts.length > 0) parts.push(positionParts.join(" "));
2738
+ }
2739
+ if (profile.location) {
2740
+ parts.push(formatLocation(profile.location));
2741
+ }
2742
+ if (parts.length === 0) {
2743
+ return `${profile.displayName ?? profile.handle} on Sifa`;
2744
+ }
2745
+ return parts.join(" \xB7 ");
2746
+ }
2747
+
2608
2748
  // src/format/text-sanitize.ts
2609
2749
  var COMBINING_MARK = /\p{M}/u;
2610
2750
  var BIDI_CONTROLS = /[‎‏‪-‮⁦-⁩]/gu;
@@ -4444,16 +4584,6 @@ function countFilledDimensions(input) {
4444
4584
  return n;
4445
4585
  }
4446
4586
 
4447
- // src/logic/primary-position.ts
4448
- function pickPrimaryPosition(positions) {
4449
- if (!positions || positions.length === 0) return void 0;
4450
- const active = positions.filter((p) => !p.endedAt);
4451
- if (active.length === 0) return void 0;
4452
- const flagged = active.find((p) => p.primary === true);
4453
- if (flagged) return flagged;
4454
- return [...active].sort((a, b) => (b.startedAt ?? "").localeCompare(a.startedAt ?? ""))[0];
4455
- }
4456
-
4457
4587
  // src/logic/profile-summary.ts
4458
4588
  var DEFAULT_MAX_SKILLS = 5;
4459
4589
  function summarizeProfileView(view, options = {}) {
@@ -4667,112 +4797,6 @@ function isCompanyPageIndexable(company) {
4667
4797
  return present >= COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS;
4668
4798
  }
4669
4799
 
4670
- // src/profile/section-model.ts
4671
- var SECTION_GROUPS = [
4672
- { id: "overview", labelKey: "groupOverview" },
4673
- { id: "experience", labelKey: "groupExperience" },
4674
- { id: "qualifications", labelKey: "groupQualifications" },
4675
- { id: "more", labelKey: "groupMore" }
4676
- ];
4677
- var ALL_SECTIONS = [
4678
- { id: "about", labelKey: "about", ns: "profile", group: "overview" },
4679
- { id: "career", labelKey: "career", ns: "sections", group: "experience" },
4680
- { id: "skills", labelKey: "skills", ns: "sections", group: "experience" },
4681
- { id: "projects", labelKey: "projects", ns: "sections", group: "experience" },
4682
- {
4683
- id: "presentations",
4684
- labelKey: "talksAndSessions",
4685
- ns: "sections",
4686
- group: "experience"
4687
- },
4688
- {
4689
- id: "publications",
4690
- labelKey: "publications",
4691
- ns: "sections",
4692
- group: "experience"
4693
- },
4694
- {
4695
- id: "credentials",
4696
- labelKey: "credentials",
4697
- ns: "sections",
4698
- group: "qualifications"
4699
- },
4700
- {
4701
- id: "education",
4702
- labelKey: "education",
4703
- ns: "sections",
4704
- group: "qualifications"
4705
- },
4706
- { id: "courses", labelKey: "courses", ns: "sections", group: "qualifications" },
4707
- { id: "awards", labelKey: "awards", ns: "sections", group: "more" },
4708
- { id: "involvement", labelKey: "involvement", ns: "sections", group: "more" },
4709
- { id: "languages", labelKey: "languages", ns: "sections", group: "more" },
4710
- {
4711
- id: "other-profiles",
4712
- labelKey: "otherProfiles",
4713
- ns: "sections",
4714
- group: "more"
4715
- }
4716
- ];
4717
- function isSectionPopulated(profile, id) {
4718
- switch (id) {
4719
- case "about":
4720
- return Boolean(profile.about && profile.headline);
4721
- case "career":
4722
- return Boolean(profile.positions?.length);
4723
- case "education":
4724
- return Boolean(profile.education?.length);
4725
- case "courses":
4726
- return Boolean(profile.courses?.length);
4727
- case "skills":
4728
- return Boolean(profile.skills?.length);
4729
- case "projects":
4730
- return Boolean(profile.projects?.length);
4731
- case "credentials":
4732
- return Boolean(profile.certifications?.length);
4733
- case "publications":
4734
- return Boolean(profile.publications?.length);
4735
- case "presentations":
4736
- return Boolean(profile.presentations?.length) || Boolean(profile.presentationDeliveries?.length);
4737
- case "involvement":
4738
- return Boolean(profile.involvement?.length);
4739
- case "awards":
4740
- return Boolean(profile.honors?.length);
4741
- case "languages":
4742
- return Boolean(profile.languages?.length);
4743
- case "other-profiles":
4744
- return Boolean(profile.externalAccounts?.length);
4745
- default:
4746
- return false;
4747
- }
4748
- }
4749
- function getVisibleSectionIds(profile, isOwnProfile) {
4750
- return ALL_SECTIONS.map((s) => s.id).filter(
4751
- (id) => isOwnProfile || isSectionPopulated(profile, id)
4752
- );
4753
- }
4754
- function filterHidden(items) {
4755
- return (items ?? []).filter((i) => !i.hidden);
4756
- }
4757
- function visibleItems(items, isOwnProfile) {
4758
- return isOwnProfile ? items ?? [] : filterHidden(items);
4759
- }
4760
- var SECTION_LABELS = {
4761
- about: "About",
4762
- career: "Career",
4763
- skills: "Skills",
4764
- projects: "Projects",
4765
- presentations: "Talks & sessions",
4766
- publications: "Publications",
4767
- credentials: "Credentials",
4768
- education: "Education",
4769
- courses: "Courses",
4770
- awards: "Awards",
4771
- involvement: "Involvement",
4772
- languages: "Languages",
4773
- "other-profiles": "Links"
4774
- };
4775
-
4776
4800
  // src/profile/range-sort.ts
4777
4801
  var hasValue = (date) => !!date;
4778
4802
  function sortByActiveDateRange(items) {
@@ -5624,7 +5648,7 @@ function describeSifaRecord(collection, value) {
5624
5648
  }
5625
5649
 
5626
5650
  // src/index.ts
5627
- var SIFA_SDK_VERSION = "0.12.58";
5651
+ var SIFA_SDK_VERSION = "0.12.60";
5628
5652
 
5629
5653
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
5630
5654
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;
@@ -5725,6 +5749,7 @@ exports.VERIFICATION_PROVIDERS = VERIFICATION_PROVIDERS;
5725
5749
  exports.WORKPLACE_TYPE_LABELS = WORKPLACE_TYPE_LABELS;
5726
5750
  exports.WORKPLACE_TYPE_OPTIONS = WORKPLACE_TYPE_OPTIONS;
5727
5751
  exports.atUriSchema = atUriSchema;
5752
+ exports.buildMetaDescription = buildMetaDescription;
5728
5753
  exports.buildTalkSlug = buildTalkSlug;
5729
5754
  exports.categoryForApp = categoryForApp;
5730
5755
  exports.certDateExtractor = certDateExtractor;