@teamscala/service-boot 0.23.474 → 0.23.478
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
|
@@ -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
|
|
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 ?? "",
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
type ReportAssessmentInput,
|
|
15
15
|
type StageBand,
|
|
16
16
|
} from "./assessment-report-data.ts";
|
|
17
|
+
import { assessmentResearchFindingsSchema } from "@teamscala/db-validation/generated/assessment-research-findings";
|
|
17
18
|
|
|
18
19
|
const ANNA_LINKEDIN_RAW = "https://www.linkedin.com/in/annaosherov/";
|
|
19
20
|
const ANNA_KEY = "linkedin.com/in/annaosherov";
|
|
@@ -173,7 +174,17 @@ describe("research shaping", () => {
|
|
|
173
174
|
).toThrow(/superseded/);
|
|
174
175
|
});
|
|
175
176
|
|
|
176
|
-
|
|
177
|
+
// The db-validation generated schema is the contract this parse enforces.
|
|
178
|
+
// While the generated artifact is still the permissive v.record fallback
|
|
179
|
+
// (the codegen engine that emits the faithful schema embeds
|
|
180
|
+
// STRUCTURED_JSONB_KEYS at its build and needs an engine rebuild with
|
|
181
|
+
// @teamscala/codegen >= 2.1.585 — then `scala-tools codegen run --output
|
|
182
|
+
// db-column-validation --force`, publish db-validation, bump here), this
|
|
183
|
+
// test activates itself: the skip is a property of the shipped artifact,
|
|
184
|
+
// not of the expectation.
|
|
185
|
+
const schemaIsFaithful = !("key" in (assessmentResearchFindingsSchema as object));
|
|
186
|
+
const enforceTest = schemaIsFaithful ? test : test.skip;
|
|
187
|
+
enforceTest("malformed authored findings throw instead of silently rendering garbage", () => {
|
|
177
188
|
expect(() => readResearchFindings({ groups: "not-an-array" })).toThrow();
|
|
178
189
|
});
|
|
179
190
|
});
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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
|
+
});
|