@sessionplan/contracts 0.1.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/README.md +70 -0
- package/dist/common.d.ts +37 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +9 -0
- package/dist/common.js.map +1 -0
- package/dist/context.d.ts +239 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +2 -0
- package/dist/context.js.map +1 -0
- package/dist/exercises.d.ts +106 -0
- package/dist/exercises.d.ts.map +1 -0
- package/dist/exercises.js +2 -0
- package/dist/exercises.js.map +1 -0
- package/dist/health.d.ts +23 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +2 -0
- package/dist/health.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/logs.d.ts +207 -0
- package/dist/logs.d.ts.map +1 -0
- package/dist/logs.js +2 -0
- package/dist/logs.js.map +1 -0
- package/dist/profile.d.ts +77 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +2 -0
- package/dist/profile.js.map +1 -0
- package/dist/reports.d.ts +135 -0
- package/dist/reports.d.ts.map +1 -0
- package/dist/reports.js +5 -0
- package/dist/reports.js.map +1 -0
- package/dist/sessions.d.ts +82 -0
- package/dist/sessions.d.ts.map +1 -0
- package/dist/sessions.js +2 -0
- package/dist/sessions.js.map +1 -0
- package/dist/workspaces.d.ts +100 -0
- package/dist/workspaces.d.ts.map +1 -0
- package/dist/workspaces.js +2 -0
- package/dist/workspaces.js.map +1 -0
- package/package.json +35 -0
package/dist/logs.d.ts
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance log content (perf-2 format) and the computed performance summary
|
|
3
|
+
* the API assembles for AI report generation.
|
|
4
|
+
*/
|
|
5
|
+
import type { UnitSystem } from './common.js';
|
|
6
|
+
/** Performance data for a single exercise in one round/set. */
|
|
7
|
+
export interface ExercisePerformance {
|
|
8
|
+
key: string;
|
|
9
|
+
name: string;
|
|
10
|
+
weight?: number;
|
|
11
|
+
angle?: number;
|
|
12
|
+
multiplier?: number;
|
|
13
|
+
reps?: number;
|
|
14
|
+
rpe?: number;
|
|
15
|
+
timeSeconds?: number;
|
|
16
|
+
holdSeconds?: number;
|
|
17
|
+
distanceMeters?: number;
|
|
18
|
+
distanceMiles?: number;
|
|
19
|
+
side?: 'L' | 'R' | 'B';
|
|
20
|
+
tempo?: string;
|
|
21
|
+
completed?: boolean;
|
|
22
|
+
notes?: string;
|
|
23
|
+
}
|
|
24
|
+
/** One set of a standalone exercise. */
|
|
25
|
+
export interface SetEntry {
|
|
26
|
+
set?: number;
|
|
27
|
+
weight?: number;
|
|
28
|
+
angle?: number;
|
|
29
|
+
multiplier?: number;
|
|
30
|
+
reps?: number;
|
|
31
|
+
rpe?: number;
|
|
32
|
+
timeSeconds?: number;
|
|
33
|
+
holdSeconds?: number;
|
|
34
|
+
distanceMeters?: number;
|
|
35
|
+
distanceMiles?: number;
|
|
36
|
+
side?: 'L' | 'R' | 'B';
|
|
37
|
+
tempo?: string;
|
|
38
|
+
restSeconds?: number;
|
|
39
|
+
completed?: boolean;
|
|
40
|
+
notes?: string;
|
|
41
|
+
}
|
|
42
|
+
/** One complete round through a superset or circuit. */
|
|
43
|
+
export interface Round {
|
|
44
|
+
round: number;
|
|
45
|
+
prescribedRestSeconds?: number;
|
|
46
|
+
actualRestSeconds?: number;
|
|
47
|
+
notes?: string;
|
|
48
|
+
exercises: ExercisePerformance[];
|
|
49
|
+
}
|
|
50
|
+
/** Session item: standalone exercise, superset, or circuit. */
|
|
51
|
+
export interface PerformanceItem {
|
|
52
|
+
kind: 'exercise' | 'superset' | 'circuit';
|
|
53
|
+
name: string;
|
|
54
|
+
key?: string;
|
|
55
|
+
notes?: string;
|
|
56
|
+
sets?: SetEntry[];
|
|
57
|
+
rounds?: Round[];
|
|
58
|
+
}
|
|
59
|
+
/** Section categories in a performance log. */
|
|
60
|
+
export type SectionType = 'Warm-up' | 'Main Work' | 'Strength' | 'Conditioning' | 'Accessory/Core' | 'Cooldown/Recovery' | 'Recovery' | 'Mobility';
|
|
61
|
+
/** Section within a performance log. */
|
|
62
|
+
export interface PerformanceSection {
|
|
63
|
+
type: SectionType;
|
|
64
|
+
title: string;
|
|
65
|
+
notes?: string;
|
|
66
|
+
items: PerformanceItem[];
|
|
67
|
+
}
|
|
68
|
+
/** Pre-computed summary for fast queries. */
|
|
69
|
+
export interface ExerciseSummary {
|
|
70
|
+
name: string;
|
|
71
|
+
angle?: number;
|
|
72
|
+
sectionType?: SectionType;
|
|
73
|
+
sectionPath?: string;
|
|
74
|
+
totalSets: number;
|
|
75
|
+
totalRounds: number;
|
|
76
|
+
totalReps?: number;
|
|
77
|
+
avgRpe?: number;
|
|
78
|
+
maxWeight?: number;
|
|
79
|
+
totalVolume: number;
|
|
80
|
+
jsonPaths?: string[];
|
|
81
|
+
}
|
|
82
|
+
/** Full performance log content (perf-2 format). */
|
|
83
|
+
export interface PerformanceLogContent {
|
|
84
|
+
version: 'perf-2';
|
|
85
|
+
unitSystem?: UnitSystem;
|
|
86
|
+
sessionFile: string;
|
|
87
|
+
workspaceId?: string;
|
|
88
|
+
personaId?: string;
|
|
89
|
+
userId?: string;
|
|
90
|
+
teamIds?: string[];
|
|
91
|
+
timestamp: string;
|
|
92
|
+
date?: string;
|
|
93
|
+
title?: string;
|
|
94
|
+
block?: number;
|
|
95
|
+
week?: number;
|
|
96
|
+
notes?: string;
|
|
97
|
+
quickLog?: boolean;
|
|
98
|
+
completionStatus?: 'completed' | 'partial' | 'skipped';
|
|
99
|
+
sessionRpe?: number;
|
|
100
|
+
painType?: 'none' | 'soreness' | 'acute';
|
|
101
|
+
skippedSections?: string[];
|
|
102
|
+
device?: Record<string, unknown>;
|
|
103
|
+
sections: PerformanceSection[];
|
|
104
|
+
exerciseIndex?: Record<string, ExerciseSummary>;
|
|
105
|
+
}
|
|
106
|
+
/** Request body for creating a performance log. */
|
|
107
|
+
export interface CreateLogRequest {
|
|
108
|
+
session_id?: string;
|
|
109
|
+
performed_at?: string;
|
|
110
|
+
content: PerformanceLogContent;
|
|
111
|
+
notes?: string;
|
|
112
|
+
}
|
|
113
|
+
/** Request body for updating a performance log. */
|
|
114
|
+
export interface UpdateLogRequest {
|
|
115
|
+
performed_at?: string;
|
|
116
|
+
content?: PerformanceLogContent;
|
|
117
|
+
notes?: string;
|
|
118
|
+
}
|
|
119
|
+
/** Performance log as stored in the database / returned for a single log. */
|
|
120
|
+
export interface PerformanceLogRow {
|
|
121
|
+
id: string;
|
|
122
|
+
user_id: string;
|
|
123
|
+
workspace_id: string;
|
|
124
|
+
session_id: string | null;
|
|
125
|
+
performed_at: string;
|
|
126
|
+
content: PerformanceLogContent;
|
|
127
|
+
exercise_index: Record<string, ExerciseSummary> | null;
|
|
128
|
+
notes: string | null;
|
|
129
|
+
created_at: string;
|
|
130
|
+
updated_at?: string;
|
|
131
|
+
}
|
|
132
|
+
/** Summary view of a log in list responses. */
|
|
133
|
+
export interface LogSummary {
|
|
134
|
+
id: string;
|
|
135
|
+
user_id: string;
|
|
136
|
+
session_id: string | null;
|
|
137
|
+
performed_at: string;
|
|
138
|
+
title: string | null;
|
|
139
|
+
exercise_count: number;
|
|
140
|
+
total_volume: number;
|
|
141
|
+
avg_rpe: number | null;
|
|
142
|
+
notes: string | null;
|
|
143
|
+
unitSystem?: UnitSystem;
|
|
144
|
+
quickLog?: boolean;
|
|
145
|
+
completionStatus?: 'completed' | 'partial' | 'skipped';
|
|
146
|
+
painType?: 'none' | 'soreness' | 'acute';
|
|
147
|
+
}
|
|
148
|
+
/** List logs response with cursor pagination. */
|
|
149
|
+
export interface ListLogsResponse {
|
|
150
|
+
data: LogSummary[];
|
|
151
|
+
pagination: {
|
|
152
|
+
cursor: string | null;
|
|
153
|
+
has_more: boolean;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/** Volume trend for a single exercise. */
|
|
157
|
+
export interface ExerciseVolumeTrend {
|
|
158
|
+
exercise: string;
|
|
159
|
+
firstSession: {
|
|
160
|
+
load: string;
|
|
161
|
+
reps: number;
|
|
162
|
+
date: string;
|
|
163
|
+
};
|
|
164
|
+
lastSession: {
|
|
165
|
+
load: string;
|
|
166
|
+
reps: number;
|
|
167
|
+
date: string;
|
|
168
|
+
};
|
|
169
|
+
totalVolume: number;
|
|
170
|
+
sessions: number;
|
|
171
|
+
}
|
|
172
|
+
/** Personal record achievement. */
|
|
173
|
+
export interface PRRecord {
|
|
174
|
+
exercise: string;
|
|
175
|
+
achievement: string;
|
|
176
|
+
date: string;
|
|
177
|
+
}
|
|
178
|
+
/** Exercise frequency data. */
|
|
179
|
+
export interface ExerciseFrequencyItem {
|
|
180
|
+
exercise: string;
|
|
181
|
+
count: number;
|
|
182
|
+
lastPerformed: string;
|
|
183
|
+
}
|
|
184
|
+
/** Block-specific info (for block-progression programs). */
|
|
185
|
+
export interface BlockInfo {
|
|
186
|
+
range: string;
|
|
187
|
+
weekRange?: string;
|
|
188
|
+
deloadWeeks: string[];
|
|
189
|
+
}
|
|
190
|
+
/** Per-muscle-group volume rollup (weekly hard sets). */
|
|
191
|
+
export interface MuscleGroupVolume {
|
|
192
|
+
muscle: string;
|
|
193
|
+
totalSets: number;
|
|
194
|
+
weeklySets: number;
|
|
195
|
+
}
|
|
196
|
+
/** Complete performance summary sent to AI for report generation. */
|
|
197
|
+
export interface PerformanceSummary {
|
|
198
|
+
sessionCount: number;
|
|
199
|
+
adherence: number;
|
|
200
|
+
avgRPE: number;
|
|
201
|
+
volumeTrends: ExerciseVolumeTrend[];
|
|
202
|
+
prs: PRRecord[];
|
|
203
|
+
exerciseFrequency: ExerciseFrequencyItem[];
|
|
204
|
+
blockInfo?: BlockInfo;
|
|
205
|
+
muscleGroupVolume: MuscleGroupVolume[];
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0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AC;IAChB,iBAAiB,EAAE,qBAAqB,EAAE,CAAC;IAC3C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;CACxC"}
|
package/dist/logs.js
ADDED
package/dist/logs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Physical profile and training-context narrative shapes.
|
|
3
|
+
*
|
|
4
|
+
* Physical profile is identity-level (stored on the profiles table). Training
|
|
5
|
+
* context is per-workspace narrative + programming configuration consumed by
|
|
6
|
+
* the generation context.
|
|
7
|
+
*/
|
|
8
|
+
import type { UnitSystem } from './common.js';
|
|
9
|
+
export interface PhysicalProfile {
|
|
10
|
+
dateOfBirth?: string;
|
|
11
|
+
gender?: string;
|
|
12
|
+
heightFeet?: number;
|
|
13
|
+
heightInches?: number;
|
|
14
|
+
heightCm?: number;
|
|
15
|
+
weight?: number;
|
|
16
|
+
/** @deprecated Read-only fallback. New writes go to weight + unitSystem. */
|
|
17
|
+
weightLb?: number;
|
|
18
|
+
unitSystem?: UnitSystem;
|
|
19
|
+
}
|
|
20
|
+
/** A planned session within the weekly structure. */
|
|
21
|
+
export interface PlannedSession {
|
|
22
|
+
/** Session type: "upper-body", "lower-body", "full-body", "mobility", "recovery" */
|
|
23
|
+
sessionType: string;
|
|
24
|
+
/** Optional user-facing label (e.g., "Push Day", "Active Recovery") */
|
|
25
|
+
label?: string;
|
|
26
|
+
/** Optional day hint ("mon", "tue", etc.) — not enforced, just guidance */
|
|
27
|
+
day?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface TrainingProgramConfig {
|
|
30
|
+
name: string;
|
|
31
|
+
/** Slug of the selected program template, or undefined if Custom */
|
|
32
|
+
templateSlug?: string;
|
|
33
|
+
volumePhilosophy: '2-3-sets' | 'moderate' | 'high-volume';
|
|
34
|
+
supersetStrategy: 'antagonist-preferred' | 'synergist-ok' | 'no-supersets';
|
|
35
|
+
progressionModel?: 'linear' | 'block' | 'undulating' | 'autoregulated';
|
|
36
|
+
weeklyDeduplication: boolean;
|
|
37
|
+
/** What sessions make up a week — required for Full Week generation mode */
|
|
38
|
+
weeklyPlan?: PlannedSession[];
|
|
39
|
+
}
|
|
40
|
+
export interface Sport {
|
|
41
|
+
name: string;
|
|
42
|
+
day?: string;
|
|
43
|
+
note?: string;
|
|
44
|
+
}
|
|
45
|
+
export type NarrativeBlockKey = 'goals' | 'program' | 'custom_instructions' | 'sport_context';
|
|
46
|
+
export type ProfileContextEventBlock = NarrativeBlockKey | 'movement_limitations';
|
|
47
|
+
export type ProfileContextWrittenBy = 'ai' | 'user' | 'legacy_import';
|
|
48
|
+
export type ProfileContextSourceChannel = 'chat' | 'manual_edit' | 'onboarding' | 'legacy_import';
|
|
49
|
+
export interface NarrativeBlock {
|
|
50
|
+
text: string;
|
|
51
|
+
written_at: string;
|
|
52
|
+
written_by: ProfileContextWrittenBy;
|
|
53
|
+
}
|
|
54
|
+
export type ProfileNarrativeBlocks = Partial<Record<NarrativeBlockKey, NarrativeBlock>>;
|
|
55
|
+
export type MovementLimitationRegion = 'shoulder' | 'elbow' | 'wrist' | 'hip' | 'knee' | 'ankle' | 'lower_back' | 'neck' | 'other';
|
|
56
|
+
export type AggravatingPattern = 'overhead_press' | 'deep_knee_flexion' | 'spinal_loading' | 'hinge_loading' | 'running_impact' | 'jumping' | 'pulling' | 'pushing' | 'grip_loading';
|
|
57
|
+
export type MovementLimitationStatus = 'active' | 'monitoring' | 'cleared';
|
|
58
|
+
export interface MovementLimitation {
|
|
59
|
+
region: MovementLimitationRegion;
|
|
60
|
+
aggravating_patterns: AggravatingPattern[];
|
|
61
|
+
status: MovementLimitationStatus;
|
|
62
|
+
notes?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface ProfileContextEvent {
|
|
65
|
+
id: string;
|
|
66
|
+
workspace_id: string;
|
|
67
|
+
user_id: string;
|
|
68
|
+
block: ProfileContextEventBlock;
|
|
69
|
+
before_text: string | null;
|
|
70
|
+
after_text: string | null;
|
|
71
|
+
source_text: string | null;
|
|
72
|
+
source_channel: ProfileContextSourceChannel;
|
|
73
|
+
written_at: string;
|
|
74
|
+
written_by: ProfileContextWrittenBy;
|
|
75
|
+
}
|
|
76
|
+
export type ContextGroupId = 'training-preferences' | 'programming' | 'physical-profile' | 'sports-recovery';
|
|
77
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAM9C,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAMD,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;IAC1D,gBAAgB,EAAE,sBAAsB,GAA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,EAAE,wBAAwB,CAAC;IACjC,oBAAoB,EAAE,kBAAkB,EAAE,CAAC;IAC3C,MAAM,EAAE,wBAAwB,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,wBAAwB,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,2BAA2B,CAAC;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,uBAAuB,CAAC;CACrC;AAMD,MAAM,MAAM,cAAc,GACtB,sBAAsB,GACtB,aAAa,GACb,kBAAkB,GAClB,iBAAiB,CAAC"}
|
package/dist/profile.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress report content and list/detail responses.
|
|
3
|
+
*/
|
|
4
|
+
/** Content block within a report section. */
|
|
5
|
+
export interface ContentBlock {
|
|
6
|
+
type: 'paragraph' | 'list';
|
|
7
|
+
text?: string;
|
|
8
|
+
items?: string[];
|
|
9
|
+
ordered?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Row format for exercise progression tables. */
|
|
12
|
+
export interface ExerciseProgressionRow {
|
|
13
|
+
exercise: string;
|
|
14
|
+
firstSession: string;
|
|
15
|
+
peakPerformance: string;
|
|
16
|
+
volumeChange: string;
|
|
17
|
+
volumeChangeSentiment: 'positive' | 'neutral' | 'negative';
|
|
18
|
+
sessions: string;
|
|
19
|
+
}
|
|
20
|
+
/** Table data structure for report tables. */
|
|
21
|
+
export interface TableData {
|
|
22
|
+
type: 'generic' | 'exercise-progression';
|
|
23
|
+
columns: string[];
|
|
24
|
+
rows: string[][] | ExerciseProgressionRow[];
|
|
25
|
+
}
|
|
26
|
+
/** Subsection within strength analysis sections. */
|
|
27
|
+
export interface AnalysisSubsection {
|
|
28
|
+
subtitle: string;
|
|
29
|
+
table: TableData;
|
|
30
|
+
}
|
|
31
|
+
/** Union type for different report section types. */
|
|
32
|
+
export type ReportSection = {
|
|
33
|
+
type: 'highlight-box';
|
|
34
|
+
title: string;
|
|
35
|
+
sentiment: string;
|
|
36
|
+
content: ContentBlock[];
|
|
37
|
+
} | {
|
|
38
|
+
type: 'table';
|
|
39
|
+
title: string;
|
|
40
|
+
table: TableData;
|
|
41
|
+
summary?: string;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'strength-analysis';
|
|
44
|
+
title: string;
|
|
45
|
+
subsections: AnalysisSubsection[];
|
|
46
|
+
} | {
|
|
47
|
+
type: 'text';
|
|
48
|
+
title: string;
|
|
49
|
+
content: ContentBlock[];
|
|
50
|
+
};
|
|
51
|
+
/** KPI (Key Performance Indicator) in report summary. */
|
|
52
|
+
export interface ReportKPI {
|
|
53
|
+
label: string;
|
|
54
|
+
value: string;
|
|
55
|
+
sentiment: 'positive' | 'neutral' | 'negative';
|
|
56
|
+
}
|
|
57
|
+
/** Full report content structure (matches reports/*.json). */
|
|
58
|
+
export interface ReportContent {
|
|
59
|
+
version: string;
|
|
60
|
+
metadata: {
|
|
61
|
+
title: string;
|
|
62
|
+
period: {
|
|
63
|
+
startDate: string;
|
|
64
|
+
endDate: string;
|
|
65
|
+
blockRange: string | null;
|
|
66
|
+
weeks: number;
|
|
67
|
+
};
|
|
68
|
+
generatedDate: string;
|
|
69
|
+
};
|
|
70
|
+
summary: {
|
|
71
|
+
grade: string;
|
|
72
|
+
kpis: ReportKPI[];
|
|
73
|
+
highlights: string[];
|
|
74
|
+
injuryStatus: string;
|
|
75
|
+
};
|
|
76
|
+
sections: ReportSection[];
|
|
77
|
+
}
|
|
78
|
+
/** Report as stored in the database. */
|
|
79
|
+
export interface ReportRow {
|
|
80
|
+
id: string;
|
|
81
|
+
user_id: string;
|
|
82
|
+
workspace_id: string;
|
|
83
|
+
title: string;
|
|
84
|
+
period_start: string;
|
|
85
|
+
period_end: string;
|
|
86
|
+
content: ReportContent;
|
|
87
|
+
content_html: string | null;
|
|
88
|
+
generated_at: string;
|
|
89
|
+
created_at: string;
|
|
90
|
+
}
|
|
91
|
+
/** Request body for generating a new report. */
|
|
92
|
+
export interface GenerateReportRequest {
|
|
93
|
+
periodStart: string;
|
|
94
|
+
periodEnd: string;
|
|
95
|
+
title?: string;
|
|
96
|
+
customInstructions?: string;
|
|
97
|
+
excludeContextGroups?: string[];
|
|
98
|
+
}
|
|
99
|
+
/** Request body for saving a pre-generated report. */
|
|
100
|
+
export interface SaveReportRequest {
|
|
101
|
+
title?: string;
|
|
102
|
+
periodStart: string;
|
|
103
|
+
periodEnd: string;
|
|
104
|
+
content: ReportContent;
|
|
105
|
+
source?: 'reports-page' | 'week-generation';
|
|
106
|
+
}
|
|
107
|
+
/** Summary item for the report list endpoint. */
|
|
108
|
+
export interface ReportListItem {
|
|
109
|
+
id: string;
|
|
110
|
+
title: string;
|
|
111
|
+
period_start: string;
|
|
112
|
+
period_end: string;
|
|
113
|
+
grade: string;
|
|
114
|
+
generated_at: string;
|
|
115
|
+
}
|
|
116
|
+
export interface ReportPagination {
|
|
117
|
+
total: number;
|
|
118
|
+
page: number;
|
|
119
|
+
limit: number;
|
|
120
|
+
hasMore: boolean;
|
|
121
|
+
}
|
|
122
|
+
export interface ListReportsResponse {
|
|
123
|
+
data: ReportListItem[];
|
|
124
|
+
pagination: ReportPagination;
|
|
125
|
+
}
|
|
126
|
+
export interface GetReportResponse {
|
|
127
|
+
data: ReportRow;
|
|
128
|
+
}
|
|
129
|
+
export interface GenerateReportResponse {
|
|
130
|
+
data: ReportRow;
|
|
131
|
+
}
|
|
132
|
+
export interface DeleteReportResponse {
|
|
133
|
+
success: true;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=reports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../src/reports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;IAC3D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8CAA8C;AAC9C,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,GAAG,sBAAsB,CAAC;IACzC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,sBAAsB,EAAE,CAAC;CAC7C;AAED,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,qDAAqD;AACrD,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,GACpF;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IA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version":3,"file":"reports.js","sourceRoot":"","sources":["../src/reports.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session create/update requests and responses.
|
|
3
|
+
*/
|
|
4
|
+
import type { JsonValue, SessionScope, PaginationParams, PaginationMeta } from './common.js';
|
|
5
|
+
export interface SessionListParams extends PaginationParams {
|
|
6
|
+
search?: string;
|
|
7
|
+
from?: string;
|
|
8
|
+
to?: string;
|
|
9
|
+
scheduled_from?: string;
|
|
10
|
+
scheduled_to?: string;
|
|
11
|
+
source?: string;
|
|
12
|
+
location_id?: string;
|
|
13
|
+
team_id?: string;
|
|
14
|
+
scope?: SessionScope;
|
|
15
|
+
sort?: 'created_at' | 'scheduled_for' | 'title';
|
|
16
|
+
order?: 'asc' | 'desc';
|
|
17
|
+
block?: number;
|
|
18
|
+
week?: number;
|
|
19
|
+
type?: string;
|
|
20
|
+
tags?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SessionCreateRequest {
|
|
23
|
+
title: string;
|
|
24
|
+
block_number?: number;
|
|
25
|
+
week_number?: number;
|
|
26
|
+
session_type?: string;
|
|
27
|
+
/** SessionPlan JSON. */
|
|
28
|
+
content: JsonValue;
|
|
29
|
+
source?: string;
|
|
30
|
+
location_id?: string;
|
|
31
|
+
scheduled_for?: string;
|
|
32
|
+
team_id?: string;
|
|
33
|
+
scope?: SessionScope;
|
|
34
|
+
}
|
|
35
|
+
export interface SessionUpdateRequest {
|
|
36
|
+
title?: string;
|
|
37
|
+
block_number?: number;
|
|
38
|
+
week_number?: number;
|
|
39
|
+
session_type?: string;
|
|
40
|
+
content?: JsonValue;
|
|
41
|
+
source?: string;
|
|
42
|
+
location_id?: string;
|
|
43
|
+
scheduled_for?: string;
|
|
44
|
+
team_id?: string;
|
|
45
|
+
scope?: SessionScope;
|
|
46
|
+
}
|
|
47
|
+
/** Session with scope info for API responses (the single-session payload). */
|
|
48
|
+
export interface SessionWithScope {
|
|
49
|
+
id: string;
|
|
50
|
+
user_id: string;
|
|
51
|
+
workspace_id: string;
|
|
52
|
+
title: string;
|
|
53
|
+
block_number: number | null;
|
|
54
|
+
week_number: number | null;
|
|
55
|
+
session_type: string | null;
|
|
56
|
+
content: JsonValue;
|
|
57
|
+
source: string;
|
|
58
|
+
location_id: string | null;
|
|
59
|
+
scheduled_for: string | null;
|
|
60
|
+
team_id: string | null;
|
|
61
|
+
scope: SessionScope;
|
|
62
|
+
created_at: string;
|
|
63
|
+
updated_at: string;
|
|
64
|
+
}
|
|
65
|
+
/** Single-session response (GET). */
|
|
66
|
+
export type SessionResponse = SessionWithScope;
|
|
67
|
+
/**
|
|
68
|
+
* Create/update response: the session plus mutation-time advisories.
|
|
69
|
+
* `warnings` flags equipment mismatches; the auto-assignment fields are present
|
|
70
|
+
* on create when the API resolves a default location.
|
|
71
|
+
*/
|
|
72
|
+
export interface SessionMutationResponse extends SessionWithScope {
|
|
73
|
+
warnings?: string[];
|
|
74
|
+
location_auto_assigned?: boolean;
|
|
75
|
+
location_assignment_source?: string | null;
|
|
76
|
+
}
|
|
77
|
+
/** List sessions response. */
|
|
78
|
+
export interface SessionListResponse {
|
|
79
|
+
sessions: SessionWithScope[];
|
|
80
|
+
pagination: PaginationMeta;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../src/sessions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7F,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CA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8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qCAAqC;AACrC,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,0BAA0B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,8BAA8B;AAC9B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,UAAU,EAAE,cAAc,CAAC;CAC5B"}
|
package/dist/sessions.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../src/sessions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace list/detail responses and related team types.
|
|
3
|
+
*/
|
|
4
|
+
import type { WorkspaceRole, TeamRole } from './common.js';
|
|
5
|
+
/**
|
|
6
|
+
* Known workspace settings keys; additional keys allowed for extensibility.
|
|
7
|
+
*/
|
|
8
|
+
export interface WorkspaceSettings {
|
|
9
|
+
autoJoinNewUsers?: boolean;
|
|
10
|
+
autoJoinRole?: 'member' | 'admin';
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface Workspace {
|
|
14
|
+
id: string;
|
|
15
|
+
slug: string;
|
|
16
|
+
display_name: string;
|
|
17
|
+
owner_id: string;
|
|
18
|
+
settings: WorkspaceSettings;
|
|
19
|
+
created_at: string;
|
|
20
|
+
updated_at: string;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkspaceMember {
|
|
23
|
+
id: string;
|
|
24
|
+
workspace_id: string;
|
|
25
|
+
user_id: string;
|
|
26
|
+
role: WorkspaceRole;
|
|
27
|
+
created_at: string;
|
|
28
|
+
profile?: {
|
|
29
|
+
display_name: string | null;
|
|
30
|
+
email: string | null;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface WorkspaceCreateRequest {
|
|
34
|
+
slug: string;
|
|
35
|
+
display_name: string;
|
|
36
|
+
settings?: WorkspaceSettings;
|
|
37
|
+
}
|
|
38
|
+
export interface WorkspaceUpdateRequest {
|
|
39
|
+
display_name?: string;
|
|
40
|
+
settings?: WorkspaceSettings;
|
|
41
|
+
}
|
|
42
|
+
export interface WorkspaceListItem extends Workspace {
|
|
43
|
+
user_role: WorkspaceRole;
|
|
44
|
+
member_count: number;
|
|
45
|
+
}
|
|
46
|
+
export interface WorkspaceWithContext extends Workspace {
|
|
47
|
+
members: WorkspaceMember[];
|
|
48
|
+
teams: Team[];
|
|
49
|
+
user_role: WorkspaceRole;
|
|
50
|
+
}
|
|
51
|
+
/** Response for listing the current user's workspaces. */
|
|
52
|
+
export interface WorkspaceListResponse {
|
|
53
|
+
workspaces: WorkspaceListItem[];
|
|
54
|
+
}
|
|
55
|
+
export interface MembersListResponse {
|
|
56
|
+
members: WorkspaceMember[];
|
|
57
|
+
}
|
|
58
|
+
export interface Team {
|
|
59
|
+
id: string;
|
|
60
|
+
workspace_id: string;
|
|
61
|
+
display_name: string;
|
|
62
|
+
settings: Record<string, unknown>;
|
|
63
|
+
created_at: string;
|
|
64
|
+
updated_at: string;
|
|
65
|
+
}
|
|
66
|
+
export interface TeamMember {
|
|
67
|
+
id: string;
|
|
68
|
+
team_id: string;
|
|
69
|
+
user_id: string;
|
|
70
|
+
role: TeamRole;
|
|
71
|
+
created_at: string;
|
|
72
|
+
profile?: {
|
|
73
|
+
display_name: string | null;
|
|
74
|
+
email: string | null;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface TeamWithMembers extends Team {
|
|
78
|
+
members: TeamMember[];
|
|
79
|
+
}
|
|
80
|
+
export interface TeamWithContext extends Team {
|
|
81
|
+
members: Array<{
|
|
82
|
+
id: string;
|
|
83
|
+
team_id: string;
|
|
84
|
+
user_id: string;
|
|
85
|
+
role: TeamRole;
|
|
86
|
+
created_at: string;
|
|
87
|
+
profile?: {
|
|
88
|
+
display_name: string | null;
|
|
89
|
+
email: string | null;
|
|
90
|
+
};
|
|
91
|
+
}>;
|
|
92
|
+
user_role: TeamRole | null;
|
|
93
|
+
}
|
|
94
|
+
export interface TeamsListResponse {
|
|
95
|
+
teams: Team[];
|
|
96
|
+
}
|
|
97
|
+
export interface TeamMembersListResponse {
|
|
98
|
+
members: TeamMember[];
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/workspaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM3D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,CAAC,GAAG,EAA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