@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.
Files changed (187) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-format.log +6 -0
  3. package/.turbo/turbo-lint.log +4 -0
  4. package/.turbo/turbo-test.log +196 -0
  5. package/.turbo/turbo-typecheck.log +2 -0
  6. package/README.md +52 -0
  7. package/caliper-v1_2-zod-templates.md +123 -0
  8. package/case-v1_1-zod-templates.md +290 -0
  9. package/cat-v1_0-zod-templates.md +73 -0
  10. package/cc-v1_3-zod-templates.md +531 -0
  11. package/cc-v1_4-zod-templates.md +247 -0
  12. package/clr-v2_0-zod-templates.md +117 -0
  13. package/cmi5-v1_0-zod-templates.md +9 -0
  14. package/lti-zod-templates.md +11 -0
  15. package/oneroster-v1_2-zod-templates.md +76 -0
  16. package/open-badges-v3_0-zod-templates.md +66 -0
  17. package/package.json +42 -0
  18. package/qti-v2_1-zod-templates.md +45 -0
  19. package/qti-v2_2-zod-templates.md +32 -0
  20. package/qti-v3_0_1-zod-templates.md +421 -0
  21. package/src/adapter.ts +83 -0
  22. package/src/caliper/v1_2/caliper_v1p2_bootcamp_schema.ts +781 -0
  23. package/src/caliper/v1_2/index.ts +37 -0
  24. package/src/caliper/v1_2/shared.ts +122 -0
  25. package/src/caliper/v1_2/textual_requirements.ts +219 -0
  26. package/src/case/v1_1/case_v1p1_cfassociation_jsonschema1.ts +1 -0
  27. package/src/case/v1_1/case_v1p1_cfassociationgrouping_jsonschema1.ts +1 -0
  28. package/src/case/v1_1/case_v1p1_cfassociationset_jsonschema1.ts +1 -0
  29. package/src/case/v1_1/case_v1p1_cfconceptset_jsonschema1.ts +1 -0
  30. package/src/case/v1_1/case_v1p1_cfdocument_jsonschema1.ts +1 -0
  31. package/src/case/v1_1/case_v1p1_cfdocumentset_jsonschema1.ts +1 -0
  32. package/src/case/v1_1/case_v1p1_cfitem_jsonschema1.ts +1 -0
  33. package/src/case/v1_1/case_v1p1_cfitemtypeset_jsonschema1.ts +1 -0
  34. package/src/case/v1_1/case_v1p1_cflicense_jsonschema1.ts +1 -0
  35. package/src/case/v1_1/case_v1p1_cfpackage_jsonschema1.ts +1 -0
  36. package/src/case/v1_1/case_v1p1_cfrubric_jsonschema1.ts +1 -0
  37. package/src/case/v1_1/case_v1p1_cfsubjectset_jsonschema1.ts +1 -0
  38. package/src/case/v1_1/case_v1p1_imsx_statusinfo_jsonschema1.ts +1 -0
  39. package/src/case/v1_1/case_v1p1_openapi3_restbinding_schema.ts +113 -0
  40. package/src/case/v1_1/index.ts +95 -0
  41. package/src/case/v1_1/shared.ts +384 -0
  42. package/src/cat/v1_0/cat_v1p0_restbinding_operations_schema.ts +75 -0
  43. package/src/cat/v1_0/index.ts +124 -0
  44. package/src/cat/v1_0/shared.ts +345 -0
  45. package/src/clr/v2_0/clr_v2p0_achievementcredential_schema.ts +16 -0
  46. package/src/clr/v2_0/clr_v2p0_clrcredential_schema.ts +9 -0
  47. package/src/clr/v2_0/clr_v2p0_endorsementcredential_schema.ts +11 -0
  48. package/src/clr/v2_0/clr_v2p0_getclrcredentialsresponse_schema.ts +1 -0
  49. package/src/clr/v2_0/clr_v2p0_imsx_statusinfo_schema.ts +8 -0
  50. package/src/clr/v2_0/clr_v2p0_profile_schema.ts +9 -0
  51. package/src/clr/v2_0/index.ts +22 -0
  52. package/src/clr/v2_0/shared.ts +206 -0
  53. package/src/cmi5/index.ts +3 -0
  54. package/src/cmi5/v1_0/index.ts +134 -0
  55. package/src/common-cartridge/v1_3/ccv1p3_imsccauth_v1p3.ts +26 -0
  56. package/src/common-cartridge/v1_3/ccv1p3_imscp_v1p2_v1p0.ts +352 -0
  57. package/src/common-cartridge/v1_3/ccv1p3_imscsmd_v1p0.ts +35 -0
  58. package/src/common-cartridge/v1_3/ccv1p3_imsdt_v1p3.ts +33 -0
  59. package/src/common-cartridge/v1_3/ccv1p3_imswl_v1p3.ts +23 -0
  60. package/src/common-cartridge/v1_3/ccv1p3_lomccltilink_v1p0.ts +14 -0
  61. package/src/common-cartridge/v1_3/ccv1p3_lommanifest_v1p0.ts +14 -0
  62. package/src/common-cartridge/v1_3/ccv1p3_lomresource_v1p0.ts +14 -0
  63. package/src/common-cartridge/v1_3/ccv1p3_qtiasiv1p2p1_v1p0.ts +964 -0
  64. package/src/common-cartridge/v1_3/index.ts +41 -0
  65. package/src/common-cartridge/v1_3/lom-internal.ts +396 -0
  66. package/src/common-cartridge/v1_3/shared.ts +68 -0
  67. package/src/common-cartridge/v1_4/core/ccv1p4_imscp_v1p2_v1p0.ts +360 -0
  68. package/src/common-cartridge/v1_4/core/ccv1p4_lommanifest_v1p0.ts +14 -0
  69. package/src/common-cartridge/v1_4/core/ccv1p4_lomresource_v1p0.ts +14 -0
  70. package/src/common-cartridge/v1_4/extension/cc_extresource_assignmentv1p0_v1p0.ts +61 -0
  71. package/src/common-cartridge/v1_4/extension/ccv1p4_cpextensionv1p2_v1p0.ts +20 -0
  72. package/src/common-cartridge/v1_4/extension/ims_openvideov1p0_v1p0.ts +325 -0
  73. package/src/common-cartridge/v1_4/index.ts +104 -0
  74. package/src/common-cartridge/v1_4/k12/ccv1p4_imscp_v1p2_v1p0.ts +19 -0
  75. package/src/common-cartridge/v1_4/k12/ccv1p4_imscp_v1p2_v1p0_thin.ts +17 -0
  76. package/src/common-cartridge/v1_4/k12/ccv1p4_lommanifest_v1p0.ts +14 -0
  77. package/src/common-cartridge/v1_4/k12/ccv1p4_lomresource_v1p0.ts +14 -0
  78. package/src/common-cartridge/v1_4/lom-internal.ts +476 -0
  79. package/src/common-cartridge/v1_4/shared/ccv1p4_imsccauth_v1p4.ts +26 -0
  80. package/src/common-cartridge/v1_4/shared/ccv1p4_imscsmd_v1p1.ts +36 -0
  81. package/src/common-cartridge/v1_4/shared/ccv1p4_imsdt_v1p4.ts +33 -0
  82. package/src/common-cartridge/v1_4/shared/ccv1p4_imslticc_v1p4.ts +45 -0
  83. package/src/common-cartridge/v1_4/shared/ccv1p4_imswl_v1p4.ts +23 -0
  84. package/src/common-cartridge/v1_4/shared/ccv1p4_lomccltilink_v1p0.ts +14 -0
  85. package/src/common-cartridge/v1_4/shared/ccv1p4_qtiasiv1p2p1_v1p0.ts +964 -0
  86. package/src/common-cartridge/v1_4/shared/imsbasiclti_v1p0p1.ts +24 -0
  87. package/src/common-cartridge/v1_4/shared/imslticm_v1p0.ts +23 -0
  88. package/src/common-cartridge/v1_4/shared/imslticp_v1p0.ts +57 -0
  89. package/src/common-cartridge/v1_4/shared/lineitem_v1p0.ts +35 -0
  90. package/src/common-cartridge/v1_4/shared/resourcea11ymetadata-20210915.ts +110 -0
  91. package/src/common-cartridge/v1_4/shared.ts +68 -0
  92. package/src/common-cartridge/v1_4/thin/ccv1p4_imscp_v1p2_v1p0.ts +243 -0
  93. package/src/common-cartridge/v1_4/thin/ccv1p4_lommanifest_v1p0.ts +14 -0
  94. package/src/common-cartridge/v1_4/thin/ccv1p4_lomresource_v1p0.ts +14 -0
  95. package/src/common-cartridge/v1_4/vdex/imsmd_loose_v1p3p2.ts +13 -0
  96. package/src/common-cartridge/v1_4/vdex/imsvdex_v1p0.ts +124 -0
  97. package/src/config.ts +121 -0
  98. package/src/index.ts +32 -0
  99. package/src/lti/ags/v2_0/index.ts +97 -0
  100. package/src/lti/deep-linking/v2_0/index.ts +100 -0
  101. package/src/lti/index.ts +26 -0
  102. package/src/lti/nrps/v2_0/index.ts +69 -0
  103. package/src/lti/proctoring/v1_0/index.ts +131 -0
  104. package/src/lti/shared.ts +66 -0
  105. package/src/lti/v1_3/index.ts +84 -0
  106. package/src/oneroster/v1_2/index.ts +156 -0
  107. package/src/oneroster/v1_2/or_v1p2_csv_binding_schema.ts +427 -0
  108. package/src/oneroster/v1_2/or_v1p2_gradebook_restbinding_schema.ts +120 -0
  109. package/src/oneroster/v1_2/or_v1p2_gradebook_service_schema.ts +243 -0
  110. package/src/oneroster/v1_2/or_v1p2_resource_restbinding_schema.ts +24 -0
  111. package/src/oneroster/v1_2/or_v1p2_resource_service_schema.ts +47 -0
  112. package/src/oneroster/v1_2/or_v1p2_rostering_restbinding_schema.ts +84 -0
  113. package/src/oneroster/v1_2/or_v1p2_rostering_service_schema.ts +288 -0
  114. package/src/oneroster/v1_2/shared.ts +90 -0
  115. package/src/open-badges/v3_0/index.ts +20 -0
  116. package/src/open-badges/v3_0/ob_v3p0_achievementcredential_schema.ts +17 -0
  117. package/src/open-badges/v3_0/ob_v3p0_endorsementcredential_schema.ts +11 -0
  118. package/src/open-badges/v3_0/ob_v3p0_getopenbadgecredentialsresponse_schema.ts +1 -0
  119. package/src/open-badges/v3_0/ob_v3p0_imsx_statusinfo_schema.ts +8 -0
  120. package/src/open-badges/v3_0/ob_v3p0_profile_schema.ts +9 -0
  121. package/src/open-badges/v3_0/shared.ts +458 -0
  122. package/src/qti/v2-internal.ts +1683 -0
  123. package/src/qti/v2_1/apipv1p0_qtiextv2p1_v1p0.ts +3 -0
  124. package/src/qti/v2_1/imsqti_metadata_v2p1.ts +3 -0
  125. package/src/qti/v2_1/imsqti_result_v2p1.ts +3 -0
  126. package/src/qti/v2_1/imsqti_usagedata_v2p1.ts +3 -0
  127. package/src/qti/v2_1/imsqti_v2p1p2.ts +71 -0
  128. package/src/qti/v2_1/index.ts +53 -0
  129. package/src/qti/v2_1/qtiv2p1_imscpv1p2_v1p0.ts +3 -0
  130. package/src/qti/v2_1/schemas.ts +15 -0
  131. package/src/qti/v2_1/shared.ts +3 -0
  132. package/src/qti/v2_2/apipv1p0_qtiextv2p2_v1p0p1.ts +3 -0
  133. package/src/qti/v2_2/imsqti_metadata_v2p2.ts +3 -0
  134. package/src/qti/v2_2/imsqti_result_v2p2.ts +3 -0
  135. package/src/qti/v2_2/imsqti_usagedata_v2p2.ts +3 -0
  136. package/src/qti/v2_2/imsqti_v2p2p4.ts +76 -0
  137. package/src/qti/v2_2/imsqtiv2p2p4_html5_v1p0.ts +8 -0
  138. package/src/qti/v2_2/index.ts +59 -0
  139. package/src/qti/v2_2/qtiv2p2_csm_v2p2.ts +4 -0
  140. package/src/qti/v2_2/qtiv2p2_imscpv1p2_v1p0.ts +3 -0
  141. package/src/qti/v2_2/schemas.ts +19 -0
  142. package/src/qti/v2_2/shared.ts +3 -0
  143. package/src/qti/v3_0_1/assessment-internal.ts +1509 -0
  144. package/src/qti/v3_0_1/imsqti_asiv3p0p1_v1p0.ts +57 -0
  145. package/src/qti/v3_0_1/imsqti_itemv3p0p1_v1p0.ts +60 -0
  146. package/src/qti/v3_0_1/imsqti_metadatav3p0_v1p0.ts +73 -0
  147. package/src/qti/v3_0_1/imsqti_outcomev3p0p1_v1p0.ts +11 -0
  148. package/src/qti/v3_0_1/imsqti_responseprocessingv3p0p1_v1p0.ts +17 -0
  149. package/src/qti/v3_0_1/imsqti_resultv3p0_v1p0.ts +222 -0
  150. package/src/qti/v3_0_1/imsqti_sectionv3p0p1_v1p0.ts +15 -0
  151. package/src/qti/v3_0_1/imsqti_stimulusv3p0p1_v1p0.ts +15 -0
  152. package/src/qti/v3_0_1/imsqti_testv3p0p1_v1p0.ts +49 -0
  153. package/src/qti/v3_0_1/imsqti_usagedatav3p0_v1p0.ts +77 -0
  154. package/src/qti/v3_0_1/imsqtiv3p0_afa3p0pnp_v1p0.ts +269 -0
  155. package/src/qti/v3_0_1/index.ts +50 -0
  156. package/src/qti/v3_0_1/processing-internal.ts +667 -0
  157. package/src/qti/v3_0_1/shared.ts +146 -0
  158. package/src/qti/v3_0_1/variables-internal.ts +274 -0
  159. package/src/shared/imsx-status.ts +49 -0
  160. package/src/summary.ts +70 -0
  161. package/src/vc-data-model/v2_0/index.ts +27 -0
  162. package/src/vc-data-model/v2_0/shared.ts +206 -0
  163. package/src/xapi/index.ts +12 -0
  164. package/src/xapi/shared.ts +444 -0
  165. package/src/xapi/v1_0_3/index.ts +169 -0
  166. package/src/xapi/v2_0/index.ts +256 -0
  167. package/test/caliper-v1_2.test.ts +270 -0
  168. package/test/case-v1_1.test.ts +147 -0
  169. package/test/cat-v1_0.test.ts +338 -0
  170. package/test/cc-v1_4.test.ts +239 -0
  171. package/test/clr-v2_0.test.ts +225 -0
  172. package/test/cmi5-v1_0.test.ts +196 -0
  173. package/test/contracts.test.ts +125 -0
  174. package/test/fixtures/cmi5/extended-cmi5.xml +72 -0
  175. package/test/fixtures/cmi5/simple-cmi5.xml +26 -0
  176. package/test/lti.test.ts +146 -0
  177. package/test/oneroster-v1_2.test.ts +234 -0
  178. package/test/open-badges-v3_0.test.ts +144 -0
  179. package/test/qti-v2_1.test.ts +146 -0
  180. package/test/qti-v2_2.test.ts +154 -0
  181. package/test/qti-v3_0_1.test.ts +576 -0
  182. package/test/schema-examples.test.ts +101 -0
  183. package/test/vc-data-model-v2_0.test.ts +63 -0
  184. package/test/xapi.test.ts +384 -0
  185. package/tsconfig.json +7 -0
  186. package/vc-data-model-v2_0-zod-templates.md +43 -0
  187. package/xapi-zod-templates.md +95 -0
