timeback 0.1.3 → 0.1.5
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 +65 -550
- package/dist/cli/src/config.d.ts +8 -0
- package/dist/cli.js +131552 -0
- package/dist/types/src/config.d.ts +186 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/primitives.d.ts +53 -0
- package/package.json +29 -91
- package/schema.json +222 -0
- package/dist/client/adapters/react/SignInButton.d.ts +0 -60
- package/dist/client/adapters/react/SignInButton.d.ts.map +0 -1
- package/dist/client/adapters/react/index.d.ts +0 -43
- package/dist/client/adapters/react/index.d.ts.map +0 -1
- package/dist/client/adapters/react/index.js +0 -478
- package/dist/client/adapters/react/provider.d.ts +0 -74
- package/dist/client/adapters/react/provider.d.ts.map +0 -1
- package/dist/client/adapters/solid/SignInButton.d.ts +0 -52
- package/dist/client/adapters/solid/SignInButton.d.ts.map +0 -1
- package/dist/client/adapters/solid/SignInButton.tsx +0 -321
- package/dist/client/adapters/solid/context.d.ts +0 -73
- package/dist/client/adapters/solid/context.d.ts.map +0 -1
- package/dist/client/adapters/solid/context.tsx +0 -91
- package/dist/client/adapters/solid/index.d.ts +0 -42
- package/dist/client/adapters/solid/index.d.ts.map +0 -1
- package/dist/client/adapters/solid/index.ts +0 -46
- package/dist/client/adapters/svelte/SignInButton.svelte +0 -234
- package/dist/client/adapters/svelte/SignInButton.svelte.d.ts +0 -24
- package/dist/client/adapters/svelte/index.d.ts +0 -33
- package/dist/client/adapters/svelte/index.d.ts.map +0 -1
- package/dist/client/adapters/svelte/index.ts +0 -38
- package/dist/client/adapters/svelte/stores.d.ts +0 -62
- package/dist/client/adapters/svelte/stores.d.ts.map +0 -1
- package/dist/client/adapters/svelte/stores.ts +0 -139
- package/dist/client/adapters/vue/SignInButton.vue +0 -260
- package/dist/client/adapters/vue/SignInButton.vue.d.ts +0 -53
- package/dist/client/adapters/vue/index.d.ts +0 -43
- package/dist/client/adapters/vue/index.d.ts.map +0 -1
- package/dist/client/adapters/vue/index.ts +0 -48
- package/dist/client/adapters/vue/provider.d.ts +0 -94
- package/dist/client/adapters/vue/provider.d.ts.map +0 -1
- package/dist/client/adapters/vue/provider.ts +0 -147
- package/dist/client/index.d.ts +0 -9
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/lib/activity/activity.class.d.ts +0 -73
- package/dist/client/lib/activity/activity.class.d.ts.map +0 -1
- package/dist/client/lib/activity/activity.d.ts +0 -16
- package/dist/client/lib/activity/activity.d.ts.map +0 -1
- package/dist/client/lib/activity/index.d.ts +0 -6
- package/dist/client/lib/activity/index.d.ts.map +0 -1
- package/dist/client/lib/utils.d.ts +0 -20
- package/dist/client/lib/utils.d.ts.map +0 -1
- package/dist/client/namespaces/activity.d.ts +0 -37
- package/dist/client/namespaces/activity.d.ts.map +0 -1
- package/dist/client/namespaces/auth.d.ts +0 -33
- package/dist/client/namespaces/auth.d.ts.map +0 -1
- package/dist/client/namespaces/index.d.ts +0 -7
- package/dist/client/namespaces/index.d.ts.map +0 -1
- package/dist/client/namespaces/user.d.ts +0 -29
- package/dist/client/namespaces/user.d.ts.map +0 -1
- package/dist/client/timeback-client.class.d.ts +0 -37
- package/dist/client/timeback-client.class.d.ts.map +0 -1
- package/dist/client/timeback-client.d.ts +0 -29
- package/dist/client/timeback-client.d.ts.map +0 -1
- package/dist/client.d.ts +0 -30
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -198
- package/dist/edge.d.ts +0 -13
- package/dist/edge.d.ts.map +0 -1
- package/dist/edge.js +0 -1149
- package/dist/identity.d.ts +0 -14
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js +0 -1019
- package/dist/index.d.ts +0 -48
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -10221
- package/dist/server/adapters/express.d.ts +0 -66
- package/dist/server/adapters/express.d.ts.map +0 -1
- package/dist/server/adapters/express.js +0 -9326
- package/dist/server/adapters/native.d.ts +0 -47
- package/dist/server/adapters/native.d.ts.map +0 -1
- package/dist/server/adapters/native.js +0 -190
- package/dist/server/adapters/nextjs.d.ts +0 -32
- package/dist/server/adapters/nextjs.d.ts.map +0 -1
- package/dist/server/adapters/nextjs.js +0 -202
- package/dist/server/adapters/nuxt.d.ts +0 -98
- package/dist/server/adapters/nuxt.d.ts.map +0 -1
- package/dist/server/adapters/nuxt.js +0 -9395
- package/dist/server/adapters/solid-start.d.ts +0 -63
- package/dist/server/adapters/solid-start.d.ts.map +0 -1
- package/dist/server/adapters/solid-start.js +0 -9294
- package/dist/server/adapters/svelte-kit.d.ts +0 -84
- package/dist/server/adapters/svelte-kit.d.ts.map +0 -1
- package/dist/server/adapters/svelte-kit.js +0 -243
- package/dist/server/adapters/tanstack-start.d.ts +0 -42
- package/dist/server/adapters/tanstack-start.d.ts.map +0 -1
- package/dist/server/adapters/tanstack-start.js +0 -9272
- package/dist/server/adapters/types.d.ts +0 -294
- package/dist/server/adapters/types.d.ts.map +0 -1
- package/dist/server/adapters/utils.d.ts +0 -76
- package/dist/server/adapters/utils.d.ts.map +0 -1
- package/dist/server/handlers/activity.d.ts +0 -28
- package/dist/server/handlers/activity.d.ts.map +0 -1
- package/dist/server/handlers/identity-full.d.ts +0 -28
- package/dist/server/handlers/identity-full.d.ts.map +0 -1
- package/dist/server/handlers/identity-only.d.ts +0 -22
- package/dist/server/handlers/identity-only.d.ts.map +0 -1
- package/dist/server/handlers/index.d.ts +0 -9
- package/dist/server/handlers/index.d.ts.map +0 -1
- package/dist/server/handlers/user.d.ts +0 -30
- package/dist/server/handlers/user.d.ts.map +0 -1
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/lib/index.d.ts +0 -10
- package/dist/server/lib/index.d.ts.map +0 -1
- package/dist/server/lib/logger.d.ts +0 -21
- package/dist/server/lib/logger.d.ts.map +0 -1
- package/dist/server/lib/oidc.d.ts +0 -76
- package/dist/server/lib/oidc.d.ts.map +0 -1
- package/dist/server/lib/resolve-timeback-user.d.ts +0 -42
- package/dist/server/lib/resolve-timeback-user.d.ts.map +0 -1
- package/dist/server/lib/utils.d.ts +0 -54
- package/dist/server/lib/utils.d.ts.map +0 -1
- package/dist/server/timeback-identity.d.ts +0 -19
- package/dist/server/timeback-identity.d.ts.map +0 -1
- package/dist/server/timeback.d.ts +0 -68
- package/dist/server/timeback.d.ts.map +0 -1
- package/dist/server/types.d.ts +0 -402
- package/dist/server/types.d.ts.map +0 -1
- package/dist/shared/constants.d.ts +0 -18
- package/dist/shared/constants.d.ts.map +0 -1
- package/dist/shared/types.d.ts +0 -144
- package/dist/shared/types.d.ts.map +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,115 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "timeback",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Timeback SDK for frontend and backend integration",
|
|
3
|
+
"version": "0.1.5",
|
|
5
4
|
"type": "module",
|
|
6
5
|
"exports": {
|
|
7
|
-
"
|
|
8
|
-
"types": "./dist/
|
|
9
|
-
"import": "./dist/
|
|
10
|
-
|
|
11
|
-
"./client": {
|
|
12
|
-
"types": "./dist/client.d.ts",
|
|
13
|
-
"import": "./dist/client.js"
|
|
14
|
-
},
|
|
15
|
-
"./identity": {
|
|
16
|
-
"types": "./dist/identity.d.ts",
|
|
17
|
-
"import": "./dist/identity.js"
|
|
18
|
-
},
|
|
19
|
-
"./edge": {
|
|
20
|
-
"types": "./dist/edge.d.ts",
|
|
21
|
-
"import": "./dist/edge.js"
|
|
22
|
-
},
|
|
23
|
-
"./react": {
|
|
24
|
-
"types": "./dist/client/adapters/react/index.d.ts",
|
|
25
|
-
"import": "./dist/client/adapters/react/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./svelte": {
|
|
28
|
-
"types": "./dist/client/adapters/svelte/index.d.ts",
|
|
29
|
-
"svelte": "./dist/client/adapters/svelte/index.ts",
|
|
30
|
-
"import": "./dist/client/adapters/svelte/index.ts"
|
|
31
|
-
},
|
|
32
|
-
"./solid": {
|
|
33
|
-
"types": "./dist/client/adapters/solid/index.d.ts",
|
|
34
|
-
"solid": "./dist/client/adapters/solid/index.ts",
|
|
35
|
-
"import": "./dist/client/adapters/solid/index.ts"
|
|
36
|
-
},
|
|
37
|
-
"./native": {
|
|
38
|
-
"types": "./dist/server/adapters/native.d.ts",
|
|
39
|
-
"import": "./dist/server/adapters/native.js"
|
|
40
|
-
},
|
|
41
|
-
"./nextjs": {
|
|
42
|
-
"types": "./dist/server/adapters/nextjs.d.ts",
|
|
43
|
-
"import": "./dist/server/adapters/nextjs.js"
|
|
44
|
-
},
|
|
45
|
-
"./svelte-kit": {
|
|
46
|
-
"types": "./dist/server/adapters/svelte-kit.d.ts",
|
|
47
|
-
"import": "./dist/server/adapters/svelte-kit.js"
|
|
48
|
-
},
|
|
49
|
-
"./solid-start": {
|
|
50
|
-
"types": "./dist/server/adapters/solid-start.d.ts",
|
|
51
|
-
"import": "./dist/server/adapters/solid-start.js"
|
|
52
|
-
},
|
|
53
|
-
"./express": {
|
|
54
|
-
"types": "./dist/server/adapters/express.d.ts",
|
|
55
|
-
"import": "./dist/server/adapters/express.js"
|
|
56
|
-
},
|
|
57
|
-
"./tanstack-start": {
|
|
58
|
-
"types": "./dist/server/adapters/tanstack-start.d.ts",
|
|
59
|
-
"import": "./dist/server/adapters/tanstack-start.js"
|
|
60
|
-
},
|
|
61
|
-
"./vue": {
|
|
62
|
-
"types": "./dist/client/adapters/vue/index.d.ts",
|
|
63
|
-
"import": "./dist/client/adapters/vue/index.ts"
|
|
64
|
-
},
|
|
65
|
-
"./nuxt": {
|
|
66
|
-
"types": "./dist/server/adapters/nuxt.d.ts",
|
|
67
|
-
"import": "./dist/server/adapters/nuxt.js"
|
|
6
|
+
"./config": {
|
|
7
|
+
"types": "./dist/config.d.ts",
|
|
8
|
+
"import": "./dist/config.d.ts",
|
|
9
|
+
"default": "./dist/config.d.ts"
|
|
68
10
|
}
|
|
69
11
|
},
|
|
70
|
-
"
|
|
71
|
-
"
|
|
12
|
+
"types": "./dist/config.d.ts",
|
|
13
|
+
"bin": {
|
|
14
|
+
"timeback": "./dist/cli.js"
|
|
15
|
+
},
|
|
72
16
|
"files": [
|
|
73
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"schema.json"
|
|
74
19
|
],
|
|
75
20
|
"scripts": {
|
|
76
21
|
"build": "bun build.ts",
|
|
77
|
-
"
|
|
22
|
+
"build:binary": "bun build-binary.ts --checksums",
|
|
23
|
+
"dev": "DEBUG=1 bun src/cli.ts",
|
|
24
|
+
"dev:studio": "DEBUG=studio:* bun src/cli.ts studio",
|
|
25
|
+
"start": "bun dist/cli.js",
|
|
26
|
+
"unused": "bunx ts-unused-exports tsconfig.json --ignoreFiles='(dist|timeback\\.config\\.ts|src/config\\.ts)'"
|
|
78
27
|
},
|
|
79
28
|
"dependencies": {
|
|
80
|
-
"@
|
|
29
|
+
"@clack/prompts": "^0.11.0",
|
|
30
|
+
"colorette": "^2.0.20",
|
|
31
|
+
"commander": "^14.0.2",
|
|
81
32
|
"jiti": "^2.6.1",
|
|
82
33
|
"zod": "^4.2.1"
|
|
83
34
|
},
|
|
84
35
|
"devDependencies": {
|
|
85
|
-
"@timeback/caliper": "0.1.
|
|
36
|
+
"@timeback/caliper": "0.1.2",
|
|
37
|
+
"@timeback/core": "0.1.3",
|
|
38
|
+
"@timeback/edubridge": "0.1.1",
|
|
86
39
|
"@timeback/internal-cli-infra": "0.0.0",
|
|
87
|
-
"@timeback/internal-
|
|
40
|
+
"@timeback/internal-client-infra": "0.0.0",
|
|
88
41
|
"@timeback/internal-utils": "0.0.0",
|
|
42
|
+
"@timeback/oneroster": "0.1.3",
|
|
43
|
+
"@timeback/powerpath": "0.1.1",
|
|
44
|
+
"@timeback/qti": "0.1.1",
|
|
89
45
|
"@timeback/types": "0.0.0",
|
|
90
46
|
"@types/bun": "latest",
|
|
91
|
-
"
|
|
92
|
-
"
|
|
47
|
+
"bun-plugin-dts": "^0.3.0",
|
|
48
|
+
"timeback-studio": "0.1.3"
|
|
93
49
|
},
|
|
94
50
|
"peerDependencies": {
|
|
95
|
-
"
|
|
96
|
-
"solid-js": "^1.9.10",
|
|
97
|
-
"svelte": "^4 || ^5",
|
|
98
|
-
"typescript": "^5",
|
|
99
|
-
"vue": "^3"
|
|
100
|
-
},
|
|
101
|
-
"peerDependenciesMeta": {
|
|
102
|
-
"react": {
|
|
103
|
-
"optional": true
|
|
104
|
-
},
|
|
105
|
-
"solid-js": {
|
|
106
|
-
"optional": true
|
|
107
|
-
},
|
|
108
|
-
"svelte": {
|
|
109
|
-
"optional": true
|
|
110
|
-
},
|
|
111
|
-
"vue": {
|
|
112
|
-
"optional": true
|
|
113
|
-
}
|
|
51
|
+
"typescript": "^5"
|
|
114
52
|
}
|
|
115
53
|
}
|
package/schema.json
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://timeback.dev/schemas/timeback.config.schema.json",
|
|
4
|
+
"title": "Timeback Config",
|
|
5
|
+
"description": "Configuration schema for timeback.config.ts files",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["name", "courses"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "JSON Schema reference for editor support"
|
|
12
|
+
},
|
|
13
|
+
"name": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1,
|
|
16
|
+
"description": "Display name for your app"
|
|
17
|
+
},
|
|
18
|
+
"defaults": {
|
|
19
|
+
"$ref": "#/$defs/CourseDefaults",
|
|
20
|
+
"description": "Default properties applied to all courses"
|
|
21
|
+
},
|
|
22
|
+
"courses": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"minItems": 1,
|
|
25
|
+
"items": {
|
|
26
|
+
"$ref": "#/$defs/CourseConfig"
|
|
27
|
+
},
|
|
28
|
+
"description": "Courses available in this app"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"$defs": {
|
|
32
|
+
"TimebackSubject": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": [
|
|
35
|
+
"Reading",
|
|
36
|
+
"Language",
|
|
37
|
+
"Vocabulary",
|
|
38
|
+
"Social Studies",
|
|
39
|
+
"Writing",
|
|
40
|
+
"Science",
|
|
41
|
+
"FastMath",
|
|
42
|
+
"Math",
|
|
43
|
+
"None",
|
|
44
|
+
"Other"
|
|
45
|
+
],
|
|
46
|
+
"description": "Subject area"
|
|
47
|
+
},
|
|
48
|
+
"TimebackGrade": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"minimum": -1,
|
|
51
|
+
"maximum": 13,
|
|
52
|
+
"description": "Grade level (-1 = Pre-K, 0 = K, 1-12 = grades, 13 = AP)"
|
|
53
|
+
},
|
|
54
|
+
"CourseType": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"enum": ["base", "hole-filling", "optional"],
|
|
57
|
+
"description": "Course classification type"
|
|
58
|
+
},
|
|
59
|
+
"PublishStatus": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"enum": ["draft", "testing", "published", "deactivated"],
|
|
62
|
+
"description": "Course publication status"
|
|
63
|
+
},
|
|
64
|
+
"CourseGoals": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"description": "Daily learning goals for a course",
|
|
67
|
+
"properties": {
|
|
68
|
+
"dailyXp": {
|
|
69
|
+
"type": "integer",
|
|
70
|
+
"minimum": 1,
|
|
71
|
+
"description": "Target XP to earn per day"
|
|
72
|
+
},
|
|
73
|
+
"dailyLessons": {
|
|
74
|
+
"type": "integer",
|
|
75
|
+
"minimum": 1,
|
|
76
|
+
"description": "Target lessons to complete per day"
|
|
77
|
+
},
|
|
78
|
+
"dailyActiveMinutes": {
|
|
79
|
+
"type": "integer",
|
|
80
|
+
"minimum": 1,
|
|
81
|
+
"description": "Target active learning minutes per day"
|
|
82
|
+
},
|
|
83
|
+
"dailyAccuracy": {
|
|
84
|
+
"type": "integer",
|
|
85
|
+
"minimum": 0,
|
|
86
|
+
"maximum": 100,
|
|
87
|
+
"description": "Target accuracy percentage (0-100)"
|
|
88
|
+
},
|
|
89
|
+
"dailyMasteredUnits": {
|
|
90
|
+
"type": "integer",
|
|
91
|
+
"minimum": 1,
|
|
92
|
+
"description": "Target units to master per day"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"additionalProperties": false
|
|
96
|
+
},
|
|
97
|
+
"CourseMetrics": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"description": "Aggregate metrics for a course",
|
|
100
|
+
"properties": {
|
|
101
|
+
"totalXp": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"minimum": 1,
|
|
104
|
+
"description": "Total XP available in the course"
|
|
105
|
+
},
|
|
106
|
+
"totalLessons": {
|
|
107
|
+
"type": "integer",
|
|
108
|
+
"minimum": 1,
|
|
109
|
+
"description": "Total number of lessons/activities"
|
|
110
|
+
},
|
|
111
|
+
"totalGrades": {
|
|
112
|
+
"type": "integer",
|
|
113
|
+
"minimum": 1,
|
|
114
|
+
"description": "Total grade levels covered"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"additionalProperties": false
|
|
118
|
+
},
|
|
119
|
+
"CourseIds": {
|
|
120
|
+
"type": ["object", "null"],
|
|
121
|
+
"description": "Environment-specific course IDs (populated by sync)",
|
|
122
|
+
"properties": {
|
|
123
|
+
"staging": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"description": "Course ID in staging environment"
|
|
126
|
+
},
|
|
127
|
+
"production": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"description": "Course ID in production environment"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"additionalProperties": false
|
|
133
|
+
},
|
|
134
|
+
"CourseMetadata": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"description": "Course metadata (matches API metadata object)",
|
|
137
|
+
"properties": {
|
|
138
|
+
"courseType": {
|
|
139
|
+
"$ref": "#/$defs/CourseType"
|
|
140
|
+
},
|
|
141
|
+
"isSupplemental": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"description": "Whether this is supplemental to a base course"
|
|
144
|
+
},
|
|
145
|
+
"isCustom": {
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"description": "Whether this is a custom course for an individual student"
|
|
148
|
+
},
|
|
149
|
+
"publishStatus": {
|
|
150
|
+
"$ref": "#/$defs/PublishStatus"
|
|
151
|
+
},
|
|
152
|
+
"contactEmail": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"format": "email",
|
|
155
|
+
"description": "Contact email for course issues"
|
|
156
|
+
},
|
|
157
|
+
"primaryApp": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"description": "Primary application identifier"
|
|
160
|
+
},
|
|
161
|
+
"goals": {
|
|
162
|
+
"$ref": "#/$defs/CourseGoals"
|
|
163
|
+
},
|
|
164
|
+
"metrics": {
|
|
165
|
+
"$ref": "#/$defs/CourseMetrics"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"additionalProperties": false
|
|
169
|
+
},
|
|
170
|
+
"CourseDefaults": {
|
|
171
|
+
"type": "object",
|
|
172
|
+
"description": "Default properties that apply to all courses unless overridden",
|
|
173
|
+
"properties": {
|
|
174
|
+
"courseCode": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"description": "Course code (e.g., 'MATH101')"
|
|
177
|
+
},
|
|
178
|
+
"level": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"description": "Course level (e.g., 'AP', 'Honors')"
|
|
181
|
+
},
|
|
182
|
+
"metadata": {
|
|
183
|
+
"$ref": "#/$defs/CourseMetadata"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"additionalProperties": false
|
|
187
|
+
},
|
|
188
|
+
"CourseConfig": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"description": "Configuration for a single course",
|
|
191
|
+
"required": ["subject", "grade"],
|
|
192
|
+
"allOf": [
|
|
193
|
+
{
|
|
194
|
+
"$ref": "#/$defs/CourseDefaults"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"properties": {
|
|
198
|
+
"subject": {
|
|
199
|
+
"$ref": "#/$defs/TimebackSubject"
|
|
200
|
+
},
|
|
201
|
+
"grade": {
|
|
202
|
+
"$ref": "#/$defs/TimebackGrade"
|
|
203
|
+
},
|
|
204
|
+
"courseCode": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"description": "Course code (e.g., 'MATH101')"
|
|
207
|
+
},
|
|
208
|
+
"level": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"description": "Course level (e.g., 'AP', 'Honors')"
|
|
211
|
+
},
|
|
212
|
+
"metadata": {
|
|
213
|
+
"$ref": "#/$defs/CourseMetadata"
|
|
214
|
+
},
|
|
215
|
+
"ids": {
|
|
216
|
+
"$ref": "#/$defs/CourseIds"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"additionalProperties": false
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sign In with Timeback Button
|
|
3
|
-
*
|
|
4
|
-
* A pre-styled button for Timeback SSO authentication.
|
|
5
|
-
* Fully customizable via CSS variables.
|
|
6
|
-
*/
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
/**
|
|
9
|
-
* Props for SignInButton component.
|
|
10
|
-
*/
|
|
11
|
-
export interface SignInButtonProps {
|
|
12
|
-
/** Button text (default: "Sign in with Timeback") */
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
/** Additional CSS class names */
|
|
15
|
-
className?: string;
|
|
16
|
-
/** Inline styles */
|
|
17
|
-
style?: React.CSSProperties;
|
|
18
|
-
/** Disabled state */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/** Show loading spinner when clicked */
|
|
21
|
-
showLoading?: boolean;
|
|
22
|
-
/** Called before redirect (can prevent with e.preventDefault()) */
|
|
23
|
-
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
24
|
-
/** Button variant */
|
|
25
|
-
variant?: 'default' | 'outline' | 'minimal';
|
|
26
|
-
/** Button size */
|
|
27
|
-
size?: 'sm' | 'md' | 'lg';
|
|
28
|
-
/** Show Timeback logo */
|
|
29
|
-
showLogo?: boolean;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Sign In with Timeback button component.
|
|
33
|
-
*
|
|
34
|
-
* Triggers SSO authentication flow when clicked.
|
|
35
|
-
*
|
|
36
|
-
* @param props - Component props
|
|
37
|
-
* @returns Button element
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```tsx
|
|
41
|
-
* // Basic usage
|
|
42
|
-
* <SignInButton />
|
|
43
|
-
*
|
|
44
|
-
* // Custom text
|
|
45
|
-
* <SignInButton>Continue with Timeback</SignInButton>
|
|
46
|
-
*
|
|
47
|
-
* // Outline variant
|
|
48
|
-
* <SignInButton variant="outline" />
|
|
49
|
-
*
|
|
50
|
-
* // Custom styling via CSS variables
|
|
51
|
-
* <SignInButton
|
|
52
|
-
* style={{
|
|
53
|
-
* '--tb-btn-bg': '#6366f1',
|
|
54
|
-
* '--tb-btn-bg-hover': '#4f46e5',
|
|
55
|
-
* } as React.CSSProperties}
|
|
56
|
-
* />
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export declare function SignInButton(props: SignInButtonProps): React.ReactElement;
|
|
60
|
-
//# sourceMappingURL=SignInButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../../src/client/adapters/react/SignInButton.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wCAAwC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mEAAmE;IACnE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC1D,qBAAqB;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAC3C,kBAAkB;IAClB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACzB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AA8MD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CA4DzE"}
|