@modulus-learning/lti 0.0.0-stage → 0.11.1
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/LICENSE +661 -0
- package/dist/access-token.d.ts +15 -0
- package/dist/access-token.d.ts.map +1 -0
- package/dist/access-token.js +1 -0
- package/dist/constants.d.ts +24 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +26 -0
- package/dist/contract.d.ts +125 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +18 -0
- package/dist/cutoff.d.ts +11 -0
- package/dist/cutoff.d.ts.map +1 -0
- package/dist/cutoff.js +19 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/login.d.ts +60 -0
- package/dist/login.d.ts.map +1 -0
- package/dist/login.js +46 -0
- package/dist/messages/platform-originating/base-message.d.ts +26 -0
- package/dist/messages/platform-originating/base-message.d.ts.map +1 -0
- package/dist/messages/platform-originating/base-message.js +44 -0
- package/dist/messages/platform-originating/deep-linking-request.d.ts +40 -0
- package/dist/messages/platform-originating/deep-linking-request.d.ts.map +1 -0
- package/dist/messages/platform-originating/deep-linking-request.js +26 -0
- package/dist/messages/platform-originating/platform-message.d.ts +69 -0
- package/dist/messages/platform-originating/platform-message.d.ts.map +1 -0
- package/dist/messages/platform-originating/platform-message.js +8 -0
- package/dist/messages/platform-originating/resource-link-launch-request.d.ts +33 -0
- package/dist/messages/platform-originating/resource-link-launch-request.d.ts.map +1 -0
- package/dist/messages/platform-originating/resource-link-launch-request.js +11 -0
- package/dist/messages/tool-originating/deep-linking-response.d.ts +103 -0
- package/dist/messages/tool-originating/deep-linking-response.d.ts.map +1 -0
- package/dist/messages/tool-originating/deep-linking-response.js +60 -0
- package/dist/score.d.ts +84 -0
- package/dist/score.d.ts.map +1 -0
- package/dist/score.js +13 -0
- package/package.json +48 -3
- package/README.md +0 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const resourceLinkLaunchRequestSchema: z.ZodObject<{
|
|
3
|
+
iss: z.ZodString;
|
|
4
|
+
aud: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
5
|
+
sub: z.ZodString;
|
|
6
|
+
exp: z.ZodNumber;
|
|
7
|
+
iat: z.ZodNumber;
|
|
8
|
+
nonce: z.ZodString;
|
|
9
|
+
azp: z.ZodOptional<z.ZodString>;
|
|
10
|
+
given_name: z.ZodOptional<z.ZodString>;
|
|
11
|
+
family_name: z.ZodOptional<z.ZodString>;
|
|
12
|
+
name: z.ZodOptional<z.ZodString>;
|
|
13
|
+
email: z.ZodOptional<z.ZodString>;
|
|
14
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
15
|
+
"https://purl.imsglobal.org/spec/lti/claim/version": z.ZodLiteral<"1.3.0">;
|
|
16
|
+
"https://purl.imsglobal.org/spec/lti/claim/deployment_id": z.ZodString;
|
|
17
|
+
"https://purl.imsglobal.org/spec/lti/claim/target_link_uri": z.ZodString;
|
|
18
|
+
"https://purl.imsglobal.org/spec/lti/claim/roles": z.ZodArray<z.ZodString>;
|
|
19
|
+
"https://purl.imsglobal.org/spec/lti-ags/claim/endpoint": z.ZodOptional<z.ZodObject<{
|
|
20
|
+
lineitems: z.ZodOptional<z.ZodString>;
|
|
21
|
+
lineitem: z.ZodOptional<z.ZodString>;
|
|
22
|
+
scope: z.ZodArray<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
"https://purl.imsglobal.org/spec/lti/claim/custom": z.ZodPrefault<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>>;
|
|
25
|
+
"https://purl.imsglobal.org/spec/lti/claim/message_type": z.ZodLiteral<"LtiResourceLinkRequest">;
|
|
26
|
+
"https://purl.imsglobal.org/spec/lti/claim/resource_link": z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type ResourceLinkLaunchRequest = z.infer<typeof resourceLinkLaunchRequestSchema>;
|
|
33
|
+
//# sourceMappingURL=resource-link-launch-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-link-launch-request.d.ts","sourceRoot":"","sources":["../../../src/messages/platform-originating/resource-link-launch-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAO1C,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CLAIM_MESSAGE_TYPE, CLAIM_RESOURCE_LINK } from '../../constants.js';
|
|
3
|
+
import { baseMessageSchema } from './base-message.js';
|
|
4
|
+
export const resourceLinkLaunchRequestSchema = baseMessageSchema.extend({
|
|
5
|
+
[CLAIM_MESSAGE_TYPE]: z.literal('LtiResourceLinkRequest'),
|
|
6
|
+
[CLAIM_RESOURCE_LINK]: z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
title: z.string().nullable().optional(),
|
|
9
|
+
description: z.string().nullable().optional(),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const contentItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"ltiResourceLink">;
|
|
4
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
5
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
text: z.ZodOptional<z.ZodString>;
|
|
7
|
+
icon: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
url: z.ZodURL;
|
|
9
|
+
width: z.ZodNumber;
|
|
10
|
+
height: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
url: z.ZodURL;
|
|
14
|
+
width: z.ZodNumber;
|
|
15
|
+
height: z.ZodNumber;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
window: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
targetName: z.ZodOptional<z.ZodString>;
|
|
19
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
windowFeatures: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
iframe: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
width: z.ZodNumber;
|
|
25
|
+
height: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
|
+
lineItem: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
label: z.ZodOptional<z.ZodString>;
|
|
30
|
+
scoreMaximum: z.ZodNumber;
|
|
31
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
32
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
33
|
+
gradesReleased: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
available: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
startDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
37
|
+
endDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
submission: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
startDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
41
|
+
endDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>], "type">;
|
|
44
|
+
export declare const deepLinkingResponseSchema: z.ZodObject<{
|
|
45
|
+
iss: z.ZodString;
|
|
46
|
+
aud: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
47
|
+
nonce: z.ZodString;
|
|
48
|
+
azp: z.ZodOptional<z.ZodString>;
|
|
49
|
+
"https://purl.imsglobal.org/spec/lti/claim/message_type": z.ZodLiteral<"LtiDeepLinkingResponse">;
|
|
50
|
+
"https://purl.imsglobal.org/spec/lti/claim/version": z.ZodLiteral<"1.3.0">;
|
|
51
|
+
"https://purl.imsglobal.org/spec/lti/claim/deployment_id": z.ZodString;
|
|
52
|
+
"https://purl.imsglobal.org/spec/lti-dl/claim/data": z.ZodOptional<z.ZodAny>;
|
|
53
|
+
"https://purl.imsglobal.org/spec/lti-dl/claim/content_items": z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
54
|
+
type: z.ZodLiteral<"ltiResourceLink">;
|
|
55
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
56
|
+
title: z.ZodOptional<z.ZodString>;
|
|
57
|
+
text: z.ZodOptional<z.ZodString>;
|
|
58
|
+
icon: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
url: z.ZodURL;
|
|
60
|
+
width: z.ZodNumber;
|
|
61
|
+
height: z.ZodNumber;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
url: z.ZodURL;
|
|
65
|
+
width: z.ZodNumber;
|
|
66
|
+
height: z.ZodNumber;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
window: z.ZodOptional<z.ZodObject<{
|
|
69
|
+
targetName: z.ZodOptional<z.ZodString>;
|
|
70
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
windowFeatures: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
iframe: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
width: z.ZodNumber;
|
|
76
|
+
height: z.ZodNumber;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
79
|
+
lineItem: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
label: z.ZodOptional<z.ZodString>;
|
|
81
|
+
scoreMaximum: z.ZodNumber;
|
|
82
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
83
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
84
|
+
gradesReleased: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
available: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
startDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
88
|
+
endDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
submission: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
startDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
92
|
+
endDateTime: z.ZodOptional<z.ZodISODateTime>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
}, z.core.$strip>], "type">>>;
|
|
95
|
+
"https://purl.imsglobal.org/spec/lti-dl/claim/msg": z.ZodOptional<z.ZodString>;
|
|
96
|
+
"https://purl.imsglobal.org/spec/lti-dl/claim/log": z.ZodOptional<z.ZodString>;
|
|
97
|
+
"https://purl.imsglobal.org/spec/lti-dl/claim/errormsg": z.ZodOptional<z.ZodString>;
|
|
98
|
+
"https://purl.imsglobal.org/spec/lti-dl/claim/errorlog": z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type DeepLinkingResponse = z.infer<typeof deepLinkingResponseSchema>;
|
|
101
|
+
export type DeepLinkingContentItem = z.infer<typeof contentItemSchema>;
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=deep-linking-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-linking-response.d.ts","sourceRoot":"","sources":["../../../src/messages/tool-originating/deep-linking-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAkEvB,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAAqD,CAAA;AAE5E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC3E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CLAIM_DEEP_LINKING_CONTENT, CLAIM_DEEP_LINKING_DATA, CLAIM_DEEP_LINKING_ERRORLOG, CLAIM_DEEP_LINKING_ERRORMSG, CLAIM_DEEP_LINKING_LOG, CLAIM_DEEP_LINKING_MSG, CLAIM_DEPLOYMENT_ID, CLAIM_MESSAGE_TYPE, CLAIM_VERSION, } from '../../constants.js';
|
|
3
|
+
const imageUrlSchema = z.object({
|
|
4
|
+
url: z.url(),
|
|
5
|
+
width: z.number().int(),
|
|
6
|
+
height: z.number().int(),
|
|
7
|
+
});
|
|
8
|
+
const resourceLinkSchema = z.object({
|
|
9
|
+
type: z.literal('ltiResourceLink'),
|
|
10
|
+
url: z.optional(z.url()),
|
|
11
|
+
title: z.optional(z.string()),
|
|
12
|
+
text: z.optional(z.string()),
|
|
13
|
+
icon: z.optional(imageUrlSchema),
|
|
14
|
+
thumbnail: z.optional(imageUrlSchema),
|
|
15
|
+
window: z.optional(z.object({
|
|
16
|
+
targetName: z.optional(z.string()),
|
|
17
|
+
width: z.optional(z.number().int()),
|
|
18
|
+
height: z.optional(z.number().int()),
|
|
19
|
+
windowFeatures: z.optional(z.string()),
|
|
20
|
+
})),
|
|
21
|
+
iframe: z.optional(z.object({
|
|
22
|
+
width: z.number().int(),
|
|
23
|
+
height: z.number().int(),
|
|
24
|
+
})),
|
|
25
|
+
custom: z.optional(z.record(z.string(), z.string())),
|
|
26
|
+
lineItem: z.optional(z.object({
|
|
27
|
+
label: z.optional(z.string()),
|
|
28
|
+
scoreMaximum: z.number(),
|
|
29
|
+
resourceId: z.optional(z.string()),
|
|
30
|
+
tag: z.optional(z.string()),
|
|
31
|
+
gradesReleased: z.optional(z.boolean()),
|
|
32
|
+
})),
|
|
33
|
+
available: z.optional(z.object({
|
|
34
|
+
startDateTime: z.optional(z.iso.datetime()),
|
|
35
|
+
endDateTime: z.optional(z.iso.datetime()),
|
|
36
|
+
})),
|
|
37
|
+
submission: z.optional(z.object({
|
|
38
|
+
startDateTime: z.optional(z.iso.datetime()),
|
|
39
|
+
endDateTime: z.optional(z.iso.datetime()),
|
|
40
|
+
})),
|
|
41
|
+
});
|
|
42
|
+
// TODO: Other content item types if we need them.
|
|
43
|
+
const contentItemSchema = z.discriminatedUnion('type', [resourceLinkSchema]);
|
|
44
|
+
export const deepLinkingResponseSchema = z.object({
|
|
45
|
+
iss: z.string(),
|
|
46
|
+
aud: z.union([z.string(), z.array(z.string())]),
|
|
47
|
+
// exp: z.number(),
|
|
48
|
+
// iat: z.number(),
|
|
49
|
+
nonce: z.string(),
|
|
50
|
+
azp: z.string().optional(),
|
|
51
|
+
[CLAIM_MESSAGE_TYPE]: z.literal('LtiDeepLinkingResponse'),
|
|
52
|
+
[CLAIM_VERSION]: z.literal('1.3.0'),
|
|
53
|
+
[CLAIM_DEPLOYMENT_ID]: z.string(),
|
|
54
|
+
[CLAIM_DEEP_LINKING_DATA]: z.optional(z.any()),
|
|
55
|
+
[CLAIM_DEEP_LINKING_CONTENT]: z.optional(z.array(contentItemSchema)),
|
|
56
|
+
[CLAIM_DEEP_LINKING_MSG]: z.optional(z.string()),
|
|
57
|
+
[CLAIM_DEEP_LINKING_LOG]: z.optional(z.string()),
|
|
58
|
+
[CLAIM_DEEP_LINKING_ERRORMSG]: z.optional(z.string()),
|
|
59
|
+
[CLAIM_DEEP_LINKING_ERRORLOG]: z.optional(z.string()),
|
|
60
|
+
});
|
package/dist/score.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AccessToken, AccessTokenResult } from './access-token.js';
|
|
2
|
+
/**
|
|
3
|
+
* Score passback (LTI Assignment and Grade Services, AGS): the outcome
|
|
4
|
+
* categories every adapter's client reports, and the client interface core's
|
|
5
|
+
* submission queue drives. The categories' meaning belongs to this contract;
|
|
6
|
+
* recognising a vendor's responses as one of them belongs to the adapter.
|
|
7
|
+
*/
|
|
8
|
+
export type SubmissionErrorCategory =
|
|
9
|
+
/** A newer score already reached the line item. */
|
|
10
|
+
'superseded'
|
|
11
|
+
/** The line item no longer exists; stop sending to it. */
|
|
12
|
+
| 'lineitem_dead'
|
|
13
|
+
/** Retry later; nothing is wrong with the request. */
|
|
14
|
+
| 'transient'
|
|
15
|
+
/** The registration or tool configuration is wrong. */
|
|
16
|
+
| 'platform_config'
|
|
17
|
+
/** The access token was rejected. */
|
|
18
|
+
| 'platform_token'
|
|
19
|
+
/** The platform is throttling. */
|
|
20
|
+
| 'rate_limit'
|
|
21
|
+
/** The request itself was invalid. */
|
|
22
|
+
| 'malformed'
|
|
23
|
+
/** Not recognised; follows the default failure policy. */
|
|
24
|
+
| 'unknown';
|
|
25
|
+
export type SubmissionResult = {
|
|
26
|
+
ok: true;
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
category: SubmissionErrorCategory;
|
|
30
|
+
description: string;
|
|
31
|
+
status?: number;
|
|
32
|
+
text?: string;
|
|
33
|
+
};
|
|
34
|
+
export type PublishScoreInput = {
|
|
35
|
+
lineitemUrl: string;
|
|
36
|
+
ltiUserId: string;
|
|
37
|
+
scoreGiven: number;
|
|
38
|
+
};
|
|
39
|
+
export type PublishScoreOutcome = {
|
|
40
|
+
result: SubmissionResult;
|
|
41
|
+
/**
|
|
42
|
+
* The response's scheduling signal for the adapter's own pacing policy.
|
|
43
|
+
* Opaque to core, which only passes it on.
|
|
44
|
+
*/
|
|
45
|
+
reading?: unknown;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The transport for one registration's AGS requests: acquiring the access
|
|
49
|
+
* token, speaking the wire format, and classifying the response.
|
|
50
|
+
*/
|
|
51
|
+
export interface LtiAgsClient {
|
|
52
|
+
readonly issuer: string;
|
|
53
|
+
publishScore(input: PublishScoreInput): Promise<PublishScoreOutcome>;
|
|
54
|
+
}
|
|
55
|
+
/** An LMS registration, as plain values (core's registration record satisfies it). */
|
|
56
|
+
export type LtiRegistration = {
|
|
57
|
+
id: string;
|
|
58
|
+
issuer: string;
|
|
59
|
+
name: string;
|
|
60
|
+
client_id: string;
|
|
61
|
+
authorization_endpoint: string;
|
|
62
|
+
token_endpoint: string;
|
|
63
|
+
jwks_uri: string;
|
|
64
|
+
authorization_server: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The registration values a platform connection is built from. Two snapshots of
|
|
68
|
+
* one registration with different fingerprints must not share cached tokens or
|
|
69
|
+
* score clients: a corrected client id or endpoint takes effect on the next use.
|
|
70
|
+
*/
|
|
71
|
+
export declare const registrationFingerprint: (registration: LtiRegistration) => string;
|
|
72
|
+
/** Where a score client obtains, and returns rejected, access tokens. */
|
|
73
|
+
export interface AccessTokenSource {
|
|
74
|
+
getAccessToken(registration: LtiRegistration): Promise<AccessTokenResult>;
|
|
75
|
+
invalidateAccessToken(registration: LtiRegistration, accessToken: AccessToken): void;
|
|
76
|
+
}
|
|
77
|
+
/** The logging an adapter may do: structured data plus a message. */
|
|
78
|
+
export interface LtiLogger {
|
|
79
|
+
debug(data: Record<string, unknown>, message?: string): void;
|
|
80
|
+
info(data: Record<string, unknown>, message?: string): void;
|
|
81
|
+
warn(data: Record<string, unknown>, message?: string): void;
|
|
82
|
+
error(data: Record<string, unknown>, message?: string): void;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=score.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.d.ts","sourceRoot":"","sources":["../src/score.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAEvE;;;;;GAKG;AAEH,MAAM,MAAM,uBAAuB;AACjC,mDAAmD;AACjD,YAAY;AACd,0DAA0D;GACxD,eAAe;AACjB,sDAAsD;GACpD,WAAW;AACb,uDAAuD;GACrD,iBAAiB;AACnB,qCAAqC;GACnC,gBAAgB;AAClB,kCAAkC;GAChC,YAAY;AACd,sCAAsC;GACpC,WAAW;AACb,0DAA0D;GACxD,SAAS,CAAA;AAEb,MAAM,MAAM,gBAAgB,GACxB;IACE,EAAE,EAAE,IAAI,CAAA;CACT,GACD;IACE,EAAE,EAAE,KAAK,CAAA;IACT,QAAQ,EAAE,uBAAuB,CAAA;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAEL,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,gBAAgB,CAAA;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;CACrE;AAED,sFAAsF;AACtF,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,iBAAkB,eAAe,KAAG,MAQpE,CAAA;AAEJ,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,YAAY,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACzE,qBAAqB,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;CACrF;AAED,qEAAqE;AACrE,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5D,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3D,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3D,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7D"}
|
package/dist/score.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The registration values a platform connection is built from. Two snapshots of
|
|
3
|
+
* one registration with different fingerprints must not share cached tokens or
|
|
4
|
+
* score clients: a corrected client id or endpoint takes effect on the next use.
|
|
5
|
+
*/
|
|
6
|
+
export const registrationFingerprint = (registration) => JSON.stringify([
|
|
7
|
+
registration.issuer,
|
|
8
|
+
registration.client_id,
|
|
9
|
+
registration.authorization_endpoint,
|
|
10
|
+
registration.token_endpoint,
|
|
11
|
+
registration.jwks_uri,
|
|
12
|
+
registration.authorization_server,
|
|
13
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modulus-learning/lti",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.11.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Shared LTI 1.3 vocabulary and the Modulus LMS adapter contract",
|
|
6
|
+
"license": "AGPL-3.0-only",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"homepage": "https://github.com/Modulus-Learning/app.modulus-learning.org",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/Modulus-Learning/app.modulus-learning.org/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/Modulus-Learning/app.modulus-learning.org.git",
|
|
15
|
+
"directory": "packages/lti"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": "^22.18.0 || ^24.11.0 || >=26.0.0"
|
|
19
|
+
},
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"zod": "^4.6.7"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@biomejs/biome": "^2.6.4",
|
|
36
|
+
"@types/node": "^26.6.6",
|
|
37
|
+
"tsx": "^4.23.15",
|
|
38
|
+
"typescript": "^7.0.2"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"clean": "rm -rf node_modules dist .turbo",
|
|
45
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
46
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
47
|
+
"lint": "biome check --write --diagnostic-level=error",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"test": "LOG_LEVEL=off tsx --test $(find src -name \"*.test.ts\")"
|
|
50
|
+
}
|
|
6
51
|
}
|
package/README.md
DELETED