@lti-tool/core 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/ltiTool.d.ts +70 -3
- package/dist/ltiTool.d.ts.map +1 -1
- package/dist/ltiTool.js +116 -3
- package/dist/schemas/client.schema.d.ts +1 -1
- package/dist/schemas/client.schema.d.ts.map +1 -1
- package/dist/schemas/client.schema.js +1 -1
- package/dist/schemas/common.schema.d.ts +1 -1
- package/dist/schemas/common.schema.d.ts.map +1 -1
- package/dist/schemas/common.schema.js +1 -1
- package/dist/schemas/deployment.schema.d.ts +1 -1
- package/dist/schemas/deployment.schema.d.ts.map +1 -1
- package/dist/schemas/deployment.schema.js +1 -1
- package/dist/schemas/lti13/ags/lineItem.schema.d.ts +80 -0
- package/dist/schemas/lti13/ags/lineItem.schema.d.ts.map +1 -0
- package/dist/schemas/lti13/ags/lineItem.schema.js +49 -0
- package/dist/schemas/lti13/ags/result.schema.d.ts +65 -0
- package/dist/schemas/lti13/ags/result.schema.d.ts.map +1 -0
- package/dist/schemas/lti13/ags/result.schema.js +35 -0
- package/dist/schemas/lti13/ags/scoreSubmission.schema.d.ts +25 -4
- package/dist/schemas/lti13/ags/scoreSubmission.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/ags/scoreSubmission.schema.js +2 -1
- package/dist/schemas/lti13/claims/baseJwtClaims.schema.d.ts +1 -1
- package/dist/schemas/lti13/claims/baseJwtClaims.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/claims/baseJwtClaims.schema.js +1 -1
- package/dist/schemas/lti13/claims/contextClaims.schema.d.ts +1 -1
- package/dist/schemas/lti13/claims/contextClaims.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/claims/contextClaims.schema.js +1 -1
- package/dist/schemas/lti13/claims/coreLtiClaims.schema.d.ts +1 -1
- package/dist/schemas/lti13/claims/coreLtiClaims.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/claims/coreLtiClaims.schema.js +1 -1
- package/dist/schemas/lti13/claims/platformClaims.schema.d.ts +1 -1
- package/dist/schemas/lti13/claims/platformClaims.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/claims/platformClaims.schema.js +1 -1
- package/dist/schemas/lti13/claims/privacyClaims.schema.d.ts +1 -1
- package/dist/schemas/lti13/claims/privacyClaims.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/claims/privacyClaims.schema.js +1 -1
- package/dist/schemas/lti13/claims/serviceClaims.schema.d.ts +1 -1
- package/dist/schemas/lti13/claims/serviceClaims.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/claims/serviceClaims.schema.js +1 -1
- package/dist/schemas/lti13/lti13JwtPayload.schema.d.ts +1 -1
- package/dist/schemas/lti13/lti13JwtPayload.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/lti13JwtPayload.schema.js +1 -1
- package/dist/schemas/lti13/lti13Launch.schema.d.ts +1 -1
- package/dist/schemas/lti13/lti13Launch.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/lti13Launch.schema.js +1 -1
- package/dist/schemas/lti13/lti13Login.schema.d.ts +1 -1
- package/dist/schemas/lti13/lti13Login.schema.d.ts.map +1 -1
- package/dist/schemas/lti13/lti13Login.schema.js +1 -1
- package/dist/services/ags.service.d.ts +86 -0
- package/dist/services/ags.service.d.ts.map +1 -1
- package/dist/services/ags.service.js +184 -8
- package/dist/services/token.service.d.ts.map +1 -1
- package/dist/services/token.service.js +2 -1
- package/package.json +1 -1
- package/src/ltiTool.ts +144 -5
- package/src/schemas/client.schema.ts +1 -1
- package/src/schemas/common.schema.ts +1 -1
- package/src/schemas/deployment.schema.ts +1 -1
- package/src/schemas/lti13/ags/lineItem.schema.ts +85 -0
- package/src/schemas/lti13/ags/result.schema.ts +55 -0
- package/src/schemas/lti13/ags/scoreSubmission.schema.ts +3 -1
- package/src/schemas/lti13/claims/baseJwtClaims.schema.ts +1 -1
- package/src/schemas/lti13/claims/contextClaims.schema.ts +1 -1
- package/src/schemas/lti13/claims/coreLtiClaims.schema.ts +1 -1
- package/src/schemas/lti13/claims/platformClaims.schema.ts +1 -1
- package/src/schemas/lti13/claims/privacyClaims.schema.ts +1 -1
- package/src/schemas/lti13/claims/serviceClaims.schema.ts +1 -1
- package/src/schemas/lti13/lti13JwtPayload.schema.ts +1 -1
- package/src/schemas/lti13/lti13Launch.schema.ts +1 -1
- package/src/schemas/lti13/lti13Login.schema.ts +1 -1
- package/src/services/ags.service.ts +253 -16
- package/src/services/token.service.ts +4 -1
package/CHANGELOG.md
CHANGED
package/dist/ltiTool.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ import type { LTIConfig } from './interfaces/ltiConfig.js';
|
|
|
4
4
|
import type { LTIDeployment } from './interfaces/ltiDeployment.js';
|
|
5
5
|
import type { LTISession } from './interfaces/ltiSession.js';
|
|
6
6
|
import { type LTI13JwtPayload } from './schemas/index.js';
|
|
7
|
-
import type
|
|
7
|
+
import { type CreateLineItem, type LineItem, type LineItems, type UpdateLineItem } from './schemas/lti13/ags/lineItem.schema.js';
|
|
8
|
+
import { type Results } from './schemas/lti13/ags/result.schema.js';
|
|
9
|
+
import { type ScoreSubmission } from './schemas/lti13/ags/scoreSubmission.schema.js';
|
|
8
10
|
/**
|
|
9
11
|
* Main LTI 1.3 Tool implementation providing secure authentication, launch verification,
|
|
10
12
|
* and LTI Advantage services integration.
|
|
@@ -105,10 +107,75 @@ export declare class LTITool {
|
|
|
105
107
|
*
|
|
106
108
|
* @param session - Active LTI session containing AGS service endpoints
|
|
107
109
|
* @param score - Score submission data including grade value and user ID
|
|
108
|
-
* @returns Result of the score submission
|
|
109
110
|
* @throws {Error} When AGS is not available or submission fails
|
|
110
111
|
*/
|
|
111
|
-
submitScore(session: LTISession, score: ScoreSubmission): Promise<
|
|
112
|
+
submitScore(session: LTISession, score: ScoreSubmission): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Retrieves all scores for a specific line item from the platform using Assignment and Grade Services (AGS).
|
|
115
|
+
*
|
|
116
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
117
|
+
* @returns Array of score submissions for the line item
|
|
118
|
+
* @throws {Error} When AGS is not available or request fails
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const scores = await ltiTool.getScores(session);
|
|
123
|
+
* console.log('All scores:', scores.map(s => `${s.userId}: ${s.scoreGiven}`));
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
getScores(session: LTISession): Promise<Results>;
|
|
127
|
+
/**
|
|
128
|
+
* Retrieves line items (gradebook columns) from the platform using Assignment and Grade Services (AGS).
|
|
129
|
+
*
|
|
130
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
131
|
+
* @returns Array of line items from the platform
|
|
132
|
+
* @throws {Error} When AGS is not available or request fails
|
|
133
|
+
*/
|
|
134
|
+
listLineItems(session: LTISession): Promise<LineItems>;
|
|
135
|
+
/**
|
|
136
|
+
* Retrieves a specific line item (gradebook column) from the platform using Assignment and Grade Services (AGS).
|
|
137
|
+
*
|
|
138
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
139
|
+
* @returns Line item data from the platform
|
|
140
|
+
* @throws {Error} When AGS is not available or request fails
|
|
141
|
+
*/
|
|
142
|
+
getLineItem(session: LTISession): Promise<LineItem>;
|
|
143
|
+
/**
|
|
144
|
+
* Creates a new line item (gradebook column) on the platform using Assignment and Grade Services (AGS).
|
|
145
|
+
*
|
|
146
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
147
|
+
* @param createLineItem - Line item data including label, scoreMaximum, and optional metadata
|
|
148
|
+
* @returns Created line item with platform-generated ID and validated data
|
|
149
|
+
* @throws {Error} When AGS is not available, input validation fails, or creation fails
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* const newLineItem = await ltiTool.createLineItem(session, {
|
|
154
|
+
* label: 'Quiz 1',
|
|
155
|
+
* scoreMaximum: 100,
|
|
156
|
+
* tag: 'quiz',
|
|
157
|
+
* resourceId: 'quiz-001'
|
|
158
|
+
* });
|
|
159
|
+
* console.log('Created line item:', newLineItem.id);
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
createLineItem(session: LTISession, createLineItem: CreateLineItem): Promise<LineItem>;
|
|
163
|
+
/**
|
|
164
|
+
* Updates an existing line item (gradebook column) on the platform using Assignment and Grade Services (AGS).
|
|
165
|
+
*
|
|
166
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
167
|
+
* @param updateLineItem - Updated line item data including all required fields
|
|
168
|
+
* @returns Updated line item with validated data from the platform
|
|
169
|
+
* @throws {Error} When AGS is not available, input validation fails, or update fails
|
|
170
|
+
*/
|
|
171
|
+
updateLineItem(session: LTISession, updateLineItem: UpdateLineItem): Promise<LineItem>;
|
|
172
|
+
/**
|
|
173
|
+
* Deletes a line item (gradebook column) from the platform using Assignment and Grade Services (AGS).
|
|
174
|
+
*
|
|
175
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
176
|
+
* @throws {Error} When AGS is not available or deletion fails
|
|
177
|
+
*/
|
|
178
|
+
deleteLineItem(session: LTISession): Promise<void>;
|
|
112
179
|
/**
|
|
113
180
|
* Retrieves all configured LTI client platforms.
|
|
114
181
|
*
|
package/dist/ltiTool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ltiTool.d.ts","sourceRoot":"","sources":["../src/ltiTool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;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SAAS,GAAG,SAAS,CAAC;IAIrE;;;;;OAKG;IACG,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,aAAa,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/E;;;;OAIG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMnD;;;;;OAKG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAIjE;;;;;;OAMG;IACG,aAAa,CACjB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAIrC;;;;;;OAMG;IACG,aAAa,CACjB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC;IAIlB;;;;;;OAMG;IACG,gBAAgB,CACpB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;;OAKG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG9E"}
|
package/dist/ltiTool.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createRemoteJWKSet, decodeJwt, exportJWK, jwtVerify, SignJWT } from 'jose';
|
|
2
2
|
import { AddClientSchema, UpdateClientSchema } from './schemas/client.schema.js';
|
|
3
3
|
import { HandleLoginParamsSchema, LTI13JwtPayloadSchema, SessionIdSchema, VerifyLaunchParamsSchema, } from './schemas/index.js';
|
|
4
|
+
import { LineItemSchema, LineItemsSchema, } from './schemas/lti13/ags/lineItem.schema.js';
|
|
5
|
+
import { ResultsSchema } from './schemas/lti13/ags/result.schema.js';
|
|
4
6
|
import { AGSService } from './services/ags.service.js';
|
|
5
7
|
import { createSession } from './services/session.service.js';
|
|
6
8
|
import { TokenService } from './services/token.service.js';
|
|
@@ -195,7 +197,6 @@ export class LTITool {
|
|
|
195
197
|
*
|
|
196
198
|
* @param session - Active LTI session containing AGS service endpoints
|
|
197
199
|
* @param score - Score submission data including grade value and user ID
|
|
198
|
-
* @returns Result of the score submission
|
|
199
200
|
* @throws {Error} When AGS is not available or submission fails
|
|
200
201
|
*/
|
|
201
202
|
async submitScore(session, score) {
|
|
@@ -205,7 +206,119 @@ export class LTITool {
|
|
|
205
206
|
if (!score) {
|
|
206
207
|
throw new Error('score is required');
|
|
207
208
|
}
|
|
208
|
-
|
|
209
|
+
await this.agsService.submitScore(session, score);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Retrieves all scores for a specific line item from the platform using Assignment and Grade Services (AGS).
|
|
213
|
+
*
|
|
214
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
215
|
+
* @returns Array of score submissions for the line item
|
|
216
|
+
* @throws {Error} When AGS is not available or request fails
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```typescript
|
|
220
|
+
* const scores = await ltiTool.getScores(session);
|
|
221
|
+
* console.log('All scores:', scores.map(s => `${s.userId}: ${s.scoreGiven}`));
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
async getScores(session) {
|
|
225
|
+
if (!session) {
|
|
226
|
+
throw new Error('session is required');
|
|
227
|
+
}
|
|
228
|
+
const response = await this.agsService.getScores(session);
|
|
229
|
+
const data = await response.json();
|
|
230
|
+
return ResultsSchema.parse(data);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Retrieves line items (gradebook columns) from the platform using Assignment and Grade Services (AGS).
|
|
234
|
+
*
|
|
235
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
236
|
+
* @returns Array of line items from the platform
|
|
237
|
+
* @throws {Error} When AGS is not available or request fails
|
|
238
|
+
*/
|
|
239
|
+
async listLineItems(session) {
|
|
240
|
+
if (!session) {
|
|
241
|
+
throw new Error('session is required');
|
|
242
|
+
}
|
|
243
|
+
const response = await this.agsService.listLineItems(session);
|
|
244
|
+
const data = await response.json();
|
|
245
|
+
return LineItemsSchema.parse(data);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Retrieves a specific line item (gradebook column) from the platform using Assignment and Grade Services (AGS).
|
|
249
|
+
*
|
|
250
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
251
|
+
* @returns Line item data from the platform
|
|
252
|
+
* @throws {Error} When AGS is not available or request fails
|
|
253
|
+
*/
|
|
254
|
+
async getLineItem(session) {
|
|
255
|
+
if (!session) {
|
|
256
|
+
throw new Error('session is required');
|
|
257
|
+
}
|
|
258
|
+
const response = await this.agsService.getLineItem(session);
|
|
259
|
+
const data = await response.json();
|
|
260
|
+
return LineItemSchema.parse(data);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Creates a new line item (gradebook column) on the platform using Assignment and Grade Services (AGS).
|
|
264
|
+
*
|
|
265
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
266
|
+
* @param createLineItem - Line item data including label, scoreMaximum, and optional metadata
|
|
267
|
+
* @returns Created line item with platform-generated ID and validated data
|
|
268
|
+
* @throws {Error} When AGS is not available, input validation fails, or creation fails
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* const newLineItem = await ltiTool.createLineItem(session, {
|
|
273
|
+
* label: 'Quiz 1',
|
|
274
|
+
* scoreMaximum: 100,
|
|
275
|
+
* tag: 'quiz',
|
|
276
|
+
* resourceId: 'quiz-001'
|
|
277
|
+
* });
|
|
278
|
+
* console.log('Created line item:', newLineItem.id);
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
async createLineItem(session, createLineItem) {
|
|
282
|
+
if (!session) {
|
|
283
|
+
throw new Error('session is required');
|
|
284
|
+
}
|
|
285
|
+
if (!createLineItem) {
|
|
286
|
+
throw new Error('createLineItem is required');
|
|
287
|
+
}
|
|
288
|
+
const response = await this.agsService.createLineItem(session, createLineItem);
|
|
289
|
+
const data = await response.json();
|
|
290
|
+
return LineItemSchema.parse(data);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Updates an existing line item (gradebook column) on the platform using Assignment and Grade Services (AGS).
|
|
294
|
+
*
|
|
295
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
296
|
+
* @param updateLineItem - Updated line item data including all required fields
|
|
297
|
+
* @returns Updated line item with validated data from the platform
|
|
298
|
+
* @throws {Error} When AGS is not available, input validation fails, or update fails
|
|
299
|
+
*/
|
|
300
|
+
async updateLineItem(session, updateLineItem) {
|
|
301
|
+
if (!session) {
|
|
302
|
+
throw new Error('session is required');
|
|
303
|
+
}
|
|
304
|
+
if (!updateLineItem) {
|
|
305
|
+
throw new Error('lineItem is required');
|
|
306
|
+
}
|
|
307
|
+
const response = await this.agsService.updateLineItem(session, updateLineItem);
|
|
308
|
+
const data = await response.json();
|
|
309
|
+
return LineItemSchema.parse(data);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Deletes a line item (gradebook column) from the platform using Assignment and Grade Services (AGS).
|
|
313
|
+
*
|
|
314
|
+
* @param session - Active LTI session containing AGS service endpoints
|
|
315
|
+
* @throws {Error} When AGS is not available or deletion fails
|
|
316
|
+
*/
|
|
317
|
+
async deleteLineItem(session) {
|
|
318
|
+
if (!session) {
|
|
319
|
+
throw new Error('session is required');
|
|
320
|
+
}
|
|
321
|
+
await this.agsService.deleteLineItem(session);
|
|
209
322
|
}
|
|
210
323
|
// Client management
|
|
211
324
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/client.schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"client.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/client.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;iBASvB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;iBAAqD,CAAC;AAClF,eAAO,MAAM,kBAAkB;;;;;;;iBAAqD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/common.schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"common.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/common.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;GAEG;AAEH,eAAO,MAAM,eAAe,aAA6C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/deployment.schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"deployment.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/deployment.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,gBAAgB;;;;;iBAS3B,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for LTI Assignment and Grade Services (AGS) Line Item.
|
|
4
|
+
* Represents a gradebook column/assignment according to LTI AGS v2.0 specification.
|
|
5
|
+
*
|
|
6
|
+
* @see https://www.imsglobal.org/spec/lti-ags/v2p0/#line-item-service
|
|
7
|
+
*/
|
|
8
|
+
export declare const LineItemSchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodURL;
|
|
10
|
+
scoreMaximum: z.ZodNumber;
|
|
11
|
+
label: z.ZodString;
|
|
12
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
resourceLinkId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
15
|
+
startDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
16
|
+
endDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
/**
|
|
19
|
+
* Schema for creating a new LTI Assignment and Grade Services (AGS) Line Item.
|
|
20
|
+
* Omits the 'id' field since it's generated by the platform upon creation.
|
|
21
|
+
*
|
|
22
|
+
* @see https://www.imsglobal.org/spec/lti-ags/v2p0/#line-item-service
|
|
23
|
+
*/
|
|
24
|
+
export declare const CreateLineItemSchema: z.ZodObject<{
|
|
25
|
+
label: z.ZodString;
|
|
26
|
+
scoreMaximum: z.ZodNumber;
|
|
27
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
resourceLinkId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
30
|
+
startDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
31
|
+
endDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
/**
|
|
34
|
+
* Schema for updating an existing LTI Assignment and Grade Services (AGS) Line Item.
|
|
35
|
+
* Omits 'id' and 'resourceLinkId' fields as they are immutable per LTI AGS specification.
|
|
36
|
+
* Tools MUST NOT change these values during updates.
|
|
37
|
+
*
|
|
38
|
+
* @see https://www.imsglobal.org/spec/lti-ags/v2p0/#line-item-service
|
|
39
|
+
*/
|
|
40
|
+
export declare const UpdateLineItemSchema: z.ZodObject<{
|
|
41
|
+
label: z.ZodString;
|
|
42
|
+
scoreMaximum: z.ZodNumber;
|
|
43
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
45
|
+
startDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
46
|
+
endDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
/**
|
|
49
|
+
* Schema for an array of line items returned from the line items service.
|
|
50
|
+
*/
|
|
51
|
+
export declare const LineItemsSchema: z.ZodArray<z.ZodObject<{
|
|
52
|
+
id: z.ZodURL;
|
|
53
|
+
scoreMaximum: z.ZodNumber;
|
|
54
|
+
label: z.ZodString;
|
|
55
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
resourceLinkId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
58
|
+
startDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
59
|
+
endDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
/**
|
|
62
|
+
* Type representing a validated line item for LTI AGS.
|
|
63
|
+
* Represents a gradebook column or assignment.
|
|
64
|
+
*/
|
|
65
|
+
export type LineItem = z.infer<typeof LineItemSchema>;
|
|
66
|
+
/**
|
|
67
|
+
* Type representing an array of line items.
|
|
68
|
+
*/
|
|
69
|
+
export type LineItems = z.infer<typeof LineItemsSchema>;
|
|
70
|
+
/**
|
|
71
|
+
* Type representing data required to create a new line item for LTI AGS.
|
|
72
|
+
* Contains all LineItem fields except the platform-generated 'id'.
|
|
73
|
+
*/
|
|
74
|
+
export type CreateLineItem = z.infer<typeof CreateLineItemSchema>;
|
|
75
|
+
/**
|
|
76
|
+
* Type representing data for updating an existing line item for LTI AGS.
|
|
77
|
+
* Contains all LineItem fields except immutable 'id' and 'resourceLinkId'.
|
|
78
|
+
*/
|
|
79
|
+
export type UpdateLineItem = z.infer<typeof UpdateLineItemSchema>;
|
|
80
|
+
//# sourceMappingURL=lineItem.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineItem.schema.d.ts","sourceRoot":"","sources":["../../../../src/schemas/lti13/ags/lineItem.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;;iBAwBzB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;iBAE/B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;iBAG/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;kBAA0B,CAAC;AAIvD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for LTI Assignment and Grade Services (AGS) Line Item.
|
|
4
|
+
* Represents a gradebook column/assignment according to LTI AGS v2.0 specification.
|
|
5
|
+
*
|
|
6
|
+
* @see https://www.imsglobal.org/spec/lti-ags/v2p0/#line-item-service
|
|
7
|
+
*/
|
|
8
|
+
export const LineItemSchema = z.object({
|
|
9
|
+
/** Unique identifier for the line item */
|
|
10
|
+
id: z.url(),
|
|
11
|
+
/** Maximum score possible for this line item */
|
|
12
|
+
scoreMaximum: z.number().min(0),
|
|
13
|
+
/** Human-readable label for the line item */
|
|
14
|
+
label: z.string(),
|
|
15
|
+
/** Optional resource identifier that this line item is associated with */
|
|
16
|
+
resourceId: z.string().optional(),
|
|
17
|
+
/** Optional resource link identifier */
|
|
18
|
+
resourceLinkId: z.string().optional(),
|
|
19
|
+
/** Optional tag to identify the line item */
|
|
20
|
+
tag: z.string().optional(),
|
|
21
|
+
/** Optional start date/time for the assignment */
|
|
22
|
+
startDateTime: z.iso.datetime().optional(),
|
|
23
|
+
/** Optional end date/time for the assignment */
|
|
24
|
+
endDateTime: z.iso.datetime().optional(),
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Schema for creating a new LTI Assignment and Grade Services (AGS) Line Item.
|
|
28
|
+
* Omits the 'id' field since it's generated by the platform upon creation.
|
|
29
|
+
*
|
|
30
|
+
* @see https://www.imsglobal.org/spec/lti-ags/v2p0/#line-item-service
|
|
31
|
+
*/
|
|
32
|
+
export const CreateLineItemSchema = LineItemSchema.omit({
|
|
33
|
+
id: true,
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Schema for updating an existing LTI Assignment and Grade Services (AGS) Line Item.
|
|
37
|
+
* Omits 'id' and 'resourceLinkId' fields as they are immutable per LTI AGS specification.
|
|
38
|
+
* Tools MUST NOT change these values during updates.
|
|
39
|
+
*
|
|
40
|
+
* @see https://www.imsglobal.org/spec/lti-ags/v2p0/#line-item-service
|
|
41
|
+
*/
|
|
42
|
+
export const UpdateLineItemSchema = LineItemSchema.omit({
|
|
43
|
+
id: true,
|
|
44
|
+
resourceLinkId: true,
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Schema for an array of line items returned from the line items service.
|
|
48
|
+
*/
|
|
49
|
+
export const LineItemsSchema = z.array(LineItemSchema);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for LTI Assignment and Grade Services (AGS) Result.
|
|
4
|
+
* Results contain richer metadata than scores, including user info and timestamps.
|
|
5
|
+
*
|
|
6
|
+
* @see https://www.imsglobal.org/spec/lti-ags/v2p0/#result-service
|
|
7
|
+
*/
|
|
8
|
+
export declare const ResultSchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
scoreOf: z.ZodURL;
|
|
11
|
+
userId: z.ZodString;
|
|
12
|
+
resultScore: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
resultMaximum: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
15
|
+
timestamp: z.ZodOptional<z.ZodISODateTime>;
|
|
16
|
+
activityProgress: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
Initialized: "Initialized";
|
|
18
|
+
Started: "Started";
|
|
19
|
+
InProgress: "InProgress";
|
|
20
|
+
Submitted: "Submitted";
|
|
21
|
+
Completed: "Completed";
|
|
22
|
+
}>>;
|
|
23
|
+
gradingProgress: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
FullyGraded: "FullyGraded";
|
|
25
|
+
Pending: "Pending";
|
|
26
|
+
PendingManual: "PendingManual";
|
|
27
|
+
Failed: "Failed";
|
|
28
|
+
NotReady: "NotReady";
|
|
29
|
+
}>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
/**
|
|
32
|
+
* Schema for an array of results returned from the results service.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ResultsSchema: z.ZodArray<z.ZodObject<{
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
scoreOf: z.ZodURL;
|
|
37
|
+
userId: z.ZodString;
|
|
38
|
+
resultScore: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
resultMaximum: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
41
|
+
timestamp: z.ZodOptional<z.ZodISODateTime>;
|
|
42
|
+
activityProgress: z.ZodOptional<z.ZodEnum<{
|
|
43
|
+
Initialized: "Initialized";
|
|
44
|
+
Started: "Started";
|
|
45
|
+
InProgress: "InProgress";
|
|
46
|
+
Submitted: "Submitted";
|
|
47
|
+
Completed: "Completed";
|
|
48
|
+
}>>;
|
|
49
|
+
gradingProgress: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
FullyGraded: "FullyGraded";
|
|
51
|
+
Pending: "Pending";
|
|
52
|
+
PendingManual: "PendingManual";
|
|
53
|
+
Failed: "Failed";
|
|
54
|
+
NotReady: "NotReady";
|
|
55
|
+
}>>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
/**
|
|
58
|
+
* Type representing a validated result for LTI AGS.
|
|
59
|
+
*/
|
|
60
|
+
export type Result = z.infer<typeof ResultSchema>;
|
|
61
|
+
/**
|
|
62
|
+
* Type representing an array of results.
|
|
63
|
+
*/
|
|
64
|
+
export type Results = z.infer<typeof ResultsSchema>;
|
|
65
|
+
//# sourceMappingURL=result.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.schema.d.ts","sourceRoot":"","sources":["../../../../src/schemas/lti13/ags/result.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;iBA+BvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;kBAAwB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for LTI Assignment and Grade Services (AGS) Result.
|
|
4
|
+
* Results contain richer metadata than scores, including user info and timestamps.
|
|
5
|
+
*
|
|
6
|
+
* @see https://www.imsglobal.org/spec/lti-ags/v2p0/#result-service
|
|
7
|
+
*/
|
|
8
|
+
export const ResultSchema = z.object({
|
|
9
|
+
/** Unique identifier for the result */
|
|
10
|
+
id: z.string(),
|
|
11
|
+
/** Score of the result, represented as a URL */
|
|
12
|
+
scoreOf: z.url(),
|
|
13
|
+
/** URL identifying the Line Item to which this result belongs. */
|
|
14
|
+
userId: z.string(),
|
|
15
|
+
/** The score given to the user */
|
|
16
|
+
resultScore: z.number().optional(),
|
|
17
|
+
/** Maximum possible score */
|
|
18
|
+
resultMaximum: z.number().optional(),
|
|
19
|
+
/** Comment associated with the result */
|
|
20
|
+
comment: z.string().optional(),
|
|
21
|
+
/** Timestamp when the result was recorded */
|
|
22
|
+
timestamp: z.iso.datetime({ offset: true }).optional(),
|
|
23
|
+
/** Activity progress status */
|
|
24
|
+
activityProgress: z
|
|
25
|
+
.enum(['Initialized', 'Started', 'InProgress', 'Submitted', 'Completed'])
|
|
26
|
+
.optional(),
|
|
27
|
+
/** Grading progress status */
|
|
28
|
+
gradingProgress: z
|
|
29
|
+
.enum(['FullyGraded', 'Pending', 'PendingManual', 'Failed', 'NotReady'])
|
|
30
|
+
.optional(),
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Schema for an array of results returned from the results service.
|
|
34
|
+
*/
|
|
35
|
+
export const ResultsSchema = z.array(ResultSchema);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod';
|
|
2
2
|
/**
|
|
3
3
|
* Schema for submitting grades via LTI Assignment and Grade Services (AGS).
|
|
4
4
|
* Validates score data according to LTI AGS v2.0 specification.
|
|
@@ -19,13 +19,34 @@ export declare const ScoreSubmissionSchema: z.ZodObject<{
|
|
|
19
19
|
Completed: "Completed";
|
|
20
20
|
}>>;
|
|
21
21
|
gradingProgress: z.ZodDefault<z.ZodEnum<{
|
|
22
|
-
|
|
23
|
-
Failed: "Failed";
|
|
22
|
+
FullyGraded: "FullyGraded";
|
|
24
23
|
Pending: "Pending";
|
|
25
24
|
PendingManual: "PendingManual";
|
|
26
|
-
|
|
25
|
+
Failed: "Failed";
|
|
26
|
+
NotReady: "NotReady";
|
|
27
27
|
}>>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
|
+
export declare const ScoreSubmissionsSchema: z.ZodArray<z.ZodObject<{
|
|
30
|
+
scoreGiven: z.ZodNumber;
|
|
31
|
+
scoreMaximum: z.ZodNumber;
|
|
32
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
33
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
timestamp: z.ZodOptional<z.ZodISODateTime>;
|
|
35
|
+
activityProgress: z.ZodDefault<z.ZodEnum<{
|
|
36
|
+
Initialized: "Initialized";
|
|
37
|
+
Started: "Started";
|
|
38
|
+
InProgress: "InProgress";
|
|
39
|
+
Submitted: "Submitted";
|
|
40
|
+
Completed: "Completed";
|
|
41
|
+
}>>;
|
|
42
|
+
gradingProgress: z.ZodDefault<z.ZodEnum<{
|
|
43
|
+
FullyGraded: "FullyGraded";
|
|
44
|
+
Pending: "Pending";
|
|
45
|
+
PendingManual: "PendingManual";
|
|
46
|
+
Failed: "Failed";
|
|
47
|
+
NotReady: "NotReady";
|
|
48
|
+
}>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
29
50
|
/**
|
|
30
51
|
* Type representing a validated score submission for LTI AGS.
|
|
31
52
|
* Contains grade data and metadata to be sent to the platform.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoreSubmission.schema.d.ts","sourceRoot":"","sources":["../../../../src/schemas/lti13/ags/scoreSubmission.schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"scoreSubmission.schema.d.ts","sourceRoot":"","sources":["../../../../src/schemas/lti13/ags/scoreSubmission.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;iBAuChC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;kBAAiC,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod';
|
|
2
2
|
/**
|
|
3
3
|
* Schema for submitting grades via LTI Assignment and Grade Services (AGS).
|
|
4
4
|
* Validates score data according to LTI AGS v2.0 specification.
|
|
@@ -39,3 +39,4 @@ export const ScoreSubmissionSchema = z.object({
|
|
|
39
39
|
.enum(['NotReady', 'Failed', 'Pending', 'PendingManual', 'FullyGraded'])
|
|
40
40
|
.default('FullyGraded'),
|
|
41
41
|
});
|
|
42
|
+
export const ScoreSubmissionsSchema = z.array(ScoreSubmissionSchema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseJwtClaims.schema.d.ts","sourceRoot":"","sources":["../../../../src/schemas/lti13/claims/baseJwtClaims.schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"baseJwtClaims.schema.d.ts","sourceRoot":"","sources":["../../../../src/schemas/lti13/claims/baseJwtClaims.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,mBAAmB;;;;;;;;iBAQ9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextClaims.schema.d.ts","sourceRoot":"","sources":["../../../../src/schemas/lti13/claims/contextClaims.schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"contextClaims.schema.d.ts","sourceRoot":"","sources":["../../../../src/schemas/lti13/claims/contextClaims.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,kBAAkB;;;kBAKlB,CAAC;AAEd,eAAO,MAAM,aAAa;;;;kBAMb,CAAC"}
|