@@ -0,0 +1,37 @@
1
+ export * from "./shared";
2
+ export * from "./textual_requirements";
3
+ export * from "./caliper_v1p2_bootcamp_schema";
4
+
5
+ import {
6
+ ActionSchema,
7
+ AgentSchema,
8
+ AssessmentEventSchema,
9
+ CaliperV1P2ConformanceMetadata,
10
+ CaliperV1P2JsonSchemaEntryPoints,
11
+ EnvelopeSchema,
12
+ EventSchema,
13
+ MetricSchema,
14
+ PersonSchema,
15
+ ProfileSchema,
16
+ SessionSchema,
17
+ SoftwareApplicationSchema,
18
+ StatusSchema,
19
+ SystemIdentifierSchema,
20
+ } from "./caliper_v1p2_bootcamp_schema";
21
+
22
+ export const Caliper12DerivedZodTemplates = {
23
+ envelope: EnvelopeSchema,
24
+ event: EventSchema,
25
+ assessmentEvent: AssessmentEventSchema,
26
+ person: PersonSchema,
27
+ softwareApplication: SoftwareApplicationSchema,
28
+ session: SessionSchema,
29
+ systemIdentifier: SystemIdentifierSchema,
30
+ actionVocabulary: ActionSchema,
31
+ profileVocabulary: ProfileSchema,
32
+ metricVocabulary: MetricSchema,
33
+ statusVocabulary: StatusSchema,
34
+ agent: AgentSchema,
35
+ jsonSchemaEntryPoints: CaliperV1P2JsonSchemaEntryPoints,
36
+ conformance: CaliperV1P2ConformanceMetadata,
37
+ } as const;
@@ -0,0 +1,122 @@
1
+ import { z } from "zod";
2
+
3
+ export const CALIPER_CONTEXT_V1P1 = "http://purl.imsglobal.org/ctx/caliper/v1p1" as const;
4
+ export const CALIPER_CONTEXT_V1P2 = "http://purl.imsglobal.org/ctx/caliper/v1p2" as const;
5
+
6
+ export const CaliperContextStringSchema = z.union([z.literal(CALIPER_CONTEXT_V1P1), z.literal(CALIPER_CONTEXT_V1P2)]);
7
+
8
+ export const CaliperTopLevelContextSchema = z.union([
9
+ CaliperContextStringSchema,
10
+ z.array(z.union([z.string(), z.record(z.string(), z.unknown())])).min(1),
11
+ ]);
12
+
13
+ export const CaliperNestedContextSchema = z.union([
14
+ CaliperContextStringSchema,
15
+ z.array(z.union([z.string(), z.record(z.string(), z.unknown())])).min(1),
16
+ z.record(z.string(), z.unknown()),
17
+ ]);
18
+
19
+ export const CaliperExtensionsSchema = z.record(z.string(), z.unknown());
20
+ export const CaliperDateTimeSchema = z
21
+ .string()
22
+ .regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u, "Expected ISO8601 UTC datetime with millisecond precision");
23
+ export const CaliperIriSchema = z
24
+ .string()
25
+ .regex(/^(?:[A-Za-z][A-Za-z0-9+.-]*:.+|_:[A-Za-z0-9._-]+)$/u, "Expected absolute IRI/URI or blank-node identifier");
26
+ export const CaliperEventIdSchema = z
27
+ .string()
28
+ .regex(/^urn:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/u);
29
+
30
+ export const CaliperReferenceObjectSchema = z
31
+ .object({
32
+ id: CaliperIriSchema,
33
+ type: z.string().min(1),
34
+ "@context": CaliperNestedContextSchema.optional(),
35
+ extensions: CaliperExtensionsSchema.optional(),
36
+ })
37
+ .passthrough();
38
+
39
+ export const CaliperReferenceSchema = z.union([CaliperIriSchema, CaliperReferenceObjectSchema]);
40
+
41
+ const CaliperEntityObjectBaseSchema = z
42
+ .object({
43
+ id: CaliperIriSchema,
44
+ type: z.string().min(1),
45
+ "@context": CaliperTopLevelContextSchema.optional(),
46
+ name: z.string().optional(),
47
+ description: z.string().optional(),
48
+ dateCreated: CaliperDateTimeSchema.optional(),
49
+ dateModified: CaliperDateTimeSchema.optional(),
50
+ extensions: CaliperExtensionsSchema.optional(),
51
+ })
52
+ .passthrough();
53
+
54
+ const CaliperEventObjectBaseSchema = z
55
+ .object({
56
+ type: z.string().min(1),
57
+ "@context": CaliperTopLevelContextSchema,
58
+ id: CaliperEventIdSchema,
59
+ actor: CaliperReferenceSchema,
60
+ action: z.string().min(1),
61
+ object: CaliperReferenceSchema,
62
+ eventTime: CaliperDateTimeSchema,
63
+ edApp: CaliperReferenceSchema.optional(),
64
+ federatedSession: CaliperReferenceSchema.optional(),
65
+ generated: CaliperReferenceSchema.optional(),
66
+ group: CaliperReferenceSchema.optional(),
67
+ membership: CaliperReferenceSchema.optional(),
68
+ session: CaliperReferenceSchema.optional(),
69
+ target: CaliperReferenceSchema.optional(),
70
+ referrer: CaliperReferenceSchema.optional(),
71
+ extensions: CaliperExtensionsSchema.optional(),
72
+ profile: z.string().min(1).optional(),
73
+ })
74
+ .strict();
75
+
76
+ export const createCaliperEntitySchema = <TType extends string>(type: TType, requireContext = true) => {
77
+ if (requireContext) {
78
+ return CaliperEntityObjectBaseSchema.extend({
79
+ type: z.literal(type),
80
+ "@context": CaliperTopLevelContextSchema,
81
+ });
82
+ }
83
+
84
+ return CaliperEntityObjectBaseSchema.extend({
85
+ type: z.literal(type),
86
+ "@context": CaliperTopLevelContextSchema.optional(),
87
+ });
88
+ };
89
+
90
+ export const createCaliperEventSchema = <TType extends string>(
91
+ type: TType,
92
+ actionSchema: z.ZodType<string> = z.string().min(1),
93
+ ) =>
94
+ CaliperEventObjectBaseSchema.extend({
95
+ type: z.literal(type),
96
+ action: actionSchema,
97
+ });
98
+
99
+ export const getReferenceType = (value: unknown): string | null => {
100
+ if (typeof value !== "object" || value === null) {
101
+ return null;
102
+ }
103
+
104
+ if (!("type" in value)) {
105
+ return null;
106
+ }
107
+
108
+ const candidate = (value as { type?: unknown }).type;
109
+ return typeof candidate === "string" ? candidate : null;
110
+ };
111
+ // Inferred types from exported Zod validators.
112
+ export type CaliperContextString = z.infer<typeof CaliperContextStringSchema>;
113
+ export type CaliperTopLevelContext = z.infer<typeof CaliperTopLevelContextSchema>;
114
+ export type CaliperNestedContext = z.infer<typeof CaliperNestedContextSchema>;
115
+ export type CaliperExtensions = z.infer<typeof CaliperExtensionsSchema>;
116
+ export type CaliperDateTime = z.infer<typeof CaliperDateTimeSchema>;
117
+ export type CaliperIri = z.infer<typeof CaliperIriSchema>;
118
+ export type CaliperEventId = z.infer<typeof CaliperEventIdSchema>;
119
+ export type CaliperReferenceObject = z.infer<typeof CaliperReferenceObjectSchema>;
120
+ export type CaliperReference = z.infer<typeof CaliperReferenceSchema>;
121
+ export type createCaliperEntity = z.infer<typeof createCaliperEntitySchema>;
122
+ export type createCaliperEvent = z.infer<typeof createCaliperEventSchema>;
@@ -0,0 +1,219 @@
1
+ export type CaliperRequirementSource = "textual-spec-v1p2" | "textual-spec-v1p2-impl" | "bootcamp-v1_2";
2
+
3
+ export const CALIPER_REQUIREMENT_SOURCE_PRECEDENCE = [
4
+ "textual-spec-v1p2",
5
+ "textual-spec-v1p2-impl",
6
+ "bootcamp-v1_2",
7
+ ] as const;
8
+
9
+ export const CALIPER_REQUIREMENT_SOURCES = {
10
+ textualSpecV12: "https://www.imsglobal.org/spec/caliper/v1p2",
11
+ textualImplGuideV12: "https://www.imsglobal.org/spec/caliper/v1p2/impl/",
12
+ caliperSpecMarkdown:
13
+ "https://raw.githubusercontent.com/1EdTech/caliper-spec/1849e118b47acb24a6d97f976fe72fc2f5182570/caliper-spec.md",
14
+ bootcampSchemas: "https://github.com/1EdTech/CaliperBootcamp/tree/main/schemas/v1_2",
15
+ } as const;
16
+
17
+ export interface CaliperTextualEventRule {
18
+ profile: string;
19
+ supportedActors: readonly string[];
20
+ supportedActions: readonly string[];
21
+ deprecatedActions: readonly string[];
22
+ supportedObjects: readonly string[];
23
+ supportedGeneratedEntities: readonly string[];
24
+ supportedTargetEntities: readonly string[];
25
+ source: CaliperRequirementSource;
26
+ }
27
+
28
+ export const CALIPER_TEXTUAL_EVENT_RULES: Record<string, CaliperTextualEventRule> = {
29
+ AnnotationEvent: {
30
+ profile: "AnnotationProfile",
31
+ supportedActors: ["Person"],
32
+ supportedActions: ["Bookmarked", "Highlighted", "Shared", "Tagged"],
33
+ deprecatedActions: [
34
+ "Attached",
35
+ "Classified",
36
+ "Commented",
37
+ "Described",
38
+ "Disliked",
39
+ "Identified",
40
+ "Liked",
41
+ "Linked",
42
+ "Questioned",
43
+ "Ranked",
44
+ "Recommended",
45
+ "Subscribed",
46
+ ],
47
+ supportedObjects: ["DigitalResource"],
48
+ supportedGeneratedEntities: [
49
+ "Annotation",
50
+ "BookmarkAnnotation",
51
+ "HighlightAnnotation",
52
+ "SharedAnnotation",
53
+ "TagAnnotation",
54
+ ],
55
+ supportedTargetEntities: [],
56
+ source: "textual-spec-v1p2",
57
+ },
58
+ AssessmentEvent: {
59
+ profile: "AssessmentProfile",
60
+ supportedActors: ["Person"],
61
+ supportedActions: ["Started", "Paused", "Resumed", "Restarted", "Reset", "Submitted"],
62
+ deprecatedActions: [],
63
+ supportedObjects: ["Assessment"],
64
+ supportedGeneratedEntities: ["Attempt"],
65
+ supportedTargetEntities: [],
66
+ source: "textual-spec-v1p2",
67
+ },
68
+ AssessmentItemEvent: {
69
+ profile: "AssessmentProfile",
70
+ supportedActors: ["Person"],
71
+ supportedActions: ["Started", "Skipped", "Completed"],
72
+ deprecatedActions: ["Reviewed", "Viewed"],
73
+ supportedObjects: ["AssessmentItem"],
74
+ supportedGeneratedEntities: [
75
+ "Response",
76
+ "FillinBlankResponse",
77
+ "MultipleChoiceResponse",
78
+ "MultipleResponseResponse",
79
+ "SelectTextResponse",
80
+ "TrueFalseResponse",
81
+ ],
82
+ supportedTargetEntities: [],
83
+ source: "textual-spec-v1p2",
84
+ },
85
+ AssignableEvent: {
86
+ profile: "AssignableProfile",
87
+ supportedActors: ["Person"],
88
+ supportedActions: ["Activated", "Deactivated", "Started", "Completed", "Submitted", "Reviewed"],
89
+ deprecatedActions: ["Abandoned", "Hid", "Showed"],
90
+ supportedObjects: ["AssignableDigitalResource"],
91
+ supportedGeneratedEntities: ["Attempt"],
92
+ supportedTargetEntities: [],
93
+ source: "textual-spec-v1p2",
94
+ },
95
+ ForumEvent: {
96
+ profile: "ForumProfile",
97
+ supportedActors: ["Person"],
98
+ supportedActions: ["Subscribed", "Unsubscribed"],
99
+ deprecatedActions: [],
100
+ supportedObjects: ["Forum"],
101
+ supportedGeneratedEntities: [],
102
+ supportedTargetEntities: [],
103
+ source: "textual-spec-v1p2",
104
+ },
105
+ GradeEvent: {
106
+ profile: "GradingProfile",
107
+ supportedActors: ["Agent"],
108
+ supportedActions: ["Graded"],
109
+ deprecatedActions: [],
110
+ supportedObjects: ["Attempt"],
111
+ supportedGeneratedEntities: ["Score"],
112
+ supportedTargetEntities: [],
113
+ source: "textual-spec-v1p2",
114
+ },
115
+ MediaEvent: {
116
+ profile: "MediaProfile",
117
+ supportedActors: ["Person"],
118
+ supportedActions: [
119
+ "Started",
120
+ "Ended",
121
+ "Paused",
122
+ "Resumed",
123
+ "Restarted",
124
+ "ForwardedTo",
125
+ "JumpedTo",
126
+ "ChangedResolution",
127
+ "ChangedSize",
128
+ "ChangedSpeed",
129
+ "ChangedVolume",
130
+ "EnabledClosedCaptioning",
131
+ "DisabledClosedCaptioning",
132
+ "EnteredFullScreen",
133
+ "ExitedFullScreen",
134
+ "Muted",
135
+ "Unmuted",
136
+ "OpenedPopout",
137
+ "ClosedPopout",
138
+ ],
139
+ deprecatedActions: ["Rewound"],
140
+ supportedObjects: ["AudioObject", "ImageObject", "MediaObject", "VideoObject"],
141
+ supportedGeneratedEntities: [],
142
+ supportedTargetEntities: ["MediaLocation"],
143
+ source: "textual-spec-v1p2",
144
+ },
145
+ MessageEvent: {
146
+ profile: "ForumProfile",
147
+ supportedActors: ["Person"],
148
+ supportedActions: ["MarkedAsRead", "MarkedAsUnRead", "Posted"],
149
+ deprecatedActions: [],
150
+ supportedObjects: ["Message"],
151
+ supportedGeneratedEntities: [],
152
+ supportedTargetEntities: [],
153
+ source: "textual-spec-v1p2",
154
+ },
155
+ NavigationEvent: {
156
+ profile: "ReadingProfile",
157
+ supportedActors: ["Person"],
158
+ supportedActions: ["NavigatedTo"],
159
+ deprecatedActions: [],
160
+ supportedObjects: ["DigitalResource", "SoftwareApplication"],
161
+ supportedGeneratedEntities: ["Result"],
162
+ supportedTargetEntities: ["Frame"],
163
+ source: "textual-spec-v1p2",
164
+ },
165
+ SessionEvent: {
166
+ profile: "SessionProfile",
167
+ supportedActors: ["Person", "SoftwareApplication"],
168
+ supportedActions: ["LoggedIn", "LoggedOut", "TimedOut"],
169
+ deprecatedActions: [],
170
+ supportedObjects: ["Session", "SoftwareApplication"],
171
+ supportedGeneratedEntities: [],
172
+ supportedTargetEntities: [],
173
+ source: "textual-spec-v1p2",
174
+ },
175
+ ThreadEvent: {
176
+ profile: "ForumProfile",
177
+ supportedActors: ["Person"],
178
+ supportedActions: ["MarkedAsRead", "MarkedAsUnRead"],
179
+ deprecatedActions: [],
180
+ supportedObjects: ["Thread"],
181
+ supportedGeneratedEntities: [],
182
+ supportedTargetEntities: [],
183
+ source: "textual-spec-v1p2",
184
+ },
185
+ ToolUseEvent: {
186
+ profile: "ToolUseProfile",
187
+ supportedActors: ["Person"],
188
+ supportedActions: ["Used"],
189
+ deprecatedActions: [],
190
+ supportedObjects: ["SoftwareApplication"],
191
+ supportedGeneratedEntities: [],
192
+ supportedTargetEntities: [],
193
+ source: "textual-spec-v1p2",
194
+ },
195
+ ViewEvent: {
196
+ profile: "ReadingProfile",
197
+ supportedActors: ["Person"],
198
+ supportedActions: ["Viewed"],
199
+ deprecatedActions: [],
200
+ supportedObjects: ["DigitalResource"],
201
+ supportedGeneratedEntities: [],
202
+ supportedTargetEntities: ["Frame"],
203
+ source: "textual-spec-v1p2",
204
+ },
205
+ };
206
+
207
+ export const CALIPER_BOOTCAMP_ONLY_EVENT_TYPES = [
208
+ "Event",
209
+ "FeedbackEvent",
210
+ "OutcomeEvent",
211
+ "QuestionnaireEvent",
212
+ "QuestionnaireItemEvent",
213
+ "ReadingEvent",
214
+ "ResourceManagementEvent",
215
+ "SearchEvent",
216
+ "SurveyEvent",
217
+ "SurveyInvitationEvent",
218
+ "ToolLaunchEvent",
219
+ ] as const;
@@ -0,0 +1 @@
1
+ export { CFAssociationSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFAssociationGroupingSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFAssociationSetSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFConceptSetSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFDocumentSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFDocumentSetSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFItemSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFItemTypeSetSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFLicenseSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFPackageSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFRubricSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { CFSubjectSetSchema } from "./shared";
@@ -0,0 +1 @@
1
+ export { ImsxStatusInfoSchema } from "./shared";
@@ -0,0 +1,113 @@
1
+ import { z } from "zod";
2
+ import {
3
+ CFAssociationSchema,
4
+ CFAssociationSetSchema,
5
+ CFConceptSetSchema,
6
+ CFItemSchema,
7
+ CFItemTypeSetSchema,
8
+ CFLicenseSchema,
9
+ CFPackageSchema,
10
+ CFRubricSchema,
11
+ CFSubjectSetSchema,
12
+ ImsxStatusInfoSchema,
13
+ } from "./shared";
14
+
15
+ export const CaseV1P1OpenApi3OperationSchema = z.object({
16
+ method: z.enum(["GET", "POST", "PUT", "DELETE"]),
17
+ path: z.string(),
18
+ requestPayload: z.optional(z.record(z.string(), z.unknown())),
19
+ successResponsePayload: z.record(z.string(), z.unknown()),
20
+ errorResponsePayload: z.record(z.string(), z.unknown()),
21
+ });
22
+
23
+ export type CaseV1P1OpenApi3Operation = z.infer<typeof CaseV1P1OpenApi3OperationSchema>;
24
+
25
+ export const CaseV1P1RestBindingOperations = {
26
+ getCFAssociation: {
27
+ method: "GET",
28
+ path: "/cfAssociations/{id}",
29
+ successResponsePayload: CFAssociationSchema,
30
+ errorResponsePayload: ImsxStatusInfoSchema,
31
+ } as unknown as CaseV1P1OpenApi3Operation,
32
+
33
+ listCFAssociations: {
34
+ method: "GET",
35
+ path: "/cfAssociations",
36
+ successResponsePayload: CFAssociationSetSchema,
37
+ errorResponsePayload: ImsxStatusInfoSchema,
38
+ } as unknown as CaseV1P1OpenApi3Operation,
39
+
40
+ getCFConcept: {
41
+ method: "GET",
42
+ path: "/cfConcepts/{id}",
43
+ successResponsePayload: z.object({
44
+ cfConcept: z.record(z.string(), z.unknown()),
45
+ }),
46
+ errorResponsePayload: ImsxStatusInfoSchema,
47
+ } as unknown as CaseV1P1OpenApi3Operation,
48
+
49
+ listCFConcepts: {
50
+ method: "GET",
51
+ path: "/cfConcepts",
52
+ successResponsePayload: CFConceptSetSchema,
53
+ errorResponsePayload: ImsxStatusInfoSchema,
54
+ } as unknown as CaseV1P1OpenApi3Operation,
55
+
56
+ getCFItem: {
57
+ method: "GET",
58
+ path: "/cfItems/{id}",
59
+ successResponsePayload: CFItemSchema,
60
+ errorResponsePayload: ImsxStatusInfoSchema,
61
+ } as unknown as CaseV1P1OpenApi3Operation,
62
+
63
+ listCFItems: {
64
+ method: "GET",
65
+ path: "/cfItems",
66
+ successResponsePayload: CFItemSchema,
67
+ errorResponsePayload: ImsxStatusInfoSchema,
68
+ } as unknown as CaseV1P1OpenApi3Operation,
69
+
70
+ getCFItemType: {
71
+ method: "GET",
72
+ path: "/cfItemTypes/{id}",
73
+ successResponsePayload: z.record(z.string(), z.unknown()),
74
+ errorResponsePayload: ImsxStatusInfoSchema,
75
+ } as unknown as CaseV1P1OpenApi3Operation,
76
+
77
+ listCFItemTypes: {
78
+ method: "GET",
79
+ path: "/cfItemTypes",
80
+ successResponsePayload: CFItemTypeSetSchema,
81
+ errorResponsePayload: ImsxStatusInfoSchema,
82
+ } as unknown as CaseV1P1OpenApi3Operation,
83
+
84
+ getCFLicense: {
85
+ method: "GET",
86
+ path: "/cfLicenses/{id}",
87
+ successResponsePayload: CFLicenseSchema,
88
+ errorResponsePayload: ImsxStatusInfoSchema,
89
+ } as unknown as CaseV1P1OpenApi3Operation,
90
+
91
+ getCFPackage: {
92
+ method: "GET",
93
+ path: "/cfPackages/{id}",
94
+ successResponsePayload: CFPackageSchema,
95
+ errorResponsePayload: ImsxStatusInfoSchema,
96
+ } as unknown as CaseV1P1OpenApi3Operation,
97
+
98
+ getCFRubric: {
99
+ method: "GET",
100
+ path: "/cfRubrics/{id}",
101
+ successResponsePayload: CFRubricSchema,
102
+ errorResponsePayload: ImsxStatusInfoSchema,
103
+ } as unknown as CaseV1P1OpenApi3Operation,
104
+
105
+ listCFSubjects: {
106
+ method: "GET",
107
+ path: "/cfSubjects",
108
+ successResponsePayload: CFSubjectSetSchema,
109
+ errorResponsePayload: ImsxStatusInfoSchema,
110
+ } as unknown as CaseV1P1OpenApi3Operation,
111
+ };
112
+
113
+ export type CaseV1P1RestBindingOperations = typeof CaseV1P1RestBindingOperations;
@@ -0,0 +1,95 @@
1
+ import * as CaseV1P1AssociationGrouping from "./case_v1p1_cfassociationgrouping_jsonschema1";
2
+ import * as CaseV1P1Association from "./case_v1p1_cfassociation_jsonschema1";
3
+ import * as CaseV1P1AssociationSet from "./case_v1p1_cfassociationset_jsonschema1";
4
+ import * as CaseV1P1ConceptSet from "./case_v1p1_cfconceptset_jsonschema1";
5
+ import * as CaseV1P1Document from "./case_v1p1_cfdocument_jsonschema1";
6
+ import * as CaseV1P1DocumentSet from "./case_v1p1_cfdocumentset_jsonschema1";
7
+ import * as CaseV1P1Item from "./case_v1p1_cfitem_jsonschema1";
8
+ import * as CaseV1P1ItemTypeSet from "./case_v1p1_cfitemtypeset_jsonschema1";
9
+ import * as CaseV1P1License from "./case_v1p1_cflicense_jsonschema1";
10
+ import * as CaseV1P1Package from "./case_v1p1_cfpackage_jsonschema1";
11
+ import * as CaseV1P1Rubric from "./case_v1p1_cfrubric_jsonschema1";
12
+ import * as CaseV1P1SubjectSet from "./case_v1p1_cfsubjectset_jsonschema1";
13
+ import * as CaseV1P1Status from "./case_v1p1_imsx_statusinfo_jsonschema1";
14
+ import {
15
+ CFAssociationSchema,
16
+ CFAssociationSetSchema,
17
+ CFConceptSetSchema,
18
+ CFItemSchema,
19
+ CFItemTypeSetSchema,
20
+ CFLicenseSchema,
21
+ CFPackageSchema,
22
+ CFRubricSchema,
23
+ CFSubjectSetSchema,
24
+ ImsxStatusInfoSchema,
25
+ LinkUriSchema,
26
+ LinkGenUriSchema,
27
+ UuidSchema,
28
+ DateTimeSchema,
29
+ ExtensionEnumSchema,
30
+ } from "./shared";
31
+ import { CaseV1P1RestBindingOperations } from "./case_v1p1_openapi3_restbinding_schema";
32
+
33
+ export namespace CaseV1_1 {
34
+ export namespace JsonSchema {
35
+ export const AssociationGrouping = CaseV1P1AssociationGrouping;
36
+ export const Association = CaseV1P1Association;
37
+ export const AssociationSet = CaseV1P1AssociationSet;
38
+ export const ConceptSet = CaseV1P1ConceptSet;
39
+ export const Document = CaseV1P1Document;
40
+ export const DocumentSet = CaseV1P1DocumentSet;
41
+ export const Item = CaseV1P1Item;
42
+ export const ItemTypeSet = CaseV1P1ItemTypeSet;
43
+ export const License = CaseV1P1License;
44
+ export const Package = CaseV1P1Package;
45
+ export const Rubric = CaseV1P1Rubric;
46
+ export const SubjectSet = CaseV1P1SubjectSet;
47
+ export const Status = CaseV1P1Status;
48
+ }
49
+
50
+ export namespace Schemas {
51
+ export const CFAssociation = CFAssociationSchema;
52
+ export const CFAssociationSet = CFAssociationSetSchema;
53
+ export const CFConceptSet = CFConceptSetSchema;
54
+ export const CFItem = CFItemSchema;
55
+ export const CFItemTypeSet = CFItemTypeSetSchema;
56
+ export const CFLicense = CFLicenseSchema;
57
+ export const CFPackage = CFPackageSchema;
58
+ export const CFRubric = CFRubricSchema;
59
+ export const CFSubjectSet = CFSubjectSetSchema;
60
+ export const ImsxStatusInfo = ImsxStatusInfoSchema;
61
+ }
62
+
63
+ export namespace Shared {
64
+ export const LinkUri = LinkUriSchema;
65
+ export const LinkGenUri = LinkGenUriSchema;
66
+ export const Uuid = UuidSchema;
67
+ export const DateTime = DateTimeSchema;
68
+ export const ExtensionEnum = ExtensionEnumSchema;
69
+ }
70
+
71
+ export namespace RestBinding {
72
+ export const Operations = CaseV1P1RestBindingOperations;
73
+ }
74
+ }
75
+
76
+ export type CaseV1_1Schemas = typeof CaseV1_1.Schemas;
77
+
78
+ export const Case11DerivedZodTemplates = {
79
+ description: "CASE v1.1 Zod schemas derived from official 1EdTech JSON Schema and OpenAPI3 specifications",
80
+ specLinks: {
81
+ base: "https://www.imsglobal.org/spec/case/v1p1",
82
+ jsonSchema: "https://purl.imsglobal.org/spec/case/v1p1/schema/json/",
83
+ openApi: "https://purl.imsglobal.org/spec/case/v1p1/schema/openapi/",
84
+ },
85
+ scopes: {
86
+ jsonSchema: ["CFAssociation", "CFPackage", "CFItem", "CFRubric", "CFConceptSet"],
87
+ restBinding: ["GET operations for all major entity types"],
88
+ },
89
+ notes: [
90
+ "CASE v1.1 introduces Competency and Academic Standards modeling in JSON Schema format.",
91
+ "Core entities are modeled as strict Zod schemas with UUID identifiers and datetime tracking.",
92
+ "REST binding operations expose structured method/path/payload contracts for direct API implementation.",
93
+ "Extensible vocabularies use open enum pattern (standard values + ext:* custom extensions).",
94
+ ],
95
+ };