Skip to content

Commit d58edd5

Browse files
committed
Merge branch 'release' into feature/CCM-17830_Double_prod_rate_limits
2 parents 9d5e2d3 + 5058bc8 commit d58edd5

15 files changed

Lines changed: 3184 additions & 476 deletions

‎.python-version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.11
1+
3.13.2

‎.tool-versions‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python 3.13.2
22
poetry 2.2.1
33
jq 1.6
4-
nodejs 20.2.0
4+
nodejs 22.22.3

‎package-lock.json‎

Lines changed: 3086 additions & 458 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"devDependencies": {
2828
"@babel/core": "^7.25.2",
2929
"@babel/eslint-parser": "^7.25.1",
30-
"@redocly/cli": "^2.14.4",
30+
"@redocly/cli": "1.34.15",
3131
"eslint": "^8.57.1",
3232
"eslint-config-airbnb-base": "^15.0.0",
3333
"eslint-config-prettier": "^8.5.0",
@@ -40,7 +40,7 @@
4040
"eslint-plugin-unicorn": "^56.0.1",
4141
"eslint-plugin-workspaces": "^0.11.0",
4242
"eslint-plugin-yml": "^1.2.0",
43-
"hbs-cli": "^1.4.1",
43+
"handlebars": "^4.7.9",
4444
"license-checker": "^25.0.1",
4545
"minimist": "^1.2.2",
4646
"newman": "^6.2.2",
@@ -57,6 +57,9 @@
5757
"flatted": "^3.4.2",
5858
"postcss": "^8.5.12",
5959
"lodash": "^4.18.1",
60-
"underscore": "^1.13.8"
60+
"underscore": "^1.13.8",
61+
"glob-promise": {
62+
"glob": "^7.2.3"
63+
}
6164
}
6265
}

