notifications-node-client
Advanced tools
Comparing version 4.7.0 to 4.7.1
@@ -1,5 +0,11 @@ | ||
## [4.7.0] - 2019-02-01 | ||
## [4.7.1] - 2020-01-27 | ||
### Changed | ||
* Refer to files, not documents, in error messages | ||
## [4.7.0] - 2019-11-01 | ||
### Changed | ||
* Add `notifyClient.getPdfForLetterNotification(notificationId)` | ||
@@ -6,0 +12,0 @@ * Returns a Buffer with pdf data |
@@ -117,3 +117,3 @@ var ApiClient = require('./api_client'), | ||
if (file.length > size_limit * 1024 * 1024) { | ||
throw "Document is larger than " + String(size_limit) + "MB."; | ||
throw "File is larger than " + String(size_limit) + "MB."; | ||
} | ||
@@ -120,0 +120,0 @@ return file.toString('base64') |
@@ -54,14 +54,1 @@ # Contributing | ||
`make markdown-standard-test-fix` | ||
## Releasing a new version | ||
This can only be done by members of the GOV.UK Notify team | ||
- Change the version number in `package.json` | ||
- Update `CHANGELOG.md` with a summary of the changes | ||
- Commit your changes and make a pull request | ||
- Get the pull request merged | ||
- In your local terminal run: | ||
- `git checkout master && git fetch && git reset --hard origin/master` (this ensures your working directory is clean) | ||
- `npm login` (as the govuk-notify user) | ||
- `npm publish` |
@@ -25,3 +25,3 @@ # Node.js client documentation | ||
To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/) and go to the __API integration__ page. You can find more information in the [API keys](#api-keys) section of the documentation. | ||
To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __API integration__ page. You can find more information in the [API keys](#api-keys) section of this documentation. | ||
@@ -64,4 +64,10 @@ ### Connect through a proxy (optional) | ||
Sign in to [GOV.UK Notify](https://www.notifications.service.gov.uk/) and go to the __Templates__ page to find the template ID. For example: | ||
To find the template ID: | ||
1. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in). | ||
1. Go to the __Templates__ page and select the relevant template. | ||
1. Select __Copy template ID to clipboard__. | ||
For example: | ||
``` | ||
@@ -106,8 +112,7 @@ 'f33517ff-2a88-4f6e-b855-c550268ce08a' | ||
To find this information, go to the __Text Message sender__ settings screen: | ||
To find the text message sender: | ||
1. Sign in to your GOV.UK Notify account. | ||
1. Go to __Settings__. | ||
1. If you need to change to another service, select __Switch service__ in the top right corner of the screen and select the correct one. | ||
1. Go to the __Text Messages__ section and select __Manage__ on the __Text Message sender__ row. | ||
1. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in). | ||
1. Go to the __Settings__ page. | ||
1. In the __Text Messages__ section, select __Manage__ on the __Text Message sender__ row. | ||
@@ -184,4 +189,10 @@ In this screen, you can either: | ||
Sign in to [GOV.UK Notify](https://www.notifications.service.gov.uk/) and go to the __Templates__ page to find the template ID. For example: | ||
To find the template ID: | ||
1. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in). | ||
1. Go to the __Templates__ page and select the relevant template. | ||
1. Select __Copy template ID to clipboard__. | ||
For example: | ||
``` | ||
@@ -222,10 +233,12 @@ "f33517ff-2a88-4f6e-b855-c550268ce08a" | ||
This is an email reply-to address specified by you to receive replies from your users. Your service cannot go live until you set up at least one of these email addresses. To set this up: | ||
This is an email address specified by you to receive replies from your users. You must add at least one reply-to email address before your service can go live. | ||
1. Sign in to your GOV.UK Notify account. | ||
1. Go to __Settings__. | ||
1. If you need to change to another service, select __Switch service__ in the top right corner of the screen then select the correct one. | ||
1. Go to the __Email__ section and select __Manage__ on the __Email reply-to addresses__ row. | ||
1. Select __Change__ to specify the email address to receive replies, and select __Save__. | ||
To add a reply-to email address: | ||
1. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in). | ||
1. Go to the __Settings__ page. | ||
1. In the __Email__ section, select __Manage__ on the __Reply-to email addresses__ row. | ||
1. Select __Add reply-to address__. | ||
1. Enter the email address you want to use, and select __Add__. | ||
``` | ||
@@ -285,11 +298,12 @@ emailReplyToId='8e222534-7f05-4972-86e3-17c5d9f894e2' | ||
1. Sign in to [GOV.UK Notify](https://www.notifications.service.gov.uk/). | ||
1. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in). | ||
1. Go to the __Templates__ page and select the relevant email template. | ||
1. Select __Edit__. | ||
1. Add a placeholder field to the email template using double brackets. For example: | ||
"Download your file at: ((link_to_document))" | ||
"Download your file at: ((link_to_file))" | ||
### Upload your file | ||
The file you upload must be a PDF file smaller than 2MB. | ||
The file you upload must be a PDF, CSV, text file or Microsoft Word document smaller than 2MB. [Contact the GOV.UK Notify team](https://www.notifications.service.gov.uk/support/ask-question-give-feedback) if you need to send other file types. | ||
@@ -307,3 +321,3 @@ Pass the file object as a value into the `personalisation` argument. For example: | ||
application_date: '2018-01-01', | ||
link_to_document: notifyClient.prepareUpload(pdfFile) | ||
link_to_file: notifyClient.prepareUpload(pdfFile) | ||
} | ||
@@ -349,4 +363,4 @@ }).then(response => console.log(response.body)).catch(err => console.error(err)) | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "Can't send to this recipient when service is in trial mode - see https://www.notifications.service.gov.uk/trial-mode"`<br>`}]`|Your service cannot send this notification in [trial mode](https://www.notifications.service.gov.uk/features/using-notify#trial-mode)| | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "Unsupported document type '{}'. Supported types are: {}"`<br>`}]`|The document you upload must be a PDF file| | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "Document didn't pass the virus scan"`<br>`}]`|The document you upload must be virus free| | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "Unsupported file type '(FILE TYPE)'. Supported types are: '(ALLOWED TYPES)'"`<br>`}]`|Wrong file type. You can only upload .pdf, .csv, .txt, .doc or .docx files| | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "File did not pass the virus scan"`<br>`}]`|The file contains a virus| | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "Service is not allowed to send documents"`<br>`}]`|Contact the GOV.UK Notify team| | ||
@@ -358,12 +372,14 @@ |`403`|`[{`<br>`"error": "AuthError",`<br>`"message": "Error: Your system clock must be accurate to within 30 seconds"`<br>`}]`|Check your system clock| | ||
|`500`|`[{`<br>`"error": "Exception",`<br>`"message": "Internal server error"`<br>`}]`|Notify was unable to process the request, resend your notification.| | ||
|`N\A`|`Document is larger than 2MB`|`Document is larger than 2MB`| | ||
|`N/A`|`File is larger than 2MB`|The file is too big. Files must be smaller than 2MB| | ||
## Send a letter | ||
When your service first signs up to GOV.UK Notify, you’ll start in trial mode. You can only send letters in live mode. You must ask the GOV.UK Notify team to make your service live. | ||
When you add a new service it will start in [trial mode](https://www.notifications.service.gov.uk/features/trial-mode). You can only send letters when your service is live. | ||
1. Sign in to [GOV.UK Notify](https://www.notifications.service.gov.uk/). | ||
1. Select __Using Notify__. | ||
1. Select __requesting to go live__. | ||
To send Notify a request to go live: | ||
1. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in). | ||
1. Go to the __Settings__ page. | ||
1. In the __Your service is in trial mode__ section, select __request to go live__. | ||
### Method | ||
@@ -390,4 +406,10 @@ | ||
Sign in to [GOV.UK Notify](https://www.notifications.service.gov.uk/) and go to the __Templates__ page to find the template ID. For example: | ||
To find the template ID: | ||
1. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in). | ||
1. Go to the __Templates__ page and select the relevant template. | ||
1. Select __Copy template ID to clipboard__. | ||
For example: | ||
``` | ||
@@ -399,3 +421,3 @@ "f33517ff-2a88-4f6e-b855-c550268ce08a" | ||
The personalisation argument always contains the following parameters for the letter recipient's address: | ||
The personalisation argument always contains the following parameters for the letter recipient’s address: | ||
@@ -421,3 +443,3 @@ - `address_line_1` | ||
The following parameters in the letter recipient's address are optional: | ||
The following parameters in the letter recipient’s address are optional: | ||
@@ -615,8 +637,4 @@ ```javascript | ||
You can also find it by signing in to [GOV.UK Notify](https://www.notifications.service.gov.uk). | ||
You can also find it by [signing in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and going to the __API integration__ page. | ||
1. Sign in to GOV.UK Notify and select __API integration__. | ||
1. Find the relevant notification in the __Message log__. | ||
1. Copy the notification ID from the `id` field. | ||
### Response | ||
@@ -816,3 +834,3 @@ | ||
You can also find it by signing in to [GOV.UK Notify](https://www.notifications.service.gov.uk) and going to the __API integration__ page. | ||
You can also find it by [signing in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and going to the __API integration__ page. | ||
@@ -831,3 +849,3 @@ ### Response | ||
|`400`|`[{`<br>`"error": "PDFNotReadyError",`<br>`"message": "PDF not available yet, try again later"`<br>`}]`|Wait for the notification to finish processing. This usually takes a few seconds| | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "Document did not pass the virus scan"`<br>`}]`|You cannot retrieve the contents of a letter notification that contains a virus| | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "File did not pass the virus scan"`<br>`}]`|You cannot retrieve the contents of a letter notification that contains a virus| | ||
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "PDF not available for letters in technical-failure"`<br>`}]`|You cannot retrieve the contents of a letter notification in technical-failure| | ||
@@ -840,3 +858,2 @@ |`400`|`[{`<br>`"error": "ValidationError",`<br>`"message": "Notification is not a letter"`<br>`}]`|Check that you are looking up the correct notification| | ||
# Get a template | ||
@@ -866,3 +883,3 @@ | ||
Sign in to [GOV.UK Notify](https://www.notifications.service.gov.uk/) and go to the __Templates__ page to find the template ID. For example: | ||
The ID of the template. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __Templates__ page to find it. For example: | ||
@@ -922,3 +939,3 @@ ``` | ||
Sign in to [GOV.UK Notify](https://www.notifications.service.gov.uk/) and go to the __Templates__ page to find the template ID. For example: | ||
The ID of the template. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __Templates__ page to find it. For example: | ||
@@ -1043,3 +1060,3 @@ ``` | ||
Sign in to [GOV.UK Notify](https://www.notifications.service.gov.uk/) and go to the __Templates__ page to find the template ID. For example: | ||
The ID of the template. [Sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __Templates__ page to find it. For example: | ||
@@ -1102,3 +1119,3 @@ ``` | ||
Contact the GOV.UK Notify team on the [support page](https://www.notifications.service.gov.uk/support) or through the [Slack channel](https://ukgovernmentdigital.slack.com/messages/C0E1ADVPC) to enable receiving text messages for your service. | ||
Contact the GOV.UK Notify team using the [support page](https://www.notifications.service.gov.uk/support) or [chat to us on Slack](https://ukgovernmentdigital.slack.com/messages/C0E1ADVPC) to request a unique number for text message replies. | ||
@@ -1105,0 +1122,0 @@ ## Get a page of received text messages |
{ | ||
"name": "notifications-node-client", | ||
"version": "4.7.0", | ||
"version": "4.7.1", | ||
"description": "GOV.UK Notify Node.js client ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -138,3 +138,3 @@ const chai = require('chai'); | ||
notifyClient.prepareUpload(file); | ||
}).to.throw("Document is larger than 2MB.") | ||
}).to.throw("File is larger than 2MB.") | ||
}); | ||
@@ -318,3 +318,3 @@ }); | ||
notifyClient.sendPrecompiledLetter(reference, file); | ||
}).to.throw("Document is larger than 5MB.") | ||
}).to.throw("File is larger than 5MB.") | ||
}); | ||
@@ -321,0 +321,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
220569
42