notifications-node-client 5.1.1 → 5.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/CHANGELOG.md +4 -0
- package/DOCUMENTATION.md +1 -0
- package/client/api_client.js +2 -3
- package/client/notification.js +2 -3
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
package/DOCUMENTATION.md
CHANGED
|
@@ -387,6 +387,7 @@ If the request is not successful, the promise fails with an `err`.
|
|
|
387
387
|
|`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, .docx, .xlsx, .rtf or .odt files|
|
|
388
388
|
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "File did not pass the virus scan"`<br>`}]`|The file contains a virus|
|
|
389
389
|
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "Send files by email has not been set up - add contact details for your service at https://www.notifications.service.gov.uk/services/(SERVICE ID)/service-settings/send-files-by-email"`<br>`}]`|See how to [add contact details to the file download page](#add-contact-details-to-the-file-download-page)|
|
|
390
|
+
|`400`|`[{`<br>`"error": "BadRequestError",`<br>`"message": "Can only send a file by email"`<br>`}]`|Make sure you are using an email template|
|
|
390
391
|
|`403`|`[{`<br>`"error": "AuthError",`<br>`"message": "Error: Your system clock must be accurate to within 30 seconds"`<br>`}]`|Check your system clock|
|
|
391
392
|
|`403`|`[{`<br>`"error": "AuthError",`<br>`"message": "Invalid token: API key not found"`<br>`}]`|Use the correct API key. Refer to [API keys](#api-keys) for more information|
|
|
392
393
|
|`429`|`[{`<br>`"error": "RateLimitError",`<br>`"message": "Exceeded rate limit for key type TEAM/TEST/LIVE of 3000 requests per 60 seconds"`<br>`}]`|Refer to [API rate limits](#rate-limits) for more information|
|
package/client/api_client.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var restClient = require('axios').default,
|
|
2
|
-
_ = require('underscore'),
|
|
3
2
|
createGovukNotifyToken = require('../client/authentication.js'),
|
|
4
3
|
notifyProductionAPI = 'https://api.notifications.service.gov.uk',
|
|
5
4
|
version = require('../package.json').version;
|
|
@@ -56,7 +55,7 @@ function createToken(requestMethod, requestPath, apiKeyId, serviceId) {
|
|
|
56
55
|
return createGovukNotifyToken(requestMethod, requestPath, apiKeyId, serviceId);
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
Object.assign(ApiClient.prototype, {
|
|
60
59
|
|
|
61
60
|
/**
|
|
62
61
|
*
|
|
@@ -73,7 +72,7 @@ _.extend(ApiClient.prototype, {
|
|
|
73
72
|
'User-Agent': 'NOTIFY-API-NODE-CLIENT/' + version
|
|
74
73
|
}
|
|
75
74
|
};
|
|
76
|
-
|
|
75
|
+
Object.assign(options, additionalOptions)
|
|
77
76
|
if(this.proxy !== null) options.proxy = this.proxy;
|
|
78
77
|
|
|
79
78
|
return restClient(options);
|
package/client/notification.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
var ApiClient = require('./api_client')
|
|
2
|
-
_ = require('underscore');
|
|
1
|
+
var ApiClient = require('./api_client');
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
*
|
|
@@ -119,7 +118,7 @@ function _check_and_encode_file(file, size_limit) {
|
|
|
119
118
|
return file.toString('base64')
|
|
120
119
|
}
|
|
121
120
|
|
|
122
|
-
|
|
121
|
+
Object.assign(NotifyClient.prototype, {
|
|
123
122
|
/**
|
|
124
123
|
* Usage:
|
|
125
124
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notifications-node-client",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"homepage": "https://docs.notifications.service.gov.uk/node.html",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"jsonwebtoken": "^8.2.1",
|
|
20
|
-
"axios": "^0.25.0"
|
|
21
|
-
"underscore": "^1.9.0"
|
|
20
|
+
"axios": "^0.25.0"
|
|
22
21
|
},
|
|
23
22
|
"devDependencies": {
|
|
24
23
|
"chai": "4.1.2",
|