notifications-ruby-client 5.1.1 → 5.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/DOCUMENTATION.md +7 -7
- data/lib/notifications/client/helper_methods.rb +1 -1
- data/lib/notifications/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7416ac0a7966ad68c26abb64d8e2a9584317267d2a783d24045eeefeee7386e2
|
4
|
+
data.tar.gz: 065f683863555d3daa8eb77f3ce36f2b7c8ab7760c590bee06da8065de687a8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e631494bb2d5129c904b3f6ab50d0083f7f041c4d5949c0cf5e868b2c56a9edef808b97a8e89a67c8809387798da5eb3db6be9ad02419018a95a96529706f225
|
7
|
+
data.tar.gz: 231279595fa4ca0af2304932507a27e382e42ed483df1833ed547d9df2f2184e679fd1f4900b0895daf19bd5d25b34148ef255b6c38351935015ebf670d08e04
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 5.1.2
|
2
|
+
|
3
|
+
* Change filesize too big exception message to refer to files rather than documents.
|
4
|
+
|
1
5
|
## 5.1.1
|
2
6
|
|
3
7
|
* Exceptions now return the error message when calling `#to_s` on them. This will make services like Sentry correctly display the full error description.
|
data/DOCUMENTATION.md
CHANGED
@@ -238,11 +238,11 @@ The links are unique and unguessable. GOV.UK Notify cannot access or decrypt you
|
|
238
238
|
1. Select __Edit__.
|
239
239
|
1. Add a placeholder field to the email template using double brackets. For example:
|
240
240
|
|
241
|
-
"Download your file at: ((
|
241
|
+
"Download your file at: ((link_to_file))"
|
242
242
|
|
243
243
|
### Upload your file
|
244
244
|
|
245
|
-
The file you upload must be a PDF
|
245
|
+
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.
|
246
246
|
|
247
247
|
1. Pass the file object as an argument to the `Notifications.prepare_upload` helper method.
|
248
248
|
1. Pass the result into the personalisation argument.
|
@@ -255,7 +255,7 @@ File.open("file.pdf", "rb") do |f|
|
|
255
255
|
personalisation: {
|
256
256
|
first_name: "Amala",
|
257
257
|
application_date: "2018-01-01",
|
258
|
-
|
258
|
+
link_to_file: Notifications.prepare_upload(f),
|
259
259
|
}
|
260
260
|
end
|
261
261
|
```
|
@@ -282,15 +282,15 @@ If the request is not successful, the client returns a `Notifications::Client::R
|
|
282
282
|
|:--- |:---|:---|:---|
|
283
283
|
|`400`|`BadRequestError: Can't send to this recipient using a team-only API key`|`BadRequestError`|Use the correct type of [API key](#api-keys)|
|
284
284
|
|`400`|`BadRequestError: Can't send to this recipient when service is in trial mode - see https://www.notifications.service.gov.uk/trial-mode`|`BadRequestError`|Your service cannot send this notification in [trial mode](https://www.notifications.service.gov.uk/features/using-notify#trial-mode)|
|
285
|
-
|`400`|`BadRequestError: Unsupported
|
286
|
-
|`400`|`BadRequestError:
|
285
|
+
|`400`|`BadRequestError: Unsupported file type '(FILE TYPE)'. Supported types are: '(ALLOWED TYPES)'`|`BadRequestError`|Wrong file type. You can only upload .pdf, .csv, .txt, .doc or .docx files|
|
286
|
+
|`400`|`BadRequestError: File did not pass the virus scan`|`BadRequestError`|The file contains a virus|
|
287
287
|
|`400`|`BadRequestError: Service is not allowed to send documents`|`BadRequestError`|Contact the GOV.UK Notify team|
|
288
288
|
|`403`|`AuthError: Error: Your system clock must be accurate to within 30 seconds`|`AuthError`|Check your system clock|
|
289
289
|
|`403`|`AuthError: Invalid token: signature, api token not found`|`AuthError`|Use the correct API key. Refer to [API keys](#api-keys) for more information|
|
290
290
|
|`429`|`RateLimitError: Exceeded rate limit for key type TEAM/TEST/LIVE of 3000 requests per 60 seconds`|`RateLimitError`|Refer to [API rate limits](#api-rate-limits) for more information|
|
291
291
|
|`429`|`TooManyRequestsError: Exceeded send limits (LIMIT NUMBER) for today`|`RateLimitError`|Refer to [service limits](#service-limits) for the limit number|
|
292
292
|
|`500`|`Exception: Internal server error`|`ServerError`|Notify was unable to process the request, resend your notification|
|
293
|
-
|-|`ArgumentError:
|
293
|
+
|-|`ArgumentError: File is larger than 2MB")`|-|The file is too big. Files must be smaller than 2MB|
|
294
294
|
|
295
295
|
## Send a letter
|
296
296
|
|
@@ -708,7 +708,7 @@ If the request is not successful, the client throws a `Notifications::Client::Re
|
|
708
708
|
|:---|:---|:---|:---|
|
709
709
|
|`400`|`ValidationError: id is not a valid UUID`|`BadRequestError`|Check the notification ID|
|
710
710
|
|`400`|`PDFNotReadyError: PDF not available yet, try again later`|`BadRequestError`|Wait for the notification to finish processing. This usually takes a few seconds|
|
711
|
-
|`400`|`BadRequestError:
|
711
|
+
|`400`|`BadRequestError: File did not pass the virus scan`|`BadRequestError`|You cannot retrieve the contents of a letter notification that contains a virus|
|
712
712
|
|`400`|`BadRequestError: PDF not available for letters in technical-failure`|`BadRequestError`|You cannot retrieve the contents of a letter notification in technical-failure|
|
713
713
|
|`400`|`ValidationError: Notification is not a letter`|`BadRequestError`|Check that you are looking up the correct notification|
|
714
714
|
|`403`|`AuthError: Error: Your system clock must be accurate to within 30 seconds`|`BadRequestError`|Check your system clock|
|
@@ -2,7 +2,7 @@ require "base64"
|
|
2
2
|
|
3
3
|
module Notifications
|
4
4
|
def self.prepare_upload(file)
|
5
|
-
raise ArgumentError.new("
|
5
|
+
raise ArgumentError.new("File is larger than 2MB") if file.size > Client::MAX_FILE_UPLOAD_SIZE
|
6
6
|
|
7
7
|
{ file: Base64.strict_encode64(file.read) }
|
8
8
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifications-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Government Digital Service
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|