timeback 0.1.5 → 0.1.7
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 +93 -26
- package/dist/cli.js +2837 -2384
- 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/README.md
CHANGED
|
@@ -19,6 +19,40 @@ timeback --help
|
|
|
19
19
|
|
|
20
20
|
## Commands
|
|
21
21
|
|
|
22
|
+
### `timeback resources`
|
|
23
|
+
|
|
24
|
+
Manage course resources with push/import/pull/unlink operations.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Push local config to Timeback (local → remote)
|
|
28
|
+
timeback resources push
|
|
29
|
+
timeback resources push --env staging
|
|
30
|
+
timeback resources push --dry-run
|
|
31
|
+
|
|
32
|
+
# Import courses from Timeback (remote → local config)
|
|
33
|
+
timeback resources import # Interactive mode
|
|
34
|
+
timeback resources import <course-id> # Import specific course
|
|
35
|
+
|
|
36
|
+
# Pull remote changes into local config (for already-linked courses)
|
|
37
|
+
timeback resources pull
|
|
38
|
+
timeback resources pull --env production
|
|
39
|
+
|
|
40
|
+
# Unlink courses from Timeback (deletes remote, keeps local definition)
|
|
41
|
+
timeback resources unlink --env staging
|
|
42
|
+
timeback resources unlink --env production --all
|
|
43
|
+
timeback resources unlink --dry-run
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### `timeback update`
|
|
47
|
+
|
|
48
|
+
Update the CLI to the latest version.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
timeback update
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Detects installation method (standalone binary, npm, bun) and updates appropriately.
|
|
55
|
+
|
|
22
56
|
### `timeback api`
|
|
23
57
|
|
|
24
58
|
Interact with education data APIs.
|
|
@@ -40,6 +74,33 @@ timeback api oneroster users list --role teacher --max 100
|
|
|
40
74
|
|
|
41
75
|
See `timeback api oneroster --help` for all resources and options.
|
|
42
76
|
|
|
77
|
+
### `timeback credentials`
|
|
78
|
+
|
|
79
|
+
Manage API credentials.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
timeback credentials add
|
|
83
|
+
timeback credentials list
|
|
84
|
+
timeback credentials remove
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `timeback studio`
|
|
88
|
+
|
|
89
|
+
Start the Timeback Studio development server.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
timeback studio
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### `timeback inspect`
|
|
96
|
+
|
|
97
|
+
Analyze Timeback entities.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
timeback inspect course <course-id> --env staging
|
|
101
|
+
timeback inspect course <course-id> --json
|
|
102
|
+
```
|
|
103
|
+
|
|
43
104
|
## Configuration
|
|
44
105
|
|
|
45
106
|
API clients read credentials from environment variables:
|
|
@@ -52,38 +113,36 @@ export ONEROSTER_CLIENT_ID="your-client-id"
|
|
|
52
113
|
export ONEROSTER_CLIENT_SECRET="your-client-secret"
|
|
53
114
|
```
|
|
54
115
|
|
|
55
|
-
### `timeback.config.
|
|
116
|
+
### `timeback.config.json`
|
|
56
117
|
|
|
57
|
-
|
|
118
|
+
The `timeback resources` commands read/write a `timeback.config.json` file.
|
|
58
119
|
|
|
59
120
|
For fields that can differ per environment (staging vs production), use `course.overrides`:
|
|
60
121
|
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
sensor:
|
|
66
|
-
courses: [
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"$schema": "https://timeback.dev/schema.json",
|
|
125
|
+
"name": "My App",
|
|
126
|
+
"sensor": "https://my-app.example.com/sensors/default",
|
|
127
|
+
"courses": [
|
|
67
128
|
{
|
|
68
|
-
subject:
|
|
69
|
-
grade: 3,
|
|
70
|
-
courseCode:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
sensor: 'https://staging.my-app.example.com/sensors/math',
|
|
79
|
-
metadata: { publishStatus: 'draft' },
|
|
80
|
-
},
|
|
81
|
-
production: {
|
|
82
|
-
metadata: { publishStatus: 'published' },
|
|
129
|
+
"subject": "Math",
|
|
130
|
+
"grade": 3,
|
|
131
|
+
"courseCode": "MATH-3",
|
|
132
|
+
"level": "Elementary",
|
|
133
|
+
"metadata": { "publishStatus": "testing" },
|
|
134
|
+
"overrides": {
|
|
135
|
+
"staging": {
|
|
136
|
+
"level": "Staging Level",
|
|
137
|
+
"sensor": "https://staging.my-app.example.com/sensors/math",
|
|
138
|
+
"metadata": { "publishStatus": "draft" }
|
|
83
139
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
140
|
+
"production": {
|
|
141
|
+
"metadata": { "publishStatus": "published" }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
]
|
|
87
146
|
}
|
|
88
147
|
```
|
|
89
148
|
|
|
@@ -92,6 +151,14 @@ Override merge rules:
|
|
|
92
151
|
- `defaults` → course → `overrides[env]` (for `level`, `sensor`, `metadata`)
|
|
93
152
|
- `metadata` is merged (not replaced); `goals` and `metrics` are deep-merged
|
|
94
153
|
|
|
154
|
+
### CLI-managed courses
|
|
155
|
+
|
|
156
|
+
When courses are created via `timeback resources push`, the CLI automatically tags them with `course.metadata.managedBy` (e.g., `timeback@1.0.0`). This marker:
|
|
157
|
+
|
|
158
|
+
- Helps distinguish CLI-managed courses from manually-created ones
|
|
159
|
+
- Is preserved during updates
|
|
160
|
+
- Can be used by `timeback resources import` to detect predictable course structure
|
|
161
|
+
|
|
95
162
|
## Debug Mode
|
|
96
163
|
|
|
97
164
|
```bash
|