@oaknational/oak-curriculum-schema 1.1.2 → 1.1.4
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/package.json +6 -3
- package/src/fixtures/index.ts +0 -3
- package/src/fixtures/lessonData.fixture.ts +0 -30
- package/src/fixtures/programmeFields.fixture.ts +0 -34
- package/src/fixtures/unitData.fixture.ts +0 -12
- package/src/index.ts +0 -2
- package/src/schema/base.schema.ts +0 -19
- package/src/schema/index.ts +0 -4
- package/src/schema/lessonData.schema.ts +0 -32
- package/src/schema/programmeFields.schema.ts +0 -45
- package/src/schema/unitData.schema.ts +0 -16
- package/src/test/lessonData.test.ts +0 -11
- package/src/test/programmeFields.test.ts +0 -11
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oaknational/oak-curriculum-schema",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Contract tests to ensure data integrity between Oak apps and their data",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/types.d.ts",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"
|
|
9
|
+
"dist/cjs",
|
|
10
|
+
"dist/esm",
|
|
11
|
+
"dist/types.d.ts",
|
|
12
|
+
"dist/src"
|
|
11
13
|
],
|
|
12
14
|
"scripts": {
|
|
13
15
|
"test": "vitest",
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
"husky": "^9.0.11",
|
|
41
43
|
"prettier": "3.2.5",
|
|
42
44
|
"rollup": "^4.14.3",
|
|
45
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
43
46
|
"rollup-plugin-dts": "^6.1.0",
|
|
44
47
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
45
48
|
"rollup-plugin-typescript-paths": "^1.5.0",
|
package/src/fixtures/index.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { LessonData } from "@/schema/lessonData.schema";
|
|
2
|
-
|
|
3
|
-
export const lessonDataFixture = (
|
|
4
|
-
overrides?: Partial<LessonData>,
|
|
5
|
-
): LessonData => ({
|
|
6
|
-
lesson_id: 1,
|
|
7
|
-
lesson_uid: "lesson-uid",
|
|
8
|
-
title: "lesson-title",
|
|
9
|
-
description: "lesson-description",
|
|
10
|
-
slug: "lesson-slug",
|
|
11
|
-
pupil_lesson_outcome: "pupil-lesson-outcome",
|
|
12
|
-
key_learning_points: [{}],
|
|
13
|
-
equipment_and_resources: null,
|
|
14
|
-
content_guidance_details: null,
|
|
15
|
-
content_guidance: null,
|
|
16
|
-
supervision_level: null,
|
|
17
|
-
thirdpartycontent_list: null,
|
|
18
|
-
misconceptions_and_common_mistakes: null,
|
|
19
|
-
keywords: null,
|
|
20
|
-
video_id: null,
|
|
21
|
-
sign_language_video_id: null,
|
|
22
|
-
quiz_id_starter: null,
|
|
23
|
-
quiz_id_exit: null,
|
|
24
|
-
asset_id_slidedeck: null,
|
|
25
|
-
asset_id_worksheet: null,
|
|
26
|
-
copyright_content: null,
|
|
27
|
-
_state: "published",
|
|
28
|
-
_cohort: "2023-2024",
|
|
29
|
-
deprecated_fields: null,
|
|
30
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ProgrammeFields } from "@/schema/programmeFields.schema";
|
|
2
|
-
|
|
3
|
-
export const programmeFieldsFixture = (): ProgrammeFields => ({
|
|
4
|
-
tier: null,
|
|
5
|
-
tier_id: null,
|
|
6
|
-
tier_slug: null,
|
|
7
|
-
tier_description: null,
|
|
8
|
-
tier_display_order: null,
|
|
9
|
-
examboard: null,
|
|
10
|
-
examboard_id: null,
|
|
11
|
-
examboard_slug: null,
|
|
12
|
-
examboard_description: null,
|
|
13
|
-
examboard_display_order: null,
|
|
14
|
-
year: "year",
|
|
15
|
-
year_slug: "year-1",
|
|
16
|
-
year_id: 1,
|
|
17
|
-
year_description: "year-description",
|
|
18
|
-
year_display_order: 1,
|
|
19
|
-
keystage: "KS1",
|
|
20
|
-
keystage_id: 1,
|
|
21
|
-
keystage_slug: "ks1",
|
|
22
|
-
keystage_description: "Key Stage 1",
|
|
23
|
-
keystage_display_order: 1,
|
|
24
|
-
phase: "primary",
|
|
25
|
-
phase_id: 0,
|
|
26
|
-
phase_slug: "primary",
|
|
27
|
-
phase_description: "primary",
|
|
28
|
-
phase_display_order: 1,
|
|
29
|
-
subject: "subject",
|
|
30
|
-
subject_id: 1,
|
|
31
|
-
subject_slug: "subject-slug",
|
|
32
|
-
subject_description: "subject-description",
|
|
33
|
-
subject_display_order: 1,
|
|
34
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { UnitData } from "@/schema/unitData.schema";
|
|
2
|
-
|
|
3
|
-
export const unitDataFixture = (): UnitData => ({
|
|
4
|
-
unit_id: 0,
|
|
5
|
-
unit_uid: "unit-uid",
|
|
6
|
-
description: null,
|
|
7
|
-
slug: "unit-slug",
|
|
8
|
-
tags: null,
|
|
9
|
-
title: "unit-title",
|
|
10
|
-
_state: "published",
|
|
11
|
-
_cohort: "2023-2024",
|
|
12
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const _stateSchema = z.enum(["published", "new", "migration"]);
|
|
4
|
-
export const _cohortSchema = z.enum(["2020-2023", "2023-2024", "0"]);
|
|
5
|
-
export const keystages = z.enum(["KS1", "KS2", "KS3", "KS4", "EYFS"]);
|
|
6
|
-
export const keystageSlugs = z.enum([
|
|
7
|
-
"ks1",
|
|
8
|
-
"ks2",
|
|
9
|
-
"ks3",
|
|
10
|
-
"ks4",
|
|
11
|
-
"early-years-foundation-stage",
|
|
12
|
-
]);
|
|
13
|
-
export const keystageDescriptions = z.enum([
|
|
14
|
-
"Key Stage 1",
|
|
15
|
-
"Key Stage 2",
|
|
16
|
-
"Key Stage 3",
|
|
17
|
-
"Key Stage 4",
|
|
18
|
-
"Early Years Foundation Stage",
|
|
19
|
-
]);
|
package/src/schema/index.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
import { _stateSchema, _cohortSchema } from "./base.schema";
|
|
4
|
-
|
|
5
|
-
export const lessonDataSchema = z.object({
|
|
6
|
-
lesson_id: z.number(),
|
|
7
|
-
lesson_uid: z.string(),
|
|
8
|
-
slug: z.string(),
|
|
9
|
-
title: z.string(),
|
|
10
|
-
description: z.string(),
|
|
11
|
-
pupil_lesson_outcome: z.string(),
|
|
12
|
-
key_learning_points: z.array(z.object({})),
|
|
13
|
-
equipment_and_resources: z.array(z.object({})).nullable(),
|
|
14
|
-
content_guidance_details: z.array(z.object({})).nullable(),
|
|
15
|
-
content_guidance: z.array(z.number()).nullable(),
|
|
16
|
-
copyright_content: z.array(z.object({})).nullable(),
|
|
17
|
-
supervision_level: z.string().nullable(),
|
|
18
|
-
thirdpartycontent_list: z.array(z.number()).nullable(),
|
|
19
|
-
misconceptions_and_common_mistakes: z.array(z.object({})).nullable(),
|
|
20
|
-
keywords: z.array(z.object({})).nullable(),
|
|
21
|
-
video_id: z.number().nullable(),
|
|
22
|
-
sign_language_video_id: z.number().nullable(),
|
|
23
|
-
quiz_id_starter: z.number().nullable(),
|
|
24
|
-
quiz_id_exit: z.number().nullable(),
|
|
25
|
-
asset_id_slidedeck: z.number().nullable(),
|
|
26
|
-
asset_id_worksheet: z.number().nullable(),
|
|
27
|
-
deprecated_fields: z.record(z.unknown()).nullable(),
|
|
28
|
-
_state: _stateSchema,
|
|
29
|
-
_cohort: _cohortSchema,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export type LessonData = z.infer<typeof lessonDataSchema>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { keystages, keystageSlugs, keystageDescriptions } from "./base.schema";
|
|
3
|
-
|
|
4
|
-
export const programmeFieldsSchema = z.object({
|
|
5
|
-
tier: z.string().nullable(),
|
|
6
|
-
tier_id: z.number().nullable(),
|
|
7
|
-
tier_slug: z.string().nullable(),
|
|
8
|
-
tier_description: z.string().nullable(),
|
|
9
|
-
tier_display_order: z.number().nullable(),
|
|
10
|
-
|
|
11
|
-
examboard: z.string().nullable(),
|
|
12
|
-
examboard_id: z.number().nullable(),
|
|
13
|
-
examboard_slug: z.string().nullable(),
|
|
14
|
-
examboard_description: z.string().nullable(),
|
|
15
|
-
examboard_display_order: z.number().nullable(),
|
|
16
|
-
|
|
17
|
-
year: z.string(),
|
|
18
|
-
year_slug: z.string(),
|
|
19
|
-
year_id: z.number(),
|
|
20
|
-
year_description: z.string(),
|
|
21
|
-
year_display_order: z.number(),
|
|
22
|
-
|
|
23
|
-
keystage: keystages,
|
|
24
|
-
keystage_id: z.number(),
|
|
25
|
-
keystage_slug: keystageSlugs,
|
|
26
|
-
keystage_description: keystageDescriptions,
|
|
27
|
-
keystage_display_order: z.number(),
|
|
28
|
-
|
|
29
|
-
phase: z.string(),
|
|
30
|
-
phase_id: z.number(),
|
|
31
|
-
phase_slug: z.string(),
|
|
32
|
-
phase_description: z.string(),
|
|
33
|
-
phase_display_order: z.number(),
|
|
34
|
-
|
|
35
|
-
subject: z.string(),
|
|
36
|
-
subject_id: z.number(),
|
|
37
|
-
subject_slug: z.string(),
|
|
38
|
-
subject_description: z.string(),
|
|
39
|
-
subject_display_order: z.number(),
|
|
40
|
-
|
|
41
|
-
legacy: z.string().optional(),
|
|
42
|
-
dataset: z.string().optional(),
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export type ProgrammeFields = z.infer<typeof programmeFieldsSchema>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
import { _stateSchema, _cohortSchema } from "./base.schema";
|
|
4
|
-
|
|
5
|
-
export const unitDataSchema = z.object({
|
|
6
|
-
unit_id: z.number(),
|
|
7
|
-
unit_uid: z.string(),
|
|
8
|
-
description: z.string().nullable(),
|
|
9
|
-
slug: z.string(),
|
|
10
|
-
tags: z.array(z.number()).nullable(),
|
|
11
|
-
title: z.string(),
|
|
12
|
-
_state: _stateSchema,
|
|
13
|
-
_cohort: _cohortSchema,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export type UnitData = z.infer<typeof unitDataSchema>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
3
|
-
import { lessonDataFixture } from "@/fixtures/lessonData.fixture";
|
|
4
|
-
import { lessonDataSchema } from "@/schema/lessonData.schema";
|
|
5
|
-
|
|
6
|
-
describe("lessonData", () => {
|
|
7
|
-
it("conforms to the schema", () => {
|
|
8
|
-
const l = lessonDataFixture();
|
|
9
|
-
expect(() => lessonDataSchema.parse(l)).not.toThrow();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
3
|
-
import { programmeFieldsFixture } from "@/fixtures/programmeFields.fixture";
|
|
4
|
-
import { programmeFieldsSchema } from "@/schema/programmeFields.schema";
|
|
5
|
-
|
|
6
|
-
describe("programmeFields", () => {
|
|
7
|
-
it("conforms to the schema", () => {
|
|
8
|
-
const l = programmeFieldsFixture();
|
|
9
|
-
expect(() => programmeFieldsSchema.parse(l)).not.toThrow();
|
|
10
|
-
});
|
|
11
|
-
});
|