@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,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
function strictObject<T extends z.ZodRawShape>(shape: T) {
|
|
4
|
+
return z.object(shape).strict();
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function extensibleEnum<Values extends readonly [string, ...string[]]>(values: Values) {
|
|
8
|
+
return z.union([z.enum(values), ExtensibleVocabularyValueSchema]);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function guidReferenceSchema<const EntityType extends string>(entityType: EntityType) {
|
|
12
|
+
return strictObject({
|
|
13
|
+
href: UrlSchema,
|
|
14
|
+
sourcedId: SourcedIdSchema,
|
|
15
|
+
type: z.literal(entityType),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const UrlSchema = z.url();
|
|
20
|
+
export const DateSchema = z.iso.date();
|
|
21
|
+
export const DateTimeSchema = z.iso.datetime();
|
|
22
|
+
export const SourcedIdSchema = z.string();
|
|
23
|
+
export const EntityStatusSchema = z.enum(["active", "tobedeleted"]);
|
|
24
|
+
export const TrueFalseStringSchema = z.enum(["true", "false"]);
|
|
25
|
+
export const ExtensibleVocabularyValueSchema = z.string().regex(/^(ext:)[a-zA-Z0-9.\-_]+$/u);
|
|
26
|
+
|
|
27
|
+
export const MetadataSchema = z.record(z.string(), z.unknown());
|
|
28
|
+
|
|
29
|
+
export const AcadSessionGuidRefSchema = guidReferenceSchema("academicSession");
|
|
30
|
+
export const ClassGuidRefSchema = guidReferenceSchema("class");
|
|
31
|
+
export const CourseGuidRefSchema = guidReferenceSchema("course");
|
|
32
|
+
export const OrgGuidRefSchema = guidReferenceSchema("org");
|
|
33
|
+
export const ResourceGuidRefSchema = guidReferenceSchema("resource");
|
|
34
|
+
export const UserGuidRefSchema = guidReferenceSchema("user");
|
|
35
|
+
|
|
36
|
+
export const ImsxCodeMajorSchema = z.enum(["success", "processing", "failure", "unsupported"]);
|
|
37
|
+
export const ImsxSeveritySchema = z.enum(["status", "warning", "error"]);
|
|
38
|
+
export const ImsxCodeMinorFieldValueSchema = z.enum([
|
|
39
|
+
"deletefailure",
|
|
40
|
+
"forbidden",
|
|
41
|
+
"fullsuccess",
|
|
42
|
+
"internal_server_error",
|
|
43
|
+
"invalid_filter_field",
|
|
44
|
+
"invalid_selection_field",
|
|
45
|
+
"invalid_sort_field",
|
|
46
|
+
"invaliddata",
|
|
47
|
+
"server_busy",
|
|
48
|
+
"unauthorisedrequest",
|
|
49
|
+
"unknownobject",
|
|
50
|
+
"unsupported",
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
export const ImsxCodeMinorFieldSchema = strictObject({
|
|
54
|
+
imsx_codeMinorFieldName: z.string(),
|
|
55
|
+
imsx_codeMinorFieldValue: ImsxCodeMinorFieldValueSchema,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const ImsxCodeMinorSchema = strictObject({
|
|
59
|
+
imsx_codeMinorField: z.array(ImsxCodeMinorFieldSchema).min(1),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const ImsxStatusInfoSchema = strictObject({
|
|
63
|
+
imsx_codeMajor: ImsxCodeMajorSchema,
|
|
64
|
+
imsx_severity: ImsxSeveritySchema,
|
|
65
|
+
imsx_description: z.string().optional(),
|
|
66
|
+
imsx_CodeMinor: ImsxCodeMinorSchema.optional(),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export { strictObject };
|
|
70
|
+
// Inferred types from exported Zod validators.
|
|
71
|
+
export type Url = z.infer<typeof UrlSchema>;
|
|
72
|
+
export type Date = z.infer<typeof DateSchema>;
|
|
73
|
+
export type DateTime = z.infer<typeof DateTimeSchema>;
|
|
74
|
+
export type SourcedId = z.infer<typeof SourcedIdSchema>;
|
|
75
|
+
export type EntityStatus = z.infer<typeof EntityStatusSchema>;
|
|
76
|
+
export type TrueFalseString = z.infer<typeof TrueFalseStringSchema>;
|
|
77
|
+
export type ExtensibleVocabularyValue = z.infer<typeof ExtensibleVocabularyValueSchema>;
|
|
78
|
+
export type Metadata = z.infer<typeof MetadataSchema>;
|
|
79
|
+
export type AcadSessionGuidRef = z.infer<typeof AcadSessionGuidRefSchema>;
|
|
80
|
+
export type ClassGuidRef = z.infer<typeof ClassGuidRefSchema>;
|
|
81
|
+
export type CourseGuidRef = z.infer<typeof CourseGuidRefSchema>;
|
|
82
|
+
export type OrgGuidRef = z.infer<typeof OrgGuidRefSchema>;
|
|
83
|
+
export type ResourceGuidRef = z.infer<typeof ResourceGuidRefSchema>;
|
|
84
|
+
export type UserGuidRef = z.infer<typeof UserGuidRefSchema>;
|
|
85
|
+
export type ImsxCodeMajor = z.infer<typeof ImsxCodeMajorSchema>;
|
|
86
|
+
export type ImsxSeverity = z.infer<typeof ImsxSeveritySchema>;
|
|
87
|
+
export type ImsxCodeMinorFieldValue = z.infer<typeof ImsxCodeMinorFieldValueSchema>;
|
|
88
|
+
export type ImsxCodeMinorField = z.infer<typeof ImsxCodeMinorFieldSchema>;
|
|
89
|
+
export type ImsxCodeMinor = z.infer<typeof ImsxCodeMinorSchema>;
|
|
90
|
+
export type ImsxStatusInfo = z.infer<typeof ImsxStatusInfoSchema>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./ob_v3p0_achievementcredential_schema";
|
|
2
|
+
export * from "./ob_v3p0_endorsementcredential_schema";
|
|
3
|
+
export * from "./ob_v3p0_profile_schema";
|
|
4
|
+
export * from "./ob_v3p0_getopenbadgecredentialsresponse_schema";
|
|
5
|
+
export * from "./ob_v3p0_imsx_statusinfo_schema";
|
|
6
|
+
|
|
7
|
+
import { AchievementCredentialSchema, OpenBadgeCredentialSchema } from "./ob_v3p0_achievementcredential_schema";
|
|
8
|
+
import { EndorsementCredentialSchema } from "./ob_v3p0_endorsementcredential_schema";
|
|
9
|
+
import { GetOpenBadgeCredentialsResponseSchema } from "./ob_v3p0_getopenbadgecredentialsresponse_schema";
|
|
10
|
+
import { ImsxStatusInfoSchema } from "./ob_v3p0_imsx_statusinfo_schema";
|
|
11
|
+
import { ProfileSchema } from "./ob_v3p0_profile_schema";
|
|
12
|
+
|
|
13
|
+
export const OpenBadges30DerivedZodTemplates = {
|
|
14
|
+
achievementCredential: AchievementCredentialSchema,
|
|
15
|
+
openBadgeCredential: OpenBadgeCredentialSchema,
|
|
16
|
+
endorsementCredential: EndorsementCredentialSchema,
|
|
17
|
+
getOpenBadgeCredentialsResponse: GetOpenBadgeCredentialsResponseSchema,
|
|
18
|
+
profile: ProfileSchema,
|
|
19
|
+
imsxStatusInfo: ImsxStatusInfoSchema,
|
|
20
|
+
} as const;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export {
|
|
2
|
+
AchievementCredentialSchema,
|
|
3
|
+
AchievementSchema,
|
|
4
|
+
AchievementSubjectSchema,
|
|
5
|
+
AchievementTypeSchema,
|
|
6
|
+
AlignmentSchema,
|
|
7
|
+
AlignmentTargetTypeSchema,
|
|
8
|
+
CriteriaSchema,
|
|
9
|
+
IdentityObjectSchema,
|
|
10
|
+
OpenBadgeCredentialSchema,
|
|
11
|
+
RelatedSchema,
|
|
12
|
+
ResultDescriptionSchema,
|
|
13
|
+
ResultSchema,
|
|
14
|
+
ResultStatusTypeSchema,
|
|
15
|
+
ResultTypeSchema,
|
|
16
|
+
RubricCriterionLevelSchema,
|
|
17
|
+
} from "./shared";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetOpenBadgeCredentialsResponseSchema } from "./shared";
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CompactJwsValueSchema,
|
|
5
|
+
type CompactJwsValue,
|
|
6
|
+
contextArraySchema,
|
|
7
|
+
CredentialSchemaSchema,
|
|
8
|
+
CredentialStatusSchema,
|
|
9
|
+
credentialTypeSchema,
|
|
10
|
+
type JsonLdContextEntry,
|
|
11
|
+
localizedEnumValueSchema,
|
|
12
|
+
oneOrMany,
|
|
13
|
+
type OneOrManyValue,
|
|
14
|
+
passthroughObject,
|
|
15
|
+
ProofSchema,
|
|
16
|
+
RefreshServiceSchema,
|
|
17
|
+
singleTypeSchema,
|
|
18
|
+
TermsOfUseSchema,
|
|
19
|
+
TextValueSchema,
|
|
20
|
+
type TextValue,
|
|
21
|
+
UriValueSchema,
|
|
22
|
+
type UriValue,
|
|
23
|
+
W3cCredentialsV2ContextSchema,
|
|
24
|
+
} from "../../vc-data-model/v2_0/shared";
|
|
25
|
+
|
|
26
|
+
const OpenBadgesV30ContextUrlSchema = z
|
|
27
|
+
.string()
|
|
28
|
+
.regex(/^https:\/\/purl\.imsglobal\.org\/spec\/ob\/v3p0\/context(-3\.\d\.\d)*\.json$/u);
|
|
29
|
+
|
|
30
|
+
type Profile = {
|
|
31
|
+
id: UriValue;
|
|
32
|
+
type: unknown;
|
|
33
|
+
name?: TextValue;
|
|
34
|
+
url?: UriValue;
|
|
35
|
+
phone?: TextValue;
|
|
36
|
+
description?: TextValue;
|
|
37
|
+
endorsement?: OneOrManyValue<EndorsementCredential>;
|
|
38
|
+
endorsementJwt?: OneOrManyValue<CompactJwsValue>;
|
|
39
|
+
image?: Record<string, unknown>;
|
|
40
|
+
email?: TextValue;
|
|
41
|
+
address?: Record<string, unknown>;
|
|
42
|
+
otherIdentifier?: OneOrManyValue<Record<string, unknown>>;
|
|
43
|
+
official?: TextValue;
|
|
44
|
+
parentOrg?: Profile;
|
|
45
|
+
familyName?: TextValue;
|
|
46
|
+
givenName?: TextValue;
|
|
47
|
+
additionalName?: TextValue;
|
|
48
|
+
patronymicName?: TextValue;
|
|
49
|
+
honorificPrefix?: TextValue;
|
|
50
|
+
honorificSuffix?: TextValue;
|
|
51
|
+
familyNamePrefix?: TextValue;
|
|
52
|
+
dateOfBirth?: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type ProfileRef = Profile | UriValue;
|
|
57
|
+
|
|
58
|
+
type EndorsementCredential = {
|
|
59
|
+
"@context": JsonLdContextEntry[];
|
|
60
|
+
type: unknown;
|
|
61
|
+
id: UriValue;
|
|
62
|
+
name: TextValue;
|
|
63
|
+
description?: TextValue;
|
|
64
|
+
credentialSubject: Record<string, unknown>;
|
|
65
|
+
awardedDate?: string;
|
|
66
|
+
issuer: ProfileRef;
|
|
67
|
+
validFrom: string;
|
|
68
|
+
validUntil?: string;
|
|
69
|
+
proof?: OneOrManyValue<Record<string, unknown>>;
|
|
70
|
+
credentialSchema?: OneOrManyValue<Record<string, unknown>>;
|
|
71
|
+
credentialStatus?: Record<string, unknown>;
|
|
72
|
+
refreshService?: Record<string, unknown>;
|
|
73
|
+
termsOfUse?: OneOrManyValue<Record<string, unknown>>;
|
|
74
|
+
evidence?: OneOrManyValue<Record<string, unknown>>;
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const IDENTIFIER_TYPES = [
|
|
79
|
+
"name",
|
|
80
|
+
"sourcedId",
|
|
81
|
+
"systemId",
|
|
82
|
+
"productId",
|
|
83
|
+
"userName",
|
|
84
|
+
"accountId",
|
|
85
|
+
"emailAddress",
|
|
86
|
+
"nationalIdentityNumber",
|
|
87
|
+
"isbn",
|
|
88
|
+
"issn",
|
|
89
|
+
"lisSourcedId",
|
|
90
|
+
"oneRosterSourcedId",
|
|
91
|
+
"sisSourcedId",
|
|
92
|
+
"ltiContextId",
|
|
93
|
+
"ltiDeploymentId",
|
|
94
|
+
"ltiToolId",
|
|
95
|
+
"ltiPlatformId",
|
|
96
|
+
"ltiUserId",
|
|
97
|
+
"identifier",
|
|
98
|
+
] as const;
|
|
99
|
+
|
|
100
|
+
const ACHIEVEMENT_TYPES = [
|
|
101
|
+
"Achievement",
|
|
102
|
+
"ApprenticeshipCertificate",
|
|
103
|
+
"Assessment",
|
|
104
|
+
"Assignment",
|
|
105
|
+
"AssociateDegree",
|
|
106
|
+
"Award",
|
|
107
|
+
"Badge",
|
|
108
|
+
"BachelorDegree",
|
|
109
|
+
"Certificate",
|
|
110
|
+
"CertificateOfCompletion",
|
|
111
|
+
"Certification",
|
|
112
|
+
"CommunityService",
|
|
113
|
+
"Competency",
|
|
114
|
+
"Course",
|
|
115
|
+
"CoCurricular",
|
|
116
|
+
"Degree",
|
|
117
|
+
"Diploma",
|
|
118
|
+
"DoctoralDegree",
|
|
119
|
+
"Fieldwork",
|
|
120
|
+
"GeneralEducationDevelopment",
|
|
121
|
+
"JourneymanCertificate",
|
|
122
|
+
"LearningProgram",
|
|
123
|
+
"License",
|
|
124
|
+
"Membership",
|
|
125
|
+
"ProfessionalDoctorate",
|
|
126
|
+
"QualityAssuranceCredential",
|
|
127
|
+
"MasterCertificate",
|
|
128
|
+
"MasterDegree",
|
|
129
|
+
"MicroCredential",
|
|
130
|
+
"ResearchDoctorate",
|
|
131
|
+
"SecondarySchoolDiploma",
|
|
132
|
+
] as const;
|
|
133
|
+
|
|
134
|
+
const ALIGNMENT_TARGET_TYPES = [
|
|
135
|
+
"ceasn:Competency",
|
|
136
|
+
"ceterms:Credential",
|
|
137
|
+
"CFItem",
|
|
138
|
+
"CFRubric",
|
|
139
|
+
"CFRubricCriterion",
|
|
140
|
+
"CFRubricCriterionLevel",
|
|
141
|
+
"CTDL",
|
|
142
|
+
] as const;
|
|
143
|
+
|
|
144
|
+
const RESULT_TYPES = [
|
|
145
|
+
"GradePointAverage",
|
|
146
|
+
"LetterGrade",
|
|
147
|
+
"Percent",
|
|
148
|
+
"PerformanceLevel",
|
|
149
|
+
"PredictedScore",
|
|
150
|
+
"RawScore",
|
|
151
|
+
"Result",
|
|
152
|
+
"RubricCriterion",
|
|
153
|
+
"RubricCriterionLevel",
|
|
154
|
+
"RubricScore",
|
|
155
|
+
"ScaledScore",
|
|
156
|
+
"Status",
|
|
157
|
+
] as const;
|
|
158
|
+
|
|
159
|
+
const RESULT_STATUSES = ["Completed", "Enrolled", "Failed", "InProgress", "OnHold", "Provisional", "Withdrew"] as const;
|
|
160
|
+
|
|
161
|
+
export const IdentifierTypeEnumSchema = z.enum(IDENTIFIER_TYPES);
|
|
162
|
+
export const AchievementTypeSchema = z.enum(ACHIEVEMENT_TYPES);
|
|
163
|
+
export const AlignmentTargetTypeSchema = z.enum(ALIGNMENT_TARGET_TYPES);
|
|
164
|
+
export const ResultTypeSchema = z.enum(RESULT_TYPES);
|
|
165
|
+
export const ResultStatusTypeSchema = z.enum(RESULT_STATUSES);
|
|
166
|
+
|
|
167
|
+
export const OpenBadgesAchievementCredentialContextSchema = contextArraySchema("Open Badges 3.0", [
|
|
168
|
+
W3cCredentialsV2ContextSchema,
|
|
169
|
+
OpenBadgesV30ContextUrlSchema,
|
|
170
|
+
]);
|
|
171
|
+
|
|
172
|
+
export const OpenBadgesEndorsementCredentialContextSchema = contextArraySchema("Open Badges 3.0", [
|
|
173
|
+
W3cCredentialsV2ContextSchema,
|
|
174
|
+
OpenBadgesV30ContextUrlSchema,
|
|
175
|
+
]);
|
|
176
|
+
|
|
177
|
+
export const OpenBadgesVerifiableCredentialContextSchema = contextArraySchema("Open Badges 3.0", [
|
|
178
|
+
W3cCredentialsV2ContextSchema,
|
|
179
|
+
]);
|
|
180
|
+
|
|
181
|
+
export const ImageSchema = passthroughObject({
|
|
182
|
+
id: UriValueSchema,
|
|
183
|
+
type: singleTypeSchema("Image"),
|
|
184
|
+
caption: TextValueSchema.optional(),
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
export const GeoCoordinatesSchema = passthroughObject({
|
|
188
|
+
type: singleTypeSchema("GeoCoordinates"),
|
|
189
|
+
latitude: z.number(),
|
|
190
|
+
longitude: z.number(),
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
export const AddressSchema = passthroughObject({
|
|
194
|
+
type: singleTypeSchema("Address"),
|
|
195
|
+
addressCountry: TextValueSchema.optional(),
|
|
196
|
+
addressCountryCode: TextValueSchema.optional(),
|
|
197
|
+
addressRegion: TextValueSchema.optional(),
|
|
198
|
+
addressLocality: TextValueSchema.optional(),
|
|
199
|
+
streetAddress: TextValueSchema.optional(),
|
|
200
|
+
postOfficeBoxNumber: TextValueSchema.optional(),
|
|
201
|
+
postalCode: TextValueSchema.optional(),
|
|
202
|
+
geo: GeoCoordinatesSchema.optional(),
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
export const IdentifierEntrySchema = passthroughObject({
|
|
206
|
+
type: singleTypeSchema("IdentifierEntry"),
|
|
207
|
+
identifier: TextValueSchema,
|
|
208
|
+
identifierType: localizedEnumValueSchema(IDENTIFIER_TYPES),
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
export const CriteriaSchema = passthroughObject({
|
|
212
|
+
id: UriValueSchema.optional(),
|
|
213
|
+
narrative: TextValueSchema.optional(),
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
export const AlignmentSchema = passthroughObject({
|
|
217
|
+
type: singleTypeSchema("Alignment"),
|
|
218
|
+
targetCode: TextValueSchema.optional(),
|
|
219
|
+
targetDescription: TextValueSchema.optional(),
|
|
220
|
+
targetName: TextValueSchema,
|
|
221
|
+
targetFramework: TextValueSchema.optional(),
|
|
222
|
+
targetType: localizedEnumValueSchema(ALIGNMENT_TARGET_TYPES).optional(),
|
|
223
|
+
targetUrl: UriValueSchema,
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
export const RelatedSchema = passthroughObject({
|
|
227
|
+
id: UriValueSchema,
|
|
228
|
+
type: singleTypeSchema("Related"),
|
|
229
|
+
inLanguage: TextValueSchema.optional(),
|
|
230
|
+
version: TextValueSchema.optional(),
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
export const RubricCriterionLevelSchema = passthroughObject({
|
|
234
|
+
id: UriValueSchema,
|
|
235
|
+
type: singleTypeSchema("RubricCriterionLevel"),
|
|
236
|
+
alignment: oneOrMany(AlignmentSchema).optional(),
|
|
237
|
+
description: TextValueSchema.optional(),
|
|
238
|
+
level: TextValueSchema.optional(),
|
|
239
|
+
name: TextValueSchema.optional(),
|
|
240
|
+
points: TextValueSchema.optional(),
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
export const ResultDescriptionSchema = passthroughObject({
|
|
244
|
+
id: UriValueSchema,
|
|
245
|
+
type: singleTypeSchema("ResultDescription"),
|
|
246
|
+
alignment: oneOrMany(AlignmentSchema).optional(),
|
|
247
|
+
allowedValue: oneOrMany(TextValueSchema).optional(),
|
|
248
|
+
name: TextValueSchema,
|
|
249
|
+
requiredLevel: TextValueSchema.optional(),
|
|
250
|
+
requiredValue: TextValueSchema.optional(),
|
|
251
|
+
resultType: localizedEnumValueSchema(RESULT_TYPES),
|
|
252
|
+
rubricCriterionLevel: oneOrMany(RubricCriterionLevelSchema).optional(),
|
|
253
|
+
valueMax: TextValueSchema.optional(),
|
|
254
|
+
valueMin: TextValueSchema.optional(),
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
export const EvidenceSchema = passthroughObject({
|
|
258
|
+
id: UriValueSchema.optional(),
|
|
259
|
+
type: singleTypeSchema("Evidence"),
|
|
260
|
+
narrative: TextValueSchema.optional(),
|
|
261
|
+
name: TextValueSchema.optional(),
|
|
262
|
+
description: TextValueSchema.optional(),
|
|
263
|
+
genre: TextValueSchema.optional(),
|
|
264
|
+
audience: TextValueSchema.optional(),
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
export const EndorsementSubjectSchema = passthroughObject({
|
|
268
|
+
id: UriValueSchema.optional(),
|
|
269
|
+
type: singleTypeSchema("EndorsementSubject"),
|
|
270
|
+
endorsementComment: TextValueSchema.optional(),
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
export const CredentialSubjectSchema = passthroughObject({
|
|
274
|
+
id: UriValueSchema.optional(),
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
export const ProfileSchema: z.ZodType<Profile> = passthroughObject({
|
|
278
|
+
id: UriValueSchema,
|
|
279
|
+
type: singleTypeSchema("Profile"),
|
|
280
|
+
name: TextValueSchema.optional(),
|
|
281
|
+
url: UriValueSchema.optional(),
|
|
282
|
+
phone: TextValueSchema.optional(),
|
|
283
|
+
description: TextValueSchema.optional(),
|
|
284
|
+
endorsement: z.lazy(() => oneOrMany(EndorsementCredentialSchema)).optional(),
|
|
285
|
+
endorsementJwt: oneOrMany(CompactJwsValueSchema).optional(),
|
|
286
|
+
image: ImageSchema.optional(),
|
|
287
|
+
email: TextValueSchema.optional(),
|
|
288
|
+
address: AddressSchema.optional(),
|
|
289
|
+
otherIdentifier: oneOrMany(IdentifierEntrySchema).optional(),
|
|
290
|
+
official: TextValueSchema.optional(),
|
|
291
|
+
parentOrg: z.lazy(() => ProfileSchema).optional(),
|
|
292
|
+
familyName: TextValueSchema.optional(),
|
|
293
|
+
givenName: TextValueSchema.optional(),
|
|
294
|
+
additionalName: TextValueSchema.optional(),
|
|
295
|
+
patronymicName: TextValueSchema.optional(),
|
|
296
|
+
honorificPrefix: TextValueSchema.optional(),
|
|
297
|
+
honorificSuffix: TextValueSchema.optional(),
|
|
298
|
+
familyNamePrefix: TextValueSchema.optional(),
|
|
299
|
+
dateOfBirth: z.iso.date().optional(),
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
export const ProfileRefSchema: z.ZodType<ProfileRef> = z.lazy(() => z.union([ProfileSchema, UriValueSchema]));
|
|
303
|
+
|
|
304
|
+
export const EndorsementCredentialSchema: z.ZodType<EndorsementCredential> = passthroughObject({
|
|
305
|
+
"@context": OpenBadgesEndorsementCredentialContextSchema,
|
|
306
|
+
type: credentialTypeSchema(["EndorsementCredential"]),
|
|
307
|
+
id: UriValueSchema,
|
|
308
|
+
name: TextValueSchema,
|
|
309
|
+
description: TextValueSchema.optional(),
|
|
310
|
+
credentialSubject: EndorsementSubjectSchema,
|
|
311
|
+
awardedDate: z.iso.datetime().optional(),
|
|
312
|
+
issuer: ProfileRefSchema,
|
|
313
|
+
validFrom: z.iso.datetime(),
|
|
314
|
+
validUntil: z.iso.datetime().optional(),
|
|
315
|
+
proof: oneOrMany(ProofSchema).optional(),
|
|
316
|
+
credentialSchema: oneOrMany(CredentialSchemaSchema).optional(),
|
|
317
|
+
credentialStatus: CredentialStatusSchema.optional(),
|
|
318
|
+
refreshService: RefreshServiceSchema.optional(),
|
|
319
|
+
termsOfUse: oneOrMany(TermsOfUseSchema).optional(),
|
|
320
|
+
evidence: oneOrMany(EvidenceSchema).optional(),
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
export const AchievementSchema = passthroughObject({
|
|
324
|
+
id: UriValueSchema,
|
|
325
|
+
type: singleTypeSchema("Achievement"),
|
|
326
|
+
alignment: oneOrMany(AlignmentSchema).optional(),
|
|
327
|
+
achievementType: localizedEnumValueSchema(ACHIEVEMENT_TYPES).optional(),
|
|
328
|
+
creator: ProfileSchema.optional(),
|
|
329
|
+
creditsAvailable: z.number().optional(),
|
|
330
|
+
criteria: CriteriaSchema,
|
|
331
|
+
description: TextValueSchema,
|
|
332
|
+
endorsement: oneOrMany(EndorsementCredentialSchema).optional(),
|
|
333
|
+
endorsementJwt: oneOrMany(CompactJwsValueSchema).optional(),
|
|
334
|
+
fieldOfStudy: TextValueSchema.optional(),
|
|
335
|
+
humanCode: TextValueSchema.optional(),
|
|
336
|
+
image: ImageSchema.optional(),
|
|
337
|
+
inLanguage: TextValueSchema.optional(),
|
|
338
|
+
name: TextValueSchema,
|
|
339
|
+
otherIdentifier: oneOrMany(IdentifierEntrySchema).optional(),
|
|
340
|
+
related: oneOrMany(RelatedSchema).optional(),
|
|
341
|
+
resultDescription: oneOrMany(ResultDescriptionSchema).optional(),
|
|
342
|
+
specialization: TextValueSchema.optional(),
|
|
343
|
+
tag: oneOrMany(TextValueSchema).optional(),
|
|
344
|
+
version: TextValueSchema.optional(),
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
export const IdentityObjectSchema = passthroughObject({
|
|
348
|
+
type: singleTypeSchema("IdentityObject"),
|
|
349
|
+
hashed: z.boolean().optional(),
|
|
350
|
+
identityHash: TextValueSchema.optional(),
|
|
351
|
+
identityType: localizedEnumValueSchema(IDENTIFIER_TYPES).optional(),
|
|
352
|
+
salt: TextValueSchema.optional(),
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
export const ResultSchema = passthroughObject({
|
|
356
|
+
type: singleTypeSchema("Result"),
|
|
357
|
+
achievedLevel: TextValueSchema.optional(),
|
|
358
|
+
alignment: oneOrMany(AlignmentSchema).optional(),
|
|
359
|
+
resultDescription: TextValueSchema.optional(),
|
|
360
|
+
status: ResultStatusTypeSchema.optional(),
|
|
361
|
+
value: TextValueSchema.optional(),
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
export const AchievementSubjectSchema = passthroughObject({
|
|
365
|
+
id: UriValueSchema.optional(),
|
|
366
|
+
type: singleTypeSchema("AchievementSubject"),
|
|
367
|
+
activityEndDate: z.iso.date().optional(),
|
|
368
|
+
activityStartDate: z.iso.date().optional(),
|
|
369
|
+
creditsEarned: z.number().optional(),
|
|
370
|
+
achievement: AchievementSchema,
|
|
371
|
+
identifier: oneOrMany(IdentityObjectSchema).optional(),
|
|
372
|
+
image: ImageSchema.optional(),
|
|
373
|
+
licenseNumber: TextValueSchema.optional(),
|
|
374
|
+
narrative: TextValueSchema.optional(),
|
|
375
|
+
result: oneOrMany(ResultSchema).optional(),
|
|
376
|
+
role: TextValueSchema.optional(),
|
|
377
|
+
source: ProfileSchema.optional(),
|
|
378
|
+
term: TextValueSchema.optional(),
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
export const AchievementCredentialSchema = passthroughObject({
|
|
382
|
+
"@context": OpenBadgesAchievementCredentialContextSchema,
|
|
383
|
+
id: UriValueSchema,
|
|
384
|
+
type: credentialTypeSchema(["AchievementCredential", "OpenBadgeCredential"]),
|
|
385
|
+
name: TextValueSchema.optional(),
|
|
386
|
+
description: TextValueSchema.optional(),
|
|
387
|
+
image: ImageSchema.optional(),
|
|
388
|
+
awardedDate: z.iso.datetime().optional(),
|
|
389
|
+
credentialSubject: AchievementSubjectSchema,
|
|
390
|
+
endorsement: oneOrMany(EndorsementCredentialSchema).optional(),
|
|
391
|
+
endorsementJwt: oneOrMany(CompactJwsValueSchema).optional(),
|
|
392
|
+
issuer: ProfileRefSchema,
|
|
393
|
+
validFrom: z.iso.datetime(),
|
|
394
|
+
validUntil: z.iso.datetime().optional(),
|
|
395
|
+
proof: oneOrMany(ProofSchema).optional(),
|
|
396
|
+
credentialSchema: oneOrMany(CredentialSchemaSchema).optional(),
|
|
397
|
+
credentialStatus: CredentialStatusSchema.optional(),
|
|
398
|
+
refreshService: RefreshServiceSchema.optional(),
|
|
399
|
+
termsOfUse: oneOrMany(TermsOfUseSchema).optional(),
|
|
400
|
+
evidence: oneOrMany(EvidenceSchema).optional(),
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
export const OpenBadgeCredentialSchema = AchievementCredentialSchema;
|
|
404
|
+
|
|
405
|
+
export const VerifiableCredentialSchema = passthroughObject({
|
|
406
|
+
"@context": OpenBadgesVerifiableCredentialContextSchema,
|
|
407
|
+
id: UriValueSchema.optional(),
|
|
408
|
+
type: singleTypeSchema("VerifiableCredential"),
|
|
409
|
+
issuer: ProfileRefSchema,
|
|
410
|
+
validFrom: z.iso.datetime(),
|
|
411
|
+
validUntil: z.iso.datetime().optional(),
|
|
412
|
+
credentialSubject: CredentialSubjectSchema,
|
|
413
|
+
proof: oneOrMany(ProofSchema).optional(),
|
|
414
|
+
credentialSchema: oneOrMany(CredentialSchemaSchema).optional(),
|
|
415
|
+
credentialStatus: CredentialStatusSchema.optional(),
|
|
416
|
+
refreshService: RefreshServiceSchema.optional(),
|
|
417
|
+
termsOfUse: oneOrMany(TermsOfUseSchema).optional(),
|
|
418
|
+
evidence: oneOrMany(EvidenceSchema).optional(),
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
export const GetOpenBadgeCredentialsResponseSchema = z
|
|
422
|
+
.object({
|
|
423
|
+
credential: oneOrMany(AchievementCredentialSchema).optional(),
|
|
424
|
+
compactJwsString: oneOrMany(CompactJwsValueSchema).optional(),
|
|
425
|
+
})
|
|
426
|
+
.strict();
|
|
427
|
+
|
|
428
|
+
export { OpenBadgesV30ContextUrlSchema };
|
|
429
|
+
export { CredentialSchemaSchema, CredentialStatusSchema, ProofSchema, RefreshServiceSchema, TermsOfUseSchema };
|
|
430
|
+
// Inferred types from exported Zod validators.
|
|
431
|
+
export type IdentifierTypeEnum = z.infer<typeof IdentifierTypeEnumSchema>;
|
|
432
|
+
export type AchievementType = z.infer<typeof AchievementTypeSchema>;
|
|
433
|
+
export type AlignmentTargetType = z.infer<typeof AlignmentTargetTypeSchema>;
|
|
434
|
+
export type ResultType = z.infer<typeof ResultTypeSchema>;
|
|
435
|
+
export type ResultStatusType = z.infer<typeof ResultStatusTypeSchema>;
|
|
436
|
+
export type OpenBadgesAchievementCredentialContext = z.infer<typeof OpenBadgesAchievementCredentialContextSchema>;
|
|
437
|
+
export type OpenBadgesEndorsementCredentialContext = z.infer<typeof OpenBadgesEndorsementCredentialContextSchema>;
|
|
438
|
+
export type OpenBadgesVerifiableCredentialContext = z.infer<typeof OpenBadgesVerifiableCredentialContextSchema>;
|
|
439
|
+
export type Image = z.infer<typeof ImageSchema>;
|
|
440
|
+
export type GeoCoordinates = z.infer<typeof GeoCoordinatesSchema>;
|
|
441
|
+
export type Address = z.infer<typeof AddressSchema>;
|
|
442
|
+
export type IdentifierEntry = z.infer<typeof IdentifierEntrySchema>;
|
|
443
|
+
export type Criteria = z.infer<typeof CriteriaSchema>;
|
|
444
|
+
export type Alignment = z.infer<typeof AlignmentSchema>;
|
|
445
|
+
export type Related = z.infer<typeof RelatedSchema>;
|
|
446
|
+
export type RubricCriterionLevel = z.infer<typeof RubricCriterionLevelSchema>;
|
|
447
|
+
export type ResultDescription = z.infer<typeof ResultDescriptionSchema>;
|
|
448
|
+
export type Evidence = z.infer<typeof EvidenceSchema>;
|
|
449
|
+
export type EndorsementSubject = z.infer<typeof EndorsementSubjectSchema>;
|
|
450
|
+
export type CredentialSubject = z.infer<typeof CredentialSubjectSchema>;
|
|
451
|
+
export type Achievement = z.infer<typeof AchievementSchema>;
|
|
452
|
+
export type IdentityObject = z.infer<typeof IdentityObjectSchema>;
|
|
453
|
+
export type Result = z.infer<typeof ResultSchema>;
|
|
454
|
+
export type AchievementSubject = z.infer<typeof AchievementSubjectSchema>;
|
|
455
|
+
export type AchievementCredential = z.infer<typeof AchievementCredentialSchema>;
|
|
456
|
+
export type OpenBadgeCredential = z.infer<typeof OpenBadgeCredentialSchema>;
|
|
457
|
+
export type VerifiableCredential = z.infer<typeof VerifiableCredentialSchema>;
|
|
458
|
+
export type GetOpenBadgeCredentialsResponse = z.infer<typeof GetOpenBadgeCredentialsResponseSchema>;
|