@oaknational/oak-curriculum-schema 1.0.1 → 1.1.2
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/README.md +2 -1
- package/package.json +31 -3
- package/src/fixtures/index.ts +3 -0
- package/src/fixtures/lessonData.fixture.ts +30 -0
- package/src/fixtures/programmeFields.fixture.ts +34 -0
- package/src/fixtures/unitData.fixture.ts +12 -0
- package/src/index.ts +2 -0
- package/src/schema/base.schema.ts +19 -0
- package/src/schema/index.ts +4 -0
- package/src/schema/lessonData.schema.ts +32 -0
- package/src/schema/programmeFields.schema.ts +45 -0
- package/src/schema/unitData.schema.ts +16 -0
- package/src/test/lessonData.test.ts +11 -0
- package/src/test/programmeFields.test.ts +11 -0
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/types.d.ts +0 -86
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oaknational/oak-curriculum-schema",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Contract tests to ensure data integrity between Oak apps and their data",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"main": "dist/cjs/index.js",
|
|
7
6
|
"module": "dist/esm/index.js",
|
|
8
7
|
"types": "dist/types.d.ts",
|
|
9
8
|
"files": [
|
|
10
|
-
"dist"
|
|
9
|
+
"dist",
|
|
10
|
+
"src"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "vitest",
|
|
14
14
|
"test:ci": "vitest run",
|
|
15
15
|
"build": "rollup -c --bundleConfigAsCjs",
|
|
16
16
|
"lint": "eslint --fix",
|
|
17
|
+
"check-types": "tsc",
|
|
17
18
|
"prepare": "husky"
|
|
18
19
|
},
|
|
19
20
|
"author": "",
|
|
@@ -27,6 +28,8 @@
|
|
|
27
28
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
28
29
|
"@rollup/plugin-terser": "^0.4.4",
|
|
29
30
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
31
|
+
"@semantic-release/git": "^10.0.1",
|
|
32
|
+
"@semantic-release/npm": "^12.0.0",
|
|
30
33
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
31
34
|
"eslint": "^8.57.0",
|
|
32
35
|
"eslint-config-standard-with-typescript": "^43.0.1",
|
|
@@ -46,5 +49,30 @@
|
|
|
46
49
|
},
|
|
47
50
|
"peerDependencies": {
|
|
48
51
|
"zod": "^3.22.4"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/oaknational/oak-curriculum-schema.git"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/oaknational/oak-curriculum-schema#readme",
|
|
58
|
+
"release": {
|
|
59
|
+
"branches": [
|
|
60
|
+
"main"
|
|
61
|
+
],
|
|
62
|
+
"plugins": [
|
|
63
|
+
"@semantic-release/commit-analyzer",
|
|
64
|
+
"@semantic-release/release-notes-generator",
|
|
65
|
+
"@semantic-release/npm",
|
|
66
|
+
[
|
|
67
|
+
"@semantic-release/git",
|
|
68
|
+
{
|
|
69
|
+
"assets": [
|
|
70
|
+
"package.json",
|
|
71
|
+
"package-lock.json"
|
|
72
|
+
],
|
|
73
|
+
"message": "build(release): ${nextRelease.version} [skip ci]"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
]
|
|
49
77
|
}
|
|
50
78
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
]);
|
|
@@ -0,0 +1,32 @@
|
|
|
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>;
|
|
@@ -0,0 +1,45 @@
|
|
|
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>;
|
|
@@ -0,0 +1,16 @@
|
|
|
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>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
});
|
package/dist/cjs/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("zod");const l=e.z.enum(["published","new","migration"]),n=e.z.enum(["2020-2023","2023-2024","0"]),t=e.z.object({lesson_id:e.z.number(),lesson_uid:e.z.string(),slug:e.z.string(),title:e.z.string(),description:e.z.string(),pupil_lesson_outcome:e.z.string(),key_learning_points:e.z.array(e.z.object({})),equipment_and_resources:e.z.array(e.z.object({})).nullable(),content_guidance_details:e.z.array(e.z.object({})).nullable(),content_guidance:e.z.array(e.z.number()).nullable(),copyright_content:e.z.array(e.z.object({})).nullable(),supervision_level:e.z.string().nullable(),thirdpartycontent_list:e.z.array(e.z.number()).nullable(),misconceptions_and_common_mistakes:e.z.array(e.z.object({})).nullable(),keywords:e.z.array(e.z.object({})).nullable(),video_id:e.z.number().nullable(),sign_language_video_id:e.z.number().nullable(),quiz_id_starter:e.z.number().nullable(),quiz_id_exit:e.z.number().nullable(),asset_id_slidedeck:e.z.number().nullable(),asset_id_worksheet:e.z.number().nullable(),deprecated_fields:e.z.record(e.z.unknown()).nullable(),_state:l,_cohort:n});exports._cohortSchema=n,exports._stateSchema=l,exports.lessonDataFixture=e=>({lesson_id:1,lesson_uid:"lesson-uid",title:"lesson-title",description:"lesson-description",slug:"lesson-slug",pupil_lesson_outcome:"pupil-lesson-outcome",key_learning_points:[{}],equipment_and_resources:null,content_guidance_details:null,content_guidance:null,supervision_level:null,thirdpartycontent_list:null,misconceptions_and_common_mistakes:null,keywords:null,video_id:null,sign_language_video_id:null,quiz_id_starter:null,quiz_id_exit:null,asset_id_slidedeck:null,asset_id_worksheet:null,copyright_content:null,_state:"published",_cohort:"2023-2024",deprecated_fields:null}),exports.lessonDataSchema=t;
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/schema/base.schema.ts","../../src/schema/lessonData.schema.ts","../../src/fixtures/lessonData.fixture.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const _stateSchema = z.enum([\"published\", \"new\", \"migration\"]);\nexport const _cohortSchema = z.enum([\"2020-2023\", \"2023-2024\", \"0\"]);\n","import { z } from \"zod\";\n\nimport { _stateSchema, _cohortSchema } from \"./base.schema\";\n\nexport const lessonDataSchema = z.object({\n lesson_id: z.number(),\n lesson_uid: z.string(),\n slug: z.string(),\n title: z.string(),\n description: z.string(),\n pupil_lesson_outcome: z.string(),\n key_learning_points: z.array(z.object({})),\n equipment_and_resources: z.array(z.object({})).nullable(),\n content_guidance_details: z.array(z.object({})).nullable(),\n content_guidance: z.array(z.number()).nullable(),\n copyright_content: z.array(z.object({})).nullable(),\n supervision_level: z.string().nullable(),\n thirdpartycontent_list: z.array(z.number()).nullable(),\n misconceptions_and_common_mistakes: z.array(z.object({})).nullable(),\n keywords: z.array(z.object({})).nullable(),\n video_id: z.number().nullable(),\n sign_language_video_id: z.number().nullable(),\n quiz_id_starter: z.number().nullable(),\n quiz_id_exit: z.number().nullable(),\n asset_id_slidedeck: z.number().nullable(),\n asset_id_worksheet: z.number().nullable(),\n deprecated_fields: z.record(z.unknown()).nullable(),\n _state: _stateSchema,\n _cohort: _cohortSchema,\n});\n\nexport type LessonData = z.infer<typeof lessonDataSchema>;\n","import { LessonData } from \"@/schema/lessonData.schema\";\n\nexport const lessonDataFixture = (\n overrides?: Partial<LessonData>,\n): LessonData => ({\n lesson_id: 1,\n lesson_uid: \"lesson-uid\",\n title: \"lesson-title\",\n description: \"lesson-description\",\n slug: \"lesson-slug\",\n pupil_lesson_outcome: \"pupil-lesson-outcome\",\n key_learning_points: [{}],\n equipment_and_resources: null,\n content_guidance_details: null,\n content_guidance: null,\n supervision_level: null,\n thirdpartycontent_list: null,\n misconceptions_and_common_mistakes: null,\n keywords: null,\n video_id: null,\n sign_language_video_id: null,\n quiz_id_starter: null,\n quiz_id_exit: null,\n asset_id_slidedeck: null,\n asset_id_worksheet: null,\n copyright_content: null,\n _state: \"published\",\n _cohort: \"2023-2024\",\n deprecated_fields: null,\n});\n"],"names":["_stateSchema","z","enum","_cohortSchema","lessonDataSchema","object","lesson_id","number","lesson_uid","string","slug","title","description","pupil_lesson_outcome","key_learning_points","array","equipment_and_resources","nullable","content_guidance_details","content_guidance","copyright_content","supervision_level","thirdpartycontent_list","misconceptions_and_common_mistakes","keywords","video_id","sign_language_video_id","quiz_id_starter","quiz_id_exit","asset_id_slidedeck","asset_id_worksheet","deprecated_fields","record","unknown","_state","_cohort","overrides"],"mappings":"kCAEa,MAAAA,EAAeC,EAACA,EAACC,KAAK,CAAC,YAAa,MAAO,cAC3CC,EAAgBF,EAACA,EAACC,KAAK,CAAC,YAAa,YAAa,MCClDE,EAAmBH,EAACA,EAACI,OAAO,CACvCC,UAAWL,EAACA,EAACM,SACbC,WAAYP,EAACA,EAACQ,SACdC,KAAMT,EAACA,EAACQ,SACRE,MAAOV,EAACA,EAACQ,SACTG,YAAaX,EAACA,EAACQ,SACfI,qBAAsBZ,EAACA,EAACQ,SACxBK,oBAAqBb,EAACA,EAACc,MAAMd,EAACA,EAACI,OAAO,CAAE,IACxCW,wBAAyBf,EAACA,EAACc,MAAMd,EAAAA,EAAEI,OAAO,CAAE,IAAGY,WAC/CC,yBAA0BjB,EAACA,EAACc,MAAMd,EAAAA,EAAEI,OAAO,CAAE,IAAGY,WAChDE,iBAAkBlB,EAACA,EAACc,MAAMd,EAACA,EAACM,UAAUU,WACtCG,kBAAmBnB,EAACA,EAACc,MAAMd,EAAAA,EAAEI,OAAO,CAAE,IAAGY,WACzCI,kBAAmBpB,EAACA,EAACQ,SAASQ,WAC9BK,uBAAwBrB,EAACA,EAACc,MAAMd,EAACA,EAACM,UAAUU,WAC5CM,mCAAoCtB,EAACA,EAACc,MAAMd,EAAAA,EAAEI,OAAO,CAAE,IAAGY,WAC1DO,SAAUvB,EAACA,EAACc,MAAMd,EAAAA,EAAEI,OAAO,CAAE,IAAGY,WAChCQ,SAAUxB,EAACA,EAACM,SAASU,WACrBS,uBAAwBzB,EAACA,EAACM,SAASU,WACnCU,gBAAiB1B,EAACA,EAACM,SAASU,WAC5BW,aAAc3B,EAACA,EAACM,SAASU,WACzBY,mBAAoB5B,EAACA,EAACM,SAASU,WAC/Ba,mBAAoB7B,EAACA,EAACM,SAASU,WAC/Bc,kBAAmB9B,EAACA,EAAC+B,OAAO/B,EAACA,EAACgC,WAAWhB,WACzCiB,OAAQlC,EACRmC,QAAShC,6ECzBTiC,IACgB,CAChB9B,UAAW,EACXE,WAAY,aACZG,MAAO,eACPC,YAAa,qBACbF,KAAM,cACNG,qBAAsB,uBACtBC,oBAAqB,CAAC,CAAA,GACtBE,wBAAyB,KACzBE,yBAA0B,KAC1BC,iBAAkB,KAClBE,kBAAmB,KACnBC,uBAAwB,KACxBC,mCAAoC,KACpCC,SAAU,KACVC,SAAU,KACVC,uBAAwB,KACxBC,gBAAiB,KACjBC,aAAc,KACdC,mBAAoB,KACpBC,mBAAoB,KACpBV,kBAAmB,KACnBc,OAAQ,YACRC,QAAS,YACTJ,kBAAmB"}
|
package/dist/esm/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{z as e}from"zod";const l=e.enum(["published","new","migration"]),n=e.enum(["2020-2023","2023-2024","0"]),i=e.object({lesson_id:e.number(),lesson_uid:e.string(),slug:e.string(),title:e.string(),description:e.string(),pupil_lesson_outcome:e.string(),key_learning_points:e.array(e.object({})),equipment_and_resources:e.array(e.object({})).nullable(),content_guidance_details:e.array(e.object({})).nullable(),content_guidance:e.array(e.number()).nullable(),copyright_content:e.array(e.object({})).nullable(),supervision_level:e.string().nullable(),thirdpartycontent_list:e.array(e.number()).nullable(),misconceptions_and_common_mistakes:e.array(e.object({})).nullable(),keywords:e.array(e.object({})).nullable(),video_id:e.number().nullable(),sign_language_video_id:e.number().nullable(),quiz_id_starter:e.number().nullable(),quiz_id_exit:e.number().nullable(),asset_id_slidedeck:e.number().nullable(),asset_id_worksheet:e.number().nullable(),deprecated_fields:e.record(e.unknown()).nullable(),_state:l,_cohort:n}),t=e=>({lesson_id:1,lesson_uid:"lesson-uid",title:"lesson-title",description:"lesson-description",slug:"lesson-slug",pupil_lesson_outcome:"pupil-lesson-outcome",key_learning_points:[{}],equipment_and_resources:null,content_guidance_details:null,content_guidance:null,supervision_level:null,thirdpartycontent_list:null,misconceptions_and_common_mistakes:null,keywords:null,video_id:null,sign_language_video_id:null,quiz_id_starter:null,quiz_id_exit:null,asset_id_slidedeck:null,asset_id_worksheet:null,copyright_content:null,_state:"published",_cohort:"2023-2024",deprecated_fields:null});export{n as _cohortSchema,l as _stateSchema,t as lessonDataFixture,i as lessonDataSchema};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/schema/base.schema.ts","../../src/schema/lessonData.schema.ts","../../src/fixtures/lessonData.fixture.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const _stateSchema = z.enum([\"published\", \"new\", \"migration\"]);\nexport const _cohortSchema = z.enum([\"2020-2023\", \"2023-2024\", \"0\"]);\n","import { z } from \"zod\";\n\nimport { _stateSchema, _cohortSchema } from \"./base.schema\";\n\nexport const lessonDataSchema = z.object({\n lesson_id: z.number(),\n lesson_uid: z.string(),\n slug: z.string(),\n title: z.string(),\n description: z.string(),\n pupil_lesson_outcome: z.string(),\n key_learning_points: z.array(z.object({})),\n equipment_and_resources: z.array(z.object({})).nullable(),\n content_guidance_details: z.array(z.object({})).nullable(),\n content_guidance: z.array(z.number()).nullable(),\n copyright_content: z.array(z.object({})).nullable(),\n supervision_level: z.string().nullable(),\n thirdpartycontent_list: z.array(z.number()).nullable(),\n misconceptions_and_common_mistakes: z.array(z.object({})).nullable(),\n keywords: z.array(z.object({})).nullable(),\n video_id: z.number().nullable(),\n sign_language_video_id: z.number().nullable(),\n quiz_id_starter: z.number().nullable(),\n quiz_id_exit: z.number().nullable(),\n asset_id_slidedeck: z.number().nullable(),\n asset_id_worksheet: z.number().nullable(),\n deprecated_fields: z.record(z.unknown()).nullable(),\n _state: _stateSchema,\n _cohort: _cohortSchema,\n});\n\nexport type LessonData = z.infer<typeof lessonDataSchema>;\n","import { LessonData } from \"@/schema/lessonData.schema\";\n\nexport const lessonDataFixture = (\n overrides?: Partial<LessonData>,\n): LessonData => ({\n lesson_id: 1,\n lesson_uid: \"lesson-uid\",\n title: \"lesson-title\",\n description: \"lesson-description\",\n slug: \"lesson-slug\",\n pupil_lesson_outcome: \"pupil-lesson-outcome\",\n key_learning_points: [{}],\n equipment_and_resources: null,\n content_guidance_details: null,\n content_guidance: null,\n supervision_level: null,\n thirdpartycontent_list: null,\n misconceptions_and_common_mistakes: null,\n keywords: null,\n video_id: null,\n sign_language_video_id: null,\n quiz_id_starter: null,\n quiz_id_exit: null,\n asset_id_slidedeck: null,\n asset_id_worksheet: null,\n copyright_content: null,\n _state: \"published\",\n _cohort: \"2023-2024\",\n deprecated_fields: null,\n});\n"],"names":["_stateSchema","z","enum","_cohortSchema","lessonDataSchema","object","lesson_id","number","lesson_uid","string","slug","title","description","pupil_lesson_outcome","key_learning_points","array","equipment_and_resources","nullable","content_guidance_details","content_guidance","copyright_content","supervision_level","thirdpartycontent_list","misconceptions_and_common_mistakes","keywords","video_id","sign_language_video_id","quiz_id_starter","quiz_id_exit","asset_id_slidedeck","asset_id_worksheet","deprecated_fields","record","unknown","_state","_cohort","lessonDataFixture","overrides"],"mappings":"wBAEa,MAAAA,EAAeC,EAAEC,KAAK,CAAC,YAAa,MAAO,cAC3CC,EAAgBF,EAAEC,KAAK,CAAC,YAAa,YAAa,MCClDE,EAAmBH,EAAEI,OAAO,CACvCC,UAAWL,EAAEM,SACbC,WAAYP,EAAEQ,SACdC,KAAMT,EAAEQ,SACRE,MAAOV,EAAEQ,SACTG,YAAaX,EAAEQ,SACfI,qBAAsBZ,EAAEQ,SACxBK,oBAAqBb,EAAEc,MAAMd,EAAEI,OAAO,CAAE,IACxCW,wBAAyBf,EAAEc,MAAMd,EAAEI,OAAO,CAAE,IAAGY,WAC/CC,yBAA0BjB,EAAEc,MAAMd,EAAEI,OAAO,CAAE,IAAGY,WAChDE,iBAAkBlB,EAAEc,MAAMd,EAAEM,UAAUU,WACtCG,kBAAmBnB,EAAEc,MAAMd,EAAEI,OAAO,CAAE,IAAGY,WACzCI,kBAAmBpB,EAAEQ,SAASQ,WAC9BK,uBAAwBrB,EAAEc,MAAMd,EAAEM,UAAUU,WAC5CM,mCAAoCtB,EAAEc,MAAMd,EAAEI,OAAO,CAAE,IAAGY,WAC1DO,SAAUvB,EAAEc,MAAMd,EAAEI,OAAO,CAAE,IAAGY,WAChCQ,SAAUxB,EAAEM,SAASU,WACrBS,uBAAwBzB,EAAEM,SAASU,WACnCU,gBAAiB1B,EAAEM,SAASU,WAC5BW,aAAc3B,EAAEM,SAASU,WACzBY,mBAAoB5B,EAAEM,SAASU,WAC/Ba,mBAAoB7B,EAAEM,SAASU,WAC/Bc,kBAAmB9B,EAAE+B,OAAO/B,EAAEgC,WAAWhB,WACzCiB,OAAQlC,EACRmC,QAAShC,IC1BEiC,EACXC,IACgB,CAChB/B,UAAW,EACXE,WAAY,aACZG,MAAO,eACPC,YAAa,qBACbF,KAAM,cACNG,qBAAsB,uBACtBC,oBAAqB,CAAC,CAAA,GACtBE,wBAAyB,KACzBE,yBAA0B,KAC1BC,iBAAkB,KAClBE,kBAAmB,KACnBC,uBAAwB,KACxBC,mCAAoC,KACpCC,SAAU,KACVC,SAAU,KACVC,uBAAwB,KACxBC,gBAAiB,KACjBC,aAAc,KACdC,mBAAoB,KACpBC,mBAAoB,KACpBV,kBAAmB,KACnBc,OAAQ,YACRC,QAAS,YACTJ,kBAAmB"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
declare const _stateSchema: z.ZodEnum<["published", "new", "migration"]>;
|
|
4
|
-
declare const _cohortSchema: z.ZodEnum<["2020-2023", "2023-2024", "0"]>;
|
|
5
|
-
|
|
6
|
-
declare const lessonDataSchema: z.ZodObject<{
|
|
7
|
-
lesson_id: z.ZodNumber;
|
|
8
|
-
lesson_uid: z.ZodString;
|
|
9
|
-
slug: z.ZodString;
|
|
10
|
-
title: z.ZodString;
|
|
11
|
-
description: z.ZodString;
|
|
12
|
-
pupil_lesson_outcome: z.ZodString;
|
|
13
|
-
key_learning_points: z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">;
|
|
14
|
-
equipment_and_resources: z.ZodNullable<z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">>;
|
|
15
|
-
content_guidance_details: z.ZodNullable<z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">>;
|
|
16
|
-
content_guidance: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
|
|
17
|
-
copyright_content: z.ZodNullable<z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">>;
|
|
18
|
-
supervision_level: z.ZodNullable<z.ZodString>;
|
|
19
|
-
thirdpartycontent_list: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
|
|
20
|
-
misconceptions_and_common_mistakes: z.ZodNullable<z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">>;
|
|
21
|
-
keywords: z.ZodNullable<z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">>;
|
|
22
|
-
video_id: z.ZodNullable<z.ZodNumber>;
|
|
23
|
-
sign_language_video_id: z.ZodNullable<z.ZodNumber>;
|
|
24
|
-
quiz_id_starter: z.ZodNullable<z.ZodNumber>;
|
|
25
|
-
quiz_id_exit: z.ZodNullable<z.ZodNumber>;
|
|
26
|
-
asset_id_slidedeck: z.ZodNullable<z.ZodNumber>;
|
|
27
|
-
asset_id_worksheet: z.ZodNullable<z.ZodNumber>;
|
|
28
|
-
deprecated_fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
29
|
-
_state: z.ZodEnum<["published", "new", "migration"]>;
|
|
30
|
-
_cohort: z.ZodEnum<["2020-2023", "2023-2024", "0"]>;
|
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
lesson_id: number;
|
|
33
|
-
lesson_uid: string;
|
|
34
|
-
slug: string;
|
|
35
|
-
title: string;
|
|
36
|
-
description: string;
|
|
37
|
-
pupil_lesson_outcome: string;
|
|
38
|
-
key_learning_points: {}[];
|
|
39
|
-
equipment_and_resources: {}[] | null;
|
|
40
|
-
content_guidance_details: {}[] | null;
|
|
41
|
-
content_guidance: number[] | null;
|
|
42
|
-
copyright_content: {}[] | null;
|
|
43
|
-
supervision_level: string | null;
|
|
44
|
-
thirdpartycontent_list: number[] | null;
|
|
45
|
-
misconceptions_and_common_mistakes: {}[] | null;
|
|
46
|
-
keywords: {}[] | null;
|
|
47
|
-
video_id: number | null;
|
|
48
|
-
sign_language_video_id: number | null;
|
|
49
|
-
quiz_id_starter: number | null;
|
|
50
|
-
quiz_id_exit: number | null;
|
|
51
|
-
asset_id_slidedeck: number | null;
|
|
52
|
-
asset_id_worksheet: number | null;
|
|
53
|
-
deprecated_fields: Record<string, unknown> | null;
|
|
54
|
-
_state: "published" | "new" | "migration";
|
|
55
|
-
_cohort: "0" | "2020-2023" | "2023-2024";
|
|
56
|
-
}, {
|
|
57
|
-
lesson_id: number;
|
|
58
|
-
lesson_uid: string;
|
|
59
|
-
slug: string;
|
|
60
|
-
title: string;
|
|
61
|
-
description: string;
|
|
62
|
-
pupil_lesson_outcome: string;
|
|
63
|
-
key_learning_points: {}[];
|
|
64
|
-
equipment_and_resources: {}[] | null;
|
|
65
|
-
content_guidance_details: {}[] | null;
|
|
66
|
-
content_guidance: number[] | null;
|
|
67
|
-
copyright_content: {}[] | null;
|
|
68
|
-
supervision_level: string | null;
|
|
69
|
-
thirdpartycontent_list: number[] | null;
|
|
70
|
-
misconceptions_and_common_mistakes: {}[] | null;
|
|
71
|
-
keywords: {}[] | null;
|
|
72
|
-
video_id: number | null;
|
|
73
|
-
sign_language_video_id: number | null;
|
|
74
|
-
quiz_id_starter: number | null;
|
|
75
|
-
quiz_id_exit: number | null;
|
|
76
|
-
asset_id_slidedeck: number | null;
|
|
77
|
-
asset_id_worksheet: number | null;
|
|
78
|
-
deprecated_fields: Record<string, unknown> | null;
|
|
79
|
-
_state: "published" | "new" | "migration";
|
|
80
|
-
_cohort: "0" | "2020-2023" | "2023-2024";
|
|
81
|
-
}>;
|
|
82
|
-
type LessonData = z.infer<typeof lessonDataSchema>;
|
|
83
|
-
|
|
84
|
-
declare const lessonDataFixture: (overrides?: Partial<LessonData>) => LessonData;
|
|
85
|
-
|
|
86
|
-
export { type LessonData, _cohortSchema, _stateSchema, lessonDataFixture, lessonDataSchema };
|