notifications-node-client 7.0.3 → 7.0.5

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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## 7.0.5 - 2023-11-13
2
+
3
+ * Fix a few cases of assignment to undeclared (global) variables
4
+
5
+ ## 7.0.4 - 2023-11-10
6
+
7
+ * Bump axios to the 1.x branch to address CVE-2023-45857. Due to underlying changes in Axios you may have to explicitly set the `protocol` property when constructing your `proxyConfig` object, if using a proxy.
8
+
1
9
  ## 7.0.3 - 2023-07-21
2
10
 
3
11
  * Bump word-wrap from 1.2.3 to 1.2.4 to address CVE-2023-26115.
package/DOCUMENTATION.md CHANGED
@@ -316,7 +316,7 @@ Your email should also tell recipients how long the file will be available to do
316
316
 
317
317
  #### Upload your file
318
318
 
319
- You can upload PDF, CSV, .odt, .txt, .rtf, .xlsx and MS Word Document files. Your file must be 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.
319
+ You can upload PDF, CSV, JSON, .odt, .txt, .rtf, .xlsx and MS Word Document files. Your file must be 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.
320
320
 
321
321
  Pass the file object as a value into the `personalisation` argument. For example:
322
322
 
@@ -398,10 +398,13 @@ fs.readFile('path/to/document.pdf', function (err, pdfFile) {
398
398
 
399
399
  Set the number of weeks you want the file to be available using the `retentionPeriod` option.
400
400
 
401
- You can choose any value between 1 week and 78 weeks.
402
-
403
401
  To use this feature will need version 5.2.0 of the Node.js client library, or a more recent version.
404
402
 
403
+ You can choose any value between 1 week and 78 weeks. When deciding this, you should consider:
404
+
405
+ * the need to protect the recipient’s personal information
406
+ * whether the recipient will need to download the file again later
407
+
405
408
  If you do not choose a value, the file will be available for the default period of 26 weeks (6 months).
406
409
 
407
410
  Files sent before 12 April 2023 had a longer default period of 78 weeks (18 months).
@@ -872,7 +875,7 @@ If the request is not successful, the promise fails with an `err`.
872
875
  |#`sending`|GOV.UK Notify has sent the message to the provider. The provider will try to deliver the message to the recipient for up to 72 hours. GOV.UK Notify is waiting for delivery information.|
873
876
  |#`pending`|GOV.UK Notify is waiting for more delivery information.<br>GOV.UK Notify received a callback from the provider but the recipient’s device has not yet responded. Another callback from the provider determines the final status of the text message.|
874
877
  |#`sent`|The message was sent to an international number. The mobile networks in some countries do not provide any more delivery information. The GOV.UK Notify website displays this status as 'Sent to an international number'.|
875
- |#`delivered`|The message was successfully delivered.|
878
+ |#`delivered`|The message was successfully delivered. If a recipient blocks your sender name or mobile number, your message will still show as delivered.|
876
879
  |#`permanent-failure`|The provider could not deliver the message. This can happen if the phone number was wrong or if the network operator rejects the message. If you’re sure that these phone numbers are correct, you should [contact GOV.UK Notify support](https://www.notifications.service.gov.uk/support). If not, you should remove them from your database. You’ll still be charged for text messages that cannot be delivered.
877
880
  |#`temporary-failure`|The provider could not deliver the message. This can happen when the recipient’s phone is off, has no signal, or their text message inbox is full. You can try to send the message again. You’ll still be charged for text messages to phones that are not accepting messages.|
878
881
  |#`technical-failure`|Your message was not sent because there was a problem between Notify and the provider.<br>You’ll have to try sending your messages again. You will not be charged for text messages that are affected by a technical failure.|
@@ -1207,7 +1210,10 @@ You can also set up [callbacks](#callbacks) for received text messages.
1207
1210
 
1208
1211
  ### Enable received text messages
1209
1212
 
1210
- 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.
1213
+ To receive text messages:
1214
+
1215
+ 1. Go to the **Text message settings** section of the **Settings** page.
1216
+ 1. Select **Change** on the **Receive text messages** row.
1211
1217
 
1212
1218
  ### Get a page of received text messages
1213
1219
 
@@ -201,8 +201,8 @@ Object.assign(NotifyClient.prototype, {
201
201
 
202
202
  sendPrecompiledLetter: function(reference, pdf_file, postage) {
203
203
  var postage = postage || undefined
204
- content = _check_and_encode_file(pdf_file, 5)
205
- notification = {
204
+ var content = _check_and_encode_file(pdf_file, 5)
205
+ var notification = {
206
206
  "reference": reference,
207
207
  "content": content
208
208
  }
@@ -327,6 +327,8 @@ Object.assign(NotifyClient.prototype, {
327
327
  * @returns {Promise}
328
328
  */
329
329
  getReceivedTexts: function(olderThan){
330
+ let queryString;
331
+
330
332
  if (olderThan) {
331
333
  queryString = '?older_than=' + olderThan;
332
334
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notifications-node-client",
3
- "version": "7.0.3",
3
+ "version": "7.0.5",
4
4
  "homepage": "https://docs.notifications.service.gov.uk/node.html",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
23
  "jsonwebtoken": "^9.0.0",
24
- "axios": "^0.25.0"
24
+ "axios": "^1.2.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "chai": "4.1.2",
@@ -36,3 +36,4 @@
36
36
  "standard-markdown": "5.0.1"
37
37
  }
38
38
  }
39
+
@@ -82,7 +82,7 @@ describe('api client', function () {
82
82
 
83
83
  it('should direct get requests through the proxy when set', function (done) {
84
84
  var urlBase = 'https://api.notifications.service.gov.uk',
85
- proxyConfig = { host: 'addressofmyproxy.test'},
85
+ proxyConfig = { host: 'addressofmyproxy.test', protocol: 'http'},
86
86
  path = '/email',
87
87
  apiClient = new ApiClient(urlBase, 'apiKey');
88
88
 
@@ -101,7 +101,7 @@ describe('api client', function () {
101
101
 
102
102
  it('should direct post requests through the proxy when set', function (done) {
103
103
  var urlBase = 'https://api.notifications.service.gov.uk',
104
- proxyConfig = { host: 'addressofmyproxy.test'},
104
+ proxyConfig = { host: 'addressofmyproxy.test', protocol: 'http'},
105
105
  path = '/email',
106
106
  apiClient = new ApiClient(urlBase, 'apiKey');
107
107