@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,146 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const NonEmptyStringSchema = z.string().min(1);
|
|
4
|
+
export const UriReferenceSchema = NonEmptyStringSchema;
|
|
5
|
+
export const QtiIdentifierSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.min(1)
|
|
8
|
+
.regex(/^[A-Za-z_][A-Za-z0-9._-]*$/u);
|
|
9
|
+
export const QtiIdentifierListSchema = z.array(QtiIdentifierSchema);
|
|
10
|
+
export const QtiStringListSchema = z.array(NonEmptyStringSchema);
|
|
11
|
+
export const QtiCoordsSchema = NonEmptyStringSchema;
|
|
12
|
+
export const QtiMimeTypeSchema = NonEmptyStringSchema;
|
|
13
|
+
export const QtiStringOrNumberSchema = z.union([z.string(), z.number()]);
|
|
14
|
+
export const QtiIntegerOrVariableSchema = z.union([z.number().int(), NonEmptyStringSchema]);
|
|
15
|
+
export const QtiNumberOrVariableSchema = z.union([z.number(), NonEmptyStringSchema]);
|
|
16
|
+
|
|
17
|
+
export const QtiCardinalitySchema = z.enum(["single", "multiple", "ordered", "record"]);
|
|
18
|
+
|
|
19
|
+
export const QtiBaseTypeSchema = z.enum([
|
|
20
|
+
"boolean",
|
|
21
|
+
"directedPair",
|
|
22
|
+
"duration",
|
|
23
|
+
"file",
|
|
24
|
+
"float",
|
|
25
|
+
"identifier",
|
|
26
|
+
"integer",
|
|
27
|
+
"pair",
|
|
28
|
+
"point",
|
|
29
|
+
"string",
|
|
30
|
+
"uri",
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
export const QtiShowHideSchema = z.enum(["show", "hide"]);
|
|
34
|
+
export const QtiViewSchema = z.enum(["author", "candidate", "proctor", "scorer", "testConstructor", "tutor"]);
|
|
35
|
+
export const QtiDirectionSchema = z.enum(["ltr", "rtl", "auto"]);
|
|
36
|
+
export const QtiOrientationSchema = z.enum(["horizontal", "vertical"]);
|
|
37
|
+
export const QtiNavigationModeSchema = z.enum(["linear", "nonlinear"]);
|
|
38
|
+
export const QtiSubmissionModeSchema = z.enum(["individual", "simultaneous"]);
|
|
39
|
+
export const QtiSuppressTtsSchema = z.enum(["computer-read-aloud", "screen-reader", "all"]);
|
|
40
|
+
export const QtiShapeSchema = z.enum(["circle", "default", "ellipse", "poly", "rect"]);
|
|
41
|
+
export const QtiExternalScoredSchema = z.enum(["externalMachine", "human"]);
|
|
42
|
+
export const QtiSessionStatusSchema = z.enum([
|
|
43
|
+
"final",
|
|
44
|
+
"initial",
|
|
45
|
+
"pendingExternalScoring",
|
|
46
|
+
"pendingResponseProcessing",
|
|
47
|
+
"pendingSubmission",
|
|
48
|
+
]);
|
|
49
|
+
export const QtiScoreStatusSchema = z.enum(["notscored", "scored"]);
|
|
50
|
+
export const QtiAnsweredStatusSchema = z.enum(["notpresented", "presented", "attempted", "answered"]);
|
|
51
|
+
export const QtiSupportAssignmentSchema = z.enum(["assigned", "universal", "prohibited", "inherit"]);
|
|
52
|
+
|
|
53
|
+
export const XmlForeignAttributesSchema = z.record(z.string(), z.unknown());
|
|
54
|
+
|
|
55
|
+
export const XmlExtensionNodeSchema = z
|
|
56
|
+
.object({
|
|
57
|
+
namespace: NonEmptyStringSchema,
|
|
58
|
+
name: NonEmptyStringSchema,
|
|
59
|
+
value: z.unknown().optional(),
|
|
60
|
+
attributes: XmlForeignAttributesSchema.optional(),
|
|
61
|
+
children: z.array(z.unknown()).optional(),
|
|
62
|
+
})
|
|
63
|
+
.strict();
|
|
64
|
+
|
|
65
|
+
export const XmlExtensionNodeListSchema = z.array(XmlExtensionNodeSchema);
|
|
66
|
+
|
|
67
|
+
export function strictObject<T extends z.ZodRawShape>(shape: T) {
|
|
68
|
+
return z.object(shape).strict();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function looseObject<T extends z.ZodRawShape>(shape: T) {
|
|
72
|
+
return strictObject({
|
|
73
|
+
...shape,
|
|
74
|
+
extensions: XmlExtensionNodeListSchema.optional(),
|
|
75
|
+
foreignAttributes: XmlForeignAttributesSchema.optional(),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function createXmlNodeSchema(childSchema: z.ZodTypeAny): z.ZodTypeAny {
|
|
80
|
+
return z.lazy(() =>
|
|
81
|
+
strictObject({
|
|
82
|
+
kind: z.literal("xml"),
|
|
83
|
+
namespace: z.string().optional(),
|
|
84
|
+
name: NonEmptyStringSchema,
|
|
85
|
+
value: z.string().optional(),
|
|
86
|
+
attributes: XmlForeignAttributesSchema.optional(),
|
|
87
|
+
children: z.array(childSchema).optional(),
|
|
88
|
+
}),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function addIssue(context: z.RefinementCtx, path: Array<string | number>, message: string) {
|
|
93
|
+
context.addIssue({
|
|
94
|
+
code: z.ZodIssueCode.custom,
|
|
95
|
+
path,
|
|
96
|
+
message,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function collectDuplicates(values: string[]): string[] {
|
|
101
|
+
const seen = new Set<string>();
|
|
102
|
+
const duplicates = new Set<string>();
|
|
103
|
+
|
|
104
|
+
for (const value of values) {
|
|
105
|
+
if (seen.has(value)) {
|
|
106
|
+
duplicates.add(value);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
seen.add(value);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return [...duplicates];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function asArray<T>(value: readonly T[] | T[] | undefined | null): T[] {
|
|
116
|
+
return Array.isArray(value) ? [...value] : [];
|
|
117
|
+
}
|
|
118
|
+
// Inferred types from exported Zod validators.
|
|
119
|
+
export type NonEmptyString = z.infer<typeof NonEmptyStringSchema>;
|
|
120
|
+
export type UriReference = z.infer<typeof UriReferenceSchema>;
|
|
121
|
+
export type QtiIdentifier = z.infer<typeof QtiIdentifierSchema>;
|
|
122
|
+
export type QtiIdentifierList = z.infer<typeof QtiIdentifierListSchema>;
|
|
123
|
+
export type QtiStringList = z.infer<typeof QtiStringListSchema>;
|
|
124
|
+
export type QtiCoords = z.infer<typeof QtiCoordsSchema>;
|
|
125
|
+
export type QtiMimeType = z.infer<typeof QtiMimeTypeSchema>;
|
|
126
|
+
export type QtiStringOrNumber = z.infer<typeof QtiStringOrNumberSchema>;
|
|
127
|
+
export type QtiIntegerOrVariable = z.infer<typeof QtiIntegerOrVariableSchema>;
|
|
128
|
+
export type QtiNumberOrVariable = z.infer<typeof QtiNumberOrVariableSchema>;
|
|
129
|
+
export type QtiCardinality = z.infer<typeof QtiCardinalitySchema>;
|
|
130
|
+
export type QtiBaseType = z.infer<typeof QtiBaseTypeSchema>;
|
|
131
|
+
export type QtiShowHide = z.infer<typeof QtiShowHideSchema>;
|
|
132
|
+
export type QtiView = z.infer<typeof QtiViewSchema>;
|
|
133
|
+
export type QtiDirection = z.infer<typeof QtiDirectionSchema>;
|
|
134
|
+
export type QtiOrientation = z.infer<typeof QtiOrientationSchema>;
|
|
135
|
+
export type QtiNavigationMode = z.infer<typeof QtiNavigationModeSchema>;
|
|
136
|
+
export type QtiSubmissionMode = z.infer<typeof QtiSubmissionModeSchema>;
|
|
137
|
+
export type QtiSuppressTts = z.infer<typeof QtiSuppressTtsSchema>;
|
|
138
|
+
export type QtiShape = z.infer<typeof QtiShapeSchema>;
|
|
139
|
+
export type QtiExternalScored = z.infer<typeof QtiExternalScoredSchema>;
|
|
140
|
+
export type QtiSessionStatus = z.infer<typeof QtiSessionStatusSchema>;
|
|
141
|
+
export type QtiScoreStatus = z.infer<typeof QtiScoreStatusSchema>;
|
|
142
|
+
export type QtiAnsweredStatus = z.infer<typeof QtiAnsweredStatusSchema>;
|
|
143
|
+
export type QtiSupportAssignment = z.infer<typeof QtiSupportAssignmentSchema>;
|
|
144
|
+
export type XmlForeignAttributes = z.infer<typeof XmlForeignAttributesSchema>;
|
|
145
|
+
export type XmlExtensionNode = z.infer<typeof XmlExtensionNodeSchema>;
|
|
146
|
+
export type XmlExtensionNodeList = z.infer<typeof XmlExtensionNodeListSchema>;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
QtiBaseTypeSchema,
|
|
5
|
+
QtiCardinalitySchema,
|
|
6
|
+
QtiCoordsSchema,
|
|
7
|
+
QtiExternalScoredSchema,
|
|
8
|
+
QtiIdentifierSchema,
|
|
9
|
+
QtiMimeTypeSchema,
|
|
10
|
+
QtiShapeSchema,
|
|
11
|
+
QtiViewSchema,
|
|
12
|
+
addIssue,
|
|
13
|
+
looseObject,
|
|
14
|
+
strictObject,
|
|
15
|
+
} from "./shared";
|
|
16
|
+
|
|
17
|
+
export const QtiValueSchema = strictObject({
|
|
18
|
+
value: z.string(),
|
|
19
|
+
fieldIdentifier: QtiIdentifierSchema.optional(),
|
|
20
|
+
baseType: QtiBaseTypeSchema.optional(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const QtiDefaultValueSchema = strictObject({
|
|
24
|
+
values: z.array(QtiValueSchema).min(1),
|
|
25
|
+
interpretation: z.string().optional(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const QtiCorrectResponseSchema = strictObject({
|
|
29
|
+
values: z.array(QtiValueSchema).min(1),
|
|
30
|
+
interpretation: z.string().optional(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const QtiAreaMapEntrySchema = strictObject({
|
|
34
|
+
shape: QtiShapeSchema,
|
|
35
|
+
coords: QtiCoordsSchema,
|
|
36
|
+
mappedValue: z.number(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const QtiAreaMappingSchema = strictObject({
|
|
40
|
+
areaMapEntries: z.array(QtiAreaMapEntrySchema).min(1),
|
|
41
|
+
lowerBound: z.number().optional(),
|
|
42
|
+
upperBound: z.number().optional(),
|
|
43
|
+
defaultValue: z.number().optional(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const QtiMapEntrySchema = strictObject({
|
|
47
|
+
mapKey: z.string(),
|
|
48
|
+
mappedValue: z.number(),
|
|
49
|
+
caseSensitive: z.boolean().optional(),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const QtiMappingSchema = strictObject({
|
|
53
|
+
mapEntries: z.array(QtiMapEntrySchema).min(1),
|
|
54
|
+
lowerBound: z.number().optional(),
|
|
55
|
+
upperBound: z.number().optional(),
|
|
56
|
+
defaultValue: z.number().optional(),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const QtiInterpolationTableEntrySchema = strictObject({
|
|
60
|
+
sourceValue: z.number(),
|
|
61
|
+
includeBoundary: z.boolean().optional(),
|
|
62
|
+
targetValue: z.string(),
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export const QtiInterpolationTableSchema = strictObject({
|
|
66
|
+
interpolationTableEntries: z.array(QtiInterpolationTableEntrySchema).min(1),
|
|
67
|
+
defaultValue: z.string().optional(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const QtiMatchTableEntrySchema = strictObject({
|
|
71
|
+
sourceValue: z.number().int(),
|
|
72
|
+
targetValue: z.string(),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const QtiMatchTableSchema = strictObject({
|
|
76
|
+
matchTableEntries: z.array(QtiMatchTableEntrySchema).min(1),
|
|
77
|
+
defaultValue: z.string().optional(),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export const QtiStyleSheetSchema = strictObject({
|
|
81
|
+
href: z.string(),
|
|
82
|
+
type: QtiMimeTypeSchema,
|
|
83
|
+
media: z.string().optional(),
|
|
84
|
+
title: z.string().optional(),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const QtiCatalogSchema = looseObject({
|
|
88
|
+
kind: z.literal("catalog"),
|
|
89
|
+
content: z.array(z.unknown()).optional(),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export const QtiCatalogInfoSchema = strictObject({
|
|
93
|
+
catalogs: z.array(QtiCatalogSchema).min(1),
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
export const QtiItemSessionControlSchema = strictObject({
|
|
97
|
+
maxAttempts: z.number().int().optional(),
|
|
98
|
+
showFeedback: z.boolean().optional(),
|
|
99
|
+
allowReview: z.boolean().optional(),
|
|
100
|
+
showSolution: z.boolean().optional(),
|
|
101
|
+
allowComment: z.boolean().optional(),
|
|
102
|
+
allowSkipping: z.boolean().optional(),
|
|
103
|
+
validateResponses: z.boolean().optional(),
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export const QtiTimeLimitsSchema = strictObject({
|
|
107
|
+
minTime: z.number().nonnegative().optional(),
|
|
108
|
+
maxTime: z.number().nonnegative().optional(),
|
|
109
|
+
allowLateSubmission: z.boolean().optional(),
|
|
110
|
+
}).superRefine((value, context) => {
|
|
111
|
+
if (value.minTime !== undefined && value.maxTime !== undefined && value.minTime > value.maxTime) {
|
|
112
|
+
addIssue(context, ["maxTime"], "maxTime must be greater than or equal to minTime.");
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export const QtiVariableMappingSchema = strictObject({
|
|
117
|
+
sourceIdentifier: QtiIdentifierSchema,
|
|
118
|
+
targetIdentifier: QtiIdentifierSchema,
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
export const QtiWeightSchema = strictObject({
|
|
122
|
+
identifier: QtiIdentifierSchema,
|
|
123
|
+
value: z.number(),
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
function validateValuesForCardinality(
|
|
127
|
+
values: readonly z.infer<typeof QtiValueSchema>[] | undefined,
|
|
128
|
+
cardinality: z.infer<typeof QtiCardinalitySchema>,
|
|
129
|
+
context: z.RefinementCtx,
|
|
130
|
+
path: Array<string | number>,
|
|
131
|
+
) {
|
|
132
|
+
if (!values?.length) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (cardinality === "record") {
|
|
137
|
+
for (const [index, value] of values.entries()) {
|
|
138
|
+
if (!value.fieldIdentifier) {
|
|
139
|
+
addIssue(
|
|
140
|
+
context,
|
|
141
|
+
[...path, index, "fieldIdentifier"],
|
|
142
|
+
"Record cardinality values must define fieldIdentifier.",
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
for (const [index, value] of values.entries()) {
|
|
150
|
+
if (value.fieldIdentifier) {
|
|
151
|
+
addIssue(
|
|
152
|
+
context,
|
|
153
|
+
[...path, index, "fieldIdentifier"],
|
|
154
|
+
"fieldIdentifier is only valid for record cardinality values.",
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function validateDeclarationBaseType(
|
|
161
|
+
cardinality: z.infer<typeof QtiCardinalitySchema>,
|
|
162
|
+
baseType: z.infer<typeof QtiBaseTypeSchema> | undefined,
|
|
163
|
+
context: z.RefinementCtx,
|
|
164
|
+
) {
|
|
165
|
+
if (cardinality === "record" && baseType) {
|
|
166
|
+
addIssue(context, ["baseType"], "baseType must be omitted when cardinality is record.");
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const QtiVariableDeclarationBaseShape = {
|
|
171
|
+
identifier: QtiIdentifierSchema,
|
|
172
|
+
cardinality: QtiCardinalitySchema,
|
|
173
|
+
baseType: QtiBaseTypeSchema.optional(),
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const QtiContextDeclarationSchema = strictObject({
|
|
177
|
+
...QtiVariableDeclarationBaseShape,
|
|
178
|
+
defaultValue: QtiDefaultValueSchema.optional(),
|
|
179
|
+
}).superRefine((value, context) => {
|
|
180
|
+
validateDeclarationBaseType(value.cardinality, value.baseType, context);
|
|
181
|
+
validateValuesForCardinality(value.defaultValue?.values, value.cardinality, context, ["defaultValue", "values"]);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
export const QtiTemplateDeclarationSchema = strictObject({
|
|
185
|
+
...QtiVariableDeclarationBaseShape,
|
|
186
|
+
defaultValue: QtiDefaultValueSchema.optional(),
|
|
187
|
+
paramVariable: z.boolean().optional(),
|
|
188
|
+
mathVariable: z.boolean().optional(),
|
|
189
|
+
}).superRefine((value, context) => {
|
|
190
|
+
validateDeclarationBaseType(value.cardinality, value.baseType, context);
|
|
191
|
+
validateValuesForCardinality(value.defaultValue?.values, value.cardinality, context, ["defaultValue", "values"]);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
export const QtiResponseDeclarationRawSchema = strictObject({
|
|
195
|
+
...QtiVariableDeclarationBaseShape,
|
|
196
|
+
defaultValue: QtiDefaultValueSchema.optional(),
|
|
197
|
+
correctResponse: QtiCorrectResponseSchema.optional(),
|
|
198
|
+
mapping: QtiMappingSchema.optional(),
|
|
199
|
+
areaMapping: QtiAreaMappingSchema.optional(),
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
export const QtiResponseDeclarationSchema = QtiResponseDeclarationRawSchema.superRefine((value, context) => {
|
|
203
|
+
validateDeclarationBaseType(value.cardinality, value.baseType, context);
|
|
204
|
+
validateValuesForCardinality(value.defaultValue?.values, value.cardinality, context, ["defaultValue", "values"]);
|
|
205
|
+
validateValuesForCardinality(value.correctResponse?.values, value.cardinality, context, [
|
|
206
|
+
"correctResponse",
|
|
207
|
+
"values",
|
|
208
|
+
]);
|
|
209
|
+
|
|
210
|
+
if (value.areaMapping && value.baseType !== "point") {
|
|
211
|
+
addIssue(context, ["areaMapping"], "areaMapping is only valid for response declarations with baseType 'point'.");
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (value.mapping && (value.baseType === "file" || value.baseType === "duration" || value.cardinality === "record")) {
|
|
215
|
+
addIssue(context, ["mapping"], "mapping is not valid for file, duration, or record-valued response declarations.");
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
export const QtiOutcomeDeclarationRawSchema = strictObject({
|
|
220
|
+
...QtiVariableDeclarationBaseShape,
|
|
221
|
+
defaultValue: QtiDefaultValueSchema.optional(),
|
|
222
|
+
matchTable: QtiMatchTableSchema.optional(),
|
|
223
|
+
interpolationTable: QtiInterpolationTableSchema.optional(),
|
|
224
|
+
view: z.array(QtiViewSchema).optional(),
|
|
225
|
+
interpretation: z.string().optional(),
|
|
226
|
+
longInterpretation: z.string().optional(),
|
|
227
|
+
normalMaximum: z.number().optional(),
|
|
228
|
+
normalMinimum: z.number().optional(),
|
|
229
|
+
masteryValue: z.number().optional(),
|
|
230
|
+
externalScored: QtiExternalScoredSchema.optional(),
|
|
231
|
+
variableIdentifierRef: QtiIdentifierSchema.optional(),
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
export const QtiOutcomeDeclarationSchema = QtiOutcomeDeclarationRawSchema.superRefine((value, context) => {
|
|
235
|
+
validateDeclarationBaseType(value.cardinality, value.baseType, context);
|
|
236
|
+
validateValuesForCardinality(value.defaultValue?.values, value.cardinality, context, ["defaultValue", "values"]);
|
|
237
|
+
|
|
238
|
+
if (value.matchTable && value.interpolationTable) {
|
|
239
|
+
addIssue(context, ["matchTable"], "Only one of matchTable or interpolationTable may be supplied.");
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (
|
|
243
|
+
value.normalMinimum !== undefined &&
|
|
244
|
+
value.normalMaximum !== undefined &&
|
|
245
|
+
value.normalMinimum > value.normalMaximum
|
|
246
|
+
) {
|
|
247
|
+
addIssue(context, ["normalMaximum"], "normalMaximum must be greater than or equal to normalMinimum.");
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
// Inferred types from exported Zod validators.
|
|
251
|
+
export type QtiValue = z.infer<typeof QtiValueSchema>;
|
|
252
|
+
export type QtiDefaultValue = z.infer<typeof QtiDefaultValueSchema>;
|
|
253
|
+
export type QtiCorrectResponse = z.infer<typeof QtiCorrectResponseSchema>;
|
|
254
|
+
export type QtiAreaMapEntry = z.infer<typeof QtiAreaMapEntrySchema>;
|
|
255
|
+
export type QtiAreaMapping = z.infer<typeof QtiAreaMappingSchema>;
|
|
256
|
+
export type QtiMapEntry = z.infer<typeof QtiMapEntrySchema>;
|
|
257
|
+
export type QtiMapping = z.infer<typeof QtiMappingSchema>;
|
|
258
|
+
export type QtiInterpolationTableEntry = z.infer<typeof QtiInterpolationTableEntrySchema>;
|
|
259
|
+
export type QtiInterpolationTable = z.infer<typeof QtiInterpolationTableSchema>;
|
|
260
|
+
export type QtiMatchTableEntry = z.infer<typeof QtiMatchTableEntrySchema>;
|
|
261
|
+
export type QtiMatchTable = z.infer<typeof QtiMatchTableSchema>;
|
|
262
|
+
export type QtiStyleSheet = z.infer<typeof QtiStyleSheetSchema>;
|
|
263
|
+
export type QtiCatalog = z.infer<typeof QtiCatalogSchema>;
|
|
264
|
+
export type QtiCatalogInfo = z.infer<typeof QtiCatalogInfoSchema>;
|
|
265
|
+
export type QtiItemSessionControl = z.infer<typeof QtiItemSessionControlSchema>;
|
|
266
|
+
export type QtiTimeLimits = z.infer<typeof QtiTimeLimitsSchema>;
|
|
267
|
+
export type QtiVariableMapping = z.infer<typeof QtiVariableMappingSchema>;
|
|
268
|
+
export type QtiWeight = z.infer<typeof QtiWeightSchema>;
|
|
269
|
+
export type QtiContextDeclaration = z.infer<typeof QtiContextDeclarationSchema>;
|
|
270
|
+
export type QtiTemplateDeclaration = z.infer<typeof QtiTemplateDeclarationSchema>;
|
|
271
|
+
export type QtiResponseDeclarationRaw = z.infer<typeof QtiResponseDeclarationRawSchema>;
|
|
272
|
+
export type QtiResponseDeclaration = z.infer<typeof QtiResponseDeclarationSchema>;
|
|
273
|
+
export type QtiOutcomeDeclarationRaw = z.infer<typeof QtiOutcomeDeclarationRawSchema>;
|
|
274
|
+
export type QtiOutcomeDeclaration = z.infer<typeof QtiOutcomeDeclarationSchema>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
const LocaleTagSchema = z.string().regex(/^[a-z]{2}(-[A-Z]{2})?$/u);
|
|
4
|
+
const TextValueSchema = z.union([z.string(), z.record(LocaleTagSchema, z.string())]);
|
|
5
|
+
|
|
6
|
+
function strictObject<T extends z.ZodRawShape>(shape: T) {
|
|
7
|
+
return z.object(shape).strict();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const ImsxCodeMajorSchema = z.enum(["failure", "processing", "success", "unsupported"]);
|
|
11
|
+
export const ImsxSeveritySchema = z.enum(["error", "status", "warning"]);
|
|
12
|
+
export const ImsxCodeMinorFieldValueSchema = z.enum([
|
|
13
|
+
"forbidden",
|
|
14
|
+
"fullsuccess",
|
|
15
|
+
"internal_server_error",
|
|
16
|
+
"invalid_data",
|
|
17
|
+
"invalid_query_parameter",
|
|
18
|
+
"misdirected_request",
|
|
19
|
+
"not_acceptable",
|
|
20
|
+
"not_allowed",
|
|
21
|
+
"not_found",
|
|
22
|
+
"not_modified",
|
|
23
|
+
"server_busy",
|
|
24
|
+
"unauthorizedrequest",
|
|
25
|
+
"unknown",
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
export const ImsxCodeMinorFieldSchema = strictObject({
|
|
29
|
+
imsx_codeMinorFieldName: TextValueSchema,
|
|
30
|
+
imsx_codeMinorFieldValue: ImsxCodeMinorFieldValueSchema,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const ImsxCodeMinorSchema = strictObject({
|
|
34
|
+
imsx_codeMinorField: z.union([ImsxCodeMinorFieldSchema, z.array(ImsxCodeMinorFieldSchema).min(1)]),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const ImsxStatusInfoSchema = strictObject({
|
|
38
|
+
imsx_codeMajor: ImsxCodeMajorSchema,
|
|
39
|
+
imsx_severity: ImsxSeveritySchema,
|
|
40
|
+
imsx_description: TextValueSchema.optional(),
|
|
41
|
+
imsx_codeMinor: ImsxCodeMinorSchema.optional(),
|
|
42
|
+
});
|
|
43
|
+
// Inferred types from exported Zod validators.
|
|
44
|
+
export type ImsxCodeMajor = z.infer<typeof ImsxCodeMajorSchema>;
|
|
45
|
+
export type ImsxSeverity = z.infer<typeof ImsxSeveritySchema>;
|
|
46
|
+
export type ImsxCodeMinorFieldValue = z.infer<typeof ImsxCodeMinorFieldValueSchema>;
|
|
47
|
+
export type ImsxCodeMinorField = z.infer<typeof ImsxCodeMinorFieldSchema>;
|
|
48
|
+
export type ImsxCodeMinor = z.infer<typeof ImsxCodeMinorSchema>;
|
|
49
|
+
export type ImsxStatusInfo = z.infer<typeof ImsxStatusInfoSchema>;
|
package/src/summary.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const RunnerSummarySchema = z.object({
|
|
4
|
+
contractVersion: z.string().regex(/^\d+\.\d+\.\d+$/u),
|
|
5
|
+
runner: z.object({
|
|
6
|
+
suite: z.string().min(1),
|
|
7
|
+
version: z.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/u),
|
|
8
|
+
profileVersion: z.string().regex(/^\d+\.\d+\.\d+$/u),
|
|
9
|
+
target: z.string().min(1),
|
|
10
|
+
}),
|
|
11
|
+
startedAt: z.iso.datetime(),
|
|
12
|
+
finishedAt: z.iso.datetime(),
|
|
13
|
+
durationMs: z.number().int().nonnegative(),
|
|
14
|
+
result: z.object({
|
|
15
|
+
status: z.enum(["passed", "failed", "error"]),
|
|
16
|
+
passed: z.number().int().nonnegative(),
|
|
17
|
+
failed: z.number().int().nonnegative(),
|
|
18
|
+
skipped: z.number().int().nonnegative(),
|
|
19
|
+
}),
|
|
20
|
+
adapter: z
|
|
21
|
+
.object({
|
|
22
|
+
name: z.string().min(1),
|
|
23
|
+
version: z.string().min(1),
|
|
24
|
+
profileVersion: z.string().regex(/^\d+\.\d+\.\d+$/u),
|
|
25
|
+
})
|
|
26
|
+
.optional(),
|
|
27
|
+
artifacts: z.object({
|
|
28
|
+
summaryFile: z.string().min(1),
|
|
29
|
+
junitFile: z.string().min(1),
|
|
30
|
+
requirementTraceFile: z.string().min(1),
|
|
31
|
+
runMetadataFile: z.string().min(1),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const RequirementTraceSchema = z.object({
|
|
36
|
+
contractVersion: z.string().regex(/^\d+\.\d+\.\d+$/u),
|
|
37
|
+
runId: z.string().min(1),
|
|
38
|
+
requirements: z.record(
|
|
39
|
+
z.string().min(1),
|
|
40
|
+
z.object({
|
|
41
|
+
status: z.enum(["passed", "failed", "skipped", "error"]),
|
|
42
|
+
evidence: z.array(z.string().min(1)).default([]),
|
|
43
|
+
message: z.string().optional(),
|
|
44
|
+
}),
|
|
45
|
+
),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const RunMetadataSchema = z.object({
|
|
49
|
+
runId: z.string().min(1),
|
|
50
|
+
startedAt: z.iso.datetime(),
|
|
51
|
+
finishedAt: z.iso.datetime(),
|
|
52
|
+
image: z.object({
|
|
53
|
+
reference: z.string().min(1),
|
|
54
|
+
digest: z.string().min(1),
|
|
55
|
+
source: z.string().min(1),
|
|
56
|
+
}),
|
|
57
|
+
standards: z.object({
|
|
58
|
+
suiteSourceRevision: z.string().min(1),
|
|
59
|
+
requirementsRevision: z.string().min(1),
|
|
60
|
+
profileVersion: z.string().regex(/^\d+\.\d+\.\d+$/u),
|
|
61
|
+
}),
|
|
62
|
+
runner: z.object({
|
|
63
|
+
version: z.string().min(1),
|
|
64
|
+
revision: z.string().min(1),
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export type RunnerSummary = z.infer<typeof RunnerSummarySchema>;
|
|
69
|
+
export type RequirementTrace = z.infer<typeof RequirementTraceSchema>;
|
|
70
|
+
export type RunMetadata = z.infer<typeof RunMetadataSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from "./shared";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CredentialSchemaSchema,
|
|
5
|
+
CredentialStatusSchema,
|
|
6
|
+
CredentialSubjectSchema,
|
|
7
|
+
EvidenceSchema,
|
|
8
|
+
HolderSchema,
|
|
9
|
+
ProofSchema,
|
|
10
|
+
RefreshServiceSchema,
|
|
11
|
+
TermsOfUseSchema,
|
|
12
|
+
VerifiableCredentialSchema,
|
|
13
|
+
VerifiablePresentationSchema,
|
|
14
|
+
} from "./shared";
|
|
15
|
+
|
|
16
|
+
export const VcDataModel20DerivedZodTemplates = {
|
|
17
|
+
verifiableCredential: VerifiableCredentialSchema,
|
|
18
|
+
verifiablePresentation: VerifiablePresentationSchema,
|
|
19
|
+
credentialSubject: CredentialSubjectSchema,
|
|
20
|
+
credentialSchema: CredentialSchemaSchema,
|
|
21
|
+
credentialStatus: CredentialStatusSchema,
|
|
22
|
+
refreshService: RefreshServiceSchema,
|
|
23
|
+
termsOfUse: TermsOfUseSchema,
|
|
24
|
+
proof: ProofSchema,
|
|
25
|
+
evidence: EvidenceSchema,
|
|
26
|
+
holder: HolderSchema,
|
|
27
|
+
} as const;
|