@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,124 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import { UriReferenceSchema, addIssue, asArray, collectDuplicates, looseObject, strictObject } from "../shared";
|
|
4
|
+
|
|
5
|
+
export const VdexProfilesTypeSchema = z.enum([
|
|
6
|
+
"lax",
|
|
7
|
+
"hierarchicalTokenTerms",
|
|
8
|
+
"flatTokenTerms",
|
|
9
|
+
"glossaryOrDictionary",
|
|
10
|
+
"thesaurus",
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
export const VdexIdentifierSchema = looseObject({
|
|
14
|
+
value: UriReferenceSchema,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const VdexMediaLocatorSchema = looseObject({
|
|
18
|
+
value: UriReferenceSchema,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const VdexLangStringSchema = looseObject({
|
|
22
|
+
value: z.string(),
|
|
23
|
+
language: z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const VdexLangStringBagSchema = looseObject({
|
|
27
|
+
langstring: z.array(VdexLangStringSchema).min(1),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const VdexDescriptionSchema = VdexLangStringBagSchema;
|
|
31
|
+
|
|
32
|
+
export const VdexVocabSchema = looseObject({
|
|
33
|
+
value: z.string(),
|
|
34
|
+
source: UriReferenceSchema,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const VdexMetadataSchema = looseObject({});
|
|
38
|
+
|
|
39
|
+
export const VdexMediaDescriptorSchema = looseObject({
|
|
40
|
+
mediaLocator: VdexMediaLocatorSchema,
|
|
41
|
+
interpretationNote: VdexDescriptionSchema.optional(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const VdexVocabIdentifierSchema = looseObject({
|
|
45
|
+
value: UriReferenceSchema,
|
|
46
|
+
isRegistered: z.boolean().optional(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const VdexTermRefSchema = looseObject({
|
|
50
|
+
value: UriReferenceSchema,
|
|
51
|
+
vocabularyIdentifier: UriReferenceSchema.optional(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const VdexTermSchema: z.ZodTypeAny = z.lazy(() =>
|
|
55
|
+
looseObject({
|
|
56
|
+
termIdentifier: VdexIdentifierSchema,
|
|
57
|
+
caption: VdexLangStringBagSchema.optional(),
|
|
58
|
+
description: VdexDescriptionSchema.optional(),
|
|
59
|
+
mediaDescriptor: z.array(VdexMediaDescriptorSchema).optional(),
|
|
60
|
+
metadata: z.array(VdexMetadataSchema).optional(),
|
|
61
|
+
term: z.array(VdexTermSchema).optional(),
|
|
62
|
+
orderSignificant: z.boolean().optional(),
|
|
63
|
+
validIndex: z.boolean().optional(),
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
export const VdexRelationshipSchema = looseObject({
|
|
68
|
+
relationshipIdentifier: VdexIdentifierSchema.optional(),
|
|
69
|
+
sourceTerm: VdexTermRefSchema,
|
|
70
|
+
targetTerm: VdexTermRefSchema,
|
|
71
|
+
relationshipType: VdexVocabSchema.optional(),
|
|
72
|
+
metadata: z.array(VdexMetadataSchema).optional(),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
type VdexTermLike = {
|
|
76
|
+
termIdentifier: { value: string };
|
|
77
|
+
term?: VdexTermLike[];
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
function collectVdexTermIdentifiers(term: VdexTermLike, into: string[]) {
|
|
81
|
+
into.push(term.termIdentifier.value);
|
|
82
|
+
for (const child of asArray(term.term)) {
|
|
83
|
+
collectVdexTermIdentifiers(child, into);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const VdexSchema = looseObject({
|
|
88
|
+
vocabName: VdexLangStringBagSchema.optional(),
|
|
89
|
+
vocabIdentifier: VdexVocabIdentifierSchema.optional(),
|
|
90
|
+
term: z.array(VdexTermSchema).min(1),
|
|
91
|
+
relationship: z.array(VdexRelationshipSchema).optional(),
|
|
92
|
+
metadata: z.array(VdexMetadataSchema).optional(),
|
|
93
|
+
orderSignificant: z.boolean().optional(),
|
|
94
|
+
profileType: VdexProfilesTypeSchema.optional(),
|
|
95
|
+
language: z.string().optional(),
|
|
96
|
+
}).superRefine((vdex, context) => {
|
|
97
|
+
const termIdentifiers: string[] = [];
|
|
98
|
+
for (const term of vdex.term) {
|
|
99
|
+
collectVdexTermIdentifiers(term as VdexTermLike, termIdentifiers);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
for (const duplicate of collectDuplicates(termIdentifiers)) {
|
|
103
|
+
addIssue(context, ["term"], `Duplicate VDEX termIdentifier value: ${duplicate}`);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export const VdexDocumentSchema = strictObject({
|
|
108
|
+
vdex: VdexSchema,
|
|
109
|
+
});
|
|
110
|
+
// Inferred types from exported Zod validators.
|
|
111
|
+
export type VdexProfilesType = z.infer<typeof VdexProfilesTypeSchema>;
|
|
112
|
+
export type VdexIdentifier = z.infer<typeof VdexIdentifierSchema>;
|
|
113
|
+
export type VdexMediaLocator = z.infer<typeof VdexMediaLocatorSchema>;
|
|
114
|
+
export type VdexLangString = z.infer<typeof VdexLangStringSchema>;
|
|
115
|
+
export type VdexLangStringBag = z.infer<typeof VdexLangStringBagSchema>;
|
|
116
|
+
export type VdexDescription = z.infer<typeof VdexDescriptionSchema>;
|
|
117
|
+
export type VdexVocab = z.infer<typeof VdexVocabSchema>;
|
|
118
|
+
export type VdexMetadata = z.infer<typeof VdexMetadataSchema>;
|
|
119
|
+
export type VdexMediaDescriptor = z.infer<typeof VdexMediaDescriptorSchema>;
|
|
120
|
+
export type VdexVocabIdentifier = z.infer<typeof VdexVocabIdentifierSchema>;
|
|
121
|
+
export type VdexTermRef = z.infer<typeof VdexTermRefSchema>;
|
|
122
|
+
export type VdexRelationship = z.infer<typeof VdexRelationshipSchema>;
|
|
123
|
+
export type Vdex = z.infer<typeof VdexSchema>;
|
|
124
|
+
export type VdexDocument = z.infer<typeof VdexDocumentSchema>;
|
package/src/config.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const SuiteNameSchema = z.enum(["lrs", "cmi5", "lti13"]);
|
|
4
|
+
export const LogLevelSchema = z.enum(["error", "warn", "info", "debug"]);
|
|
5
|
+
|
|
6
|
+
const RequirementIdArraySchema = z.array(z.string().min(1)).min(1);
|
|
7
|
+
|
|
8
|
+
const TimeoutsSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
connectMs: z.number().int().min(100).max(120_000).default(5_000),
|
|
11
|
+
readMs: z.number().int().min(100).max(120_000).default(30_000),
|
|
12
|
+
operationMs: z.number().int().min(100).max(600_000).default(120_000),
|
|
13
|
+
assertionMs: z.number().int().min(100).max(600_000).default(60_000),
|
|
14
|
+
retryMaxAttempts: z.number().int().min(0).max(10).default(2),
|
|
15
|
+
retryBackoffMs: z.number().int().min(0).max(60_000).default(1_000),
|
|
16
|
+
})
|
|
17
|
+
.default(() => ({
|
|
18
|
+
connectMs: 5_000,
|
|
19
|
+
readMs: 30_000,
|
|
20
|
+
operationMs: 120_000,
|
|
21
|
+
assertionMs: 60_000,
|
|
22
|
+
retryMaxAttempts: 2,
|
|
23
|
+
retryBackoffMs: 1_000,
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
const ArtifactsSchema = z.object({
|
|
27
|
+
outputDir: z.string().min(1),
|
|
28
|
+
summaryFile: z.string().min(1).default("summary.json"),
|
|
29
|
+
junitFile: z.string().min(1).default("junit.xml"),
|
|
30
|
+
requirementTraceFile: z.string().min(1).default("requirement-trace.json"),
|
|
31
|
+
runMetadataFile: z.string().min(1).default("run-metadata.json"),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const AdapterSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
kind: z.literal("http").default("http"),
|
|
37
|
+
baseUrl: z.url(),
|
|
38
|
+
profileVersion: z
|
|
39
|
+
.string()
|
|
40
|
+
.regex(/^\d+\.\d+\.\d+$/u)
|
|
41
|
+
.default("1.0.0"),
|
|
42
|
+
auth: z
|
|
43
|
+
.object({
|
|
44
|
+
mode: z.enum(["none", "bearer"]).default("bearer"),
|
|
45
|
+
tokenFromEnv: z.string().min(1).optional(),
|
|
46
|
+
})
|
|
47
|
+
.default((): { mode: "none" | "bearer"; tokenFromEnv?: string } => ({
|
|
48
|
+
mode: "bearer" as const,
|
|
49
|
+
})),
|
|
50
|
+
requiredCapabilities: z.array(z.string().min(1)).default([]),
|
|
51
|
+
})
|
|
52
|
+
.nullable()
|
|
53
|
+
.default(null)
|
|
54
|
+
.superRefine((adapter, context) => {
|
|
55
|
+
if (!adapter) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (adapter.auth.mode === "bearer" && !adapter.auth.tokenFromEnv) {
|
|
59
|
+
context.addIssue({
|
|
60
|
+
code: z.ZodIssueCode.custom,
|
|
61
|
+
message: "adapter.auth.tokenFromEnv is required when adapter.auth.mode is bearer",
|
|
62
|
+
path: ["auth", "tokenFromEnv"],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export const RunnerConfigSchema = z
|
|
68
|
+
.object({
|
|
69
|
+
contractVersion: z
|
|
70
|
+
.string()
|
|
71
|
+
.regex(/^\d+\.\d+\.\d+$/u)
|
|
72
|
+
.default("1.0.0"),
|
|
73
|
+
suite: z.object({
|
|
74
|
+
name: SuiteNameSchema,
|
|
75
|
+
target: z.string().min(1),
|
|
76
|
+
}),
|
|
77
|
+
sut: z.record(z.string(), z.unknown()),
|
|
78
|
+
auth: z.record(z.string(), z.unknown()).default({}),
|
|
79
|
+
selection: z
|
|
80
|
+
.object({
|
|
81
|
+
includeRequirementIds: RequirementIdArraySchema.optional(),
|
|
82
|
+
excludeRequirementIds: RequirementIdArraySchema.optional(),
|
|
83
|
+
})
|
|
84
|
+
.default({}),
|
|
85
|
+
timeouts: TimeoutsSchema,
|
|
86
|
+
artifacts: ArtifactsSchema,
|
|
87
|
+
debug: z
|
|
88
|
+
.object({
|
|
89
|
+
logLevel: LogLevelSchema.default("info"),
|
|
90
|
+
redactionEnabled: z.boolean().default(true),
|
|
91
|
+
})
|
|
92
|
+
.default((): { logLevel: z.infer<typeof LogLevelSchema>; redactionEnabled: boolean } => ({
|
|
93
|
+
logLevel: "info" as const,
|
|
94
|
+
redactionEnabled: true,
|
|
95
|
+
})),
|
|
96
|
+
adapter: AdapterSchema,
|
|
97
|
+
suiteConfig: z.record(z.string(), z.unknown()).default({}),
|
|
98
|
+
})
|
|
99
|
+
.superRefine((config, context) => {
|
|
100
|
+
if (config.suite.name === "cmi5") {
|
|
101
|
+
if (!["runtime", "package", "all"].includes(config.suite.target)) {
|
|
102
|
+
context.addIssue({
|
|
103
|
+
code: z.ZodIssueCode.custom,
|
|
104
|
+
message: "suite.target must be runtime, package, or all when suite.name is cmi5",
|
|
105
|
+
path: ["suite", "target"],
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (!config.adapter) {
|
|
109
|
+
context.addIssue({
|
|
110
|
+
code: z.ZodIssueCode.custom,
|
|
111
|
+
message: "adapter is required when suite.name is cmi5",
|
|
112
|
+
path: ["adapter"],
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export type RunnerConfig = z.infer<typeof RunnerConfigSchema>;
|
|
119
|
+
// Inferred types from exported Zod validators.
|
|
120
|
+
export type SuiteName = z.infer<typeof SuiteNameSchema>;
|
|
121
|
+
export type LogLevel = z.infer<typeof LogLevelSchema>;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export * from "./config";
|
|
2
|
+
export * from "./summary";
|
|
3
|
+
export * from "./adapter";
|
|
4
|
+
export * from "./cmi5";
|
|
5
|
+
export * from "./qti/v3_0_1";
|
|
6
|
+
export * from "./lti";
|
|
7
|
+
export * as QtiV2_1 from "./qti/v2_1";
|
|
8
|
+
export * as QtiV2_2 from "./qti/v2_2";
|
|
9
|
+
export * as QtiV3_0_1 from "./qti/v3_0_1";
|
|
10
|
+
export * as Cmi5 from "./cmi5";
|
|
11
|
+
export * as Cmi5V1_0 from "./cmi5/v1_0";
|
|
12
|
+
export * as Xapi from "./xapi";
|
|
13
|
+
export * as XapiV1_0_3 from "./xapi/v1_0_3";
|
|
14
|
+
export * as XapiV2_0 from "./xapi/v2_0";
|
|
15
|
+
export * as Lti from "./lti";
|
|
16
|
+
export * as LtiV1_3 from "./lti/v1_3";
|
|
17
|
+
export * as LtiDeepLinkingV2_0 from "./lti/deep-linking/v2_0";
|
|
18
|
+
export * as LtiAgsV2_0 from "./lti/ags/v2_0";
|
|
19
|
+
export * as LtiNrpsV2_0 from "./lti/nrps/v2_0";
|
|
20
|
+
export * as LtiProctoringV1_0 from "./lti/proctoring/v1_0";
|
|
21
|
+
export * as CaliperV1_2 from "./caliper/v1_2";
|
|
22
|
+
export { Caliper12DerivedZodTemplates } from "./caliper/v1_2";
|
|
23
|
+
export * as CommonCartridgeV1_3 from "./common-cartridge/v1_3";
|
|
24
|
+
export * as CommonCartridgeV1_4 from "./common-cartridge/v1_4";
|
|
25
|
+
export * as CaseV1_1 from "./case/v1_1";
|
|
26
|
+
export { Case11DerivedZodTemplates } from "./case/v1_1";
|
|
27
|
+
export * as CatV1_0 from "./cat/v1_0";
|
|
28
|
+
export { Cat10DerivedZodTemplates } from "./cat/v1_0";
|
|
29
|
+
export * as ClrV2_0 from "./clr/v2_0";
|
|
30
|
+
export * as OpenBadgesV3_0 from "./open-badges/v3_0";
|
|
31
|
+
export * as OneRosterV1_2 from "./oneroster/v1_2";
|
|
32
|
+
export * as VcDataModelV2_0 from "./vc-data-model/v2_0";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export * from "../../shared";
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import { NonEmptyStringSchema, UrlSchema, strictObject } from "../../shared";
|
|
6
|
+
|
|
7
|
+
export const AgsScopeSchema = z.enum([
|
|
8
|
+
"https://purl.imsglobal.org/spec/lti-ags/scope/lineitem",
|
|
9
|
+
"https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly",
|
|
10
|
+
"https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly",
|
|
11
|
+
"https://purl.imsglobal.org/spec/lti-ags/scope/score",
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
export const EndpointSchema = strictObject({
|
|
15
|
+
scope: z.array(AgsScopeSchema).min(1),
|
|
16
|
+
lineitems: UrlSchema,
|
|
17
|
+
lineitem: UrlSchema.optional(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const LineItemSchema = strictObject({
|
|
21
|
+
id: UrlSchema.optional(),
|
|
22
|
+
label: NonEmptyStringSchema,
|
|
23
|
+
scoreMaximum: z.number().nonnegative(),
|
|
24
|
+
resourceId: NonEmptyStringSchema.optional(),
|
|
25
|
+
resourceLinkId: NonEmptyStringSchema.optional(),
|
|
26
|
+
tag: NonEmptyStringSchema.optional(),
|
|
27
|
+
startDateTime: z.iso.datetime().optional(),
|
|
28
|
+
endDateTime: z.iso.datetime().optional(),
|
|
29
|
+
gradesReleased: z.boolean().optional(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const ScoreProgressSchema = z.enum(["Completed", "Failed", "InProgress", "Initialized", "Submitted", "Started"]);
|
|
33
|
+
export const GradingProgressSchema = z.enum(["Failed", "FullyGraded", "NotReady", "Pending", "PendingManual"]);
|
|
34
|
+
|
|
35
|
+
export const ScoreSubmissionSchema = strictObject({
|
|
36
|
+
startedAt: z.iso.datetime().optional(),
|
|
37
|
+
submittedAt: z.iso.datetime().optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const ScoreSchema = strictObject({
|
|
41
|
+
userId: NonEmptyStringSchema,
|
|
42
|
+
scoreGiven: z.number().optional(),
|
|
43
|
+
scoreMaximum: z.number().optional(),
|
|
44
|
+
activityProgress: ScoreProgressSchema.optional(),
|
|
45
|
+
gradingProgress: GradingProgressSchema.optional(),
|
|
46
|
+
timestamp: z.iso.datetime().optional(),
|
|
47
|
+
submission: ScoreSubmissionSchema.optional(),
|
|
48
|
+
comment: z.string().optional(),
|
|
49
|
+
scorePublished: z.boolean().optional(),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const ResultSchema = strictObject({
|
|
53
|
+
id: UrlSchema.optional(),
|
|
54
|
+
scoreOf: UrlSchema.optional(),
|
|
55
|
+
userId: NonEmptyStringSchema,
|
|
56
|
+
resultScore: z.number().optional(),
|
|
57
|
+
resultMaximum: z.number().optional(),
|
|
58
|
+
scoringUserId: NonEmptyStringSchema.optional(),
|
|
59
|
+
comment: z.string().optional(),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export namespace LtiAgsV2_0 {
|
|
63
|
+
export namespace Schemas {
|
|
64
|
+
export const Endpoint = EndpointSchema;
|
|
65
|
+
export const LineItem = LineItemSchema;
|
|
66
|
+
export const Score = ScoreSchema;
|
|
67
|
+
export const ScoreSubmission = ScoreSubmissionSchema;
|
|
68
|
+
export const Result = ResultSchema;
|
|
69
|
+
export const AgsScope = AgsScopeSchema;
|
|
70
|
+
export const ScoreProgress = ScoreProgressSchema;
|
|
71
|
+
export const GradingProgress = GradingProgressSchema;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type LtiAgsV2_0Schemas = typeof LtiAgsV2_0.Schemas;
|
|
76
|
+
|
|
77
|
+
export const LtiAgsV2_0DerivedZodTemplates = {
|
|
78
|
+
description: "LTI AGS v2.0 Zod schemas for normalized endpoint, line item, score, and result objects",
|
|
79
|
+
specLinks: {
|
|
80
|
+
main: "https://www.imsglobal.org/spec/lti-ags/v2p0/",
|
|
81
|
+
},
|
|
82
|
+
scope: "Assignment and Grade Services endpoint, line item, score, and result payloads",
|
|
83
|
+
claims: ["endpoint"],
|
|
84
|
+
notes: [
|
|
85
|
+
"The endpoint claim is modeled in normalized camelCase form with explicit scope validation.",
|
|
86
|
+
"Score and result payloads are strict JSON objects suitable for adapter/reference app contracts.",
|
|
87
|
+
],
|
|
88
|
+
} as const;
|
|
89
|
+
// Inferred types from exported Zod validators.
|
|
90
|
+
export type AgsScope = z.infer<typeof AgsScopeSchema>;
|
|
91
|
+
export type Endpoint = z.infer<typeof EndpointSchema>;
|
|
92
|
+
export type LineItem = z.infer<typeof LineItemSchema>;
|
|
93
|
+
export type ScoreProgress = z.infer<typeof ScoreProgressSchema>;
|
|
94
|
+
export type GradingProgress = z.infer<typeof GradingProgressSchema>;
|
|
95
|
+
export type ScoreSubmission = z.infer<typeof ScoreSubmissionSchema>;
|
|
96
|
+
export type Score = z.infer<typeof ScoreSchema>;
|
|
97
|
+
export type Result = z.infer<typeof ResultSchema>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export * from "../../shared";
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
ContextSchema,
|
|
7
|
+
CustomParametersSchema,
|
|
8
|
+
ImageResourceSchema,
|
|
9
|
+
LaunchPresentationSchema,
|
|
10
|
+
LisSchema,
|
|
11
|
+
NonEmptyStringSchema,
|
|
12
|
+
ResourceLinkSchema,
|
|
13
|
+
RolesSchema,
|
|
14
|
+
UrlSchema,
|
|
15
|
+
LtiVersionSchema,
|
|
16
|
+
strictObject,
|
|
17
|
+
} from "../../shared";
|
|
18
|
+
import { LineItemSchema } from "../../ags/v2_0";
|
|
19
|
+
|
|
20
|
+
export const ContentItemTypeSchema = z.enum(["file", "html", "image", "link", "ltiResourceLink"]);
|
|
21
|
+
|
|
22
|
+
export const DeepLinkingSettingsSchema = strictObject({
|
|
23
|
+
deepLinkReturnUrl: UrlSchema,
|
|
24
|
+
acceptTypes: z.array(ContentItemTypeSchema).min(1),
|
|
25
|
+
acceptPresentationDocumentTargets: z.array(z.enum(["embed", "frame", "iframe", "popup", "tab", "window"])).optional(),
|
|
26
|
+
acceptMediaTypes: z.union([NonEmptyStringSchema, z.array(NonEmptyStringSchema).min(1)]).optional(),
|
|
27
|
+
acceptMultiple: z.boolean().optional(),
|
|
28
|
+
autoCreate: z.boolean().optional(),
|
|
29
|
+
title: z.string().optional(),
|
|
30
|
+
text: z.string().optional(),
|
|
31
|
+
data: z.string().optional(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const DeepLinkingRequestSchema = strictObject({
|
|
35
|
+
messageType: z.literal("LtiDeepLinkingRequest"),
|
|
36
|
+
version: LtiVersionSchema,
|
|
37
|
+
deploymentId: NonEmptyStringSchema,
|
|
38
|
+
deepLinkingSettings: DeepLinkingSettingsSchema,
|
|
39
|
+
subject: NonEmptyStringSchema.optional(),
|
|
40
|
+
resourceLink: ResourceLinkSchema.optional(),
|
|
41
|
+
context: ContextSchema.optional(),
|
|
42
|
+
roles: RolesSchema.optional(),
|
|
43
|
+
lis: LisSchema.optional(),
|
|
44
|
+
launchPresentation: LaunchPresentationSchema.optional(),
|
|
45
|
+
custom: CustomParametersSchema.optional(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const ContentItemSchema = strictObject({
|
|
49
|
+
type: ContentItemTypeSchema,
|
|
50
|
+
title: z.string().optional(),
|
|
51
|
+
text: z.string().optional(),
|
|
52
|
+
url: UrlSchema.optional(),
|
|
53
|
+
custom: CustomParametersSchema.optional(),
|
|
54
|
+
icon: ImageResourceSchema.optional(),
|
|
55
|
+
thumbnail: ImageResourceSchema.optional(),
|
|
56
|
+
lineItem: LineItemSchema.optional(),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const DeepLinkingResponseSchema = strictObject({
|
|
60
|
+
messageType: z.literal("LtiDeepLinkingResponse"),
|
|
61
|
+
version: LtiVersionSchema,
|
|
62
|
+
deploymentId: NonEmptyStringSchema.optional(),
|
|
63
|
+
contentItems: z.array(ContentItemSchema).min(1),
|
|
64
|
+
data: z.string().optional(),
|
|
65
|
+
message: z.string().optional(),
|
|
66
|
+
log: z.string().optional(),
|
|
67
|
+
errorMessage: z.string().optional(),
|
|
68
|
+
errorLog: z.string().optional(),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export namespace LtiDeepLinkingV2_0 {
|
|
72
|
+
export namespace Schemas {
|
|
73
|
+
export const ContentItemType = ContentItemTypeSchema;
|
|
74
|
+
export const DeepLinkingSettings = DeepLinkingSettingsSchema;
|
|
75
|
+
export const DeepLinkingRequest = DeepLinkingRequestSchema;
|
|
76
|
+
export const ContentItem = ContentItemSchema;
|
|
77
|
+
export const DeepLinkingResponse = DeepLinkingResponseSchema;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type LtiDeepLinkingV2_0Schemas = typeof LtiDeepLinkingV2_0.Schemas;
|
|
82
|
+
|
|
83
|
+
export const LtiDeepLinkingV2_0DerivedZodTemplates = {
|
|
84
|
+
description: "LTI Deep Linking v2.0 Zod schemas for normalized request settings and response content items",
|
|
85
|
+
specLinks: {
|
|
86
|
+
main: "https://www.imsglobal.org/spec/lti-dl/v2p0/",
|
|
87
|
+
},
|
|
88
|
+
scope: "Deep linking request settings and response content items",
|
|
89
|
+
claims: ["deep_linking_settings", "content_items"],
|
|
90
|
+
notes: [
|
|
91
|
+
"Accept-media-types is intentionally permissive because implementations vary between comma-delimited strings and arrays.",
|
|
92
|
+
"Content items reuse the AGS line-item schema when a deep-linked resource declares grading metadata.",
|
|
93
|
+
],
|
|
94
|
+
} as const;
|
|
95
|
+
// Inferred types from exported Zod validators.
|
|
96
|
+
export type ContentItemType = z.infer<typeof ContentItemTypeSchema>;
|
|
97
|
+
export type DeepLinkingSettings = z.infer<typeof DeepLinkingSettingsSchema>;
|
|
98
|
+
export type DeepLinkingRequest = z.infer<typeof DeepLinkingRequestSchema>;
|
|
99
|
+
export type ContentItem = z.infer<typeof ContentItemSchema>;
|
|
100
|
+
export type DeepLinkingResponse = z.infer<typeof DeepLinkingResponseSchema>;
|
package/src/lti/index.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from "./shared";
|
|
2
|
+
export * from "./v1_3";
|
|
3
|
+
export * from "./deep-linking/v2_0";
|
|
4
|
+
export * from "./ags/v2_0";
|
|
5
|
+
export * from "./nrps/v2_0";
|
|
6
|
+
export * from "./proctoring/v1_0";
|
|
7
|
+
|
|
8
|
+
export * as V1_3 from "./v1_3";
|
|
9
|
+
export * as DeepLinkingV2_0 from "./deep-linking/v2_0";
|
|
10
|
+
export * as AgsV2_0 from "./ags/v2_0";
|
|
11
|
+
export * as NrpsV2_0 from "./nrps/v2_0";
|
|
12
|
+
export * as ProctoringV1_0 from "./proctoring/v1_0";
|
|
13
|
+
|
|
14
|
+
import { Lti13DerivedZodTemplates } from "./v1_3";
|
|
15
|
+
import { LtiDeepLinkingV2_0DerivedZodTemplates } from "./deep-linking/v2_0";
|
|
16
|
+
import { LtiAgsV2_0DerivedZodTemplates } from "./ags/v2_0";
|
|
17
|
+
import { LtiNrpsV2_0DerivedZodTemplates } from "./nrps/v2_0";
|
|
18
|
+
import { LtiProctoringV1_0DerivedZodTemplates } from "./proctoring/v1_0";
|
|
19
|
+
|
|
20
|
+
export const LtiDerivedZodTemplates = {
|
|
21
|
+
core: Lti13DerivedZodTemplates,
|
|
22
|
+
deepLinking: LtiDeepLinkingV2_0DerivedZodTemplates,
|
|
23
|
+
ags: LtiAgsV2_0DerivedZodTemplates,
|
|
24
|
+
nrps: LtiNrpsV2_0DerivedZodTemplates,
|
|
25
|
+
proctoring: LtiProctoringV1_0DerivedZodTemplates,
|
|
26
|
+
} as const;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export * from "../../shared";
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import { NonEmptyStringSchema, UrlSchema, UriReferenceSchema, strictObject } from "../../shared";
|
|
6
|
+
|
|
7
|
+
export const MembershipStatusSchema = z.enum(["Active", "Deleted", "Inactive"]);
|
|
8
|
+
|
|
9
|
+
export const MembershipContextSchema = strictObject({
|
|
10
|
+
id: NonEmptyStringSchema,
|
|
11
|
+
label: NonEmptyStringSchema.optional(),
|
|
12
|
+
title: NonEmptyStringSchema.optional(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const NamesRoleServiceSchema = strictObject({
|
|
16
|
+
contextMembershipsUrl: UrlSchema,
|
|
17
|
+
serviceVersions: z.array(z.literal("2.0")).min(1),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const MembershipSchema = strictObject({
|
|
21
|
+
status: MembershipStatusSchema.optional(),
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
picture: UrlSchema.optional(),
|
|
24
|
+
givenName: z.string().optional(),
|
|
25
|
+
familyName: z.string().optional(),
|
|
26
|
+
middleName: z.string().optional(),
|
|
27
|
+
email: z.string().email().optional(),
|
|
28
|
+
userId: NonEmptyStringSchema,
|
|
29
|
+
lisPersonSourcedId: NonEmptyStringSchema.optional(),
|
|
30
|
+
roles: z.array(UriReferenceSchema).min(1),
|
|
31
|
+
roleScopeMentor: z.array(UriReferenceSchema).min(1).optional(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const MembershipContainerSchema = strictObject({
|
|
35
|
+
id: UrlSchema,
|
|
36
|
+
context: MembershipContextSchema,
|
|
37
|
+
members: z.array(MembershipSchema).min(1),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export namespace LtiNrpsV2_0 {
|
|
41
|
+
export namespace Schemas {
|
|
42
|
+
export const NamesRoleService = NamesRoleServiceSchema;
|
|
43
|
+
export const Membership = MembershipSchema;
|
|
44
|
+
export const MembershipContainer = MembershipContainerSchema;
|
|
45
|
+
export const MembershipContext = MembershipContextSchema;
|
|
46
|
+
export const MembershipStatus = MembershipStatusSchema;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type LtiNrpsV2_0Schemas = typeof LtiNrpsV2_0.Schemas;
|
|
51
|
+
|
|
52
|
+
export const LtiNrpsV2_0DerivedZodTemplates = {
|
|
53
|
+
description: "LTI NRPS v2.0 Zod schemas for normalized names/roles service and membership container payloads",
|
|
54
|
+
specLinks: {
|
|
55
|
+
main: "https://www.imsglobal.org/spec/lti-nrps/v2p0/",
|
|
56
|
+
},
|
|
57
|
+
scope: "Names and Roles Provisioning Service claim and membership container",
|
|
58
|
+
claims: ["namesroleservice"],
|
|
59
|
+
notes: [
|
|
60
|
+
"Member records keep the required userId and roles fields strict while leaving consented personal data optional.",
|
|
61
|
+
"The membership container matches the normalized JSON shape used by the adapter reference app.",
|
|
62
|
+
],
|
|
63
|
+
} as const;
|
|
64
|
+
// Inferred types from exported Zod validators.
|
|
65
|
+
export type MembershipStatus = z.infer<typeof MembershipStatusSchema>;
|
|
66
|
+
export type MembershipContext = z.infer<typeof MembershipContextSchema>;
|
|
67
|
+
export type NamesRoleService = z.infer<typeof NamesRoleServiceSchema>;
|
|
68
|
+
export type Membership = z.infer<typeof MembershipSchema>;
|
|
69
|
+
export type MembershipContainer = z.infer<typeof MembershipContainerSchema>;
|