@teamscala/service-boot 0.23.473 → 0.23.477

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/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "name": "@teamscala/service-boot",
8
8
  "type": "module",
9
- "version": "0.23.473",
9
+ "version": "0.23.477",
10
10
  "sideEffects": false,
11
11
  "imports": {
12
12
  "#service-boot/*": "./src/*",
@@ -463,10 +463,7 @@ export function computeReportData({
463
463
  roadmap: nextSteps?.roadmap ?? orderRoadmap(band?.roadmap),
464
464
  research: {
465
465
  ...researchData,
466
- groups: researchData.groups.map((group) => ({
467
- title: group.title,
468
- items: numberItems(group.items),
469
- })),
466
+ groups: researchData.groups,
470
467
  weakestAreasList: numberItems(researchData.weakestAreas),
471
468
  },
472
469
  whoYouHelp: band?.whoYouHelp ?? "",
@@ -33,6 +33,7 @@ import {
33
33
  import type {
34
34
  ReportAssessmentInput,
35
35
  ReportData,
36
+ ReportPairResponseShape,
36
37
  StageBand,
37
38
  TitledAction,
38
39
  } from "./assessment-report-data.ts";
@@ -130,7 +131,7 @@ export function assertLiveResearch(research: ReportResearchInput | null | undefi
130
131
 
131
132
  /** The person's display name: quiz response names first, research second. */
132
133
  export function resolvePersonName(
133
- response: ReportPairResponseInput | null | undefined,
134
+ response: ReportPairResponseShape | null | undefined,
134
135
  research: ReportResearchInput | null | undefined,
135
136
  ): string {
136
137
  const fromResponse = [response?.first_name, response?.last_name]
@@ -216,13 +217,15 @@ export interface ResearchReportData {
216
217
  intro: string;
217
218
  calloutTitle: string;
218
219
  calloutBody: string;
219
- groups: Array<{ title: string; items: Array<{ index: string; text: string }> }>;
220
+ groups: Array<{ title: string; items: string[] }>;
220
221
  claims: ResearchClaim[];
221
222
  gapRows: GapRow[];
222
223
  combinedBand: string;
223
224
  combinedDelta: string;
224
225
  combinedStatement: string;
225
226
  weakestAreas: string[];
227
+ /** weakest areas numbered for badge-list rendering (shaped by the caller) */
228
+ weakestAreasList?: Array<{ index: string; text: string }>;
226
229
  methodRawScores: string;
227
230
  methodSources: string;
228
231
  researchedAt: string;
@@ -249,7 +252,7 @@ function isoDay(value: Date | string | null | undefined): string {
249
252
  */
250
253
  export function buildResearchReportData(opts: {
251
254
  research: ReportResearchInput | null | undefined;
252
- response: ReportPairResponseInput | null | undefined;
255
+ response: ReportPairResponseShape | null | undefined;
253
256
  assessment: ReportAssessmentInput | null | undefined;
254
257
  resolveBand: (score: number) => StageBand | null;
255
258
  /** the parsed bands, for band-distance derivation */
@@ -0,0 +1,27 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { normaliseLinkedinIdentity } from "./linkedin-identity.ts";
3
+
4
+ describe("normaliseLinkedinIdentity", () => {
5
+ test("collapses every spelling of the same profile to one key", () => {
6
+ expect(normaliseLinkedinIdentity("https://www.linkedin.com/in/annaosherov/")).toBe(
7
+ "linkedin.com/in/annaosherov",
8
+ );
9
+ expect(normaliseLinkedinIdentity("linkedin.com/in/AnnaOsherov")).toBe(
10
+ "linkedin.com/in/annaosherov",
11
+ );
12
+ expect(normaliseLinkedinIdentity(" LinkedIn.com/in/annaosherov/ ")).toBe(
13
+ "linkedin.com/in/annaosherov",
14
+ );
15
+ expect(normaliseLinkedinIdentity("http://www.linkedin.com/in/annaosherov")).toBe(
16
+ "linkedin.com/in/annaosherov",
17
+ );
18
+ });
19
+
20
+ test("refuses non-linkedin, empty and absent input rather than guessing a key", () => {
21
+ expect(normaliseLinkedinIdentity("https://example.com/in/someone")).toBeNull();
22
+ expect(normaliseLinkedinIdentity(" ")).toBeNull();
23
+ expect(normaliseLinkedinIdentity("")).toBeNull();
24
+ expect(normaliseLinkedinIdentity(null)).toBeNull();
25
+ expect(normaliseLinkedinIdentity(undefined)).toBeNull();
26
+ });
27
+ });