@modelhealth/sdk 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 +40 -0
- package/dist/index.d.ts +850 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1016 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +458 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +204 -0
- package/dist/types.js.map +1 -0
- package/model_health_wasm.d.ts +112 -0
- package/model_health_wasm.js +1110 -0
- package/model_health_wasm_bg.wasm +0 -0
- package/model_health_wasm_bg.wasm.d.ts +45 -0
- package/package.json +28 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAwBH,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAEpB,IAAI,UAAU,GAAQ,IAAI,CAAC;AAC3B,IAAI,eAAe,GAAG,KAAK,CAAC;AAC5B,IAAI,eAAe,GAAyB,IAAI,CAAC;AAEjD;;;;;;;GAOG;AACH,KAAK,UAAU,QAAQ;IACrB,IAAI,eAAe;QACjB,OAAO;IAET,IAAI,eAAe;QACjB,OAAO,eAAe,CAAC;IAEzB,eAAe,GAAG,CAAC,KAAK,IAAI,EAAE;QAC5B,IAAI,CAAC;YACH,UAAU,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;YAC3B,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;YACxB,eAAe,GAAG,IAAI,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,eAAe,GAAG,IAAI,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC,CA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SDK.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Result of a login attempt.
|
|
10
|
+
*
|
|
11
|
+
* - `ok`: Login successful, user is authenticated
|
|
12
|
+
* - `verification_required`: Two-factor authentication required
|
|
13
|
+
*/
|
|
14
|
+
export type LoginResult = "ok" | "verification_required";
|
|
15
|
+
/**
|
|
16
|
+
* Unit system preference for measurements.
|
|
17
|
+
*/
|
|
18
|
+
export type Unit = "metric" | "imperial";
|
|
19
|
+
/**
|
|
20
|
+
* Parameters required for creating a new user account.
|
|
21
|
+
*/
|
|
22
|
+
export interface RegistrationParameters {
|
|
23
|
+
username: string;
|
|
24
|
+
email: string;
|
|
25
|
+
password: string;
|
|
26
|
+
first_name: string;
|
|
27
|
+
last_name: string;
|
|
28
|
+
country?: string;
|
|
29
|
+
institution?: string;
|
|
30
|
+
profession?: string;
|
|
31
|
+
reason?: string;
|
|
32
|
+
website?: string;
|
|
33
|
+
language?: string;
|
|
34
|
+
unit?: Unit;
|
|
35
|
+
newsletter: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A session represents a collection of activities recorded together.
|
|
39
|
+
*
|
|
40
|
+
* Sessions contain multiple activities, each with their own videos and analysis results.
|
|
41
|
+
* Sessions can be shared publicly or kept private.
|
|
42
|
+
*/
|
|
43
|
+
export interface Session {
|
|
44
|
+
id: string;
|
|
45
|
+
user: number;
|
|
46
|
+
public: boolean;
|
|
47
|
+
name: string;
|
|
48
|
+
session_name: string;
|
|
49
|
+
qrcode?: string;
|
|
50
|
+
activities: Activity[];
|
|
51
|
+
subject?: number;
|
|
52
|
+
activities_count: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Gender identity options for subject demographics.
|
|
56
|
+
*/
|
|
57
|
+
export type Gender = "woman" | "man" | "transgender" | "non_binary" | "no_response";
|
|
58
|
+
/**
|
|
59
|
+
* Sex assigned at birth options for subject demographics.
|
|
60
|
+
*/
|
|
61
|
+
export type Sex = "woman" | "man" | "intersex" | "not_listed" | "no_response";
|
|
62
|
+
/**
|
|
63
|
+
* Subject information for biomechanical analysis.
|
|
64
|
+
*
|
|
65
|
+
* Subjects represent individuals being analyzed. Their anthropometric
|
|
66
|
+
* data is used for scaling musculoskeletal models and calculating
|
|
67
|
+
* personalized biomechanical metrics.
|
|
68
|
+
*/
|
|
69
|
+
export interface Subject {
|
|
70
|
+
id: number;
|
|
71
|
+
name: string;
|
|
72
|
+
weight?: number;
|
|
73
|
+
height?: number;
|
|
74
|
+
age?: number;
|
|
75
|
+
birth_year?: number;
|
|
76
|
+
gender: Gender;
|
|
77
|
+
sex_at_birth: Sex;
|
|
78
|
+
characteristics: string;
|
|
79
|
+
subject_tags: string[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Parameters required for creating a new subject.
|
|
83
|
+
*/
|
|
84
|
+
export interface SubjectParameters {
|
|
85
|
+
name: string;
|
|
86
|
+
weight: number;
|
|
87
|
+
height: number;
|
|
88
|
+
birth_year: number;
|
|
89
|
+
sex_at_birth: Sex;
|
|
90
|
+
gender: Gender;
|
|
91
|
+
characteristics: string;
|
|
92
|
+
subject_tags: string[];
|
|
93
|
+
terms: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Video file associated with an activity.
|
|
97
|
+
*/
|
|
98
|
+
export interface Video {
|
|
99
|
+
id: string;
|
|
100
|
+
activity: string;
|
|
101
|
+
video?: string;
|
|
102
|
+
video_thumb?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* An activity represents a single recording within a session.
|
|
106
|
+
*
|
|
107
|
+
* Activities contain the captured videos, processing status, and analysis results.
|
|
108
|
+
*/
|
|
109
|
+
export interface Activity {
|
|
110
|
+
id: string;
|
|
111
|
+
session: string;
|
|
112
|
+
name?: string;
|
|
113
|
+
status: string;
|
|
114
|
+
videos: Video[];
|
|
115
|
+
results: ActivityResult[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Sort order for activity lists.
|
|
119
|
+
*
|
|
120
|
+
* Specifies how activities should be ordered when retrieved from the API.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* const activities = await client.getActivitiesForSubject(
|
|
125
|
+
* subjectId,
|
|
126
|
+
* 0,
|
|
127
|
+
* 20,
|
|
128
|
+
* "updated_at"
|
|
129
|
+
* );
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export type ActivitySort = "updated_at";
|
|
133
|
+
/**
|
|
134
|
+
* A tag that can be applied to activities for categorization.
|
|
135
|
+
*
|
|
136
|
+
* Activity tags provide a way to organize and filter activities.
|
|
137
|
+
* Common tags might include activity types (e.g., "CMJ", "Squat"),
|
|
138
|
+
* conditions (e.g., "Baseline", "Post-Training"), or any custom categorization.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* const tags = await client.getActivityTags();
|
|
143
|
+
* const cmjTag = tags.find(t => t.value === "cmj");
|
|
144
|
+
* console.log(`CMJ activities: ${cmjTag?.label ?? ""}`);
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
export interface ActivityTag {
|
|
148
|
+
value: string;
|
|
149
|
+
label: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Result file associated with an activity.
|
|
153
|
+
*
|
|
154
|
+
* Results can include analysis outputs, synchronized videos,
|
|
155
|
+
* kinematic data, and visualization data.
|
|
156
|
+
*/
|
|
157
|
+
export interface ActivityResult {
|
|
158
|
+
id: number;
|
|
159
|
+
activity: string;
|
|
160
|
+
tag?: string;
|
|
161
|
+
media?: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Processing status of an activity.
|
|
165
|
+
*
|
|
166
|
+
* Indicates the current state of video upload and processing.
|
|
167
|
+
*/
|
|
168
|
+
export type ActivityProcessingStatus = {
|
|
169
|
+
type: "uploading";
|
|
170
|
+
uploaded: number;
|
|
171
|
+
total: number;
|
|
172
|
+
} | {
|
|
173
|
+
type: "processing";
|
|
174
|
+
} | {
|
|
175
|
+
type: "ready";
|
|
176
|
+
} | {
|
|
177
|
+
type: "failed";
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Video version types available for download.
|
|
181
|
+
*/
|
|
182
|
+
export type VideoVersion = "raw" | "synced";
|
|
183
|
+
/**
|
|
184
|
+
* Result data types available for download from activities.
|
|
185
|
+
*/
|
|
186
|
+
export type ResultDataType = "visualization" | "kinematic";
|
|
187
|
+
/**
|
|
188
|
+
* File format types for downloaded result data.
|
|
189
|
+
*/
|
|
190
|
+
export type FileType = "json" | "csv";
|
|
191
|
+
/**
|
|
192
|
+
* Downloaded result data from an activity.
|
|
193
|
+
*/
|
|
194
|
+
export interface ResultData {
|
|
195
|
+
file_type: FileType;
|
|
196
|
+
data: Uint8Array;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Orientation of the checkerboard during camera calibration.
|
|
200
|
+
*/
|
|
201
|
+
export type CheckerboardPlacement = "perpendicular" | "parallel";
|
|
202
|
+
/**
|
|
203
|
+
* Configuration for checkerboard-based camera calibration.
|
|
204
|
+
*/
|
|
205
|
+
export interface CheckerboardDetails {
|
|
206
|
+
rows: number;
|
|
207
|
+
columns: number;
|
|
208
|
+
square_size: number;
|
|
209
|
+
placement: CheckerboardPlacement;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Status updates during calibration process.
|
|
213
|
+
*/
|
|
214
|
+
export type CalibrationStatus = {
|
|
215
|
+
type: "recording";
|
|
216
|
+
} | {
|
|
217
|
+
type: "uploading";
|
|
218
|
+
uploaded: number;
|
|
219
|
+
total: number;
|
|
220
|
+
} | {
|
|
221
|
+
type: "processing";
|
|
222
|
+
percent?: number;
|
|
223
|
+
} | {
|
|
224
|
+
type: "done";
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* Analysis types supported by the Model Health platform.
|
|
228
|
+
*/
|
|
229
|
+
export type AnalysisType = "counter_movement_jump";
|
|
230
|
+
/**
|
|
231
|
+
* Identifier for a running analysis task.
|
|
232
|
+
*/
|
|
233
|
+
export interface AnalysisTask {
|
|
234
|
+
task_id: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Status of an analysis task.
|
|
238
|
+
*/
|
|
239
|
+
export type AnalysisTaskStatus = {
|
|
240
|
+
type: "processing";
|
|
241
|
+
} | {
|
|
242
|
+
type: "completed";
|
|
243
|
+
result_tags: string[];
|
|
244
|
+
} | {
|
|
245
|
+
type: "failed";
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Results from a biomechanical analysis.
|
|
249
|
+
*
|
|
250
|
+
* Contains computed metrics like jump height, peak velocities,
|
|
251
|
+
* asymmetries, and other biomechanical parameters.
|
|
252
|
+
*/
|
|
253
|
+
export interface AnalysisResult {
|
|
254
|
+
analysis_title: string;
|
|
255
|
+
analysis_description: string;
|
|
256
|
+
metrics: Record<string, Metric>;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Individual biomechanical metric from an analysis.
|
|
260
|
+
*/
|
|
261
|
+
export interface Metric {
|
|
262
|
+
label: string;
|
|
263
|
+
bilateral: boolean;
|
|
264
|
+
value: MetricValue;
|
|
265
|
+
info: string;
|
|
266
|
+
decimal_places: number;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Value of a metric (single measurement or bilateral left/right).
|
|
270
|
+
*/
|
|
271
|
+
export type MetricValue = {
|
|
272
|
+
type: "single";
|
|
273
|
+
value: number;
|
|
274
|
+
} | {
|
|
275
|
+
type: "bilateral";
|
|
276
|
+
left: number;
|
|
277
|
+
right: number;
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Interface for storing authentication tokens securely.
|
|
281
|
+
*
|
|
282
|
+
* Implement this interface to provide custom token storage
|
|
283
|
+
* (e.g., encrypted storage, secure cookies, etc.)
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* class SecureTokenStorage implements TokenStorage {
|
|
288
|
+
* async getToken(): Promise<string | null> {
|
|
289
|
+
* // Retrieve from encrypted storage
|
|
290
|
+
* }
|
|
291
|
+
* async setToken(token: string): Promise<void> {
|
|
292
|
+
* // Store in encrypted storage
|
|
293
|
+
* }
|
|
294
|
+
* async removeToken(): Promise<void> {
|
|
295
|
+
* // Remove from storage
|
|
296
|
+
* }
|
|
297
|
+
* }
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
export interface TokenStorage {
|
|
301
|
+
/**
|
|
302
|
+
* Retrieve the stored authentication token.
|
|
303
|
+
*
|
|
304
|
+
* @returns The token string, or null if no token is stored
|
|
305
|
+
*/
|
|
306
|
+
getToken(): Promise<string | null>;
|
|
307
|
+
/**
|
|
308
|
+
* Store an authentication token securely.
|
|
309
|
+
*
|
|
310
|
+
* @param token The token to store
|
|
311
|
+
*/
|
|
312
|
+
setToken(token: string): Promise<void>;
|
|
313
|
+
/**
|
|
314
|
+
* Remove the stored authentication token.
|
|
315
|
+
*/
|
|
316
|
+
removeToken(): Promise<void>;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* In-memory token storage implementation.
|
|
320
|
+
*
|
|
321
|
+
* **Warning**: Not secure - tokens are lost on page refresh.
|
|
322
|
+
* Only use for development and testing.
|
|
323
|
+
*
|
|
324
|
+
* For production, use:
|
|
325
|
+
* - Encrypted IndexedDB
|
|
326
|
+
* - HttpOnly cookies with CSRF protection
|
|
327
|
+
* - Platform-specific secure storage
|
|
328
|
+
*/
|
|
329
|
+
export declare class MemoryTokenStorage implements TokenStorage {
|
|
330
|
+
private token;
|
|
331
|
+
getToken(): Promise<string | null>;
|
|
332
|
+
setToken(token: string): Promise<void>;
|
|
333
|
+
removeToken(): Promise<void>;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* LocalStorage-based token storage implementation.
|
|
337
|
+
*
|
|
338
|
+
* **Warning**: LocalStorage is not encrypted. Use secure
|
|
339
|
+
* HTTP-only cookies or encrypted storage for production.
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```typescript
|
|
343
|
+
* const storage = new LocalStorageTokenStorage("my_app_token");
|
|
344
|
+
* const client = new ModelHealthService({ storage });
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
export declare class LocalStorageTokenStorage implements TokenStorage {
|
|
348
|
+
private key;
|
|
349
|
+
/**
|
|
350
|
+
* Create a LocalStorage token storage.
|
|
351
|
+
*
|
|
352
|
+
* @param key Storage key name (default: "modelhealth_token")
|
|
353
|
+
*/
|
|
354
|
+
constructor(key?: string);
|
|
355
|
+
getToken(): Promise<string | null>;
|
|
356
|
+
setToken(token: string): Promise<void>;
|
|
357
|
+
removeToken(): Promise<void>;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Extract jump height from CMJ analysis results.
|
|
361
|
+
*
|
|
362
|
+
* @param result Analysis result from counter-movement jump
|
|
363
|
+
* @returns Jump height in centimeters, or null if not available
|
|
364
|
+
*/
|
|
365
|
+
export declare function getJumpHeight(result: AnalysisResult): number | null;
|
|
366
|
+
/**
|
|
367
|
+
* Extract jump time from CMJ analysis results.
|
|
368
|
+
*
|
|
369
|
+
* @param result Analysis result from counter-movement jump
|
|
370
|
+
* @returns Jump time in seconds, or null if not available
|
|
371
|
+
*/
|
|
372
|
+
export declare function getJumpTime(result: AnalysisResult): number | null;
|
|
373
|
+
/**
|
|
374
|
+
* Extract concentric/eccentric time ratio from CMJ analysis results.
|
|
375
|
+
*
|
|
376
|
+
* @param result Analysis result from counter-movement jump
|
|
377
|
+
* @returns Time ratio, or null if not available
|
|
378
|
+
*/
|
|
379
|
+
export declare function getConcentricEccentricTimeRatio(result: AnalysisResult): number | null;
|
|
380
|
+
/**
|
|
381
|
+
* Extract reactive strength index from CMJ analysis results.
|
|
382
|
+
*
|
|
383
|
+
* @param result Analysis result from counter-movement jump
|
|
384
|
+
* @returns Reactive strength index, or null if not available
|
|
385
|
+
*/
|
|
386
|
+
export declare function getReactiveStrengthIndex(result: AnalysisResult): number | null;
|
|
387
|
+
/**
|
|
388
|
+
* Extract peak vertical velocity from CMJ analysis results.
|
|
389
|
+
*
|
|
390
|
+
* @param result Analysis result from counter-movement jump
|
|
391
|
+
* @returns Peak velocity in m/s, or null if not available
|
|
392
|
+
*/
|
|
393
|
+
export declare function getPeakVerticalVelocity(result: AnalysisResult): number | null;
|
|
394
|
+
/**
|
|
395
|
+
* Extract peak knee extension speed during takeoff from CMJ analysis results.
|
|
396
|
+
*
|
|
397
|
+
* @param result Analysis result from counter-movement jump
|
|
398
|
+
* @returns Object with left and right values in deg/s, or null if not available
|
|
399
|
+
*/
|
|
400
|
+
export declare function getPeakKneeExtensionSpeed(result: AnalysisResult): {
|
|
401
|
+
left: number;
|
|
402
|
+
right: number;
|
|
403
|
+
} | null;
|
|
404
|
+
/**
|
|
405
|
+
* Extract peak hip extension speed during takeoff from CMJ analysis results.
|
|
406
|
+
*
|
|
407
|
+
* @param result Analysis result from counter-movement jump
|
|
408
|
+
* @returns Object with left and right values in deg/s, or null if not available
|
|
409
|
+
*/
|
|
410
|
+
export declare function getPeakHipExtensionSpeed(result: AnalysisResult): {
|
|
411
|
+
left: number;
|
|
412
|
+
right: number;
|
|
413
|
+
} | null;
|
|
414
|
+
/**
|
|
415
|
+
* Extract peak knee flexion angle during landing from CMJ analysis results.
|
|
416
|
+
*
|
|
417
|
+
* @param result Analysis result from counter-movement jump
|
|
418
|
+
* @returns Object with left and right values in degrees, or null if not available
|
|
419
|
+
*/
|
|
420
|
+
export declare function getPeakKneeFlexionLanding(result: AnalysisResult): {
|
|
421
|
+
left: number;
|
|
422
|
+
right: number;
|
|
423
|
+
} | null;
|
|
424
|
+
/**
|
|
425
|
+
* Extract peak knee valgus angle during landing from CMJ analysis results.
|
|
426
|
+
*
|
|
427
|
+
* @param result Analysis result from counter-movement jump
|
|
428
|
+
* @returns Object with left and right values in degrees, or null if not available
|
|
429
|
+
*/
|
|
430
|
+
export declare function getPeakKneeValgusLanding(result: AnalysisResult): {
|
|
431
|
+
left: number;
|
|
432
|
+
right: number;
|
|
433
|
+
} | null;
|
|
434
|
+
/**
|
|
435
|
+
* Extract peak hip flexion angle during landing from CMJ analysis results.
|
|
436
|
+
*
|
|
437
|
+
* @param result Analysis result from counter-movement jump
|
|
438
|
+
* @returns Object with left and right values in degrees, or null if not available
|
|
439
|
+
*/
|
|
440
|
+
export declare function getPeakHipFlexionLanding(result: AnalysisResult): {
|
|
441
|
+
left: number;
|
|
442
|
+
right: number;
|
|
443
|
+
} | null;
|
|
444
|
+
/**
|
|
445
|
+
* Extract peak trunk flexion during landing from CMJ analysis results.
|
|
446
|
+
*
|
|
447
|
+
* @param result Analysis result from counter-movement jump
|
|
448
|
+
* @returns Trunk flexion angle in degrees, or null if not available
|
|
449
|
+
*/
|
|
450
|
+
export declare function getPeakTrunkFlexionLanding(result: AnalysisResult): number | null;
|
|
451
|
+
/**
|
|
452
|
+
* Extract peak trunk lean during landing from CMJ analysis results.
|
|
453
|
+
*
|
|
454
|
+
* @param result Analysis result from counter-movement jump
|
|
455
|
+
* @returns Trunk lean angle in degrees, or null if not available
|
|
456
|
+
*/
|
|
457
|
+
export declare function getPeakTrunkLeanLanding(result: AnalysisResult): number | null;
|
|
458
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,uBAAuB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IAC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AAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAKxG;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAKvG;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAKvG;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAGhF;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAG7E"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Health SDK TypeScript Types
|
|
3
|
+
*
|
|
4
|
+
* Complete type definitions for the Model Health biomechanics SDK.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* In-memory token storage implementation.
|
|
10
|
+
*
|
|
11
|
+
* **Warning**: Not secure - tokens are lost on page refresh.
|
|
12
|
+
* Only use for development and testing.
|
|
13
|
+
*
|
|
14
|
+
* For production, use:
|
|
15
|
+
* - Encrypted IndexedDB
|
|
16
|
+
* - HttpOnly cookies with CSRF protection
|
|
17
|
+
* - Platform-specific secure storage
|
|
18
|
+
*/
|
|
19
|
+
export class MemoryTokenStorage {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.token = null;
|
|
22
|
+
}
|
|
23
|
+
async getToken() {
|
|
24
|
+
return this.token;
|
|
25
|
+
}
|
|
26
|
+
async setToken(token) {
|
|
27
|
+
this.token = token;
|
|
28
|
+
}
|
|
29
|
+
async removeToken() {
|
|
30
|
+
this.token = null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* LocalStorage-based token storage implementation.
|
|
35
|
+
*
|
|
36
|
+
* **Warning**: LocalStorage is not encrypted. Use secure
|
|
37
|
+
* HTTP-only cookies or encrypted storage for production.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const storage = new LocalStorageTokenStorage("my_app_token");
|
|
42
|
+
* const client = new ModelHealthService({ storage });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export class LocalStorageTokenStorage {
|
|
46
|
+
/**
|
|
47
|
+
* Create a LocalStorage token storage.
|
|
48
|
+
*
|
|
49
|
+
* @param key Storage key name (default: "modelhealth_token")
|
|
50
|
+
*/
|
|
51
|
+
constructor(key = "modelhealth_token") {
|
|
52
|
+
this.key = key;
|
|
53
|
+
}
|
|
54
|
+
async getToken() {
|
|
55
|
+
if (typeof localStorage === "undefined") {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return localStorage.getItem(this.key);
|
|
59
|
+
}
|
|
60
|
+
async setToken(token) {
|
|
61
|
+
if (typeof localStorage === "undefined") {
|
|
62
|
+
throw new Error("localStorage is not available");
|
|
63
|
+
}
|
|
64
|
+
localStorage.setItem(this.key, token);
|
|
65
|
+
}
|
|
66
|
+
async removeToken() {
|
|
67
|
+
if (typeof localStorage === "undefined") {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
localStorage.removeItem(this.key);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// MARK: - Helper Functions for Analysis Results
|
|
74
|
+
/**
|
|
75
|
+
* Extract jump height from CMJ analysis results.
|
|
76
|
+
*
|
|
77
|
+
* @param result Analysis result from counter-movement jump
|
|
78
|
+
* @returns Jump height in centimeters, or null if not available
|
|
79
|
+
*/
|
|
80
|
+
export function getJumpHeight(result) {
|
|
81
|
+
const metric = result.metrics["00_jump_height_COM"];
|
|
82
|
+
return metric?.value.type === "single" ? metric.value.value : null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Extract jump time from CMJ analysis results.
|
|
86
|
+
*
|
|
87
|
+
* @param result Analysis result from counter-movement jump
|
|
88
|
+
* @returns Jump time in seconds, or null if not available
|
|
89
|
+
*/
|
|
90
|
+
export function getJumpTime(result) {
|
|
91
|
+
const metric = result.metrics["01_jump_time"];
|
|
92
|
+
return metric?.value.type === "single" ? metric.value.value : null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Extract concentric/eccentric time ratio from CMJ analysis results.
|
|
96
|
+
*
|
|
97
|
+
* @param result Analysis result from counter-movement jump
|
|
98
|
+
* @returns Time ratio, or null if not available
|
|
99
|
+
*/
|
|
100
|
+
export function getConcentricEccentricTimeRatio(result) {
|
|
101
|
+
const metric = result.metrics["02_ratio_concentric_eccentric_time"];
|
|
102
|
+
return metric?.value.type === "single" ? metric.value.value : null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Extract reactive strength index from CMJ analysis results.
|
|
106
|
+
*
|
|
107
|
+
* @param result Analysis result from counter-movement jump
|
|
108
|
+
* @returns Reactive strength index, or null if not available
|
|
109
|
+
*/
|
|
110
|
+
export function getReactiveStrengthIndex(result) {
|
|
111
|
+
const metric = result.metrics["03_reactive_strength_index_COM"];
|
|
112
|
+
return metric?.value.type === "single" ? metric.value.value : null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Extract peak vertical velocity from CMJ analysis results.
|
|
116
|
+
*
|
|
117
|
+
* @param result Analysis result from counter-movement jump
|
|
118
|
+
* @returns Peak velocity in m/s, or null if not available
|
|
119
|
+
*/
|
|
120
|
+
export function getPeakVerticalVelocity(result) {
|
|
121
|
+
const metric = result.metrics["04_peak_vertical_COM_speed_during_takeoff"];
|
|
122
|
+
return metric?.value.type === "single" ? metric.value.value : null;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Extract peak knee extension speed during takeoff from CMJ analysis results.
|
|
126
|
+
*
|
|
127
|
+
* @param result Analysis result from counter-movement jump
|
|
128
|
+
* @returns Object with left and right values in deg/s, or null if not available
|
|
129
|
+
*/
|
|
130
|
+
export function getPeakKneeExtensionSpeed(result) {
|
|
131
|
+
const metric = result.metrics["05_peak_knee_extension_speed_during_takeoff"];
|
|
132
|
+
return metric?.value.type === "bilateral"
|
|
133
|
+
? { left: metric.value.left, right: metric.value.right }
|
|
134
|
+
: null;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Extract peak hip extension speed during takeoff from CMJ analysis results.
|
|
138
|
+
*
|
|
139
|
+
* @param result Analysis result from counter-movement jump
|
|
140
|
+
* @returns Object with left and right values in deg/s, or null if not available
|
|
141
|
+
*/
|
|
142
|
+
export function getPeakHipExtensionSpeed(result) {
|
|
143
|
+
const metric = result.metrics["06_peak_hip_extension_speed_during_takeoff"];
|
|
144
|
+
return metric?.value.type === "bilateral"
|
|
145
|
+
? { left: metric.value.left, right: metric.value.right }
|
|
146
|
+
: null;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Extract peak knee flexion angle during landing from CMJ analysis results.
|
|
150
|
+
*
|
|
151
|
+
* @param result Analysis result from counter-movement jump
|
|
152
|
+
* @returns Object with left and right values in degrees, or null if not available
|
|
153
|
+
*/
|
|
154
|
+
export function getPeakKneeFlexionLanding(result) {
|
|
155
|
+
const metric = result.metrics["07_peak_knee_flexion_angle_during_landing"];
|
|
156
|
+
return metric?.value.type === "bilateral"
|
|
157
|
+
? { left: metric.value.left, right: metric.value.right }
|
|
158
|
+
: null;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Extract peak knee valgus angle during landing from CMJ analysis results.
|
|
162
|
+
*
|
|
163
|
+
* @param result Analysis result from counter-movement jump
|
|
164
|
+
* @returns Object with left and right values in degrees, or null if not available
|
|
165
|
+
*/
|
|
166
|
+
export function getPeakKneeValgusLanding(result) {
|
|
167
|
+
const metric = result.metrics["08_peak_dynamic_knee_valgus_angle_during_landing"];
|
|
168
|
+
return metric?.value.type === "bilateral"
|
|
169
|
+
? { left: metric.value.left, right: metric.value.right }
|
|
170
|
+
: null;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Extract peak hip flexion angle during landing from CMJ analysis results.
|
|
174
|
+
*
|
|
175
|
+
* @param result Analysis result from counter-movement jump
|
|
176
|
+
* @returns Object with left and right values in degrees, or null if not available
|
|
177
|
+
*/
|
|
178
|
+
export function getPeakHipFlexionLanding(result) {
|
|
179
|
+
const metric = result.metrics["09_peak_hip_flexion_angle_during_landing"];
|
|
180
|
+
return metric?.value.type === "bilateral"
|
|
181
|
+
? { left: metric.value.left, right: metric.value.right }
|
|
182
|
+
: null;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Extract peak trunk flexion during landing from CMJ analysis results.
|
|
186
|
+
*
|
|
187
|
+
* @param result Analysis result from counter-movement jump
|
|
188
|
+
* @returns Trunk flexion angle in degrees, or null if not available
|
|
189
|
+
*/
|
|
190
|
+
export function getPeakTrunkFlexionLanding(result) {
|
|
191
|
+
const metric = result.metrics["10_peak_trunk_flexion_relative_to_ground_during_landing"];
|
|
192
|
+
return metric?.value.type === "single" ? metric.value.value : null;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Extract peak trunk lean during landing from CMJ analysis results.
|
|
196
|
+
*
|
|
197
|
+
* @param result Analysis result from counter-movement jump
|
|
198
|
+
* @returns Trunk lean angle in degrees, or null if not available
|
|
199
|
+
*/
|
|
200
|
+
export function getPeakTrunkLeanLanding(result) {
|
|
201
|
+
const metric = result.metrics["11_peak_trunk_lean_relative_to_ground_during_landing"];
|
|
202
|
+
return metric?.value.type === "single" ? metric.value.value : null;
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=types.js.map
|