notifications-node-client 6.0.0 → 7.0.0

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,7 @@
1
+ ## 7.0.0 - 2023-01-12
2
+
3
+ * Remove support for node versions below v14.17.3.
4
+
1
5
  ## 6.0.0 - 2022-12-22
2
6
 
3
7
  * Bump jsonwebtokens from 8.5.1 to 9.0.0 to mitigate CVE-2022-23529. We don't believe this CVE affects any use-cases of notifications-node-client; this update is out of best-practice rather than any direct concern.
package/DOCUMENTATION.md CHANGED
@@ -344,7 +344,7 @@ The method returns a [promise](https://developer.mozilla.org/en-US/docs/Web/Java
344
344
 
345
345
  ##### CSV Files
346
346
 
347
- Uploads for CSV files should use the `isCsv` parameter on the `prepareUpload()` function. For example:
347
+ Uploads for CSV files should use the `isCsv` option on the `prepareUpload()` function. For example:
348
348
 
349
349
  ```javascript
350
350
  var fs = require('fs')
@@ -355,7 +355,7 @@ fs.readFile('path/to/document.csv', function (err, csvFile) {
355
355
  personalisation: {
356
356
  first_name: 'Amala',
357
357
  application_date: '2018-01-01',
358
- link_to_file: notifyClient.prepareUpload(csvFile, true)
358
+ link_to_file: notifyClient.prepareUpload(csvFile, { isCsv: true })
359
359
  }
360
360
  }).then(response => console.log(response)).catch(err => console.error(err))
361
361
  })
@@ -373,7 +373,7 @@ From 29 March 2023, we will turn this feature on by default for every file you s
373
373
 
374
374
  To use this feature before 29 March 2023 you will need version 5.2.0 of the Node.js client library, or a more recent version.
375
375
 
376
- To make the recipient confirm their email address before downloading the file, set the `confirmEmailBeforeDownload` flag to `true`.
376
+ To make the recipient confirm their email address before downloading the file, set the `confirmEmailBeforeDownload` option to `true`.
377
377
 
378
378
  You will not need to do this after 29 March.
379
379
 
@@ -386,7 +386,7 @@ fs.readFile('path/to/document.pdf', function (err, pdfFile) {
386
386
  personalisation: {
387
387
  first_name: 'Amala',
388
388
  application_date: '2018-01-01',
389
- link_to_file: notifyClient.prepareUpload(pdfFile, false, true, undefined)
389
+ link_to_file: notifyClient.prepareUpload(pdfFile, { confirmEmailBeforeDownload: true })
390
390
  }
391
391
  }).then(response => console.log(response)).catch(err => console.error(err))
392
392
  })
@@ -404,7 +404,7 @@ You should not turn this feature off if you send files that contain:
404
404
  * commercially sensitive information
405
405
  * information classified as ‘OFFICIAL’ or ‘OFFICIAL-SENSITIVE’ under the [Government Security Classifications](https://www.gov.uk/government/publications/government-security-classifications) policy
406
406
 
407
- To let the recipient download the file without confirming their email address, set the `confirmEmailBeforeDownload` flag to `false`.
407
+ To let the recipient download the file without confirming their email address, set the `confirmEmailBeforeDownload` option to `false`.
408
408
 
409
409
  ```javascript
410
410
  var fs = require('fs')
@@ -415,7 +415,7 @@ fs.readFile('path/to/document.pdf', function (err, pdfFile) {
415
415
  personalisation: {
416
416
  first_name: 'Amala',
417
417
  application_date: '2018-01-01',
418
- link_to_file: notifyClient.prepareUpload(pdfFile, false, false, undefined)
418
+ link_to_file: notifyClient.prepareUpload(pdfFile, { confirmEmailBeforeDownload: false })
419
419
  }
420
420
  }).then(response => console.log(response)).catch(err => console.error(err))
421
421
  })
@@ -423,7 +423,7 @@ fs.readFile('path/to/document.pdf', function (err, pdfFile) {
423
423
 
424
424
  #### Choose the length of time that a file is available to download
425
425
 
426
- Set the number of weeks you want the file to be available using the `retentionPeriod` parameter.
426
+ Set the number of weeks you want the file to be available using the `retentionPeriod` option.
427
427
 
428
428
  You can choose any value between 1 week and 78 weeks.
429
429
 
@@ -440,7 +440,7 @@ fs.readFile('path/to/document.pdf', function (err, pdfFile) {
440
440
  personalisation: {
441
441
  first_name: 'Amala',
442
442
  application_date: '2018-01-01',
443
- link_to_file: notifyClient.prepareUpload(pdfFile, false, undefined, '52 weeks')
443
+ link_to_file: notifyClient.prepareUpload(pdfFile, { retentionPeriod: '52 weeks' })
444
444
  }
445
445
  }).then(response => console.log(response)).catch(err => console.error(err))
446
446
  })
package/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM node:12.16.1-slim
1
+ FROM ghcr.io/alphagov/notify/node:18-slim
2
2
 
3
3
  ENV DEBIAN_FRONTEND=noninteractive
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notifications-node-client",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "homepage": "https://docs.notifications.service.gov.uk/node.html",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,8 +14,8 @@
14
14
  "integration": "mocha spec/integration/test.js"
15
15
  },
16
16
  "engines": {
17
- "npm": ">=6.12.0",
18
- "node": ">=12.13.0"
17
+ "npm": ">=6.14.13",
18
+ "node": ">=14.17.3"
19
19
  },
20
20
  "author": "GDS developers",
21
21
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "chai-json-schema": "1.5.0",
30
30
  "chai-bytes": "0.1.2",
31
31
  "jsonschema": "1.2.4",
32
- "mocha": "5.2.0",
32
+ "mocha": "10.1.0",
33
33
  "mockdate": "2.0.2",
34
34
  "nock": "9.2.6",
35
35
  "optimist": "0.6.1",