@eduware/oneroster 1.2.4 → 1.2.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/FUNCTIONS.md +232 -0
- package/README.md +493 -334
- package/bin/mcp-server.js +338 -1328
- package/bin/mcp-server.js.map +22 -21
- package/dist/commonjs/enums/index.d.ts +2 -0
- package/dist/commonjs/enums/index.d.ts.map +1 -0
- package/dist/commonjs/enums/index.js +18 -0
- package/dist/commonjs/enums/index.js.map +1 -0
- package/dist/commonjs/index.d.ts +4 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +41 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/models/errors/index.d.ts +1 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.d.ts.map +1 -0
- package/dist/commonjs/models/index.js +18 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/operations/createuser.d.ts +8 -270
- package/dist/commonjs/models/operations/createuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createuser.js +17 -178
- package/dist/commonjs/models/operations/createuser.js.map +1 -1
- package/dist/commonjs/models/operations/getallstudents.d.ts +6 -206
- package/dist/commonjs/models/operations/getallstudents.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getallstudents.js +12 -132
- package/dist/commonjs/models/operations/getallstudents.js.map +1 -1
- package/dist/commonjs/models/operations/getallteachers.d.ts +6 -206
- package/dist/commonjs/models/operations/getallteachers.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getallteachers.js +12 -132
- package/dist/commonjs/models/operations/getallteachers.js.map +1 -1
- package/dist/commonjs/models/operations/getallusers.d.ts +6 -206
- package/dist/commonjs/models/operations/getallusers.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getallusers.js +12 -132
- package/dist/commonjs/models/operations/getallusers.js.map +1 -1
- package/dist/commonjs/models/operations/getclassesforuser.d.ts +4 -85
- package/dist/commonjs/models/operations/getclassesforuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getclassesforuser.js +8 -67
- package/dist/commonjs/models/operations/getclassesforuser.js.map +1 -1
- package/dist/commonjs/models/operations/getresourcesforuser.d.ts +5 -111
- package/dist/commonjs/models/operations/getresourcesforuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getresourcesforuser.js +10 -88
- package/dist/commonjs/models/operations/getresourcesforuser.js.map +1 -1
- package/dist/commonjs/models/operations/getstudent.d.ts +5 -174
- package/dist/commonjs/models/operations/getstudent.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getstudent.js +10 -108
- package/dist/commonjs/models/operations/getstudent.js.map +1 -1
- package/dist/commonjs/models/operations/getstudentsforclass.d.ts +6 -206
- package/dist/commonjs/models/operations/getstudentsforclass.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getstudentsforclass.js +12 -132
- package/dist/commonjs/models/operations/getstudentsforclass.js.map +1 -1
- package/dist/commonjs/models/operations/getstudentsforclassinschool.d.ts +6 -206
- package/dist/commonjs/models/operations/getstudentsforclassinschool.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getstudentsforclassinschool.js +12 -132
- package/dist/commonjs/models/operations/getstudentsforclassinschool.js.map +1 -1
- package/dist/commonjs/models/operations/getstudentsforschool.d.ts +6 -206
- package/dist/commonjs/models/operations/getstudentsforschool.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getstudentsforschool.js +12 -132
- package/dist/commonjs/models/operations/getstudentsforschool.js.map +1 -1
- package/dist/commonjs/models/operations/getteacher.d.ts +5 -174
- package/dist/commonjs/models/operations/getteacher.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getteacher.js +10 -108
- package/dist/commonjs/models/operations/getteacher.js.map +1 -1
- package/dist/commonjs/models/operations/getteachersforclass.d.ts +6 -206
- package/dist/commonjs/models/operations/getteachersforclass.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getteachersforclass.js +12 -132
- package/dist/commonjs/models/operations/getteachersforclass.js.map +1 -1
- package/dist/commonjs/models/operations/getteachersforclassinschool.d.ts +6 -206
- package/dist/commonjs/models/operations/getteachersforclassinschool.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getteachersforclassinschool.js +12 -132
- package/dist/commonjs/models/operations/getteachersforclassinschool.js.map +1 -1
- package/dist/commonjs/models/operations/getteachersforschool.d.ts +6 -206
- package/dist/commonjs/models/operations/getteachersforschool.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getteachersforschool.js +12 -132
- package/dist/commonjs/models/operations/getteachersforschool.js.map +1 -1
- package/dist/commonjs/models/operations/getuser.d.ts +5 -174
- package/dist/commonjs/models/operations/getuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getuser.js +10 -108
- package/dist/commonjs/models/operations/getuser.js.map +1 -1
- package/dist/commonjs/models/operations/getuserwithdemographics.d.ts +5 -174
- package/dist/commonjs/models/operations/getuserwithdemographics.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getuserwithdemographics.js +10 -108
- package/dist/commonjs/models/operations/getuserwithdemographics.js.map +1 -1
- package/dist/commonjs/models/operations/updateuser.d.ts +8 -270
- package/dist/commonjs/models/operations/updateuser.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateuser.js +17 -178
- package/dist/commonjs/models/operations/updateuser.js.map +1 -1
- package/dist/commonjs/models/shared/enums.d.ts +440 -0
- package/dist/commonjs/models/shared/enums.d.ts.map +1 -0
- package/dist/commonjs/models/shared/enums.js +499 -0
- package/dist/commonjs/models/shared/enums.js.map +1 -0
- package/dist/commonjs/models/shared/index.d.ts +8 -0
- package/dist/commonjs/models/shared/index.d.ts.map +1 -0
- package/dist/commonjs/models/shared/index.js +24 -0
- package/dist/commonjs/models/shared/index.js.map +1 -0
- package/dist/commonjs/types/index.d.ts +1 -0
- package/dist/commonjs/types/index.d.ts.map +1 -1
- package/dist/commonjs/types/index.js +16 -0
- package/dist/commonjs/types/index.js.map +1 -1
- package/dist/esm/enums/index.d.ts +2 -0
- package/dist/esm/enums/index.d.ts.map +1 -0
- package/dist/esm/enums/index.js +2 -0
- package/dist/esm/enums/index.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/errors/index.d.ts +1 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/operations/createuser.d.ts +8 -270
- package/dist/esm/models/operations/createuser.d.ts.map +1 -1
- package/dist/esm/models/operations/createuser.js +15 -176
- package/dist/esm/models/operations/createuser.js.map +1 -1
- package/dist/esm/models/operations/getallstudents.d.ts +6 -206
- package/dist/esm/models/operations/getallstudents.d.ts.map +1 -1
- package/dist/esm/models/operations/getallstudents.js +11 -131
- package/dist/esm/models/operations/getallstudents.js.map +1 -1
- package/dist/esm/models/operations/getallteachers.d.ts +6 -206
- package/dist/esm/models/operations/getallteachers.d.ts.map +1 -1
- package/dist/esm/models/operations/getallteachers.js +11 -131
- package/dist/esm/models/operations/getallteachers.js.map +1 -1
- package/dist/esm/models/operations/getallusers.d.ts +6 -206
- package/dist/esm/models/operations/getallusers.d.ts.map +1 -1
- package/dist/esm/models/operations/getallusers.js +11 -131
- package/dist/esm/models/operations/getallusers.js.map +1 -1
- package/dist/esm/models/operations/getclassesforuser.d.ts +4 -85
- package/dist/esm/models/operations/getclassesforuser.d.ts.map +1 -1
- package/dist/esm/models/operations/getclassesforuser.js +7 -66
- package/dist/esm/models/operations/getclassesforuser.js.map +1 -1
- package/dist/esm/models/operations/getresourcesforuser.d.ts +5 -111
- package/dist/esm/models/operations/getresourcesforuser.d.ts.map +1 -1
- package/dist/esm/models/operations/getresourcesforuser.js +9 -87
- package/dist/esm/models/operations/getresourcesforuser.js.map +1 -1
- package/dist/esm/models/operations/getstudent.d.ts +5 -174
- package/dist/esm/models/operations/getstudent.d.ts.map +1 -1
- package/dist/esm/models/operations/getstudent.js +9 -107
- package/dist/esm/models/operations/getstudent.js.map +1 -1
- package/dist/esm/models/operations/getstudentsforclass.d.ts +6 -206
- package/dist/esm/models/operations/getstudentsforclass.d.ts.map +1 -1
- package/dist/esm/models/operations/getstudentsforclass.js +11 -131
- package/dist/esm/models/operations/getstudentsforclass.js.map +1 -1
- package/dist/esm/models/operations/getstudentsforclassinschool.d.ts +6 -206
- package/dist/esm/models/operations/getstudentsforclassinschool.d.ts.map +1 -1
- package/dist/esm/models/operations/getstudentsforclassinschool.js +11 -131
- package/dist/esm/models/operations/getstudentsforclassinschool.js.map +1 -1
- package/dist/esm/models/operations/getstudentsforschool.d.ts +6 -206
- package/dist/esm/models/operations/getstudentsforschool.d.ts.map +1 -1
- package/dist/esm/models/operations/getstudentsforschool.js +11 -131
- package/dist/esm/models/operations/getstudentsforschool.js.map +1 -1
- package/dist/esm/models/operations/getteacher.d.ts +5 -174
- package/dist/esm/models/operations/getteacher.d.ts.map +1 -1
- package/dist/esm/models/operations/getteacher.js +9 -107
- package/dist/esm/models/operations/getteacher.js.map +1 -1
- package/dist/esm/models/operations/getteachersforclass.d.ts +6 -206
- package/dist/esm/models/operations/getteachersforclass.d.ts.map +1 -1
- package/dist/esm/models/operations/getteachersforclass.js +11 -131
- package/dist/esm/models/operations/getteachersforclass.js.map +1 -1
- package/dist/esm/models/operations/getteachersforclassinschool.d.ts +6 -206
- package/dist/esm/models/operations/getteachersforclassinschool.d.ts.map +1 -1
- package/dist/esm/models/operations/getteachersforclassinschool.js +11 -131
- package/dist/esm/models/operations/getteachersforclassinschool.js.map +1 -1
- package/dist/esm/models/operations/getteachersforschool.d.ts +6 -206
- package/dist/esm/models/operations/getteachersforschool.d.ts.map +1 -1
- package/dist/esm/models/operations/getteachersforschool.js +11 -131
- package/dist/esm/models/operations/getteachersforschool.js.map +1 -1
- package/dist/esm/models/operations/getuser.d.ts +5 -174
- package/dist/esm/models/operations/getuser.d.ts.map +1 -1
- package/dist/esm/models/operations/getuser.js +9 -107
- package/dist/esm/models/operations/getuser.js.map +1 -1
- package/dist/esm/models/operations/getuserwithdemographics.d.ts +5 -174
- package/dist/esm/models/operations/getuserwithdemographics.d.ts.map +1 -1
- package/dist/esm/models/operations/getuserwithdemographics.js +9 -107
- package/dist/esm/models/operations/getuserwithdemographics.js.map +1 -1
- package/dist/esm/models/operations/updateuser.d.ts +8 -270
- package/dist/esm/models/operations/updateuser.d.ts.map +1 -1
- package/dist/esm/models/operations/updateuser.js +15 -176
- package/dist/esm/models/operations/updateuser.js.map +1 -1
- package/dist/esm/models/shared/enums.d.ts +440 -0
- package/dist/esm/models/shared/enums.d.ts.map +1 -0
- package/dist/esm/models/shared/enums.js +462 -0
- package/dist/esm/models/shared/enums.js.map +1 -0
- package/dist/esm/models/shared/index.d.ts +8 -0
- package/dist/esm/models/shared/index.d.ts.map +1 -0
- package/dist/esm/models/shared/index.js +8 -0
- package/dist/esm/models/shared/index.js.map +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/index.js.map +1 -1
- package/package.json +37 -64
- package/src/enums/index.ts +1 -0
- package/src/index.ts +44 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/index.ts +1 -0
- package/src/models/operations/createuser.ts +35 -238
- package/src/models/operations/getallstudents.ts +32 -170
- package/src/models/operations/getallteachers.ts +32 -170
- package/src/models/operations/getallusers.ts +32 -170
- package/src/models/operations/getclassesforuser.ts +20 -97
- package/src/models/operations/getresourcesforuser.ts +26 -127
- package/src/models/operations/getstudent.ts +26 -136
- package/src/models/operations/getstudentsforclass.ts +32 -180
- package/src/models/operations/getstudentsforclassinschool.ts +32 -188
- package/src/models/operations/getstudentsforschool.ts +32 -180
- package/src/models/operations/getteacher.ts +26 -136
- package/src/models/operations/getteachersforclass.ts +32 -180
- package/src/models/operations/getteachersforclassinschool.ts +32 -188
- package/src/models/operations/getteachersforschool.ts +32 -180
- package/src/models/operations/getuser.ts +26 -136
- package/src/models/operations/getuserwithdemographics.ts +26 -144
- package/src/models/operations/updateuser.ts +35 -238
- package/src/models/shared/enums.ts +567 -0
- package/src/models/shared/index.ts +8 -0
- package/src/types/index.ts +3 -0
- package/test/classlink.test.ts +26 -26
- package/vitest.config.ts +2 -2
- package/test/summary-reporter.ts +0 -114
package/README.md
CHANGED
|
@@ -22,13 +22,13 @@ Type-safe TypeScript SDK for the OneRoster API with LMS-specific client profiles
|
|
|
22
22
|
|
|
23
23
|
## Features
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
25
|
+
- OneRoster v1.1 and v1.2 support
|
|
26
|
+
- LMS-specific client profiles (read-only vs full CRUD)
|
|
27
|
+
- Custom profiles: create your own profiles with TypeScript `Pick<>`
|
|
28
|
+
- OAuth 2.0 (v1.2) and OAuth 1.0a (v1.1)
|
|
29
|
+
- Automatic pagination with async iterables
|
|
30
|
+
- TypeScript-first with comprehensive types
|
|
31
|
+
- Tree-shakeable standalone functions for small bundles
|
|
32
32
|
|
|
33
33
|
## Installation
|
|
34
34
|
|
|
@@ -46,9 +46,15 @@ yarn add @eduware/oneroster zod
|
|
|
46
46
|
bun add @eduware/oneroster
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
>
|
|
49
|
+
> Note: Yarn does not install peer dependencies automatically. Install `zod` manually.
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## Changelog
|
|
52
|
+
|
|
53
|
+
See [CHANGELOG.md](./CHANGELOG.md) for release notes and breaking changes.
|
|
54
|
+
|
|
55
|
+
## Quick Start (recommended)
|
|
56
|
+
|
|
57
|
+
The main entry point is the full client:
|
|
52
58
|
|
|
53
59
|
```typescript
|
|
54
60
|
import { OneRoster } from '@eduware/oneroster';
|
|
@@ -62,21 +68,19 @@ const client = new OneRoster({
|
|
|
62
68
|
},
|
|
63
69
|
});
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
const user = await client.usersManagement.getUser({
|
|
72
|
+
sourcedId: 'user-id',
|
|
73
|
+
});
|
|
67
74
|
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
const schools = await client.schoolsManagement.getAllSchools({});
|
|
76
|
+
for await (const page of schools) {
|
|
77
|
+
console.log(page.result.orgs);
|
|
70
78
|
}
|
|
71
79
|
```
|
|
72
80
|
|
|
73
|
-
##
|
|
81
|
+
## ClassLink Example (read-only profile)
|
|
74
82
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### ClassLink Client
|
|
78
|
-
|
|
79
|
-
ClassLink provides read-only rostering data. The `ClassLink` client is typed to only expose supported methods:
|
|
83
|
+
Show LMS integrations explicitly by using the ClassLink client, which only exposes read endpoints:
|
|
80
84
|
|
|
81
85
|
```typescript
|
|
82
86
|
import { ClassLink } from '@eduware/oneroster/clients';
|
|
@@ -89,248 +93,208 @@ const client = new ClassLink({
|
|
|
89
93
|
},
|
|
90
94
|
});
|
|
91
95
|
|
|
92
|
-
//
|
|
96
|
+
// Read operations are available
|
|
93
97
|
const users = await client.usersManagement.getAllUsers({});
|
|
94
|
-
const schools = await client.schoolsManagement.getAllSchools({});
|
|
95
98
|
|
|
96
|
-
//
|
|
97
|
-
// client.usersManagement.createUser({});
|
|
99
|
+
// Write operations are not available (TypeScript error)
|
|
100
|
+
// await client.usersManagement.createUser({ ... });
|
|
98
101
|
```
|
|
99
102
|
|
|
100
|
-
|
|
103
|
+
## Custom Profile Example (your LMS)
|
|
101
104
|
|
|
102
|
-
|
|
105
|
+
Define a profile that matches your LMS contract by picking only the methods you need:
|
|
103
106
|
|
|
104
107
|
```typescript
|
|
105
108
|
import { OneRoster } from '@eduware/oneroster';
|
|
109
|
+
import type { OneRosterClient } from '@eduware/oneroster/clients';
|
|
110
|
+
import type { UsersManagement, ClassesManagement } from '@eduware/oneroster';
|
|
106
111
|
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
interface CustomProfile {
|
|
113
|
+
usersManagement: Pick<UsersManagement, 'getAllUsers' | 'getUser'>;
|
|
114
|
+
classesManagement: Pick<ClassesManagement, 'getAllClasses' | 'getClass'>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const client: OneRosterClient<CustomProfile> = new OneRoster({
|
|
118
|
+
serverURL: 'https://your-roster-server.com',
|
|
109
119
|
security: {
|
|
110
120
|
clientID: process.env.ONEROSTER_CLIENT_ID!,
|
|
111
121
|
clientSecret: process.env.ONEROSTER_CLIENT_SECRET!,
|
|
112
|
-
tokenURL: 'https://your-
|
|
122
|
+
tokenURL: 'https://your-roster-server.com/oauth/token',
|
|
113
123
|
},
|
|
114
124
|
});
|
|
115
125
|
|
|
116
|
-
// All operations available
|
|
117
126
|
const users = await client.usersManagement.getAllUsers({});
|
|
118
|
-
await client.usersManagement.createUser({
|
|
119
|
-
user: {
|
|
120
|
-
/* ... */
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
127
|
```
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
This SDK works with any OneRoster-compliant LMS and includes profiles for common integrations.
|
|
130
|
+
|
|
131
|
+
## Recommended Import Path
|
|
126
132
|
|
|
127
|
-
|
|
133
|
+
Most users only need the main client:
|
|
128
134
|
|
|
129
135
|
```typescript
|
|
130
136
|
import { OneRoster } from '@eduware/oneroster';
|
|
131
|
-
|
|
132
|
-
import type { OneRosterClient } from '@eduware/oneroster/clients';
|
|
137
|
+
```
|
|
133
138
|
|
|
134
|
-
|
|
135
|
-
interface IMyCustomProfile {
|
|
136
|
-
usersManagement: Pick<UsersManagement, 'getAllUsers' | 'getUser'>;
|
|
137
|
-
classesManagement: Pick<ClassesManagement, 'getAllClasses' | 'getClass'>;
|
|
138
|
-
}
|
|
139
|
+
Operation types use `@eduware/oneroster/types`:
|
|
139
140
|
|
|
140
|
-
|
|
141
|
-
type
|
|
141
|
+
```typescript
|
|
142
|
+
import type { GetAllUsersUser, GetAllSchoolsOrg } from '@eduware/oneroster/types';
|
|
143
|
+
```
|
|
142
144
|
|
|
143
|
-
|
|
144
|
-
serverURL: 'https://your-server.com',
|
|
145
|
-
security: {
|
|
146
|
-
/* ... */
|
|
147
|
-
},
|
|
148
|
-
});
|
|
145
|
+
Model types live at `@eduware/oneroster/models`:
|
|
149
146
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
## Management Modules & LMS Support
|
|
156
|
-
|
|
157
|
-
The SDK provides management modules for all OneRoster resources. Each module supports CRUD (Create, Read, Update, Delete) operations as defined by the OneRoster specification. However, **not all LMS providers support all operations** - some providers offer read-only access to rostering data.
|
|
158
|
-
|
|
159
|
-
> **⚠️ Important:** The availability of operations depends on your LMS provider's implementation. The table below shows which operations are supported by each LMS. Operations marked with ❌ will result in API errors if called against providers that don't support them.
|
|
160
|
-
|
|
161
|
-
### Management Modules Overview
|
|
162
|
-
|
|
163
|
-
| Module | Description | Primary Resources |
|
|
164
|
-
| ------------------------------------ | ------------------------------------------ | --------------------------------------- |
|
|
165
|
-
| `usersManagement` | User accounts (students, teachers, admins) | Users |
|
|
166
|
-
| `studentsManagement` | Student-specific operations | Users (role: student) |
|
|
167
|
-
| `teachersManagement` | Teacher-specific operations | Users (role: teacher) |
|
|
168
|
-
| `classesManagement` | Class/section management | Classes |
|
|
169
|
-
| `coursesManagement` | Course catalog management | Courses |
|
|
170
|
-
| `enrollmentsManagement` | Class enrollment records | Enrollments |
|
|
171
|
-
| `schoolsManagement` | School/organization management | Orgs (type: school) |
|
|
172
|
-
| `organizationsManagement` | All organization types | Orgs |
|
|
173
|
-
| `academicSessionsManagement` | School years, semesters, terms | Academic Sessions |
|
|
174
|
-
| `termsManagement` | Term-specific operations | Academic Sessions (type: term) |
|
|
175
|
-
| `gradingPeriodsManagement` | Grading period management | Academic Sessions (type: gradingPeriod) |
|
|
176
|
-
| `demographicsManagement` | Student demographic data | Demographics |
|
|
177
|
-
| `lineItemsManagement` | Gradebook assignments | Line Items |
|
|
178
|
-
| `resultsManagement` | Student grades/scores | Results |
|
|
179
|
-
| `categoriesManagement` | Grade categories | Categories |
|
|
180
|
-
| `scoreScalesManagement` | Grading scales | Score Scales |
|
|
181
|
-
| `resourcesManagement` | Learning resources | Resources |
|
|
182
|
-
| `courseComponentsManagement` | Course modules/units | Course Components |
|
|
183
|
-
| `courseComponentResourcesManagement` | Resources linked to components | Component Resources |
|
|
184
|
-
| `assessmentLineItemsManagement` | Assessment definitions | Assessment Line Items |
|
|
185
|
-
| `assessmentResultsManagement` | Assessment scores | Assessment Results |
|
|
147
|
+
```typescript
|
|
148
|
+
import type { User } from '@eduware/oneroster/models';
|
|
149
|
+
```
|
|
186
150
|
|
|
187
|
-
|
|
151
|
+
Enums live at `@eduware/oneroster/enums`:
|
|
188
152
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
| `studentsManagement` | — | ✅ | — | — |
|
|
193
|
-
| `teachersManagement` | — | ✅ | — | — |
|
|
194
|
-
| `classesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
195
|
-
| `coursesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
196
|
-
| `enrollmentsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
197
|
-
| `schoolsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
198
|
-
| `organizationsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
199
|
-
| `academicSessionsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
200
|
-
| `termsManagement` | — | ✅ | — | — |
|
|
201
|
-
| `gradingPeriodsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
202
|
-
| `demographicsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
203
|
-
| `lineItemsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
204
|
-
| `resultsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
205
|
-
| `categoriesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
206
|
-
| `scoreScalesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
207
|
-
| `resourcesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
208
|
-
| `courseComponentsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
209
|
-
| `courseComponentResourcesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
210
|
-
| `assessmentLineItemsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
211
|
-
| `assessmentResultsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
153
|
+
```typescript
|
|
154
|
+
import { UserRole } from '@eduware/oneroster/enums';
|
|
155
|
+
```
|
|
212
156
|
|
|
213
|
-
|
|
157
|
+
Advanced import paths (standalone functions) are documented later in this README.
|
|
214
158
|
|
|
215
|
-
|
|
159
|
+
## Client Structure
|
|
216
160
|
|
|
217
|
-
|
|
161
|
+
The SDK is organized by management modules, grouped by domain:
|
|
218
162
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
| `demographicsManagement` | ✅ CRUD | ❌ |
|
|
236
|
-
| **Gradebook** | | |
|
|
237
|
-
| `lineItemsManagement` | ✅ CRUD | ❌ |
|
|
238
|
-
| `resultsManagement` | ✅ CRUD | ❌ |
|
|
239
|
-
| `categoriesManagement` | ✅ CRUD | ❌ |
|
|
240
|
-
| `scoreScalesManagement` | ✅ CRUD | ❌ |
|
|
241
|
-
| **Resources** | | |
|
|
242
|
-
| `resourcesManagement` | ✅ CRUD | ❌ |
|
|
243
|
-
| `courseComponentsManagement` | ✅ CRUD | ❌ |
|
|
244
|
-
| `courseComponentResourcesManagement` | ✅ CRUD | ❌ |
|
|
245
|
-
| **Assessments** | | |
|
|
246
|
-
| `assessmentLineItemsManagement` | ✅ CRUD | ❌ |
|
|
247
|
-
| `assessmentResultsManagement` | ✅ CRUD | ❌ |
|
|
163
|
+
### Rostering
|
|
164
|
+
|
|
165
|
+
- `usersManagement`
|
|
166
|
+
- `studentsManagement`
|
|
167
|
+
- `teachersManagement`
|
|
168
|
+
- `classesManagement`
|
|
169
|
+
- `coursesManagement`
|
|
170
|
+
- `enrollmentsManagement`
|
|
171
|
+
- `schoolsManagement`
|
|
172
|
+
- `organizationsManagement`
|
|
173
|
+
|
|
174
|
+
### Academic Calendar
|
|
175
|
+
|
|
176
|
+
- `academicSessionsManagement`
|
|
177
|
+
- `termsManagement`
|
|
178
|
+
- `gradingPeriodsManagement`
|
|
248
179
|
|
|
249
|
-
|
|
180
|
+
### Gradebook
|
|
250
181
|
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
182
|
+
- `lineItemsManagement`
|
|
183
|
+
- `resultsManagement`
|
|
184
|
+
- `categoriesManagement`
|
|
185
|
+
- `scoreScalesManagement`
|
|
254
186
|
|
|
255
|
-
|
|
187
|
+
### Resources
|
|
256
188
|
|
|
257
|
-
|
|
189
|
+
- `resourcesManagement`
|
|
190
|
+
- `courseComponentsManagement`
|
|
191
|
+
- `courseComponentResourcesManagement`
|
|
258
192
|
|
|
259
|
-
|
|
193
|
+
### Assessments
|
|
194
|
+
|
|
195
|
+
- `assessmentLineItemsManagement`
|
|
196
|
+
- `assessmentResultsManagement`
|
|
197
|
+
|
|
198
|
+
### Demographics
|
|
199
|
+
|
|
200
|
+
- `demographicsManagement`
|
|
201
|
+
|
|
202
|
+
## Common Operations
|
|
260
203
|
|
|
261
204
|
```typescript
|
|
262
|
-
//
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
205
|
+
// List with pagination
|
|
206
|
+
const users = await client.usersManagement.getAllUsers({ limit: 100 });
|
|
207
|
+
for await (const page of users) {
|
|
208
|
+
console.log(page.result.users);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Get by sourcedId
|
|
212
|
+
const student = await client.studentsManagement.getStudent({ sourcedId: 'student-id' });
|
|
266
213
|
|
|
267
|
-
//
|
|
268
|
-
|
|
269
|
-
|
|
214
|
+
// Create
|
|
215
|
+
await client.coursesManagement.createCourse({
|
|
216
|
+
course: {
|
|
217
|
+
title: 'Algebra I',
|
|
218
|
+
org: { sourcedId: 'school-id' },
|
|
219
|
+
},
|
|
270
220
|
});
|
|
271
221
|
|
|
272
|
-
//
|
|
273
|
-
|
|
274
|
-
|
|
222
|
+
// Update
|
|
223
|
+
await client.classesManagement.updateClass({
|
|
224
|
+
sourcedId: 'class-id',
|
|
225
|
+
class: { title: 'Math 101 - Period 2' },
|
|
275
226
|
});
|
|
227
|
+
|
|
228
|
+
// Delete
|
|
229
|
+
await client.organizationsManagement.deleteOrg({ sourcedId: 'org-id' });
|
|
276
230
|
```
|
|
277
231
|
|
|
278
|
-
|
|
232
|
+
## Filtering and Sorting
|
|
279
233
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
- `users/{id}/classes`, `students/{id}/classes`, `teachers/{id}/classes`
|
|
283
|
-
- `terms/{id}/classes`, `courses/{id}/classes`
|
|
234
|
+
```typescript
|
|
235
|
+
import { OrderBy } from '@eduware/oneroster/enums';
|
|
284
236
|
|
|
285
|
-
|
|
237
|
+
const activeUsers = await client.usersManagement.getAllUsers({
|
|
238
|
+
filter: "status='active'",
|
|
239
|
+
sort: 'familyName',
|
|
240
|
+
orderBy: OrderBy.Asc,
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
const teachers = await client.usersManagement.getAllUsers({
|
|
244
|
+
filter: "role='teacher' AND status='active'",
|
|
245
|
+
});
|
|
286
246
|
|
|
287
|
-
|
|
247
|
+
const searchByEmail = await client.usersManagement.getAllUsers({
|
|
248
|
+
search: 'teacher@district.edu',
|
|
249
|
+
fields: 'sourcedId,username,email',
|
|
250
|
+
});
|
|
251
|
+
```
|
|
288
252
|
|
|
289
|
-
|
|
253
|
+
## Pagination and Total Count
|
|
290
254
|
|
|
291
|
-
|
|
255
|
+
List operations return an async iterator. If the provider sets `X-Total-Count`, it is exposed as `totalCount`.
|
|
292
256
|
|
|
293
257
|
```typescript
|
|
294
|
-
|
|
258
|
+
const pages = await client.usersManagement.getAllUsers({ limit: 200, offset: 0 });
|
|
295
259
|
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
clientID: process.env.ONEROSTER_CLIENT_ID!,
|
|
301
|
-
clientSecret: process.env.ONEROSTER_CLIENT_SECRET!,
|
|
302
|
-
tokenURL: 'https://your-server.com/oauth/token',
|
|
303
|
-
},
|
|
304
|
-
});
|
|
260
|
+
for await (const page of pages) {
|
|
261
|
+
console.log('page count', page.result.users.length);
|
|
262
|
+
console.log('total count', page.totalCount);
|
|
263
|
+
}
|
|
305
264
|
```
|
|
306
265
|
|
|
307
|
-
|
|
266
|
+
## Nested Query Patterns
|
|
308
267
|
|
|
309
|
-
|
|
268
|
+
Use the module methods that reflect OneRoster relationships:
|
|
310
269
|
|
|
311
270
|
```typescript
|
|
312
|
-
|
|
271
|
+
// School -> class -> enrollments
|
|
272
|
+
const classes = await client.schoolsManagement.getClassesForSchool({ sourcedId: 'school-id' });
|
|
273
|
+
const enrollments = await client.schoolsManagement.getEnrollmentsForClassInSchool({
|
|
274
|
+
schoolSourcedId: 'school-id',
|
|
275
|
+
classSourcedId: 'class-id',
|
|
276
|
+
});
|
|
313
277
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
278
|
+
// Teacher -> classes
|
|
279
|
+
const teaching = await client.teachersManagement.getClassesForTeacher({
|
|
280
|
+
sourcedId: 'teacher-id',
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
// Class -> line items -> results
|
|
284
|
+
const lineItems = await client.classesManagement.getLineItemsForClass({ sourcedId: 'class-id' });
|
|
285
|
+
const results = await client.classesManagement.getResultsForLineItemForClass({
|
|
286
|
+
classSourcedId: 'class-id',
|
|
287
|
+
lineItemSourcedId: 'line-item-id',
|
|
322
288
|
});
|
|
323
289
|
```
|
|
324
290
|
|
|
325
|
-
|
|
291
|
+
## OneRoster Versions
|
|
326
292
|
|
|
327
|
-
|
|
293
|
+
The SDK supports both OneRoster v1.1 and v1.2. Default is v1.2.
|
|
328
294
|
|
|
329
|
-
### OAuth 2.0
|
|
295
|
+
### v1.2 (OAuth 2.0)
|
|
330
296
|
|
|
331
297
|
```typescript
|
|
332
|
-
import { OneRoster } from '@eduware/oneroster';
|
|
333
|
-
|
|
334
298
|
const client = new OneRoster({
|
|
335
299
|
serverURL: 'https://your-server.com',
|
|
336
300
|
security: {
|
|
@@ -341,17 +305,9 @@ const client = new OneRoster({
|
|
|
341
305
|
});
|
|
342
306
|
```
|
|
343
307
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
- `ONEROSTER_CLIENT_ID`
|
|
347
|
-
- `ONEROSTER_CLIENT_SECRET`
|
|
348
|
-
- `ONEROSTER_TOKEN_URL`
|
|
349
|
-
|
|
350
|
-
### OAuth 1.0a (v1.1 only)
|
|
308
|
+
### v1.1 (OAuth 1.0a)
|
|
351
309
|
|
|
352
310
|
```typescript
|
|
353
|
-
import { OneRoster } from '@eduware/oneroster';
|
|
354
|
-
|
|
355
311
|
const client = new OneRoster({
|
|
356
312
|
serverURL: 'https://your-server.com',
|
|
357
313
|
oneRosterVersion: '1.1',
|
|
@@ -363,159 +319,388 @@ const client = new OneRoster({
|
|
|
363
319
|
});
|
|
364
320
|
```
|
|
365
321
|
|
|
366
|
-
### Bearer Token
|
|
367
|
-
|
|
368
|
-
If you already have a token:
|
|
322
|
+
### Bearer Token (provider-specific)
|
|
369
323
|
|
|
370
324
|
```typescript
|
|
371
|
-
import { OneRoster } from '@eduware/oneroster';
|
|
372
|
-
|
|
373
325
|
const client = new OneRoster({
|
|
374
326
|
serverURL: 'https://your-server.com',
|
|
375
327
|
security: {
|
|
376
328
|
authType: 'bearer',
|
|
377
|
-
bearerToken:
|
|
329
|
+
bearerToken: process.env.ONEROSTER_BEARER_TOKEN!,
|
|
378
330
|
},
|
|
379
331
|
});
|
|
380
332
|
```
|
|
381
333
|
|
|
382
|
-
##
|
|
383
|
-
|
|
384
|
-
All list endpoints support automatic pagination using async iterables:
|
|
334
|
+
## Error Handling
|
|
385
335
|
|
|
386
336
|
```typescript
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
337
|
+
import { OneRoster, OneRosterError, NotFoundResponseError } from '@eduware/oneroster';
|
|
338
|
+
|
|
339
|
+
const client = new OneRoster({
|
|
340
|
+
/* ... */
|
|
390
341
|
});
|
|
391
342
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
343
|
+
try {
|
|
344
|
+
await client.usersManagement.getUser({ sourcedId: 'missing-id' });
|
|
345
|
+
} catch (error) {
|
|
346
|
+
if (error instanceof NotFoundResponseError) {
|
|
347
|
+
console.log('User not found');
|
|
348
|
+
} else if (error instanceof OneRosterError) {
|
|
349
|
+
console.log('HTTP Error:', error.statusCode, error.message);
|
|
396
350
|
}
|
|
397
351
|
}
|
|
398
352
|
```
|
|
399
353
|
|
|
400
|
-
|
|
354
|
+
## Standalone Functions (tree-shaking)
|
|
401
355
|
|
|
402
|
-
|
|
356
|
+
Use standalone functions for minimal bundles or serverless environments:
|
|
403
357
|
|
|
404
358
|
```typescript
|
|
405
|
-
|
|
359
|
+
import { OneRosterCore } from '@eduware/oneroster/core.js';
|
|
360
|
+
import { usersManagementGetAllUsers } from '@eduware/oneroster/funcs/usersManagementGetAllUsers.js';
|
|
406
361
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
362
|
+
const core = new OneRosterCore({
|
|
363
|
+
security: {
|
|
364
|
+
clientID: process.env.ONEROSTER_CLIENT_ID!,
|
|
365
|
+
clientSecret: process.env.ONEROSTER_CLIENT_SECRET!,
|
|
366
|
+
},
|
|
367
|
+
});
|
|
411
368
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
console.log(
|
|
416
|
-
console.log(`Total: ${page.totalCount}`);
|
|
369
|
+
const result = await usersManagementGetAllUsers(core, {});
|
|
370
|
+
if (result.ok) {
|
|
371
|
+
for await (const page of result.value) {
|
|
372
|
+
console.log(page.result.users);
|
|
417
373
|
}
|
|
418
374
|
}
|
|
419
375
|
```
|
|
420
376
|
|
|
421
|
-
|
|
377
|
+
See [FUNCTIONS.md](./FUNCTIONS.md) for the full list.
|
|
422
378
|
|
|
423
|
-
##
|
|
379
|
+
## Function Index (by Module)
|
|
424
380
|
|
|
425
|
-
|
|
426
|
-
// Filter by status
|
|
427
|
-
const activeUsers = await client.usersManagement.getAllUsers({
|
|
428
|
-
filter: "status='active'",
|
|
429
|
-
});
|
|
381
|
+
Each function maps to `@eduware/oneroster/funcs/<name>.js`.
|
|
430
382
|
|
|
431
|
-
|
|
432
|
-
const filteredUsers = await client.usersManagement.getAllUsers({
|
|
433
|
-
filter: "status='active' AND role='student'",
|
|
434
|
-
});
|
|
383
|
+
### academicSessionsManagement
|
|
435
384
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
385
|
+
```text
|
|
386
|
+
academicSessionsManagementDeleteAcademicSession
|
|
387
|
+
academicSessionsManagementGetAcademicSession
|
|
388
|
+
academicSessionsManagementGetAllAcademicSessions
|
|
389
|
+
academicSessionsManagementPostAcademicSession
|
|
390
|
+
academicSessionsManagementPutAcademicSession
|
|
391
|
+
```
|
|
441
392
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
393
|
+
### assessmentLineItemsManagement
|
|
394
|
+
|
|
395
|
+
```text
|
|
396
|
+
assessmentLineItemsManagementCreateAssessmentLineItem
|
|
397
|
+
assessmentLineItemsManagementDeleteAssessmentLineItem
|
|
398
|
+
assessmentLineItemsManagementGetAllAssessmentLineItems
|
|
399
|
+
assessmentLineItemsManagementGetAssessmentLineItem
|
|
400
|
+
assessmentLineItemsManagementUpdateAssessmentLineItem
|
|
446
401
|
```
|
|
447
402
|
|
|
448
|
-
|
|
403
|
+
### assessmentResultsManagement
|
|
449
404
|
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
|
|
405
|
+
```text
|
|
406
|
+
assessmentResultsManagementCreateAssessmentResult
|
|
407
|
+
assessmentResultsManagementDeleteAssessmentResult
|
|
408
|
+
assessmentResultsManagementGetAllAssessmentResults
|
|
409
|
+
assessmentResultsManagementGetAssessmentResult
|
|
410
|
+
assessmentResultsManagementUpdateAssessmentResult
|
|
411
|
+
```
|
|
453
412
|
|
|
454
|
-
|
|
455
|
-
/* ... */
|
|
456
|
-
});
|
|
413
|
+
### categoriesManagement
|
|
457
414
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
console.log('User not found');
|
|
465
|
-
} else if (error instanceof errors.UnauthorizedRequestResponseError) {
|
|
466
|
-
console.log('Authentication failed');
|
|
467
|
-
} else if (error instanceof errors.OneRosterError) {
|
|
468
|
-
// Base class for all HTTP errors
|
|
469
|
-
console.log('HTTP Error:', error.statusCode, error.message);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
415
|
+
```text
|
|
416
|
+
categoriesManagementCreateCategory
|
|
417
|
+
categoriesManagementDeleteCategory
|
|
418
|
+
categoriesManagementGetAllCategories
|
|
419
|
+
categoriesManagementGetCategory
|
|
420
|
+
categoriesManagementUpdateCategory
|
|
472
421
|
```
|
|
473
422
|
|
|
474
|
-
###
|
|
423
|
+
### classesManagement
|
|
424
|
+
|
|
425
|
+
```text
|
|
426
|
+
classesManagementAddStudentToClass
|
|
427
|
+
classesManagementAddTeacherToClass
|
|
428
|
+
classesManagementCreateClass
|
|
429
|
+
classesManagementDeleteClass
|
|
430
|
+
classesManagementGetAllClasses
|
|
431
|
+
classesManagementGetCategoriesForClass
|
|
432
|
+
classesManagementGetClass
|
|
433
|
+
classesManagementGetClassesForStudent
|
|
434
|
+
classesManagementGetClassesForTeacher
|
|
435
|
+
classesManagementGetClassesForTerm
|
|
436
|
+
classesManagementGetClassesForUser
|
|
437
|
+
classesManagementGetLineItemsForClass
|
|
438
|
+
classesManagementGetResultsForClass
|
|
439
|
+
classesManagementGetResultsForLineItemForClass
|
|
440
|
+
classesManagementGetResultsForStudentForClass
|
|
441
|
+
classesManagementGetScoreScalesForClass
|
|
442
|
+
classesManagementGetStudentsForClass
|
|
443
|
+
classesManagementGetTeachersForClass
|
|
444
|
+
classesManagementPostResultsForAcademicSessionForClass
|
|
445
|
+
classesManagementUpdateClass
|
|
446
|
+
```
|
|
475
447
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
448
|
+
### coursesManagement
|
|
449
|
+
|
|
450
|
+
```text
|
|
451
|
+
coursesManagementCreateComponentResource
|
|
452
|
+
coursesManagementCreateCourse
|
|
453
|
+
coursesManagementCreateCourseComponent
|
|
454
|
+
coursesManagementDeleteComponentResource
|
|
455
|
+
coursesManagementDeleteCourse
|
|
456
|
+
coursesManagementDeleteCourseComponent
|
|
457
|
+
coursesManagementGetAllComponentResources
|
|
458
|
+
coursesManagementGetAllCourseComponents
|
|
459
|
+
coursesManagementGetAllCourses
|
|
460
|
+
coursesManagementGetClassesForCourse
|
|
461
|
+
coursesManagementGetComponentResource
|
|
462
|
+
coursesManagementGetCourse
|
|
463
|
+
coursesManagementGetCourseComponent
|
|
464
|
+
coursesManagementPutComponentResource
|
|
465
|
+
coursesManagementPutCourse
|
|
466
|
+
coursesManagementPutCourseComponent
|
|
467
|
+
```
|
|
485
468
|
|
|
486
|
-
|
|
469
|
+
### demographicsManagement
|
|
487
470
|
|
|
488
|
-
|
|
471
|
+
```text
|
|
472
|
+
demographicsManagementDeleteDemographics
|
|
473
|
+
demographicsManagementGetAllDemographics
|
|
474
|
+
demographicsManagementGetDemographics
|
|
475
|
+
demographicsManagementPostDemographics
|
|
476
|
+
demographicsManagementPutDemographics
|
|
477
|
+
```
|
|
489
478
|
|
|
490
|
-
|
|
491
|
-
import { OneRosterCore } from '@eduware/oneroster/core.js';
|
|
492
|
-
import { usersManagementGetAllUsers } from '@eduware/oneroster/funcs/usersManagementGetAllUsers.js';
|
|
479
|
+
### enrollmentsManagement
|
|
493
480
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
481
|
+
```text
|
|
482
|
+
enrollmentsManagementCreateEnrollment
|
|
483
|
+
enrollmentsManagementDeleteEnrollment
|
|
484
|
+
enrollmentsManagementGetAllEnrollments
|
|
485
|
+
enrollmentsManagementGetEnrollment
|
|
486
|
+
enrollmentsManagementUpdateEnrollment
|
|
487
|
+
```
|
|
500
488
|
|
|
501
|
-
|
|
489
|
+
### gradingPeriodsManagement
|
|
502
490
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
491
|
+
```text
|
|
492
|
+
gradingPeriodsManagementCreateGradingPeriod
|
|
493
|
+
gradingPeriodsManagementDeleteGradingPeriod
|
|
494
|
+
gradingPeriodsManagementGetAllGradingPeriods
|
|
495
|
+
gradingPeriodsManagementGetGradingPeriod
|
|
496
|
+
gradingPeriodsManagementUpdateGradingPeriod
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### lineItemsManagement
|
|
500
|
+
|
|
501
|
+
```text
|
|
502
|
+
lineItemsManagementCreateLineItem
|
|
503
|
+
lineItemsManagementCreateResultForLineItem
|
|
504
|
+
lineItemsManagementDeleteLineItem
|
|
505
|
+
lineItemsManagementGetAllLineItems
|
|
506
|
+
lineItemsManagementGetLineItem
|
|
507
|
+
lineItemsManagementUpdateLineItem
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### organizationsManagement
|
|
511
|
+
|
|
512
|
+
```text
|
|
513
|
+
organizationsManagementCreateOrg
|
|
514
|
+
organizationsManagementDeleteOrg
|
|
515
|
+
organizationsManagementGetAllOrgs
|
|
516
|
+
organizationsManagementGetOrg
|
|
517
|
+
organizationsManagementUpdateOrg
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
### resourcesManagement
|
|
521
|
+
|
|
522
|
+
```text
|
|
523
|
+
resourcesManagementCreateResource
|
|
524
|
+
resourcesManagementDeleteResource
|
|
525
|
+
resourcesManagementExportResourceToCommonCartridge
|
|
526
|
+
resourcesManagementGetAllResources
|
|
527
|
+
resourcesManagementGetResource
|
|
528
|
+
resourcesManagementGetResourcesForClass
|
|
529
|
+
resourcesManagementGetResourcesForCourse
|
|
530
|
+
resourcesManagementGetResourcesForUser
|
|
531
|
+
resourcesManagementUpdateResource
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
### resultsManagement
|
|
535
|
+
|
|
536
|
+
```text
|
|
537
|
+
resultsManagementCreateResult
|
|
538
|
+
resultsManagementDeleteResult
|
|
539
|
+
resultsManagementGetAllResults
|
|
540
|
+
resultsManagementGetResult
|
|
541
|
+
resultsManagementUpdateResult
|
|
510
542
|
```
|
|
511
543
|
|
|
512
|
-
|
|
544
|
+
### schoolsManagement
|
|
545
|
+
|
|
546
|
+
```text
|
|
547
|
+
schoolsManagementCreateLineItemsForSchool
|
|
548
|
+
schoolsManagementCreateSchool
|
|
549
|
+
schoolsManagementDeleteSchool
|
|
550
|
+
schoolsManagementGetAllSchools
|
|
551
|
+
schoolsManagementGetClassesForSchool
|
|
552
|
+
schoolsManagementGetCoursesForSchool
|
|
553
|
+
schoolsManagementGetEnrollmentsForClassInSchool
|
|
554
|
+
schoolsManagementGetEnrollmentsForSchool
|
|
555
|
+
schoolsManagementGetLineItemsForSchool
|
|
556
|
+
schoolsManagementGetSchool
|
|
557
|
+
schoolsManagementGetStudentsForClassInSchool
|
|
558
|
+
schoolsManagementGetStudentsForSchool
|
|
559
|
+
schoolsManagementGetTeachersForClassInSchool
|
|
560
|
+
schoolsManagementGetTeachersForSchool
|
|
561
|
+
schoolsManagementGetTermsForSchool
|
|
562
|
+
schoolsManagementUpdateSchool
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### scoreScalesManagement
|
|
566
|
+
|
|
567
|
+
```text
|
|
568
|
+
scoreScalesManagementCreateScoreScale
|
|
569
|
+
scoreScalesManagementDeleteScoreScale
|
|
570
|
+
scoreScalesManagementGetAllScoreScales
|
|
571
|
+
scoreScalesManagementGetScoreScale
|
|
572
|
+
scoreScalesManagementGetScoreScalesForSchool
|
|
573
|
+
scoreScalesManagementUpdateScoreScale
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### studentsManagement
|
|
577
|
+
|
|
578
|
+
```text
|
|
579
|
+
studentsManagementGetAllStudents
|
|
580
|
+
studentsManagementGetStudent
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
### teachersManagement
|
|
584
|
+
|
|
585
|
+
```text
|
|
586
|
+
teachersManagementGetAllTeachers
|
|
587
|
+
teachersManagementGetTeacher
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
### termsManagement
|
|
591
|
+
|
|
592
|
+
```text
|
|
593
|
+
termsManagementCreateGradingPeriodForTerm
|
|
594
|
+
termsManagementGetAllTerms
|
|
595
|
+
termsManagementGetGradingPeriodsForTerm
|
|
596
|
+
termsManagementGetTerm
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
### usersManagement
|
|
600
|
+
|
|
601
|
+
```text
|
|
602
|
+
usersManagementCreateUser
|
|
603
|
+
usersManagementDeleteUser
|
|
604
|
+
usersManagementGetAllUsers
|
|
605
|
+
usersManagementGetUser
|
|
606
|
+
usersManagementGetUserWithDemographics
|
|
607
|
+
usersManagementUpdateUser
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
## LMS Provider Support
|
|
611
|
+
|
|
612
|
+
Support varies by LMS provider and contract. The profile you choose reflects LMS capabilities, not library limitations.
|
|
613
|
+
|
|
614
|
+
### LMS Profiles
|
|
615
|
+
|
|
616
|
+
| Provider | Profile | Notes |
|
|
617
|
+
| --------- | ----------- | -------------------------- |
|
|
618
|
+
| OneRoster | full | All endpoints available |
|
|
619
|
+
| ClassLink | classlink | Read-only rostering access |
|
|
620
|
+
| (future) | coming soon | Add new LMS profiles here |
|
|
621
|
+
|
|
622
|
+
### CRUD Operations by Module
|
|
623
|
+
|
|
624
|
+
| Module | Create | Read | Update | Delete |
|
|
625
|
+
| ------------------------------------ | :----: | :--: | :----: | :----: |
|
|
626
|
+
| `usersManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
627
|
+
| `studentsManagement` | — | ✅ | — | — |
|
|
628
|
+
| `teachersManagement` | — | ✅ | — | — |
|
|
629
|
+
| `classesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
630
|
+
| `coursesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
631
|
+
| `enrollmentsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
632
|
+
| `schoolsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
633
|
+
| `organizationsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
634
|
+
| `academicSessionsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
635
|
+
| `termsManagement` | — | ✅ | — | — |
|
|
636
|
+
| `gradingPeriodsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
637
|
+
| `demographicsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
638
|
+
| `lineItemsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
639
|
+
| `resultsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
640
|
+
| `categoriesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
641
|
+
| `scoreScalesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
642
|
+
| `resourcesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
643
|
+
| `courseComponentsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
644
|
+
| `courseComponentResourcesManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
645
|
+
| `assessmentLineItemsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
646
|
+
| `assessmentResultsManagement` | ✅ | ✅ | ✅ | ✅ |
|
|
647
|
+
|
|
648
|
+
_Note: — indicates the module uses parent module operations (students/teachers map to usersManagement for create/update/delete)._
|
|
649
|
+
|
|
650
|
+
### Example Provider Matrix (LMS-Specific)
|
|
651
|
+
|
|
652
|
+
| Module | OneRoster (Full) | ClassLink |
|
|
653
|
+
| ------------------------------------ | :--------------: | :-------: |
|
|
654
|
+
| `usersManagement` | ✅ CRUD | ✅ Read |
|
|
655
|
+
| `studentsManagement` | ✅ Read | ✅ Read |
|
|
656
|
+
| `teachersManagement` | ✅ Read | ✅ Read |
|
|
657
|
+
| `classesManagement` | ✅ CRUD | ✅ Read |
|
|
658
|
+
| `coursesManagement` | ✅ CRUD | ✅ Read |
|
|
659
|
+
| `enrollmentsManagement` | ✅ CRUD | ✅ Read |
|
|
660
|
+
| `schoolsManagement` | ✅ CRUD | ✅ Read |
|
|
661
|
+
| `organizationsManagement` | ✅ CRUD | ✅ Read |
|
|
662
|
+
| `academicSessionsManagement` | ✅ CRUD | ✅ Read |
|
|
663
|
+
| `termsManagement` | ✅ Read | ✅ Read |
|
|
664
|
+
| `gradingPeriodsManagement` | ✅ CRUD | ✅ Read |
|
|
665
|
+
| `demographicsManagement` | ✅ CRUD | ❌ |
|
|
666
|
+
| `lineItemsManagement` | ✅ CRUD | ❌ |
|
|
667
|
+
| `resultsManagement` | ✅ CRUD | ❌ |
|
|
668
|
+
| `categoriesManagement` | ✅ CRUD | ❌ |
|
|
669
|
+
| `scoreScalesManagement` | ✅ CRUD | ❌ |
|
|
670
|
+
| `resourcesManagement` | ✅ CRUD | ❌ |
|
|
671
|
+
| `courseComponentsManagement` | ✅ CRUD | ❌ |
|
|
672
|
+
| `courseComponentResourcesManagement` | ✅ CRUD | ❌ |
|
|
673
|
+
| `assessmentLineItemsManagement` | ✅ CRUD | ❌ |
|
|
674
|
+
| `assessmentResultsManagement` | ✅ CRUD | ❌ |
|
|
675
|
+
|
|
676
|
+
> This matrix reflects typical provider behavior. Actual availability may vary by contract or configuration.
|
|
677
|
+
|
|
678
|
+
## Advanced Import Paths
|
|
679
|
+
|
|
680
|
+
Use these only when you need them.
|
|
681
|
+
|
|
682
|
+
### Runtime entrypoints
|
|
683
|
+
|
|
684
|
+
```text
|
|
685
|
+
@eduware/oneroster # Full client + common exports (recommended)
|
|
686
|
+
@eduware/oneroster/clients # LMS profiles (ClassLink, custom profiles)
|
|
687
|
+
@eduware/oneroster/core.js # Lightweight core client for funcs
|
|
688
|
+
@eduware/oneroster/funcs/* # Standalone functions
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
### Type-first entrypoints (prefer `import type` when you only need types)
|
|
692
|
+
|
|
693
|
+
```text
|
|
694
|
+
@eduware/oneroster/models # Data models (component schemas)
|
|
695
|
+
@eduware/oneroster/enums # Shared enums (runtime + types)
|
|
696
|
+
@eduware/oneroster/types # Operation request/response types (runtime alias)
|
|
697
|
+
```
|
|
513
698
|
|
|
514
699
|
## MCP Server
|
|
515
700
|
|
|
516
|
-
This SDK includes an MCP (Model Context Protocol) server for AI applications.
|
|
701
|
+
This SDK includes an MCP (Model Context Protocol) server for AI applications.
|
|
517
702
|
|
|
518
|
-
###
|
|
703
|
+
### OAuth 2.0 Configuration
|
|
519
704
|
|
|
520
705
|
```json
|
|
521
706
|
{
|
|
@@ -545,8 +730,6 @@ This SDK includes an MCP (Model Context Protocol) server for AI applications. Th
|
|
|
545
730
|
|
|
546
731
|
### ClassLink Configuration (Bearer Token)
|
|
547
732
|
|
|
548
|
-
For ClassLink's proxy mode with pre-authenticated bearer tokens:
|
|
549
|
-
|
|
550
733
|
```json
|
|
551
734
|
{
|
|
552
735
|
"mcpServers": {
|
|
@@ -573,9 +756,7 @@ For ClassLink's proxy mode with pre-authenticated bearer tokens:
|
|
|
573
756
|
}
|
|
574
757
|
```
|
|
575
758
|
|
|
576
|
-
### OAuth 1.0a Configuration (
|
|
577
|
-
|
|
578
|
-
For OneRoster v1.1 servers using OAuth 1.0a:
|
|
759
|
+
### OAuth 1.0a Configuration (v1.1)
|
|
579
760
|
|
|
580
761
|
```json
|
|
581
762
|
{
|
|
@@ -605,7 +786,7 @@ For OneRoster v1.1 servers using OAuth 1.0a:
|
|
|
605
786
|
}
|
|
606
787
|
```
|
|
607
788
|
|
|
608
|
-
###
|
|
789
|
+
### MCP Arguments
|
|
609
790
|
|
|
610
791
|
| Argument | Description | Default | Required |
|
|
611
792
|
| --------------------- | ------------------------------------------------------------- | --------- | ----------------- |
|
|
@@ -623,31 +804,9 @@ For OneRoster v1.1 servers using OAuth 1.0a:
|
|
|
623
804
|
| `--log-level` | Log level: `debug`, `info`, `warn`, `error` | `info` | No |
|
|
624
805
|
| `--env` | Environment variables (format: `KEY=value`, repeatable) | — | No |
|
|
625
806
|
|
|
626
|
-
### Client Profiles
|
|
627
|
-
|
|
628
|
-
The `--client-profile` flag restricts which tools are available:
|
|
629
|
-
|
|
630
|
-
- **`full`** (default): All OneRoster tools including create, update, and delete operations
|
|
631
|
-
- **`classlink`**: Read-only tools matching ClassLink's supported endpoints
|
|
632
|
-
|
|
633
|
-
Using the appropriate profile prevents AI assistants from attempting unsupported operations.
|
|
634
|
-
|
|
635
|
-
## Runtime Support
|
|
636
|
-
|
|
637
|
-
- **Browsers:** Chrome, Safari, Edge, Firefox (evergreen)
|
|
638
|
-
- **Node.js:** v18+ (LTS)
|
|
639
|
-
- **Bun:** v1+
|
|
640
|
-
- **Deno:** v1.39+
|
|
641
|
-
|
|
642
|
-
See [RUNTIMES.md](./RUNTIMES.md) for detailed runtime information.
|
|
643
|
-
|
|
644
807
|
## API Reference
|
|
645
808
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
## Contributing
|
|
649
|
-
|
|
650
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines.
|
|
809
|
+
See [FUNCTIONS.md](./FUNCTIONS.md) for the full method list.
|
|
651
810
|
|
|
652
811
|
## License
|
|
653
812
|
|