@northstar-js/contracts 0.0.0-stage → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ali Amaan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Placeholder fixtures. Display strings use placeholder tokens only; numeric
3
+ * values are obviously synthetic (zeros and even splits), never plausible results.
4
+ */
5
+ import type { Distribution, FigureValue, Study } from './index.js';
6
+ export declare const placeholderDistribution: Distribution;
7
+ export interface FigureFixture {
8
+ figure: FigureValue;
9
+ /** How the figure would be displayed, in placeholder tokens. */
10
+ display: string;
11
+ }
12
+ export declare const figures: {
13
+ readonly level: {
14
+ readonly figure: {
15
+ readonly value: 0;
16
+ readonly band: 0;
17
+ readonly claim: "level";
18
+ readonly caption: "[SHARE] ± [BAND] of [N] respondents.";
19
+ readonly state: "ok";
20
+ };
21
+ readonly display: "[SHARE] ± [BAND]";
22
+ };
23
+ readonly direction: {
24
+ readonly figure: {
25
+ readonly value: 0;
26
+ readonly claim: "direction";
27
+ readonly caption: "Direction only; the level is not reported.";
28
+ readonly state: "ok";
29
+ };
30
+ readonly display: "[OPTION] leads";
31
+ };
32
+ readonly ranking: {
33
+ readonly figure: {
34
+ readonly value: 0;
35
+ readonly claim: "ranking";
36
+ readonly caption: "Ranking between items, never the level.";
37
+ readonly state: "ok";
38
+ };
39
+ readonly display: "[OPTION] ranks first of [N]";
40
+ };
41
+ readonly withheld: {
42
+ readonly figure: {
43
+ readonly value: 0;
44
+ readonly claim: "level";
45
+ readonly caption: "Withheld: below the reporting gate.";
46
+ readonly state: "withheld";
47
+ };
48
+ readonly display: "[SHARE]";
49
+ };
50
+ readonly stale: {
51
+ readonly figure: {
52
+ readonly value: 0;
53
+ readonly band: 0;
54
+ readonly claim: "level";
55
+ readonly caption: "Stale: panel [SEED] has been rebuilt.";
56
+ readonly state: "stale";
57
+ };
58
+ readonly display: "[SHARE] ± [BAND]";
59
+ };
60
+ };
61
+ export declare const studyAurora: Study;
62
+ export declare const studyBorealis: Study;
63
+ export declare const studyCassiopeia: Study;
64
+ export declare const studyDraco: Study;
65
+ export declare const studies: readonly Study[];
66
+ //# sourceMappingURL=fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAInE,eAAO,MAAM,uBAAuB,EAAE,YAGrC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,WAAW,CAAC;IACpB,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqB8B,CAAC;AAEnD,eAAO,MAAM,WAAW,EAAE,KAUzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA2B3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAU7B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,SAAS,KAAK,EAA8D,CAAC"}
@@ -0,0 +1,88 @@
1
+ const ANCHORS = ['[OPTION] 1', '[OPTION] 2', '[OPTION] 3', '[OPTION] 4', '[OPTION] 5'];
2
+ export const placeholderDistribution = {
3
+ anchors: ANCHORS,
4
+ shares: [0.2, 0.2, 0.2, 0.2, 0.2],
5
+ };
6
+ export const figures = {
7
+ level: {
8
+ figure: { value: 0, band: 0, claim: 'level', caption: '[SHARE] ± [BAND] of [N] respondents.', state: 'ok' },
9
+ display: '[SHARE] ± [BAND]',
10
+ },
11
+ direction: {
12
+ figure: { value: 0, claim: 'direction', caption: 'Direction only; the level is not reported.', state: 'ok' },
13
+ display: '[OPTION] leads',
14
+ },
15
+ ranking: {
16
+ figure: { value: 0, claim: 'ranking', caption: 'Ranking between items, never the level.', state: 'ok' },
17
+ display: '[OPTION] ranks first of [N]',
18
+ },
19
+ withheld: {
20
+ figure: { value: 0, claim: 'level', caption: 'Withheld: below the reporting gate.', state: 'withheld' },
21
+ display: '[SHARE]',
22
+ },
23
+ stale: {
24
+ figure: { value: 0, band: 0, claim: 'level', caption: 'Stale: panel [SEED] has been rebuilt.', state: 'stale' },
25
+ display: '[SHARE] ± [BAND]',
26
+ },
27
+ };
28
+ export const studyAurora = {
29
+ id: 'study-aurora',
30
+ title: 'Study Aurora',
31
+ state: 'draft',
32
+ tab: 'brief',
33
+ population: { code: 'FI', size: 0, label: '[N] adults, seed [SEED]' },
34
+ objectives: ['Screen [OPTION] against [OPTION].'],
35
+ items: [],
36
+ createdAt: '2026-01-01T00:00:00.000Z',
37
+ cost: null,
38
+ };
39
+ export const studyBorealis = {
40
+ id: 'study-borealis',
41
+ title: 'Study Borealis',
42
+ state: 'complete',
43
+ tab: 'responses',
44
+ population: { code: 'FI', panelId: 'panel-borealis', size: 0, seed: 0, label: '[N] adults, seed [SEED]' },
45
+ objectives: ['Rank [OPTION] options for [NAME].'],
46
+ items: [
47
+ {
48
+ key: 'item-1',
49
+ question: '[NAME]: how much do you agree with [OPTION]?',
50
+ type: 'mood_direction',
51
+ format: 'likert',
52
+ anchors: ANCHORS,
53
+ result: { distribution: placeholderDistribution, headline: figures.level.figure },
54
+ },
55
+ {
56
+ key: 'item-2',
57
+ question: '[NAME]: would you choose [OPTION]?',
58
+ type: 'intention_virtue',
59
+ format: 'likert',
60
+ anchors: ANCHORS,
61
+ result: { distribution: placeholderDistribution, headline: figures.direction.figure },
62
+ },
63
+ ],
64
+ createdAt: '2026-01-01T00:00:00.000Z',
65
+ cost: { amount: 0, currency: 'EUR', basis: '[COST] per [N] respondents' },
66
+ };
67
+ export const studyCassiopeia = {
68
+ id: 'study-cassiopeia',
69
+ title: 'Study Cassiopeia',
70
+ state: 'running',
71
+ tab: 'research',
72
+ population: { code: 'JP', size: 0, label: '[N] adults' },
73
+ objectives: ['Direction of [OPTION] for [NAME].'],
74
+ items: [{ key: 'item-1', question: '[NAME]: [OPTION]?', type: 'concrete_habit', anchors: ANCHORS }],
75
+ createdAt: '2026-01-01T00:00:00.000Z',
76
+ cost: { amount: 0, currency: 'EUR', basis: '[COST] estimate' },
77
+ };
78
+ export const studyDraco = {
79
+ id: 'study-draco',
80
+ title: 'Study Draco',
81
+ state: 'failed',
82
+ population: { code: 'US', size: 0 },
83
+ objectives: [],
84
+ items: [],
85
+ createdAt: '2026-01-01T00:00:00.000Z',
86
+ };
87
+ export const studies = [studyAurora, studyBorealis, studyCassiopeia, studyDraco];
88
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.js","sourceRoot":"","sources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E,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,4BAA4B,EAAE;CAC1E,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAU;IACpC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,kBAAkB;IACzB,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,UAAU;IACf,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE;IACxD,UAAU,EAAE,CAAC,mCAAmC,CAAC;IACjD,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IACnG,SAAS,EAAE,0BAA0B;IACrC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE;CAC/D,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,QAAQ;IACf,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE;IACnC,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,0BAA0B;CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Shared Northstar types. Field names follow the engine
3
+ * (northstar-engine backend/app/models/schemas.py, services/citizen/studies.py
4
+ * and population.py), translated to camelCase.
5
+ */
6
+ /** Lifecycle of a study as the studio shows it. */
7
+ export type StudyState = 'draft' | 'ready' | 'running' | 'complete' | 'partial' | 'failed' | 'archived';
8
+ /** Studio tabs for a study. */
9
+ export type StudyTab = 'brief' | 'population' | 'research' | 'responses';
10
+ /** What a figure may claim: a level, only a direction, or only a ranking. */
11
+ export type ClaimClass = 'level' | 'direction' | 'ranking';
12
+ /** Placeholder tokens used in fixtures and display strings instead of real values. */
13
+ export type PlaceholderToken = '[SHARE]' | '[BAND]' | '[N]' | '[SEED]' | '[OPTION]' | '[COST]' | '[NAME]';
14
+ export declare const PLACEHOLDER_TOKENS: readonly ["[SHARE]", "[BAND]", "[N]", "[SEED]", "[OPTION]", "[COST]", "[NAME]"];
15
+ /** Engine question types (StudyQuestion.question_type), which select the reliability band. */
16
+ export type QuestionType = 'mood_direction' | 'consensus_trust' | 'neutral_factual' | 'concrete_habit' | 'values_identity' | 'intention_virtue';
17
+ /** Engine response formats (StudyQuestion.format). */
18
+ export type ResponseFormat = 'likert' | 'single_choice' | 'multi_select' | 'ranking' | 'free_text' | 'price_trial';
19
+ /** One displayed number. `band` is in percentage points; omit when no defensible band exists. */
20
+ export interface FigureValue {
21
+ value: number;
22
+ band?: number;
23
+ claim?: ClaimClass;
24
+ /** The sentence that qualifies the figure. */
25
+ caption?: string;
26
+ state?: 'ok' | 'withheld' | 'stale';
27
+ }
28
+ /** A Likert or option distribution; `shares[i]` belongs to `anchors[i]`. */
29
+ export interface Distribution {
30
+ anchors: string[];
31
+ shares: number[];
32
+ }
33
+ export type MarketStatus = 'roster-ready' | 'covered' | 'registered' | 'none';
34
+ export interface MarketStatusEntry {
35
+ /** ISO 3166-1 alpha-2 code. */
36
+ code: string;
37
+ status: MarketStatus;
38
+ /** For 'covered': the market whose roster covers this one. */
39
+ coveredBy?: string;
40
+ }
41
+ /** Estimated run cost, or null when no estimate exists. */
42
+ export type CostEstimate = {
43
+ amount: number;
44
+ currency: string;
45
+ basis: string;
46
+ } | null;
47
+ /** The panel a study runs against (engine PopulationSpec / PanelCreateRequest). */
48
+ export interface PopulationRef {
49
+ /** Market code, e.g. 'FI'. */
50
+ code: string;
51
+ panelId?: string;
52
+ /** Panel size (engine `count`). */
53
+ size: number;
54
+ seed?: number;
55
+ label?: string;
56
+ }
57
+ /** One question in the battery (engine StudyQuestion). */
58
+ export interface ResearchItem {
59
+ key: string;
60
+ question: string;
61
+ type: QuestionType;
62
+ format?: ResponseFormat;
63
+ /** One anchor sentence per Likert step, step 1 first. */
64
+ anchors?: string[];
65
+ options?: string[];
66
+ result?: {
67
+ distribution: Distribution;
68
+ headline?: FigureValue;
69
+ };
70
+ }
71
+ export interface Study {
72
+ id: string;
73
+ title: string;
74
+ state: StudyState;
75
+ tab?: StudyTab;
76
+ population: PopulationRef;
77
+ objectives: string[];
78
+ items: ResearchItem[];
79
+ /** ISO 8601 timestamp. */
80
+ createdAt: string;
81
+ updatedAt?: string;
82
+ cost?: CostEstimate;
83
+ }
84
+ /**
85
+ * Known market statuses. FI and JP have raked rosters, AX is served by the
86
+ * FI roster, US is registered without a roster (engine population.py).
87
+ */
88
+ export declare const MARKET_STATUS: {
89
+ readonly FI: {
90
+ readonly code: "FI";
91
+ readonly status: "roster-ready";
92
+ };
93
+ readonly JP: {
94
+ readonly code: "JP";
95
+ readonly status: "roster-ready";
96
+ };
97
+ readonly AX: {
98
+ readonly code: "AX";
99
+ readonly status: "covered";
100
+ readonly coveredBy: "FI";
101
+ };
102
+ readonly US: {
103
+ readonly code: "US";
104
+ readonly status: "registered";
105
+ };
106
+ };
107
+ export type KnownMarketCode = keyof typeof MARKET_STATUS;
108
+ /** Status for any market code (case-insensitive); unknown codes are 'none'. */
109
+ export declare function marketStatus(code: string): MarketStatusEntry;
110
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mDAAmD;AACnD,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,OAAO,GACP,SAAS,GACT,UAAU,GACV,SAAS,GACT,QAAQ,GACR,UAAU,CAAC;AA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e,GAAG,MAAM,OAAO,aAAa,CAAC;AAEzD,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAI5D"}
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared Northstar types. Field names follow the engine
3
+ * (northstar-engine backend/app/models/schemas.py, services/citizen/studies.py
4
+ * and population.py), translated to camelCase.
5
+ */
6
+ export const PLACEHOLDER_TOKENS = [
7
+ '[SHARE]',
8
+ '[BAND]',
9
+ '[N]',
10
+ '[SEED]',
11
+ '[OPTION]',
12
+ '[COST]',
13
+ '[NAME]',
14
+ ];
15
+ /**
16
+ * Known market statuses. FI and JP have raked rosters, AX is served by the
17
+ * FI roster, US is registered without a roster (engine population.py).
18
+ */
19
+ export const MARKET_STATUS = {
20
+ FI: { code: 'FI', status: 'roster-ready' },
21
+ JP: { code: 'JP', status: 'roster-ready' },
22
+ AX: { code: 'AX', status: 'covered', coveredBy: 'FI' },
23
+ US: { code: 'US', status: 'registered' },
24
+ };
25
+ /** Status for any market code (case-insensitive); unknown codes are 'none'. */
26
+ export function marketStatus(code) {
27
+ const upper = code.trim().toUpperCase();
28
+ const known = MARKET_STATUS[upper];
29
+ return known ? { ...known } : { code: upper, status: 'none' };
30
+ }
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqBH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS;IACT,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,QAAQ;CACsC,CAAC;AAmFjD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE;IAC1C,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE;IAC1C,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE;IACtD,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE;CACY,CAAC;AAIvD,+EAA+E;AAC/E,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACxC,MAAM,KAAK,GAAI,aAA+D,CAAC,KAAK,CAAC,CAAC;IACtF,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAChE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "@northstar-js/contracts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "React-free shared types and placeholder fixtures for Northstar packages.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ },
21
+ "./fixtures": {
22
+ "types": "./dist/fixtures.d.ts",
23
+ "import": "./dist/fixtures.js"
24
+ }
25
+ },
26
+ "devDependencies": {
27
+ "expect-type": "1.2.2",
28
+ "typescript": "5.9.3",
29
+ "vitest": "3.2.7"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/ali-amaan/northstar-design-system.git",
34
+ "directory": "packages/contracts"
35
+ },
36
+ "homepage": "https://ali-amaan.github.io/northstar-design-system/",
37
+ "bugs": {
38
+ "url": "https://github.com/ali-amaan/northstar-design-system/issues"
39
+ },
40
+ "scripts": {
41
+ "build": "tsc -p tsconfig.build.json",
42
+ "typecheck": "tsc -p tsconfig.json --noEmit",
43
+ "test": "vitest run --typecheck"
44
+ }
6
45
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.