Skip to content

Commit cf67a38

Browse files
CCM-7940: Rework and add generate-json-schema script
1 parent 329744d commit cf67a38

39 files changed

+537
-352
lines changed

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react": "^19.0.0",
2020
"react-dom": "^19.0.0",
2121
"react-idle-timer": "^5.7.2",
22-
"zod": "^3.24.2"
22+
"zod": "^4.0.5"
2323
},
2424
"devDependencies": {
2525
"@testing-library/jest-dom": "^6.6.3",

infrastructure/terraform/components/app/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
| <a name="module_amplify_branch"></a> [amplify\_branch](#module\_amplify\_branch) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/amp_branch | v1.0.0 |
5353
| <a name="module_backend_api"></a> [backend\_api](#module\_backend\_api) | ../../modules/backend-api | n/a |
5454
| <a name="module_download_authorizer_lambda"></a> [download\_authorizer\_lambda](#module\_download\_authorizer\_lambda) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.13 |
55-
| <a name="module_eventpub"></a> [eventpub](#module\_eventpub) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/eventpub | v1.0.13 |
55+
| <a name="module_eventpub"></a> [eventpub](#module\_eventpub) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/eventpub | v2.0.16 |
5656
| <a name="module_kms"></a> [kms](#module\_kms) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms | v1.0.8 |
5757
| <a name="module_kms_us_east_1"></a> [kms\_us\_east\_1](#module\_kms\_us\_east\_1) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms | v1.0.8 |
5858
| <a name="module_nhse_backup_vault"></a> [nhse\_backup\_vault](#module\_nhse\_backup\_vault) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/aws-backup-source | v2.0.12 |

infrastructure/terraform/components/app/module_eventpub.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "eventpub" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/eventpub?ref=v1.0.13"
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/eventpub?ref=v2.0.16"
33

44
name = "eventpub"
55

lambdas/authorizer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"jwks-rsa": "^3.2.0",
66
"jwt-decode": "^4.0.0",
77
"nhs-notify-web-template-management-utils": "^0.0.1",
8-
"zod": "^3.24.2"
8+
"zod": "^4.0.5"
99
},
1010
"devDependencies": {
1111
"@swc/core": "^1.11.13",

lambdas/backend-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"parse-multipart-data": "^1.5.0",
1919
"pdfjs-dist": "5.1.91",
2020
"winston": "^3.17.0",
21-
"zod": "^3.24.2"
21+
"zod": "^4.0.5"
2222
},
2323
"devDependencies": {
2424
"@swc/core": "^1.11.13",

lambdas/backend-api/src/__tests__/templates/api/__snapshots__/copy-scanned-object-to-internal.test.ts.snap

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,119 +3,114 @@
33
exports[`errors if the event has no object key 1`] = `
44
"[
55
{
6-
"code": "invalid_type",
76
"expected": "string",
8-
"received": "undefined",
7+
"code": "invalid_type",
98
"path": [
109
"detail",
1110
"s3ObjectDetails",
1211
"objectKey"
1312
],
14-
"message": "Required"
13+
"message": "Invalid input: expected string, received undefined"
1514
}
1615
]"
1716
`;
1817

1918
exports[`errors if the event has no version id 1`] = `
2019
"[
2120
{
22-
"code": "invalid_type",
2321
"expected": "string",
24-
"received": "undefined",
22+
"code": "invalid_type",
2523
"path": [
2624
"detail",
2725
"s3ObjectDetails",
2826
"versionId"
2927
],
30-
"message": "Required"
28+
"message": "Invalid input: expected string, received undefined"
3129
}
3230
]"
3331
`;
3432

3533
exports[`errors if the event has no virus scan status 1`] = `
3634
"[
3735
{
38-
"expected": "'NO_THREATS_FOUND'",
39-
"received": "undefined",
40-
"code": "invalid_type",
36+
"code": "invalid_value",
37+
"values": [
38+
"NO_THREATS_FOUND"
39+
],
4140
"path": [
4241
"detail",
4342
"scanResultDetails",
4443
"scanResultStatus"
4544
],
46-
"message": "Required"
45+
"message": "Invalid input: expected \\"NO_THREATS_FOUND\\""
4746
}
4847
]"
4948
`;
5049

5150
exports[`errors if the event has virus scan status ACCESS_DENIED 1`] = `
5251
"[
5352
{
54-
"received": "ACCESS_DENIED",
55-
"code": "invalid_enum_value",
56-
"options": [
53+
"code": "invalid_value",
54+
"values": [
5755
"NO_THREATS_FOUND"
5856
],
5957
"path": [
6058
"detail",
6159
"scanResultDetails",
6260
"scanResultStatus"
6361
],
64-
"message": "Invalid enum value. Expected 'NO_THREATS_FOUND', received 'ACCESS_DENIED'"
62+
"message": "Invalid input: expected \\"NO_THREATS_FOUND\\""
6563
}
6664
]"
6765
`;
6866

6967
exports[`errors if the event has virus scan status FAILED 1`] = `
7068
"[
7169
{
72-
"received": "FAILED",
73-
"code": "invalid_enum_value",
74-
"options": [
70+
"code": "invalid_value",
71+
"values": [
7572
"NO_THREATS_FOUND"
7673
],
7774
"path": [
7875
"detail",
7976
"scanResultDetails",
8077
"scanResultStatus"
8178
],
82-
"message": "Invalid enum value. Expected 'NO_THREATS_FOUND', received 'FAILED'"
79+
"message": "Invalid input: expected \\"NO_THREATS_FOUND\\""
8380
}
8481
]"
8582
`;
8683

8784
exports[`errors if the event has virus scan status THREATS_FOUND 1`] = `
8885
"[
8986
{
90-
"received": "THREATS_FOUND",
91-
"code": "invalid_enum_value",
92-
"options": [
87+
"code": "invalid_value",
88+
"values": [
9389
"NO_THREATS_FOUND"
9490
],
9591
"path": [
9692
"detail",
9793
"scanResultDetails",
9894
"scanResultStatus"
9995
],
100-
"message": "Invalid enum value. Expected 'NO_THREATS_FOUND', received 'THREATS_FOUND'"
96+
"message": "Invalid input: expected \\"NO_THREATS_FOUND\\""
10197
}
10298
]"
10399
`;
104100

105101
exports[`errors if the event has virus scan status UNSUPPORTED 1`] = `
106102
"[
107103
{
108-
"received": "UNSUPPORTED",
109-
"code": "invalid_enum_value",
110-
"options": [
104+
"code": "invalid_value",
105+
"values": [
111106
"NO_THREATS_FOUND"
112107
],
113108
"path": [
114109
"detail",
115110
"scanResultDetails",
116111
"scanResultStatus"
117112
],
118-
"message": "Invalid enum value. Expected 'NO_THREATS_FOUND', received 'UNSUPPORTED'"
113+
"message": "Invalid input: expected \\"NO_THREATS_FOUND\\""
119114
}
120115
]"
121116
`;

lambdas/backend-api/src/__tests__/templates/api/__snapshots__/delete-failed-scanned-object.test.ts.snap

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,58 @@
33
exports[`errors if the event has no s3 object key 1`] = `
44
"[
55
{
6-
"code": "invalid_type",
76
"expected": "string",
8-
"received": "undefined",
7+
"code": "invalid_type",
98
"path": [
109
"detail",
1110
"s3ObjectDetails",
1211
"objectKey"
1312
],
14-
"message": "Required"
13+
"message": "Invalid input: expected string, received undefined"
1514
}
1615
]"
1716
`;
1817

1918
exports[`errors if the event has no s3 version id 1`] = `
2019
"[
2120
{
22-
"code": "invalid_type",
2321
"expected": "string",
24-
"received": "undefined",
22+
"code": "invalid_type",
2523
"path": [
2624
"detail",
2725
"s3ObjectDetails",
2826
"versionId"
2927
],
30-
"message": "Required"
28+
"message": "Invalid input: expected string, received undefined"
3129
}
3230
]"
3331
`;
3432

3533
exports[`errors if the event has no virus scan status 1`] = `
3634
"[
3735
{
38-
"expected": "'THREATS_FOUND' | 'UNSUPPORTED' | 'ACCESS_DENIED' | 'FAILED'",
39-
"received": "undefined",
40-
"code": "invalid_type",
36+
"code": "invalid_value",
37+
"values": [
38+
"THREATS_FOUND",
39+
"UNSUPPORTED",
40+
"ACCESS_DENIED",
41+
"FAILED"
42+
],
4143
"path": [
4244
"detail",
4345
"scanResultDetails",
4446
"scanResultStatus"
4547
],
46-
"message": "Required"
48+
"message": "Invalid option: expected one of \\"THREATS_FOUND\\"|\\"UNSUPPORTED\\"|\\"ACCESS_DENIED\\"|\\"FAILED\\""
4749
}
4850
]"
4951
`;
5052

5153
exports[`errors if the event has virus scan status NO_THREATS_FOUND 1`] = `
5254
"[
5355
{
54-
"received": "NO_THREATS_FOUND",
55-
"code": "invalid_enum_value",
56-
"options": [
56+
"code": "invalid_value",
57+
"values": [
5758
"THREATS_FOUND",
5859
"UNSUPPORTED",
5960
"ACCESS_DENIED",
@@ -64,7 +65,7 @@ exports[`errors if the event has virus scan status NO_THREATS_FOUND 1`] = `
6465
"scanResultDetails",
6566
"scanResultStatus"
6667
],
67-
"message": "Invalid enum value. Expected 'THREATS_FOUND' | 'UNSUPPORTED' | 'ACCESS_DENIED' | 'FAILED', received 'NO_THREATS_FOUND'"
68+
"message": "Invalid option: expected one of \\"THREATS_FOUND\\"|\\"UNSUPPORTED\\"|\\"ACCESS_DENIED\\"|\\"FAILED\\""
6869
}
6970
]"
7071
`;

lambdas/backend-api/src/__tests__/templates/api/__snapshots__/set-letter-upload-virus-scan-status.test.ts.snap

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
exports[`errors if event has invalid scan result status 1`] = `
44
"[
55
{
6-
"received": "UNKNOWN_STATUS",
7-
"code": "invalid_enum_value",
8-
"options": [
6+
"code": "invalid_value",
7+
"values": [
98
"NO_THREATS_FOUND",
109
"THREATS_FOUND",
1110
"UNSUPPORTED",
@@ -17,39 +16,43 @@ exports[`errors if event has invalid scan result status 1`] = `
1716
"scanResultDetails",
1817
"scanResultStatus"
1918
],
20-
"message": "Invalid enum value. Expected 'NO_THREATS_FOUND' | 'THREATS_FOUND' | 'UNSUPPORTED' | 'ACCESS_DENIED' | 'FAILED', received 'UNKNOWN_STATUS'"
19+
"message": "Invalid option: expected one of \\"NO_THREATS_FOUND\\"|\\"THREATS_FOUND\\"|\\"UNSUPPORTED\\"|\\"ACCESS_DENIED\\"|\\"FAILED\\""
2120
}
2221
]"
2322
`;
2423

2524
exports[`errors if event has no object key name 1`] = `
2625
"[
2726
{
28-
"code": "invalid_type",
2927
"expected": "string",
30-
"received": "undefined",
28+
"code": "invalid_type",
3129
"path": [
3230
"detail",
3331
"s3ObjectDetails",
3432
"objectKey"
3533
],
36-
"message": "Required"
34+
"message": "Invalid input: expected string, received undefined"
3735
}
3836
]"
3937
`;
4038

4139
exports[`errors if event has no scan result status 1`] = `
4240
"[
4341
{
44-
"expected": "'NO_THREATS_FOUND' | 'THREATS_FOUND' | 'UNSUPPORTED' | 'ACCESS_DENIED' | 'FAILED'",
45-
"received": "undefined",
46-
"code": "invalid_type",
42+
"code": "invalid_value",
43+
"values": [
44+
"NO_THREATS_FOUND",
45+
"THREATS_FOUND",
46+
"UNSUPPORTED",
47+
"ACCESS_DENIED",
48+
"FAILED"
49+
],
4750
"path": [
4851
"detail",
4952
"scanResultDetails",
5053
"scanResultStatus"
5154
],
52-
"message": "Required"
55+
"message": "Invalid option: expected one of \\"NO_THREATS_FOUND\\"|\\"THREATS_FOUND\\"|\\"UNSUPPORTED\\"|\\"ACCESS_DENIED\\"|\\"FAILED\\""
5356
}
5457
]"
5558
`;

0 commit comments

Comments
 (0)