‎scripts/config/sonar-scanner.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sonar.qualitygate.wait=true
88
sonar.sources=.
99
sonar.tests=tests/, sandbox/__test__
1010
sonar.test.inclusions=tests/**.py, sandbox/__test__/**
11-
sonar.exclusions=.venv/**,proxies/utils/performance/*
11+
sonar.exclusions=.venv/**,proxies/utils/performance/*,scripts/render_hbs.js
1212

1313
sonar.python.version=3.10.8
1414

‎scripts/render_hbs.js‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
const fs = require('fs');
5+
const Handlebars = require('handlebars');
6+
7+
const [,, dataFile, templateFile] = process.argv;
8+
9+
if (!dataFile || !templateFile) {
10+
console.error('Usage: node scripts/render_hbs.js <data.json> <template.hbs>');
11+
process.exit(1);
12+
}
13+
14+
const data = JSON.parse(fs.readFileSync(dataFile, 'utf8'));
15+
const templateSource = fs.readFileSync(templateFile, 'utf8');
16+
const template = Handlebars.compile(templateSource);
17+
18+
// @generated is a data-frame variable used in the nunit template
19+
const output = template(data, { data: { generated: new Date().toISOString() } });
20+
process.stdout.write(output);

‎scripts/run_zap.sh‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,21 @@ export INTEGRATION_PRIVATE_KEY_CONTENTS=$(cat $INTEGRATION_PRIVATE_KEY)
2222

2323
docker build -t zap -f ./zap/Dockerfile .
2424

25+
echo "running zap"
2526
# run zap in a container
2627
docker container run \
2728
--env INTEGRATION_PRIVATE_KEY_CONTENTS="$INTEGRATION_PRIVATE_KEY_CONTENTS" \
28-
--env INTEGRATION_API_KEY="$INTEGRATION_API_KEY" \
29-
-v $(pwd):/zap/wrk/:rw \
30-
-v $TEMP_DIR:/zap/tmp/:rw \
31-
-v $(pwd)/zap/comms-manager-json/:/home/zap/.ZAP/reports/comms-manager-json/:rw \
32-
-t zap \
33-
bash -c "./zap.sh -cmd -autorun /zap/wrk/zap/zap.yaml"
29+
--env INTEGRATION_API_KEY="$INTEGRATION_API_KEY" \
30+
-v $(pwd):/zap/wrk/:rw \
31+
-v $TEMP_DIR:/zap/tmp/:rw \
32+
-v $(pwd)/zap/comms-manager-json/:/home/zap/.ZAP/reports/comms-manager-json/:rw \
33+
-t zap \
34+
bash -c "./zap.sh -cmd -autorun /zap/wrk/zap/zap.yaml"
35+
36+
echo "ended running zap"
3437

3538
# generate our nunit report from the zap JSON report
36-
./node_modules/.bin/hbs --data $TEMP_DIR/zap-report.json zap/nunit-template.hbs -s > zap-report.xml
39+
node scripts/render_hbs.js $TEMP_DIR/zap-report.json zap/nunit-template.hbs > zap-report.xml
3740

3841
# delete our zap compatible report
3942
rm build/communications-manager-zap.json

‎specification/documentation/APIDescription.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The NHS Notify service is intended for services involved in direct care. This AP
1717

1818
## API status and roadmap
1919

20-
This API is [in production, beta](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#statuses). We are onboarding partners to use it.
20+
This API is [in production](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#statuses). We are onboarding partners to use it.
2121

2222
We may make additive non-breaking changes to the API without notice, for example the addition of fields to a response or callback, or new optional fields to a request.
2323

@@ -215,6 +215,20 @@ Every request includes an `idempotencyKey` field located in the meta collection
215215

216216
If a request fails, our retry policy will continue to attempt to deliver the callback for a period of 2 hours.
217217

218+
## Two-way messaging
219+
220+
**This feature is currently under development and is not yet ready to use.**
221+
222+
Two-way messaging lets a service send a simple question to a recipient through the NHS App and provide a fixed list of possible answers. The recipient can choose one answer from the list, and that response is sent back to the service.
223+
224+
e.g.
225+
Question: Can you still attend your GP appointment on Tuesday 26th May at 14:00?
226+
Answer options: [Yes, No]
227+
228+
In order to present the recipient with answers include the `answerOptions` field.
229+
230+
This feature is currently only supported by the NHSAPP channel.
231+
218232
## Message character limits
219233
Different character limits apply to each of the communication channels as listed below. NHS Notify will validate that any personalisation fields submitted in the send message request do not exceed these limits but it is the client's responsibility to ensure that when personalisation is combined with any templated text, the channel character limit is not exceeded.
220234

‎specification/documentation/CreateMessage.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ Here is an example curl request which creates a message using one of these routi
3333
curl -X POST \
3434
--header "Accept: */*" \
3535
--header "Content-type: application/vnd.api+json" \
36-
-d '{"data": {"type": "Message","attributes": {"routingPlanId": "b838b13c-f98c-4def-93f0-515d4e4f4ee1","messageReference": "da0b1495-c7cb-468c-9d81-07dee089d728","recipient": {"nhsNumber": "9990548609"},"originator": {"odsCode":"X123"},"personalisation": {}}}}' \
36+
-d '{"data": {"type": "Message","attributes": {"routingPlanId": "b838b13c-f98c-4def-93f0-515d4e4f4ee1","messageReference": "da0b1495-c7cb-468c-9d81-07dee089d728","recipient": {"nhsNumber": "9990548609"},"originator": {"odsCode":"X123"},"personalisation": {},"answerOptions": {"NHSAPP":[{"code":"Yes"},{"code":"No"}]}}}}' \
3737
https://sandbox.api.service.nhs.uk/comms/v1/messages
3838
```

‎specification/documentation/CreateMessageBatch.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ Here is an example curl request which creates a message batch using one of these
3838
curl -X POST \
3939
--header "Accept: */*" \
4040
--header "Content-type: application/vnd.api+json" \
41-
-d '{"data": {"type": "MessageBatch","attributes": {"routingPlanId": "b838b13c-f98c-4def-93f0-515d4e4f4ee1","messageBatchReference": "da0b1495-c7cb-468c-9d81-07dee089d728","messages": [{"messageReference": "703b8008-545d-4a04-bb90-1f2946ce1575","recipient": {"nhsNumber": "9990548609"},"originator": {"odsCode":"X123"},"personalisation": {}}]}}}' \
41+
-d '{"data": {"type": "MessageBatch","attributes": {"routingPlanId": "b838b13c-f98c-4def-93f0-515d4e4f4ee1","messageBatchReference": "da0b1495-c7cb-468c-9d81-07dee089d728","messages": [{"messageReference": "703b8008-545d-4a04-bb90-1f2946ce1575","recipient": {"nhsNumber": "9990548609"},"originator": {"odsCode":"X123"},"personalisation": {},"answerOptions": {"NHSAPP":[{"code":"Yes"},{"code":"No"}]}}]}}}' \
4242
https://sandbox.api.service.nhs.uk/comms/v1/message-batches
4343
```

0 commit comments

Comments
 (0)