@conform-ed/contracts 0.0.3
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/.turbo/turbo-build.log +2 -0
- package/.turbo/turbo-format.log +6 -0
- package/.turbo/turbo-lint.log +4 -0
- package/.turbo/turbo-test.log +196 -0
- package/.turbo/turbo-typecheck.log +2 -0
- package/README.md +52 -0
- package/caliper-v1_2-zod-templates.md +123 -0
- package/case-v1_1-zod-templates.md +290 -0
- package/cat-v1_0-zod-templates.md +73 -0
- package/cc-v1_3-zod-templates.md +531 -0
- package/cc-v1_4-zod-templates.md +247 -0
- package/clr-v2_0-zod-templates.md +117 -0
- package/cmi5-v1_0-zod-templates.md +9 -0
- package/lti-zod-templates.md +11 -0
- package/oneroster-v1_2-zod-templates.md +76 -0
- package/open-badges-v3_0-zod-templates.md +66 -0
- package/package.json +42 -0
- package/qti-v2_1-zod-templates.md +45 -0
- package/qti-v2_2-zod-templates.md +32 -0
- package/qti-v3_0_1-zod-templates.md +421 -0
- package/src/adapter.ts +83 -0
- package/src/caliper/v1_2/caliper_v1p2_bootcamp_schema.ts +781 -0
- package/src/caliper/v1_2/index.ts +37 -0
- package/src/caliper/v1_2/shared.ts +122 -0
- package/src/caliper/v1_2/textual_requirements.ts +219 -0
- package/src/case/v1_1/case_v1p1_cfassociation_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfassociationgrouping_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfassociationset_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfconceptset_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfdocument_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfdocumentset_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfitem_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfitemtypeset_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cflicense_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfpackage_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfrubric_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_cfsubjectset_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_imsx_statusinfo_jsonschema1.ts +1 -0
- package/src/case/v1_1/case_v1p1_openapi3_restbinding_schema.ts +113 -0
- package/src/case/v1_1/index.ts +95 -0
- package/src/case/v1_1/shared.ts +384 -0
- package/src/cat/v1_0/cat_v1p0_restbinding_operations_schema.ts +75 -0
- package/src/cat/v1_0/index.ts +124 -0
- package/src/cat/v1_0/shared.ts +345 -0
- package/src/clr/v2_0/clr_v2p0_achievementcredential_schema.ts +16 -0
- package/src/clr/v2_0/clr_v2p0_clrcredential_schema.ts +9 -0
- package/src/clr/v2_0/clr_v2p0_endorsementcredential_schema.ts +11 -0
- package/src/clr/v2_0/clr_v2p0_getclrcredentialsresponse_schema.ts +1 -0
- package/src/clr/v2_0/clr_v2p0_imsx_statusinfo_schema.ts +8 -0
- package/src/clr/v2_0/clr_v2p0_profile_schema.ts +9 -0
- package/src/clr/v2_0/index.ts +22 -0
- package/src/clr/v2_0/shared.ts +206 -0
- package/src/cmi5/index.ts +3 -0
- package/src/cmi5/v1_0/index.ts +134 -0
- package/src/common-cartridge/v1_3/ccv1p3_imsccauth_v1p3.ts +26 -0
- package/src/common-cartridge/v1_3/ccv1p3_imscp_v1p2_v1p0.ts +352 -0
- package/src/common-cartridge/v1_3/ccv1p3_imscsmd_v1p0.ts +35 -0
- package/src/common-cartridge/v1_3/ccv1p3_imsdt_v1p3.ts +33 -0
- package/src/common-cartridge/v1_3/ccv1p3_imswl_v1p3.ts +23 -0
- package/src/common-cartridge/v1_3/ccv1p3_lomccltilink_v1p0.ts +14 -0
- package/src/common-cartridge/v1_3/ccv1p3_lommanifest_v1p0.ts +14 -0
- package/src/common-cartridge/v1_3/ccv1p3_lomresource_v1p0.ts +14 -0
- package/src/common-cartridge/v1_3/ccv1p3_qtiasiv1p2p1_v1p0.ts +964 -0
- package/src/common-cartridge/v1_3/index.ts +41 -0
- package/src/common-cartridge/v1_3/lom-internal.ts +396 -0
- package/src/common-cartridge/v1_3/shared.ts +68 -0
- package/src/common-cartridge/v1_4/core/ccv1p4_imscp_v1p2_v1p0.ts +360 -0
- package/src/common-cartridge/v1_4/core/ccv1p4_lommanifest_v1p0.ts +14 -0
- package/src/common-cartridge/v1_4/core/ccv1p4_lomresource_v1p0.ts +14 -0
- package/src/common-cartridge/v1_4/extension/cc_extresource_assignmentv1p0_v1p0.ts +61 -0
- package/src/common-cartridge/v1_4/extension/ccv1p4_cpextensionv1p2_v1p0.ts +20 -0
- package/src/common-cartridge/v1_4/extension/ims_openvideov1p0_v1p0.ts +325 -0
- package/src/common-cartridge/v1_4/index.ts +104 -0
- package/src/common-cartridge/v1_4/k12/ccv1p4_imscp_v1p2_v1p0.ts +19 -0
- package/src/common-cartridge/v1_4/k12/ccv1p4_imscp_v1p2_v1p0_thin.ts +17 -0
- package/src/common-cartridge/v1_4/k12/ccv1p4_lommanifest_v1p0.ts +14 -0
- package/src/common-cartridge/v1_4/k12/ccv1p4_lomresource_v1p0.ts +14 -0
- package/src/common-cartridge/v1_4/lom-internal.ts +476 -0
- package/src/common-cartridge/v1_4/shared/ccv1p4_imsccauth_v1p4.ts +26 -0
- package/src/common-cartridge/v1_4/shared/ccv1p4_imscsmd_v1p1.ts +36 -0
- package/src/common-cartridge/v1_4/shared/ccv1p4_imsdt_v1p4.ts +33 -0
- package/src/common-cartridge/v1_4/shared/ccv1p4_imslticc_v1p4.ts +45 -0
- package/src/common-cartridge/v1_4/shared/ccv1p4_imswl_v1p4.ts +23 -0
- package/src/common-cartridge/v1_4/shared/ccv1p4_lomccltilink_v1p0.ts +14 -0
- package/src/common-cartridge/v1_4/shared/ccv1p4_qtiasiv1p2p1_v1p0.ts +964 -0
- package/src/common-cartridge/v1_4/shared/imsbasiclti_v1p0p1.ts +24 -0
- package/src/common-cartridge/v1_4/shared/imslticm_v1p0.ts +23 -0
- package/src/common-cartridge/v1_4/shared/imslticp_v1p0.ts +57 -0
- package/src/common-cartridge/v1_4/shared/lineitem_v1p0.ts +35 -0
- package/src/common-cartridge/v1_4/shared/resourcea11ymetadata-20210915.ts +110 -0
- package/src/common-cartridge/v1_4/shared.ts +68 -0
- package/src/common-cartridge/v1_4/thin/ccv1p4_imscp_v1p2_v1p0.ts +243 -0
- package/src/common-cartridge/v1_4/thin/ccv1p4_lommanifest_v1p0.ts +14 -0
- package/src/common-cartridge/v1_4/thin/ccv1p4_lomresource_v1p0.ts +14 -0
- package/src/common-cartridge/v1_4/vdex/imsmd_loose_v1p3p2.ts +13 -0
- package/src/common-cartridge/v1_4/vdex/imsvdex_v1p0.ts +124 -0
- package/src/config.ts +121 -0
- package/src/index.ts +32 -0
- package/src/lti/ags/v2_0/index.ts +97 -0
- package/src/lti/deep-linking/v2_0/index.ts +100 -0
- package/src/lti/index.ts +26 -0
- package/src/lti/nrps/v2_0/index.ts +69 -0
- package/src/lti/proctoring/v1_0/index.ts +131 -0
- package/src/lti/shared.ts +66 -0
- package/src/lti/v1_3/index.ts +84 -0
- package/src/oneroster/v1_2/index.ts +156 -0
- package/src/oneroster/v1_2/or_v1p2_csv_binding_schema.ts +427 -0
- package/src/oneroster/v1_2/or_v1p2_gradebook_restbinding_schema.ts +120 -0
- package/src/oneroster/v1_2/or_v1p2_gradebook_service_schema.ts +243 -0
- package/src/oneroster/v1_2/or_v1p2_resource_restbinding_schema.ts +24 -0
- package/src/oneroster/v1_2/or_v1p2_resource_service_schema.ts +47 -0
- package/src/oneroster/v1_2/or_v1p2_rostering_restbinding_schema.ts +84 -0
- package/src/oneroster/v1_2/or_v1p2_rostering_service_schema.ts +288 -0
- package/src/oneroster/v1_2/shared.ts +90 -0
- package/src/open-badges/v3_0/index.ts +20 -0
- package/src/open-badges/v3_0/ob_v3p0_achievementcredential_schema.ts +17 -0
- package/src/open-badges/v3_0/ob_v3p0_endorsementcredential_schema.ts +11 -0
- package/src/open-badges/v3_0/ob_v3p0_getopenbadgecredentialsresponse_schema.ts +1 -0
- package/src/open-badges/v3_0/ob_v3p0_imsx_statusinfo_schema.ts +8 -0
- package/src/open-badges/v3_0/ob_v3p0_profile_schema.ts +9 -0
- package/src/open-badges/v3_0/shared.ts +458 -0
- package/src/qti/v2-internal.ts +1683 -0
- package/src/qti/v2_1/apipv1p0_qtiextv2p1_v1p0.ts +3 -0
- package/src/qti/v2_1/imsqti_metadata_v2p1.ts +3 -0
- package/src/qti/v2_1/imsqti_result_v2p1.ts +3 -0
- package/src/qti/v2_1/imsqti_usagedata_v2p1.ts +3 -0
- package/src/qti/v2_1/imsqti_v2p1p2.ts +71 -0
- package/src/qti/v2_1/index.ts +53 -0
- package/src/qti/v2_1/qtiv2p1_imscpv1p2_v1p0.ts +3 -0
- package/src/qti/v2_1/schemas.ts +15 -0
- package/src/qti/v2_1/shared.ts +3 -0
- package/src/qti/v2_2/apipv1p0_qtiextv2p2_v1p0p1.ts +3 -0
- package/src/qti/v2_2/imsqti_metadata_v2p2.ts +3 -0
- package/src/qti/v2_2/imsqti_result_v2p2.ts +3 -0
- package/src/qti/v2_2/imsqti_usagedata_v2p2.ts +3 -0
- package/src/qti/v2_2/imsqti_v2p2p4.ts +76 -0
- package/src/qti/v2_2/imsqtiv2p2p4_html5_v1p0.ts +8 -0
- package/src/qti/v2_2/index.ts +59 -0
- package/src/qti/v2_2/qtiv2p2_csm_v2p2.ts +4 -0
- package/src/qti/v2_2/qtiv2p2_imscpv1p2_v1p0.ts +3 -0
- package/src/qti/v2_2/schemas.ts +19 -0
- package/src/qti/v2_2/shared.ts +3 -0
- package/src/qti/v3_0_1/assessment-internal.ts +1509 -0
- package/src/qti/v3_0_1/imsqti_asiv3p0p1_v1p0.ts +57 -0
- package/src/qti/v3_0_1/imsqti_itemv3p0p1_v1p0.ts +60 -0
- package/src/qti/v3_0_1/imsqti_metadatav3p0_v1p0.ts +73 -0
- package/src/qti/v3_0_1/imsqti_outcomev3p0p1_v1p0.ts +11 -0
- package/src/qti/v3_0_1/imsqti_responseprocessingv3p0p1_v1p0.ts +17 -0
- package/src/qti/v3_0_1/imsqti_resultv3p0_v1p0.ts +222 -0
- package/src/qti/v3_0_1/imsqti_sectionv3p0p1_v1p0.ts +15 -0
- package/src/qti/v3_0_1/imsqti_stimulusv3p0p1_v1p0.ts +15 -0
- package/src/qti/v3_0_1/imsqti_testv3p0p1_v1p0.ts +49 -0
- package/src/qti/v3_0_1/imsqti_usagedatav3p0_v1p0.ts +77 -0
- package/src/qti/v3_0_1/imsqtiv3p0_afa3p0pnp_v1p0.ts +269 -0
- package/src/qti/v3_0_1/index.ts +50 -0
- package/src/qti/v3_0_1/processing-internal.ts +667 -0
- package/src/qti/v3_0_1/shared.ts +146 -0
- package/src/qti/v3_0_1/variables-internal.ts +274 -0
- package/src/shared/imsx-status.ts +49 -0
- package/src/summary.ts +70 -0
- package/src/vc-data-model/v2_0/index.ts +27 -0
- package/src/vc-data-model/v2_0/shared.ts +206 -0
- package/src/xapi/index.ts +12 -0
- package/src/xapi/shared.ts +444 -0
- package/src/xapi/v1_0_3/index.ts +169 -0
- package/src/xapi/v2_0/index.ts +256 -0
- package/test/caliper-v1_2.test.ts +270 -0
- package/test/case-v1_1.test.ts +147 -0
- package/test/cat-v1_0.test.ts +338 -0
- package/test/cc-v1_4.test.ts +239 -0
- package/test/clr-v2_0.test.ts +225 -0
- package/test/cmi5-v1_0.test.ts +196 -0
- package/test/contracts.test.ts +125 -0
- package/test/fixtures/cmi5/extended-cmi5.xml +72 -0
- package/test/fixtures/cmi5/simple-cmi5.xml +26 -0
- package/test/lti.test.ts +146 -0
- package/test/oneroster-v1_2.test.ts +234 -0
- package/test/open-badges-v3_0.test.ts +144 -0
- package/test/qti-v2_1.test.ts +146 -0
- package/test/qti-v2_2.test.ts +154 -0
- package/test/qti-v3_0_1.test.ts +576 -0
- package/test/schema-examples.test.ts +101 -0
- package/test/vc-data-model-v2_0.test.ts +63 -0
- package/test/xapi.test.ts +384 -0
- package/tsconfig.json +7 -0
- package/vc-data-model-v2_0-zod-templates.md +43 -0
- package/xapi-zod-templates.md +95 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export * from "../../shared";
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
ContextSchema,
|
|
7
|
+
CustomParametersSchema,
|
|
8
|
+
LaunchPresentationSchema,
|
|
9
|
+
LisSchema,
|
|
10
|
+
NonEmptyStringSchema,
|
|
11
|
+
ResourceLinkSchema,
|
|
12
|
+
RolesSchema,
|
|
13
|
+
UrlSchema,
|
|
14
|
+
LtiVersionSchema,
|
|
15
|
+
strictObject,
|
|
16
|
+
} from "../../shared";
|
|
17
|
+
|
|
18
|
+
export const AssessmentControlSeveritySchema = z.enum(["low", "medium", "high"]);
|
|
19
|
+
|
|
20
|
+
export const AssessmentProctoringSettingsSchema = strictObject({
|
|
21
|
+
proctoringUrl: UrlSchema.optional(),
|
|
22
|
+
startAssessmentUrl: UrlSchema.optional(),
|
|
23
|
+
endAssessmentReturnUrl: UrlSchema.optional(),
|
|
24
|
+
assessmentControlUrl: UrlSchema.optional(),
|
|
25
|
+
sessionData: NonEmptyStringSchema.optional(),
|
|
26
|
+
extraTime: z.number().int().nonnegative().optional(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const StartProctoringMessageSchema = strictObject({
|
|
30
|
+
messageType: z.literal("StartProctoringMessage"),
|
|
31
|
+
version: LtiVersionSchema,
|
|
32
|
+
deploymentId: NonEmptyStringSchema,
|
|
33
|
+
targetLinkUri: UrlSchema,
|
|
34
|
+
resourceLink: ResourceLinkSchema,
|
|
35
|
+
subject: NonEmptyStringSchema,
|
|
36
|
+
attemptNumber: z.number().int().positive(),
|
|
37
|
+
startAssessmentUrl: UrlSchema,
|
|
38
|
+
sessionData: NonEmptyStringSchema,
|
|
39
|
+
roles: RolesSchema,
|
|
40
|
+
context: ContextSchema.optional(),
|
|
41
|
+
launchPresentation: LaunchPresentationSchema.optional(),
|
|
42
|
+
lis: LisSchema.optional(),
|
|
43
|
+
custom: CustomParametersSchema.optional(),
|
|
44
|
+
assessmentProctoringSettings: AssessmentProctoringSettingsSchema.optional(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const StartAssessmentMessageSchema = strictObject({
|
|
48
|
+
messageType: z.literal("StartAssessmentMessage"),
|
|
49
|
+
version: LtiVersionSchema,
|
|
50
|
+
deploymentId: NonEmptyStringSchema,
|
|
51
|
+
resourceLink: ResourceLinkSchema,
|
|
52
|
+
subject: NonEmptyStringSchema,
|
|
53
|
+
attemptNumber: z.number().int().positive(),
|
|
54
|
+
sessionData: NonEmptyStringSchema,
|
|
55
|
+
endAssessmentReturnUrl: UrlSchema,
|
|
56
|
+
verifiedUser: z.union([z.boolean(), NonEmptyStringSchema]).optional(),
|
|
57
|
+
context: ContextSchema.optional(),
|
|
58
|
+
launchPresentation: LaunchPresentationSchema.optional(),
|
|
59
|
+
lis: LisSchema.optional(),
|
|
60
|
+
custom: CustomParametersSchema.optional(),
|
|
61
|
+
assessmentProctoringSettings: AssessmentProctoringSettingsSchema.optional(),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const EndAssessmentMessageSchema = strictObject({
|
|
65
|
+
messageType: z.literal("EndAssessmentMessage"),
|
|
66
|
+
version: LtiVersionSchema,
|
|
67
|
+
deploymentId: NonEmptyStringSchema,
|
|
68
|
+
targetLinkUri: UrlSchema,
|
|
69
|
+
subject: NonEmptyStringSchema,
|
|
70
|
+
attemptNumber: z.number().int().positive(),
|
|
71
|
+
roles: RolesSchema,
|
|
72
|
+
context: ContextSchema.optional(),
|
|
73
|
+
launchPresentation: LaunchPresentationSchema.optional(),
|
|
74
|
+
lis: LisSchema.optional(),
|
|
75
|
+
custom: CustomParametersSchema.optional(),
|
|
76
|
+
assessmentProctoringSettings: AssessmentProctoringSettingsSchema.optional(),
|
|
77
|
+
errorMessage: z.string().optional(),
|
|
78
|
+
errorLog: z.string().optional(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export const AssessmentControlRequestSchema = strictObject({
|
|
82
|
+
user: NonEmptyStringSchema,
|
|
83
|
+
resourceLink: NonEmptyStringSchema,
|
|
84
|
+
attemptNumber: z.number().int().positive(),
|
|
85
|
+
action: NonEmptyStringSchema,
|
|
86
|
+
incidentTime: z.iso.datetime(),
|
|
87
|
+
extraTime: z.number().int().nonnegative().optional(),
|
|
88
|
+
incidentSeverity: AssessmentControlSeveritySchema.optional(),
|
|
89
|
+
reasonCode: NonEmptyStringSchema.optional(),
|
|
90
|
+
reasonMsg: z.string().optional(),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export const AssessmentControlResponseSchema = strictObject({
|
|
94
|
+
status: NonEmptyStringSchema,
|
|
95
|
+
extraTime: z.number().int().nonnegative().optional(),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export namespace LtiProctoringV1_0 {
|
|
99
|
+
export namespace Schemas {
|
|
100
|
+
export const AssessmentProctoringSettings = AssessmentProctoringSettingsSchema;
|
|
101
|
+
export const StartProctoringMessage = StartProctoringMessageSchema;
|
|
102
|
+
export const StartAssessmentMessage = StartAssessmentMessageSchema;
|
|
103
|
+
export const EndAssessmentMessage = EndAssessmentMessageSchema;
|
|
104
|
+
export const AssessmentControlRequest = AssessmentControlRequestSchema;
|
|
105
|
+
export const AssessmentControlResponse = AssessmentControlResponseSchema;
|
|
106
|
+
export const AssessmentControlSeverity = AssessmentControlSeveritySchema;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type LtiProctoringV1_0Schemas = typeof LtiProctoringV1_0.Schemas;
|
|
111
|
+
|
|
112
|
+
export const LtiProctoringV1_0DerivedZodTemplates = {
|
|
113
|
+
description: "LTI Proctoring v1.0 Zod schemas for normalized start/end assessment message payloads",
|
|
114
|
+
specLinks: {
|
|
115
|
+
main: "https://www.imsglobal.org/spec/proctoring/v1p0/",
|
|
116
|
+
},
|
|
117
|
+
scope: "Proctoring launch messages and assessment-control service payloads",
|
|
118
|
+
claims: ["assessment_proctoring_settings", "attempt_number"],
|
|
119
|
+
notes: [
|
|
120
|
+
"The specification is still in candidate-final/public form, so the schema favors normalized compatibility over an exact JSON Schema mirror.",
|
|
121
|
+
"Control-service parameters are modeled separately from launch message payloads to keep request/response contracts explicit.",
|
|
122
|
+
],
|
|
123
|
+
} as const;
|
|
124
|
+
// Inferred types from exported Zod validators.
|
|
125
|
+
export type AssessmentControlSeverity = z.infer<typeof AssessmentControlSeveritySchema>;
|
|
126
|
+
export type AssessmentProctoringSettings = z.infer<typeof AssessmentProctoringSettingsSchema>;
|
|
127
|
+
export type StartProctoringMessage = z.infer<typeof StartProctoringMessageSchema>;
|
|
128
|
+
export type StartAssessmentMessage = z.infer<typeof StartAssessmentMessageSchema>;
|
|
129
|
+
export type EndAssessmentMessage = z.infer<typeof EndAssessmentMessageSchema>;
|
|
130
|
+
export type AssessmentControlRequest = z.infer<typeof AssessmentControlRequestSchema>;
|
|
131
|
+
export type AssessmentControlResponse = z.infer<typeof AssessmentControlResponseSchema>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export function strictObject<T extends z.ZodRawShape>(shape: T) {
|
|
4
|
+
return z.object(shape).strict();
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const UriSchema = z.string().regex(/^[a-zA-Z][a-zA-Z0-9+.-]*:.+$/u);
|
|
8
|
+
|
|
9
|
+
export const NonEmptyStringSchema = z.string().min(1);
|
|
10
|
+
export const UrlSchema = z.url();
|
|
11
|
+
export const UriReferenceSchema = UriSchema;
|
|
12
|
+
export const LtiVersionSchema = z.literal("1.3.0");
|
|
13
|
+
export const DocumentTargetSchema = z.enum(["embed", "frame", "iframe", "popup", "tab", "window"]);
|
|
14
|
+
export const RoleUriSchema = UriSchema;
|
|
15
|
+
|
|
16
|
+
export const ResourceLinkSchema = strictObject({
|
|
17
|
+
id: NonEmptyStringSchema,
|
|
18
|
+
title: NonEmptyStringSchema.optional(),
|
|
19
|
+
description: z.string().optional(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const ContextSchema = strictObject({
|
|
23
|
+
id: NonEmptyStringSchema,
|
|
24
|
+
label: NonEmptyStringSchema.optional(),
|
|
25
|
+
title: NonEmptyStringSchema.optional(),
|
|
26
|
+
type: z.array(NonEmptyStringSchema).min(1).optional(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const LaunchPresentationSchema = strictObject({
|
|
30
|
+
documentTarget: DocumentTargetSchema.optional(),
|
|
31
|
+
locale: NonEmptyStringSchema.optional(),
|
|
32
|
+
height: z.number().int().positive().optional(),
|
|
33
|
+
width: z.number().int().positive().optional(),
|
|
34
|
+
returnUrl: UrlSchema.optional(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const LisSchema = strictObject({
|
|
38
|
+
personSourcedId: NonEmptyStringSchema.optional(),
|
|
39
|
+
courseOfferingSourcedId: NonEmptyStringSchema.optional(),
|
|
40
|
+
courseSectionSourcedId: NonEmptyStringSchema.optional(),
|
|
41
|
+
membershipSourcedId: NonEmptyStringSchema.optional(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const RolesSchema = z.array(RoleUriSchema).min(1);
|
|
45
|
+
export const CustomParametersSchema = z.record(z.string().min(1), z.union([z.string(), z.number(), z.boolean()]));
|
|
46
|
+
|
|
47
|
+
export const ImageResourceSchema = strictObject({
|
|
48
|
+
url: UrlSchema,
|
|
49
|
+
width: z.number().int().positive().optional(),
|
|
50
|
+
height: z.number().int().positive().optional(),
|
|
51
|
+
alt: z.string().optional(),
|
|
52
|
+
});
|
|
53
|
+
// Inferred types from exported Zod validators.
|
|
54
|
+
export type NonEmptyString = z.infer<typeof NonEmptyStringSchema>;
|
|
55
|
+
export type Url = z.infer<typeof UrlSchema>;
|
|
56
|
+
export type UriReference = z.infer<typeof UriReferenceSchema>;
|
|
57
|
+
export type LtiVersion = z.infer<typeof LtiVersionSchema>;
|
|
58
|
+
export type DocumentTarget = z.infer<typeof DocumentTargetSchema>;
|
|
59
|
+
export type RoleUri = z.infer<typeof RoleUriSchema>;
|
|
60
|
+
export type ResourceLink = z.infer<typeof ResourceLinkSchema>;
|
|
61
|
+
export type Context = z.infer<typeof ContextSchema>;
|
|
62
|
+
export type LaunchPresentation = z.infer<typeof LaunchPresentationSchema>;
|
|
63
|
+
export type Lis = z.infer<typeof LisSchema>;
|
|
64
|
+
export type Roles = z.infer<typeof RolesSchema>;
|
|
65
|
+
export type CustomParameters = z.infer<typeof CustomParametersSchema>;
|
|
66
|
+
export type ImageResource = z.infer<typeof ImageResourceSchema>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export * from "../shared";
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
ContextSchema,
|
|
7
|
+
CustomParametersSchema,
|
|
8
|
+
LaunchPresentationSchema,
|
|
9
|
+
LisSchema,
|
|
10
|
+
NonEmptyStringSchema,
|
|
11
|
+
ResourceLinkSchema,
|
|
12
|
+
RolesSchema,
|
|
13
|
+
UrlSchema,
|
|
14
|
+
LtiVersionSchema,
|
|
15
|
+
strictObject,
|
|
16
|
+
} from "../shared";
|
|
17
|
+
|
|
18
|
+
export const CoreLaunchRequestSchema = strictObject({
|
|
19
|
+
messageType: z.literal("LtiResourceLinkRequest"),
|
|
20
|
+
version: LtiVersionSchema,
|
|
21
|
+
deploymentId: NonEmptyStringSchema,
|
|
22
|
+
targetLinkUri: UrlSchema,
|
|
23
|
+
resourceLink: ResourceLinkSchema,
|
|
24
|
+
subject: NonEmptyStringSchema,
|
|
25
|
+
context: ContextSchema.optional(),
|
|
26
|
+
roles: RolesSchema,
|
|
27
|
+
lis: LisSchema.optional(),
|
|
28
|
+
launchPresentation: LaunchPresentationSchema.optional(),
|
|
29
|
+
custom: CustomParametersSchema.optional(),
|
|
30
|
+
name: NonEmptyStringSchema.optional(),
|
|
31
|
+
givenName: NonEmptyStringSchema.optional(),
|
|
32
|
+
familyName: NonEmptyStringSchema.optional(),
|
|
33
|
+
email: z.string().email().optional(),
|
|
34
|
+
locale: NonEmptyStringSchema.optional(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const CoreLaunchClaimsSchema = CoreLaunchRequestSchema;
|
|
38
|
+
|
|
39
|
+
export namespace LtiV1_3 {
|
|
40
|
+
export namespace Schemas {
|
|
41
|
+
export const ResourceLink = ResourceLinkSchema;
|
|
42
|
+
export const Context = ContextSchema;
|
|
43
|
+
export const LaunchPresentation = LaunchPresentationSchema;
|
|
44
|
+
export const Lis = LisSchema;
|
|
45
|
+
export const CoreLaunchRequest = CoreLaunchRequestSchema;
|
|
46
|
+
export const CoreLaunchClaims = CoreLaunchClaimsSchema;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export namespace Shared {
|
|
50
|
+
export const Version = LtiVersionSchema;
|
|
51
|
+
export const Url = UrlSchema;
|
|
52
|
+
export const NonEmptyString = NonEmptyStringSchema;
|
|
53
|
+
export const Roles = RolesSchema;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type LtiV1_3Schemas = typeof LtiV1_3.Schemas;
|
|
58
|
+
|
|
59
|
+
export const Lti13DerivedZodTemplates = {
|
|
60
|
+
description: "LTI 1.3 Core Zod schemas for normalized launch claims and launch-shaped objects",
|
|
61
|
+
specLinks: {
|
|
62
|
+
main: "https://www.imsglobal.org/spec/lti/v1p3/",
|
|
63
|
+
claims: "https://www.imsglobal.org/spec/lti/v1p3/#message-claims",
|
|
64
|
+
},
|
|
65
|
+
scope: "LTI 1.3 resource-link launch claims",
|
|
66
|
+
claims: [
|
|
67
|
+
"messageType",
|
|
68
|
+
"version",
|
|
69
|
+
"deploymentId",
|
|
70
|
+
"targetLinkUri",
|
|
71
|
+
"resourceLink",
|
|
72
|
+
"context",
|
|
73
|
+
"roles",
|
|
74
|
+
"lis",
|
|
75
|
+
"launchPresentation",
|
|
76
|
+
],
|
|
77
|
+
notes: [
|
|
78
|
+
"Normalized camelCase field names are used instead of raw JWT claim URIs.",
|
|
79
|
+
"Identity fields remain optional beyond the subject claim to keep the schema useful for adapter stubs and launch fixtures.",
|
|
80
|
+
],
|
|
81
|
+
} as const;
|
|
82
|
+
// Inferred types from exported Zod validators.
|
|
83
|
+
export type CoreLaunchRequest = z.infer<typeof CoreLaunchRequestSchema>;
|
|
84
|
+
export type CoreLaunchClaims = z.infer<typeof CoreLaunchClaimsSchema>;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export * from "./shared";
|
|
2
|
+
export * from "./or_v1p2_rostering_service_schema";
|
|
3
|
+
export * from "./or_v1p2_gradebook_service_schema";
|
|
4
|
+
export * from "./or_v1p2_resource_service_schema";
|
|
5
|
+
export * from "./or_v1p2_rostering_restbinding_schema";
|
|
6
|
+
export * from "./or_v1p2_gradebook_restbinding_schema";
|
|
7
|
+
export * from "./or_v1p2_resource_restbinding_schema";
|
|
8
|
+
export * from "./or_v1p2_csv_binding_schema";
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
AcademicSessionSchema,
|
|
12
|
+
AcademicSessionSetSchema,
|
|
13
|
+
ClassSchema,
|
|
14
|
+
ClassSetSchema,
|
|
15
|
+
CourseSchema,
|
|
16
|
+
CourseSetSchema,
|
|
17
|
+
DemographicsSchema,
|
|
18
|
+
DemographicsSetSchema,
|
|
19
|
+
EnrollmentSchema,
|
|
20
|
+
EnrollmentSetSchema,
|
|
21
|
+
OrgSchema,
|
|
22
|
+
OrgSetSchema,
|
|
23
|
+
SingleAcademicSessionSchema,
|
|
24
|
+
SingleClassSchema,
|
|
25
|
+
SingleCourseSchema,
|
|
26
|
+
SingleDemographicsSchema,
|
|
27
|
+
SingleEnrollmentSchema,
|
|
28
|
+
SingleOrgSchema,
|
|
29
|
+
SingleUserSchema,
|
|
30
|
+
UserSchema,
|
|
31
|
+
UserSetSchema,
|
|
32
|
+
} from "./or_v1p2_rostering_service_schema";
|
|
33
|
+
import {
|
|
34
|
+
AssessmentLineItemSchema,
|
|
35
|
+
AssessmentLineItemSetSchema,
|
|
36
|
+
AssessmentResultSchema,
|
|
37
|
+
AssessmentResultSetSchema,
|
|
38
|
+
CategorySchema,
|
|
39
|
+
CategorySetSchema,
|
|
40
|
+
GuidPairSetSchema,
|
|
41
|
+
LineItemSchema,
|
|
42
|
+
LineItemSetSchema,
|
|
43
|
+
ResultSchema,
|
|
44
|
+
ResultSetSchema,
|
|
45
|
+
ScoreScaleSchema,
|
|
46
|
+
ScoreScaleSetSchema,
|
|
47
|
+
SingleAssessmentLineItemSchema,
|
|
48
|
+
SingleAssessmentResultSchema,
|
|
49
|
+
SingleCategorySchema,
|
|
50
|
+
SingleLineItemSchema,
|
|
51
|
+
SingleResultSchema,
|
|
52
|
+
SingleScoreScaleSchema,
|
|
53
|
+
} from "./or_v1p2_gradebook_service_schema";
|
|
54
|
+
import { ResourceSchema, ResourceSetSchema, SingleResourceSchema } from "./or_v1p2_resource_service_schema";
|
|
55
|
+
import {
|
|
56
|
+
AcademicSessionsCsvDocumentSchema,
|
|
57
|
+
CategoriesCsvDocumentSchema,
|
|
58
|
+
ClassResourcesCsvDocumentSchema,
|
|
59
|
+
ClassesCsvDocumentSchema,
|
|
60
|
+
CourseResourcesCsvDocumentSchema,
|
|
61
|
+
CoursesCsvDocumentSchema,
|
|
62
|
+
DemographicsCsvDocumentSchema,
|
|
63
|
+
EnrollmentsCsvDocumentSchema,
|
|
64
|
+
LineItemLearningObjectiveIdsCsvDocumentSchema,
|
|
65
|
+
LineItemsCsvDocumentSchema,
|
|
66
|
+
LineItemScoreScalesCsvDocumentSchema,
|
|
67
|
+
ManifestCsvDocumentSchema,
|
|
68
|
+
OneRosterCsvBindingPackageSchema,
|
|
69
|
+
OrgsCsvDocumentSchema,
|
|
70
|
+
ResourcesCsvDocumentSchema,
|
|
71
|
+
ResultLearningObjectiveIdsCsvDocumentSchema,
|
|
72
|
+
ResultsCsvDocumentSchema,
|
|
73
|
+
ResultScoreScalesCsvDocumentSchema,
|
|
74
|
+
RolesCsvDocumentSchema,
|
|
75
|
+
ScoreScalesCsvDocumentSchema,
|
|
76
|
+
UserProfilesCsvDocumentSchema,
|
|
77
|
+
UserResourcesCsvDocumentSchema,
|
|
78
|
+
UsersCsvDocumentSchema,
|
|
79
|
+
} from "./or_v1p2_csv_binding_schema";
|
|
80
|
+
import { GradebookRestBindingOperationSchemas } from "./or_v1p2_gradebook_restbinding_schema";
|
|
81
|
+
import { ResourceRestBindingOperationSchemas } from "./or_v1p2_resource_restbinding_schema";
|
|
82
|
+
import { RosteringRestBindingOperationSchemas } from "./or_v1p2_rostering_restbinding_schema";
|
|
83
|
+
import { ImsxStatusInfoSchema } from "./shared";
|
|
84
|
+
|
|
85
|
+
export const OneRoster12DerivedZodTemplates = {
|
|
86
|
+
academicSession: AcademicSessionSchema,
|
|
87
|
+
academicSessionSet: AcademicSessionSetSchema,
|
|
88
|
+
class: ClassSchema,
|
|
89
|
+
classSet: ClassSetSchema,
|
|
90
|
+
course: CourseSchema,
|
|
91
|
+
courseSet: CourseSetSchema,
|
|
92
|
+
demographics: DemographicsSchema,
|
|
93
|
+
demographicsSet: DemographicsSetSchema,
|
|
94
|
+
enrollment: EnrollmentSchema,
|
|
95
|
+
enrollmentSet: EnrollmentSetSchema,
|
|
96
|
+
org: OrgSchema,
|
|
97
|
+
orgSet: OrgSetSchema,
|
|
98
|
+
user: UserSchema,
|
|
99
|
+
userSet: UserSetSchema,
|
|
100
|
+
singleAcademicSession: SingleAcademicSessionSchema,
|
|
101
|
+
singleClass: SingleClassSchema,
|
|
102
|
+
singleCourse: SingleCourseSchema,
|
|
103
|
+
singleDemographics: SingleDemographicsSchema,
|
|
104
|
+
singleEnrollment: SingleEnrollmentSchema,
|
|
105
|
+
singleOrg: SingleOrgSchema,
|
|
106
|
+
singleUser: SingleUserSchema,
|
|
107
|
+
lineItem: LineItemSchema,
|
|
108
|
+
lineItemSet: LineItemSetSchema,
|
|
109
|
+
result: ResultSchema,
|
|
110
|
+
resultSet: ResultSetSchema,
|
|
111
|
+
category: CategorySchema,
|
|
112
|
+
categorySet: CategorySetSchema,
|
|
113
|
+
scoreScale: ScoreScaleSchema,
|
|
114
|
+
scoreScaleSet: ScoreScaleSetSchema,
|
|
115
|
+
assessmentLineItem: AssessmentLineItemSchema,
|
|
116
|
+
assessmentLineItemSet: AssessmentLineItemSetSchema,
|
|
117
|
+
assessmentResult: AssessmentResultSchema,
|
|
118
|
+
assessmentResultSet: AssessmentResultSetSchema,
|
|
119
|
+
guidPairSet: GuidPairSetSchema,
|
|
120
|
+
singleLineItem: SingleLineItemSchema,
|
|
121
|
+
singleResult: SingleResultSchema,
|
|
122
|
+
singleCategory: SingleCategorySchema,
|
|
123
|
+
singleScoreScale: SingleScoreScaleSchema,
|
|
124
|
+
singleAssessmentLineItem: SingleAssessmentLineItemSchema,
|
|
125
|
+
singleAssessmentResult: SingleAssessmentResultSchema,
|
|
126
|
+
resource: ResourceSchema,
|
|
127
|
+
resourceSet: ResourceSetSchema,
|
|
128
|
+
singleResource: SingleResourceSchema,
|
|
129
|
+
rosteringRestBindingOperations: RosteringRestBindingOperationSchemas,
|
|
130
|
+
gradebookRestBindingOperations: GradebookRestBindingOperationSchemas,
|
|
131
|
+
resourceRestBindingOperations: ResourceRestBindingOperationSchemas,
|
|
132
|
+
manifestCsvDocument: ManifestCsvDocumentSchema,
|
|
133
|
+
academicSessionsCsvDocument: AcademicSessionsCsvDocumentSchema,
|
|
134
|
+
categoriesCsvDocument: CategoriesCsvDocumentSchema,
|
|
135
|
+
classesCsvDocument: ClassesCsvDocumentSchema,
|
|
136
|
+
classResourcesCsvDocument: ClassResourcesCsvDocumentSchema,
|
|
137
|
+
courseResourcesCsvDocument: CourseResourcesCsvDocumentSchema,
|
|
138
|
+
coursesCsvDocument: CoursesCsvDocumentSchema,
|
|
139
|
+
demographicsCsvDocument: DemographicsCsvDocumentSchema,
|
|
140
|
+
enrollmentsCsvDocument: EnrollmentsCsvDocumentSchema,
|
|
141
|
+
lineItemLearningObjectiveIdsCsvDocument: LineItemLearningObjectiveIdsCsvDocumentSchema,
|
|
142
|
+
lineItemsCsvDocument: LineItemsCsvDocumentSchema,
|
|
143
|
+
lineItemScoreScalesCsvDocument: LineItemScoreScalesCsvDocumentSchema,
|
|
144
|
+
orgsCsvDocument: OrgsCsvDocumentSchema,
|
|
145
|
+
resourcesCsvDocument: ResourcesCsvDocumentSchema,
|
|
146
|
+
resultLearningObjectiveIdsCsvDocument: ResultLearningObjectiveIdsCsvDocumentSchema,
|
|
147
|
+
resultsCsvDocument: ResultsCsvDocumentSchema,
|
|
148
|
+
resultScoreScalesCsvDocument: ResultScoreScalesCsvDocumentSchema,
|
|
149
|
+
rolesCsvDocument: RolesCsvDocumentSchema,
|
|
150
|
+
scoreScalesCsvDocument: ScoreScalesCsvDocumentSchema,
|
|
151
|
+
userProfilesCsvDocument: UserProfilesCsvDocumentSchema,
|
|
152
|
+
userResourcesCsvDocument: UserResourcesCsvDocumentSchema,
|
|
153
|
+
usersCsvDocument: UsersCsvDocumentSchema,
|
|
154
|
+
csvBindingPackage: OneRosterCsvBindingPackageSchema,
|
|
155
|
+
imsxStatusInfo: ImsxStatusInfoSchema,
|
|
156
|
+
} as const;
|