timeback 0.1.5 → 0.1.6
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 +24 -26
- package/dist/cli.js +766 -695
- package/package.json +3 -11
- package/schema.json +523 -133
- package/dist/cli/src/config.d.ts +0 -8
- package/dist/types/src/config.d.ts +0 -186
- package/dist/types/src/index.d.ts +0 -5
- package/dist/types/src/primitives.d.ts +0 -53
package/dist/cli/src/config.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config types for timeback.config.ts files.
|
|
3
|
-
*
|
|
4
|
-
* Re-exported from `@timeback/types` so users can import `timeback/config`
|
|
5
|
-
* for editor IntelliSense in TS config files. SDK users can also use
|
|
6
|
-
* `@timeback/sdk/config` which exports the same types.
|
|
7
|
-
*/
|
|
8
|
-
export type { CourseConfig, CourseDefaults, CourseGoals, CourseIds, CourseMetadata, CourseMetrics, CourseType, PublishStatus, TimebackConfig, } from '@timeback/types';
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeback Config Types
|
|
3
|
-
*
|
|
4
|
-
* Types for timeback.config.ts files.
|
|
5
|
-
*
|
|
6
|
-
* Note: Runtime validation is enforced by `@timeback/types/zod` (see
|
|
7
|
-
* `packages/types/src/zod/config.ts`). These TS types are a convenience layer
|
|
8
|
-
* and should not be treated as a replacement for Zod validation.
|
|
9
|
-
*/
|
|
10
|
-
import type { TimebackGrade, TimebackSubject } from './primitives';
|
|
11
|
-
/**
|
|
12
|
-
* Environment-specific course IDs.
|
|
13
|
-
* Populated by `timeback sync` for each environment.
|
|
14
|
-
*/
|
|
15
|
-
export interface CourseIds {
|
|
16
|
-
staging?: string;
|
|
17
|
-
production?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Course classification type.
|
|
21
|
-
*/
|
|
22
|
-
export type CourseType = 'base' | 'hole-filling' | 'optional';
|
|
23
|
-
/**
|
|
24
|
-
* Course publication status.
|
|
25
|
-
*/
|
|
26
|
-
export type PublishStatus = 'draft' | 'testing' | 'published' | 'deactivated';
|
|
27
|
-
/**
|
|
28
|
-
* Daily learning goals for a course.
|
|
29
|
-
*/
|
|
30
|
-
export interface CourseGoals {
|
|
31
|
-
/** Target XP to earn per day */
|
|
32
|
-
dailyXp?: number;
|
|
33
|
-
/** Target lessons to complete per day */
|
|
34
|
-
dailyLessons?: number;
|
|
35
|
-
/** Target active learning minutes per day */
|
|
36
|
-
dailyActiveMinutes?: number;
|
|
37
|
-
/** Target accuracy percentage (0-100) */
|
|
38
|
-
dailyAccuracy?: number;
|
|
39
|
-
/** Target units to master per day */
|
|
40
|
-
dailyMasteredUnits?: number;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Aggregate metrics for a course.
|
|
44
|
-
*/
|
|
45
|
-
export interface CourseMetrics {
|
|
46
|
-
/** Total XP available in the course */
|
|
47
|
-
totalXp?: number;
|
|
48
|
-
/** Total number of lessons/activities */
|
|
49
|
-
totalLessons?: number;
|
|
50
|
-
/** Total grade levels covered */
|
|
51
|
-
totalGrades?: number;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Course metadata (matches API metadata object).
|
|
55
|
-
*/
|
|
56
|
-
export interface CourseMetadata {
|
|
57
|
-
/** Course classification (base, hole-filling, optional) */
|
|
58
|
-
courseType?: CourseType;
|
|
59
|
-
/** Whether this is supplemental to a base course */
|
|
60
|
-
isSupplemental?: boolean;
|
|
61
|
-
/** Whether this is a custom course for an individual student */
|
|
62
|
-
isCustom?: boolean;
|
|
63
|
-
/** Publication status */
|
|
64
|
-
publishStatus?: PublishStatus;
|
|
65
|
-
/** Contact email for course issues */
|
|
66
|
-
contactEmail?: string;
|
|
67
|
-
/** Primary application identifier */
|
|
68
|
-
primaryApp?: string;
|
|
69
|
-
/** Daily learning goals */
|
|
70
|
-
goals?: CourseGoals;
|
|
71
|
-
/** Aggregate metrics */
|
|
72
|
-
metrics?: CourseMetrics;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Default properties that apply to all courses unless overridden.
|
|
76
|
-
* Set these at the root level to avoid repetition.
|
|
77
|
-
*/
|
|
78
|
-
export interface CourseDefaults {
|
|
79
|
-
/** Course code (e.g., "MATH101") */
|
|
80
|
-
courseCode?: string;
|
|
81
|
-
/** Course level (e.g., "AP", "Honors") */
|
|
82
|
-
level?: string;
|
|
83
|
-
/** Course metadata */
|
|
84
|
-
metadata?: CourseMetadata;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Environment-specific course overrides.
|
|
88
|
-
*
|
|
89
|
-
* Non-identity fields that can differ per environment.
|
|
90
|
-
* Excludes `subject`, `grade`, `courseCode` (identity) and `ids` (already env-scoped).
|
|
91
|
-
*/
|
|
92
|
-
export interface CourseEnvOverrides {
|
|
93
|
-
/** Course level override for this environment */
|
|
94
|
-
level?: string;
|
|
95
|
-
/** Caliper sensor URL override for this environment */
|
|
96
|
-
sensor?: string;
|
|
97
|
-
/** Launch URL override for this environment (used in dashboard resource links) */
|
|
98
|
-
launchUrl?: string;
|
|
99
|
-
/** Metadata override for this environment (merged with base metadata) */
|
|
100
|
-
metadata?: CourseMetadata;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Per-environment course overrides.
|
|
104
|
-
*
|
|
105
|
-
* Allows staging and production to have different non-identity properties.
|
|
106
|
-
*/
|
|
107
|
-
export interface CourseOverrides {
|
|
108
|
-
/** Overrides applied when syncing to staging */
|
|
109
|
-
staging?: CourseEnvOverrides;
|
|
110
|
-
/** Overrides applied when syncing to production */
|
|
111
|
-
production?: CourseEnvOverrides;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Configuration for a single course in a Timeback app.
|
|
115
|
-
*
|
|
116
|
-
* Course identity is determined by one of:
|
|
117
|
-
* - **Grade-based**: `(subject, grade)` — traditional K-12 courses
|
|
118
|
-
* - **Grade-less**: `courseCode` — apps without grade levels (e.g., CS platforms)
|
|
119
|
-
*
|
|
120
|
-
* At least one identity must be present:
|
|
121
|
-
* - If `grade` is provided, the course is identified by `(subject, grade)`.
|
|
122
|
-
* - If `grade` is omitted, `courseCode` is required as the identifier.
|
|
123
|
-
*
|
|
124
|
-
* Sensor/LaunchUrl resolution:
|
|
125
|
-
* - Each course must have an effective sensor (either `course.sensor` or top-level `sensor`).
|
|
126
|
-
* - Each course must have an effective launchUrl (either `course.launchUrl` or top-level `launchUrl`).
|
|
127
|
-
*
|
|
128
|
-
* Environment overrides:
|
|
129
|
-
* - Use `overrides.staging` or `overrides.production` to vary non-identity fields per env.
|
|
130
|
-
*/
|
|
131
|
-
export interface CourseConfig extends CourseDefaults {
|
|
132
|
-
/** Subject area (e.g., 'Math', 'Reading') */
|
|
133
|
-
subject: TimebackSubject;
|
|
134
|
-
/**
|
|
135
|
-
* Grade level (-1 = Pre-K, 0 = K, 1-12 = grades, 13 = AP).
|
|
136
|
-
* Optional for grade-less apps; if omitted, `courseCode` is required.
|
|
137
|
-
*/
|
|
138
|
-
grade?: TimebackGrade;
|
|
139
|
-
/** Timeback course IDs per environment (populated after sync) */
|
|
140
|
-
ids?: CourseIds | null;
|
|
141
|
-
/**
|
|
142
|
-
* Caliper sensor URL for this course.
|
|
143
|
-
* Overrides the top-level `sensor` if set.
|
|
144
|
-
*/
|
|
145
|
-
sensor?: string;
|
|
146
|
-
/**
|
|
147
|
-
* Launch URL for this course (used in dashboard resource links).
|
|
148
|
-
* Overrides the top-level `launchUrl` if set.
|
|
149
|
-
*/
|
|
150
|
-
launchUrl?: string;
|
|
151
|
-
/**
|
|
152
|
-
* Environment-specific overrides for non-identity fields.
|
|
153
|
-
* Merged with base course config when syncing to a specific environment.
|
|
154
|
-
*/
|
|
155
|
-
overrides?: CourseOverrides;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Root configuration for a Timeback app.
|
|
159
|
-
* Define this in your timeback.config.ts file.
|
|
160
|
-
*
|
|
161
|
-
* Sensor resolution: every course must have an effective sensor.
|
|
162
|
-
* - Set `sensor` at the top level as a default for all courses.
|
|
163
|
-
* - Override per course with `courses[].sensor`.
|
|
164
|
-
*
|
|
165
|
-
* LaunchUrl resolution: every course must have an effective launchUrl.
|
|
166
|
-
* - Set `launchUrl` at the top level as a default for all courses.
|
|
167
|
-
* - Override per course with `courses[].launchUrl`.
|
|
168
|
-
*/
|
|
169
|
-
export interface TimebackConfig {
|
|
170
|
-
/** Display name for your app */
|
|
171
|
-
name: string;
|
|
172
|
-
/** Default properties applied to all courses */
|
|
173
|
-
defaults?: CourseDefaults;
|
|
174
|
-
/** Courses available in this app */
|
|
175
|
-
courses: CourseConfig[];
|
|
176
|
-
/**
|
|
177
|
-
* Default Caliper sensor URL for activity events.
|
|
178
|
-
* Can be overridden per course with `courses[].sensor`.
|
|
179
|
-
*/
|
|
180
|
-
sensor?: string;
|
|
181
|
-
/**
|
|
182
|
-
* Default launch URL for dashboard resource links.
|
|
183
|
-
* Can be overridden per course with `courses[].launchUrl`.
|
|
184
|
-
*/
|
|
185
|
-
launchUrl?: string;
|
|
186
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeback Shared Primitives
|
|
3
|
-
*
|
|
4
|
-
* Core types used across multiple Timeback protocols.
|
|
5
|
-
*
|
|
6
|
-
* Organization:
|
|
7
|
-
* - Shared types (this file): Used by multiple protocols (Caliper, OneRoster, etc.)
|
|
8
|
-
* - Protocol-specific types: Live in their respective protocols/X/primitives.ts files
|
|
9
|
-
*
|
|
10
|
-
* What belongs here:
|
|
11
|
-
* - TimebackSubject - Used in OneRoster courses AND Caliper events
|
|
12
|
-
* - TimebackGrade - Used across OneRoster, Caliper, and QTI
|
|
13
|
-
* - IMSErrorResponse - IMS Global standard used by multiple 1EdTech protocols
|
|
14
|
-
*
|
|
15
|
-
* What doesn't belong here:
|
|
16
|
-
* - OneRoster-specific: protocols/oneroster/primitives.ts
|
|
17
|
-
* - QTI-specific: protocols/qti/primitives.ts
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Valid Timeback subject values.
|
|
21
|
-
* Used in OneRoster courses and Caliper events.
|
|
22
|
-
*/
|
|
23
|
-
export type TimebackSubject = 'Reading' | 'Language' | 'Vocabulary' | 'Social Studies' | 'Writing' | 'Science' | 'FastMath' | 'Math' | 'None' | 'Other';
|
|
24
|
-
/**
|
|
25
|
-
* Grade levels per Timeback OneRoster GradeEnum (numeric).
|
|
26
|
-
* -1 = Pre-K, 0 = Kindergarten, 1-12 = Grades 1-12, 13 = AP
|
|
27
|
-
*
|
|
28
|
-
* Use for input types where numbers are accepted.
|
|
29
|
-
*/
|
|
30
|
-
export type TimebackGrade = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
|
31
|
-
/**
|
|
32
|
-
* Grade levels as strings (API response format).
|
|
33
|
-
* The database stores grades as text, so API responses return strings.
|
|
34
|
-
*
|
|
35
|
-
* Use for response types.
|
|
36
|
-
*/
|
|
37
|
-
export type TimebackGradeString = '-1' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13';
|
|
38
|
-
/**
|
|
39
|
-
* IMS Global error response format.
|
|
40
|
-
* Used across OneRoster, Caliper, and other 1EdTech protocols.
|
|
41
|
-
*/
|
|
42
|
-
export interface IMSErrorResponse {
|
|
43
|
-
imsx_codeMajor: 'failure' | 'success';
|
|
44
|
-
imsx_severity: 'error' | 'warning' | 'status';
|
|
45
|
-
imsx_description: string;
|
|
46
|
-
imsx_CodeMinor?: {
|
|
47
|
-
imsx_codeMinorField: Array<{
|
|
48
|
-
imsx_codeMinorFieldName: string;
|
|
49
|
-
imsx_codeMinorFieldValue: string;
|
|
50
|
-
}>;
|
|
51
|
-
};
|
|
52
|
-
imsx_error_details?: Array<Record<string, string>>;
|
|
53
|
-
}
|